mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-20 21:33:43 -07:00
spaces.php
This commit is contained in:
parent
7755490b81
commit
eefa32741e
845 changed files with 50409 additions and 0 deletions
40
aws/Aws/Api/Serializer/Ec2ParamBuilder.php
Normal file
40
aws/Aws/Api/Serializer/Ec2ParamBuilder.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
namespace Aws\Api\Serializer;
|
||||
|
||||
use Aws\Api\Shape;
|
||||
use Aws\Api\ListShape;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class Ec2ParamBuilder extends QueryParamBuilder
|
||||
{
|
||||
protected function queryName(Shape $shape, $default = null)
|
||||
{
|
||||
return ($shape['queryName']
|
||||
?: ucfirst($shape['locationName']))
|
||||
?: $default;
|
||||
}
|
||||
|
||||
protected function isFlat(Shape $shape)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function format_list(
|
||||
ListShape $shape,
|
||||
array $value,
|
||||
$prefix,
|
||||
&$query
|
||||
) {
|
||||
// Handle empty list serialization
|
||||
if (!$value) {
|
||||
$query[$prefix] = false;
|
||||
} else {
|
||||
$items = $shape->getMember();
|
||||
foreach ($value as $k => $v) {
|
||||
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue