Ec2ParamBuilder.php 819 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Aws\Api\Serializer;
  3. use Aws\Api\Shape;
  4. use Aws\Api\ListShape;
  5. /**
  6. * @internal
  7. */
  8. class Ec2ParamBuilder extends QueryParamBuilder
  9. {
  10. protected function queryName(Shape $shape, $default = null)
  11. {
  12. return ($shape['queryName']
  13. ?: ucfirst(@$shape['locationName'] ?: ""))
  14. ?: $default;
  15. }
  16. protected function isFlat(Shape $shape)
  17. {
  18. return false;
  19. }
  20. protected function format_list(
  21. ListShape $shape,
  22. array $value,
  23. $prefix,
  24. &$query
  25. ) {
  26. // Handle empty list serialization
  27. if (!empty($value)) {
  28. $items = $shape->getMember();
  29. foreach ($value as $k => $v) {
  30. $this->format($items, $v, $prefix . '.' . ($k + 1), $query);
  31. }
  32. }
  33. }
  34. }