PetController.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <?php
  2. namespace PetstoreIO;
  3. final class PetController
  4. {
  5. /**
  6. * @SWG\Get(
  7. * path="/pet/findByTags",
  8. * summary="Finds Pets by tags",
  9. * tags={"pet"},
  10. * description="Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
  11. * operationId="findPetsByTags",
  12. * produces={"application/xml", "application/json"},
  13. * @SWG\Parameter(
  14. * name="tags",
  15. * in="query",
  16. * description="Tags to filter by",
  17. * required=true,
  18. * type="array",
  19. * @SWG\Items(type="string"),
  20. * collectionFormat="multi"
  21. * ),
  22. * @SWG\Response(
  23. * response=200,
  24. * description="successful operation",
  25. * @SWG\Schema(
  26. * type="array",
  27. * @SWG\Items(ref="#/definitions/Pet")
  28. * ),
  29. * ),
  30. * @SWG\Response(
  31. * response="400",
  32. * description="Invalid tag value",
  33. * ),
  34. * security={
  35. * {
  36. * "petstore_auth": {"write:pets", "read:pets"}
  37. * }
  38. * },
  39. * deprecated=true
  40. * )
  41. */
  42. public function findByTags()
  43. {
  44. }
  45. /**
  46. * @SWG\Get(
  47. * path="/pet/findByStatus",
  48. * summary="Finds Pets by status",
  49. * description="Multiple status values can be provided with comma separated strings",
  50. * operationId="findPetsByStatus",
  51. * produces={"application/xml", "application/json"},
  52. * tags={"pet"},
  53. * @SWG\Parameter(
  54. * name="status",
  55. * in="query",
  56. * description="Status values that need to be considered for filter",
  57. * required=true,
  58. * type="array",
  59. * @SWG\Items(
  60. * type="string",
  61. * enum={"available", "pending", "sold"},
  62. * default="available"
  63. * ),
  64. * collectionFormat="multi"
  65. * ),
  66. * @SWG\Response(
  67. * response=200,
  68. * description="successful operation",
  69. * @SWG\Schema(
  70. * type="array",
  71. * @SWG\Items(ref="#/definitions/Pet")
  72. * ),
  73. * ),
  74. * @SWG\Response(
  75. * response="400",
  76. * description="Invalid status value",
  77. * ),
  78. * security={
  79. * {"petstore_auth": {"write:pets", "read:pets"}}
  80. * }
  81. * )
  82. */
  83. public function findByStatus()
  84. {
  85. }
  86. /**
  87. * @SWG\Get(
  88. * path="/pet/{petId}",
  89. * summary="Find pet by ID",
  90. * description="Returns a single pet",
  91. * operationId="getPetById",
  92. * tags={"pet"},
  93. * produces={"application/xml", "application/json"},
  94. * @SWG\Parameter(
  95. * description="ID of pet to return",
  96. * in="path",
  97. * name="petId",
  98. * required=true,
  99. * type="integer",
  100. * format="int64"
  101. * ),
  102. * @SWG\Response(
  103. * response=200,
  104. * description="successful operation",
  105. * @SWG\Schema(ref="#/definitions/Pet")
  106. * ),
  107. * @SWG\Response(
  108. * response="400",
  109. * description="Invalid ID supplied"
  110. * ),
  111. * @SWG\Response(
  112. * response="404",
  113. * description="Pet not found"
  114. * ),
  115. * security={
  116. * {"api_key": {}}
  117. * }
  118. * )
  119. */
  120. public function getPetById()
  121. {
  122. }
  123. /**
  124. * @SWG\Post(
  125. * path="/pet",
  126. * tags={"pet"},
  127. * operationId="addPet",
  128. * summary="Add a new pet to the store",
  129. * description="",
  130. * consumes={"application/json", "application/xml"},
  131. * produces={"application/xml", "application/json"},
  132. * @SWG\Parameter(
  133. * name="body",
  134. * in="body",
  135. * description="Pet object that needs to be added to the store",
  136. * required=true,
  137. * @SWG\Schema(ref="#/definitions/Pet"),
  138. * ),
  139. * @SWG\Response(
  140. * response=405,
  141. * description="Invalid input",
  142. * ),
  143. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  144. * )
  145. */
  146. public function addPet()
  147. {
  148. }
  149. /**
  150. * @SWG\Put(
  151. * path="/pet",
  152. * tags={"pet"},
  153. * operationId="updatePet",
  154. * summary="Update an existing pet",
  155. * description="",
  156. * consumes={"application/json", "application/xml"},
  157. * produces={"application/xml", "application/json"},
  158. * @SWG\Parameter(
  159. * name="body",
  160. * in="body",
  161. * description="Pet object that needs to be added to the store",
  162. * required=true,
  163. * @SWG\Schema(ref="#/definitions/Pet"),
  164. * ),
  165. * @SWG\Response(
  166. * response=400,
  167. * description="Invalid ID supplied",
  168. * ),
  169. * @SWG\Response(
  170. * response=404,
  171. * description="Pet not found",
  172. * ),
  173. * @SWG\Response(
  174. * response=405,
  175. * description="Validation exception",
  176. * ),
  177. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  178. * )
  179. */
  180. public function updatePet()
  181. {
  182. }
  183. /**
  184. * @SWG\Delete(
  185. * path="/pet/{petId}",
  186. * summary="Deletes a pet",
  187. * description="",
  188. * operationId="deletePet",
  189. * produces={"application/xml", "application/json"},
  190. * tags={"pet"},
  191. * @SWG\Parameter(
  192. * description="Pet id to delete",
  193. * in="path",
  194. * name="petId",
  195. * required=true,
  196. * type="integer",
  197. * format="int64"
  198. * ),
  199. * @SWG\Parameter(
  200. * name="api_key",
  201. * in="header",
  202. * required=false,
  203. * type="string"
  204. * ),
  205. * @SWG\Response(
  206. * response=400,
  207. * description="Invalid ID supplied"
  208. * ),
  209. * @SWG\Response(
  210. * response=404,
  211. * description="Pet not found"
  212. * ),
  213. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  214. * )
  215. */
  216. public function deletePet()
  217. {
  218. }
  219. /**
  220. * @SWG\Post(
  221. * path="/pet/{petId}",
  222. * tags={"pet"},
  223. * summary="Updates a pet in the store with form data",
  224. * description="",
  225. * operationId="updatePetWithForm",
  226. * consumes={"application/x-www-form-urlencoded"},
  227. * produces={"application/xml", "application/json"},
  228. * @SWG\Parameter(
  229. * name="petId",
  230. * in="path",
  231. * description="ID of pet that needs to be updated",
  232. * required=true,
  233. * type="integer",
  234. * format="int64"
  235. * ),
  236. * @SWG\Parameter(
  237. * name="name",
  238. * in="formData",
  239. * description="Updated name of the pet",
  240. * required=false,
  241. * type="string"
  242. * ),
  243. * @SWG\Parameter(
  244. * name="status",
  245. * in="formData",
  246. * description="Updated status of the pet",
  247. * required=false,
  248. * type="string"
  249. * ),
  250. * @SWG\Response(response="405",description="Invalid input"),
  251. * security={{
  252. * "petstore_auth": {"write:pets", "read:pets"}
  253. * }}
  254. * )
  255. */
  256. public function updatePetWithForm()
  257. {
  258. }
  259. /**
  260. * @SWG\Post(
  261. * path="/pet/{petId}/uploadImage",
  262. * consumes={"multipart/form-data"},
  263. * description="",
  264. * operationId="uploadFile",
  265. * @SWG\Parameter(
  266. * description="Additional data to pass to server",
  267. * in="formData",
  268. * name="additionalMetadata",
  269. * required=false,
  270. * type="string"
  271. * ),
  272. * @SWG\Parameter(
  273. * description="file to upload",
  274. * in="formData",
  275. * name="file",
  276. * required=false,
  277. * type="file"
  278. * ),
  279. * @SWG\Parameter(
  280. * description="ID of pet to update",
  281. * format="int64",
  282. * in="path",
  283. * name="petId",
  284. * required=true,
  285. * type="integer"
  286. * ),
  287. * produces={"application/json"},
  288. * @SWG\Response(
  289. * response="200",
  290. * description="successful operation",
  291. * @SWG\Schema(ref="#/definitions/ApiResponse")
  292. * ),
  293. * security={
  294. * {
  295. * "petstore_auth": {
  296. * "read:pets",
  297. * "write:pets"
  298. * }
  299. * }
  300. * },
  301. * summary="uploads an image",
  302. * tags={
  303. * "pet"
  304. * }
  305. * )
  306. * */
  307. public function uploadFile()
  308. {
  309. }
  310. }