DescriptionInterface.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace GuzzleHttp\Command\Guzzle;
  3. use GuzzleHttp\Psr7\Uri;
  4. interface DescriptionInterface
  5. {
  6. /**
  7. * Get the basePath/baseUri of the description
  8. *
  9. * @return Uri
  10. */
  11. public function getBaseUri();
  12. /**
  13. * Get the API operations of the service
  14. *
  15. * @return Operation[] Returns an array of {@see Operation} objects
  16. */
  17. public function getOperations();
  18. /**
  19. * Check if the service has an operation by name
  20. *
  21. * @param string $name Name of the operation to check
  22. *
  23. * @return bool
  24. */
  25. public function hasOperation($name);
  26. /**
  27. * Get an API operation by name
  28. *
  29. * @param string $name Name of the command
  30. *
  31. * @return Operation
  32. * @throws \InvalidArgumentException if the operation is not found
  33. */
  34. public function getOperation($name);
  35. /**
  36. * Get a shared definition structure.
  37. *
  38. * @param string $id ID/name of the model to retrieve
  39. *
  40. * @return Parameter
  41. * @throws \InvalidArgumentException if the model is not found
  42. */
  43. public function getModel($id);
  44. /**
  45. * Get all models of the service description.
  46. *
  47. * @return array
  48. */
  49. public function getModels();
  50. /**
  51. * Check if the service description has a model by name.
  52. *
  53. * @param string $id Name/ID of the model to check
  54. *
  55. * @return bool
  56. */
  57. public function hasModel($id);
  58. /**
  59. * Get the API version of the service
  60. *
  61. * @return string
  62. */
  63. public function getApiVersion();
  64. /**
  65. * Get the name of the API
  66. *
  67. * @return string
  68. */
  69. public function getName();
  70. /**
  71. * Get a summary of the purpose of the API
  72. *
  73. * @return string
  74. */
  75. public function getDescription();
  76. /**
  77. * Format a parameter using named formats.
  78. *
  79. * @param string $format Format to convert it to
  80. * @param mixed $input Input string
  81. *
  82. * @return mixed
  83. */
  84. public function format($format, $input);
  85. /**
  86. * Get arbitrary data from the service description that is not part of the
  87. * Guzzle service description specification.
  88. *
  89. * @param string $key Data key to retrieve or null to retrieve all extra
  90. *
  91. * @return null|mixed
  92. */
  93. public function getData($key = null);
  94. }