forked from loafle/openapi-generator-original
Merge pull request #2597 from wing328/petstore_test_spec
[C#][Perl][Ruby][PHP] update Petstore spec
This commit is contained in:
@@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
# complex module name used for testing
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl -o samples/client/petstore/perl"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l perl -o samples/client/petstore/perl"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
|
||||
@@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/php -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l php -o samples/client/petstore/php"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/php -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l php -o samples/client/petstore/php"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/ruby -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/ruby -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -80,7 +80,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -61,7 +61,8 @@ namespace {{packageName}}.Test
|
||||
public void {{operationId}}Test()
|
||||
{
|
||||
// TODO: add unit test for the method '{{operationId}}'
|
||||
{{#allParams}}{{{dataType}}} {{paramName}} = null; // TODO: replace null with proper value
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null; // TODO: replace null with proper value
|
||||
{{/allParams}}
|
||||
{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}}
|
||||
|
||||
@@ -82,7 +82,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -65,7 +65,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -61,7 +61,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -63,7 +63,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -68,7 +68,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
@@ -0,0 +1,792 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
description: 'This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.'
|
||||
version: 1.0.0
|
||||
title: Swagger Petstore
|
||||
termsOfService: 'http://swagger.io/terms/'
|
||||
contact:
|
||||
email: apiteam@swagger.io
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
host: petstore.swagger.io
|
||||
basePath: /v2
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Find out more
|
||||
url: 'http://swagger.io'
|
||||
- name: store
|
||||
description: Access to Petstore orders
|
||||
- name: user
|
||||
description: Operations about user
|
||||
externalDocs:
|
||||
description: Find out more about our store
|
||||
url: 'http://swagger.io'
|
||||
schemes:
|
||||
- http
|
||||
paths:
|
||||
/pet:
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: Add a new pet to the store
|
||||
description: ''
|
||||
operationId: addPet
|
||||
consumes:
|
||||
- application/json
|
||||
- application/xml
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
responses:
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
put:
|
||||
tags:
|
||||
- pet
|
||||
summary: Update an existing pet
|
||||
description: ''
|
||||
operationId: updatePet
|
||||
consumes:
|
||||
- application/json
|
||||
- application/xml
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
'405':
|
||||
description: Validation exception
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Finds Pets by status
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: status
|
||||
in: query
|
||||
description: Status values that need to be considered for filter
|
||||
required: true
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
default: available
|
||||
collectionFormat: csv
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/Pet'
|
||||
'400':
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/pet/findByTags:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Finds Pets by tags
|
||||
description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.'
|
||||
operationId: findPetsByTags
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: tags
|
||||
in: query
|
||||
description: Tags to filter by
|
||||
required: true
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
collectionFormat: csv
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/Pet'
|
||||
'400':
|
||||
description: Invalid tag value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/pet/{petId}':
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Find pet by ID
|
||||
description: Returns a single pet
|
||||
operationId: getPetById
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet to return
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
security:
|
||||
- api_key: []
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: Updates a pet in the store with form data
|
||||
description: ''
|
||||
operationId: updatePetWithForm
|
||||
consumes:
|
||||
- application/x-www-form-urlencoded
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet that needs to be updated
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- name: name
|
||||
in: formData
|
||||
description: Updated name of the pet
|
||||
required: false
|
||||
type: string
|
||||
- name: status
|
||||
in: formData
|
||||
description: Updated status of the pet
|
||||
required: false
|
||||
type: string
|
||||
responses:
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
delete:
|
||||
tags:
|
||||
- pet
|
||||
summary: Deletes a pet
|
||||
description: ''
|
||||
operationId: deletePet
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: api_key
|
||||
in: header
|
||||
required: false
|
||||
type: string
|
||||
- name: petId
|
||||
in: path
|
||||
description: Pet id to delete
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid pet value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/pet/{petId}/uploadImage':
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: uploads an image
|
||||
description: ''
|
||||
operationId: uploadFile
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet to update
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- name: additionalMetadata
|
||||
in: formData
|
||||
description: Additional data to pass to server
|
||||
required: false
|
||||
type: string
|
||||
- name: file
|
||||
in: formData
|
||||
description: file to upload
|
||||
required: false
|
||||
type: file
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/ApiResponse'
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/store/inventory:
|
||||
get:
|
||||
tags:
|
||||
- store
|
||||
summary: Returns pet inventories by status
|
||||
description: Returns a map of status codes to quantities
|
||||
operationId: getInventory
|
||||
produces:
|
||||
- application/json
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: integer
|
||||
format: int32
|
||||
security:
|
||||
- api_key: []
|
||||
/store/order:
|
||||
post:
|
||||
tags:
|
||||
- store
|
||||
summary: Place an order for a pet
|
||||
description: ''
|
||||
operationId: placeOrder
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: order placed for purchasing the pet
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/Order'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Order'
|
||||
'400':
|
||||
description: Invalid Order
|
||||
'/store/order/{orderId}':
|
||||
get:
|
||||
tags:
|
||||
- store
|
||||
summary: Find purchase order by ID
|
||||
description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions'
|
||||
operationId: getOrderById
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: orderId
|
||||
in: path
|
||||
description: ID of pet that needs to be fetched
|
||||
required: true
|
||||
type: integer
|
||||
maximum: 5
|
||||
minimum: 1
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Order'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Order not found
|
||||
delete:
|
||||
tags:
|
||||
- store
|
||||
summary: Delete purchase order by ID
|
||||
description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
operationId: deleteOrder
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: orderId
|
||||
in: path
|
||||
description: ID of the order that needs to be deleted
|
||||
required: true
|
||||
type: string
|
||||
minimum: 1
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Order not found
|
||||
/user:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Create user
|
||||
description: This can only be done by the logged in user.
|
||||
operationId: createUser
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: Created user object
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/User'
|
||||
responses:
|
||||
default:
|
||||
description: successful operation
|
||||
/user/createWithArray:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Creates list of users with given input array
|
||||
description: ''
|
||||
operationId: createUsersWithArrayInput
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: List of user object
|
||||
required: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/User'
|
||||
responses:
|
||||
default:
|
||||
description: successful operation
|
||||
/user/createWithList:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Creates list of users with given input array
|
||||
description: ''
|
||||
operationId: createUsersWithListInput
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: List of user object
|
||||
required: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/User'
|
||||
responses:
|
||||
default:
|
||||
description: successful operation
|
||||
/user/login:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Logs user into the system
|
||||
description: ''
|
||||
operationId: loginUser
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: username
|
||||
in: query
|
||||
description: The user name for login
|
||||
required: true
|
||||
type: string
|
||||
- name: password
|
||||
in: query
|
||||
description: The password for login in clear text
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
type: string
|
||||
headers:
|
||||
X-Rate-Limit:
|
||||
type: integer
|
||||
format: int32
|
||||
description: calls per hour allowed by the user
|
||||
X-Expires-After:
|
||||
type: string
|
||||
format: date-time
|
||||
description: date in UTC when toekn expires
|
||||
'400':
|
||||
description: Invalid username/password supplied
|
||||
/user/logout:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Logs out current logged in user session
|
||||
description: ''
|
||||
operationId: logoutUser
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters: []
|
||||
responses:
|
||||
default:
|
||||
description: successful operation
|
||||
'/user/{username}':
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Get user by user name
|
||||
description: ''
|
||||
operationId: getUserByName
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: username
|
||||
in: path
|
||||
description: 'The name that needs to be fetched. Use user1 for testing. '
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/User'
|
||||
'400':
|
||||
description: Invalid username supplied
|
||||
'404':
|
||||
description: User not found
|
||||
put:
|
||||
tags:
|
||||
- user
|
||||
summary: Updated user
|
||||
description: This can only be done by the logged in user.
|
||||
operationId: updateUser
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: username
|
||||
in: path
|
||||
description: name that need to be deleted
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: Updated user object
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/User'
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid user supplied
|
||||
'404':
|
||||
description: User not found
|
||||
delete:
|
||||
tags:
|
||||
- user
|
||||
summary: Delete user
|
||||
description: This can only be done by the logged in user.
|
||||
operationId: deleteUser
|
||||
produces:
|
||||
- application/xml
|
||||
- application/json
|
||||
parameters:
|
||||
- name: username
|
||||
in: path
|
||||
description: The name that needs to be deleted
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid username supplied
|
||||
'404':
|
||||
description: User not found
|
||||
securityDefinitions:
|
||||
petstore_auth:
|
||||
type: oauth2
|
||||
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
|
||||
flow: implicit
|
||||
scopes:
|
||||
'write:pets': modify pets in your account
|
||||
'read:pets': read your pets
|
||||
api_key:
|
||||
type: apiKey
|
||||
name: api_key
|
||||
in: header
|
||||
definitions:
|
||||
Order:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
petId:
|
||||
type: integer
|
||||
format: int64
|
||||
quantity:
|
||||
type: integer
|
||||
format: int32
|
||||
shipDate:
|
||||
type: string
|
||||
format: date-time
|
||||
status:
|
||||
type: string
|
||||
description: Order Status
|
||||
enum:
|
||||
- placed
|
||||
- approved
|
||||
- delivered
|
||||
complete:
|
||||
type: boolean
|
||||
default: false
|
||||
xml:
|
||||
name: Order
|
||||
Category:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
xml:
|
||||
name: Category
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
username:
|
||||
type: string
|
||||
firstName:
|
||||
type: string
|
||||
lastName:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
phone:
|
||||
type: string
|
||||
userStatus:
|
||||
type: integer
|
||||
format: int32
|
||||
description: User Status
|
||||
xml:
|
||||
name: User
|
||||
Tag:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
xml:
|
||||
name: Tag
|
||||
Pet:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
category:
|
||||
$ref: '#/definitions/Category'
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
photoUrls:
|
||||
type: array
|
||||
xml:
|
||||
name: photoUrl
|
||||
wrapped: true
|
||||
items:
|
||||
type: string
|
||||
tags:
|
||||
type: array
|
||||
xml:
|
||||
name: tag
|
||||
wrapped: true
|
||||
items:
|
||||
$ref: '#/definitions/Tag'
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
xml:
|
||||
name: Pet
|
||||
ApiResponse:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int32
|
||||
type:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
'$special[model.name]':
|
||||
properties:
|
||||
'$special[property.name]':
|
||||
type: integer
|
||||
format: int64
|
||||
xml:
|
||||
name: '$special[model.name]'
|
||||
Return:
|
||||
description: Model for testing reserved words
|
||||
properties:
|
||||
return:
|
||||
type: integer
|
||||
format: int32
|
||||
xml:
|
||||
name: Return
|
||||
Name:
|
||||
description: Model for testing model name same as property name
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: integer
|
||||
format: int32
|
||||
snake_case:
|
||||
readOnly: true
|
||||
type: integer
|
||||
format: int32
|
||||
xml:
|
||||
name: Name
|
||||
200_response:
|
||||
description: Model for testing model name starting with number
|
||||
properties:
|
||||
name:
|
||||
type: integer
|
||||
format: int32
|
||||
xml:
|
||||
name: Name
|
||||
Dog:
|
||||
allOf:
|
||||
- $ref: '#/definitions/Animal'
|
||||
- type: object
|
||||
properties:
|
||||
breed:
|
||||
type: string
|
||||
Cat:
|
||||
allOf:
|
||||
- $ref: '#/definitions/Animal'
|
||||
- type: object
|
||||
properties:
|
||||
declawed:
|
||||
type: boolean
|
||||
Animal:
|
||||
type: object
|
||||
discriminator: className
|
||||
required:
|
||||
- className
|
||||
properties:
|
||||
className:
|
||||
type: string
|
||||
format_test:
|
||||
type: object
|
||||
required:
|
||||
- number
|
||||
properties:
|
||||
integer:
|
||||
type: integer
|
||||
int32:
|
||||
type: integer
|
||||
format: int32
|
||||
int64:
|
||||
type: integer
|
||||
format: int64
|
||||
number:
|
||||
type: number
|
||||
float:
|
||||
type: number
|
||||
format: float
|
||||
double:
|
||||
type: number
|
||||
format: double
|
||||
string:
|
||||
type: string
|
||||
byte:
|
||||
type: string
|
||||
format: byte
|
||||
binary:
|
||||
type: string
|
||||
format: binary
|
||||
date:
|
||||
type: string
|
||||
format: date
|
||||
dateTime:
|
||||
type: string
|
||||
format: date-time
|
||||
password:
|
||||
type: string
|
||||
format: password
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: 'http://swagger.io'
|
||||
@@ -65,18 +65,6 @@ namespace IO.Swagger.Test
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test AddPetUsingByteArray
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void AddPetUsingByteArrayTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'AddPetUsingByteArray'
|
||||
byte[] body = null; // TODO: replace null with proper value
|
||||
instance.AddPetUsingByteArray(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test DeletePet
|
||||
/// </summary>
|
||||
@@ -85,7 +73,7 @@ namespace IO.Swagger.Test
|
||||
{
|
||||
// TODO: add unit test for the method 'DeletePet'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string apiKey = null; // TODO: replace null with proper value
|
||||
string apiKey = null; // TODO: replace null with proper value
|
||||
instance.DeletePet(petId, apiKey);
|
||||
|
||||
}
|
||||
@@ -126,30 +114,6 @@ string apiKey = null; // TODO: replace null with proper value
|
||||
Assert.IsInstanceOf<Pet> (response, "response is Pet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetPetByIdInObject
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetPetByIdInObjectTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetPetByIdInObject'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
var response = instance.GetPetByIdInObject(petId);
|
||||
Assert.IsInstanceOf<InlineResponse200> (response, "response is InlineResponse200");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test PetPetIdtestingByteArraytrueGet
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PetPetIdtestingByteArraytrueGetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'PetPetIdtestingByteArraytrueGet'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
var response = instance.PetPetIdtestingByteArraytrueGet(petId);
|
||||
Assert.IsInstanceOf<byte[]> (response, "response is byte[]");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test UpdatePet
|
||||
/// </summary>
|
||||
@@ -169,9 +133,9 @@ string apiKey = null; // TODO: replace null with proper value
|
||||
public void UpdatePetWithFormTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdatePetWithForm'
|
||||
string petId = null; // TODO: replace null with proper value
|
||||
string name = null; // TODO: replace null with proper value
|
||||
string status = null; // TODO: replace null with proper value
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string name = null; // TODO: replace null with proper value
|
||||
string status = null; // TODO: replace null with proper value
|
||||
instance.UpdatePetWithForm(petId, name, status);
|
||||
|
||||
}
|
||||
@@ -184,10 +148,10 @@ string status = null; // TODO: replace null with proper value
|
||||
{
|
||||
// TODO: add unit test for the method 'UploadFile'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string additionalMetadata = null; // TODO: replace null with proper value
|
||||
System.IO.Stream file = null; // TODO: replace null with proper value
|
||||
instance.UploadFile(petId, additionalMetadata, file);
|
||||
|
||||
string additionalMetadata = null; // TODO: replace null with proper value
|
||||
System.IO.Stream file = null; // TODO: replace null with proper value
|
||||
var response = instance.UploadFile(petId, additionalMetadata, file);
|
||||
Assert.IsInstanceOf<ApiResponse> (response, "response is ApiResponse");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,18 +65,6 @@ namespace IO.Swagger.Test
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test FindOrdersByStatus
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FindOrdersByStatusTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'FindOrdersByStatus'
|
||||
string status = null; // TODO: replace null with proper value
|
||||
var response = instance.FindOrdersByStatus(status);
|
||||
Assert.IsInstanceOf<List<Order>> (response, "response is List<Order>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetInventory
|
||||
/// </summary>
|
||||
@@ -84,21 +72,10 @@ namespace IO.Swagger.Test
|
||||
public void GetInventoryTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetInventory'
|
||||
var response = instance.GetInventory();
|
||||
var response = instance.GetInventory();
|
||||
Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetInventoryInObject
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetInventoryInObjectTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetInventoryInObject'
|
||||
var response = instance.GetInventoryInObject();
|
||||
Assert.IsInstanceOf<Object> (response, "response is Object");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetOrderById
|
||||
/// </summary>
|
||||
@@ -106,7 +83,7 @@ namespace IO.Swagger.Test
|
||||
public void GetOrderByIdTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetOrderById'
|
||||
string orderId = null; // TODO: replace null with proper value
|
||||
long? orderId = null; // TODO: replace null with proper value
|
||||
var response = instance.GetOrderById(orderId);
|
||||
Assert.IsInstanceOf<Order> (response, "response is Order");
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace IO.Swagger.Test
|
||||
{
|
||||
// TODO: add unit test for the method 'LoginUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
string password = null; // TODO: replace null with proper value
|
||||
string password = null; // TODO: replace null with proper value
|
||||
var response = instance.LoginUser(username, password);
|
||||
Assert.IsInstanceOf<string> (response, "response is string");
|
||||
}
|
||||
@@ -133,7 +133,7 @@ string password = null; // TODO: replace null with proper value
|
||||
public void LogoutUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'LogoutUser'
|
||||
instance.LogoutUser();
|
||||
instance.LogoutUser();
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ string password = null; // TODO: replace null with proper value
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdateUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
User body = null; // TODO: replace null with proper value
|
||||
User body = null; // TODO: replace null with proper value
|
||||
instance.UpdateUser(username, body);
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,27 +36,6 @@ namespace IO.Swagger.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
|
||||
/// <summary>
|
||||
/// Finds orders by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A single status value can be provided as a string
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>List<Order></returns>
|
||||
List<Order> FindOrdersByStatus (string status = null);
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A single status value can be provided as a string
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>ApiResponse of List<Order></returns>
|
||||
ApiResponse<List<Order>> FindOrdersByStatusWithHttpInfo (string status = null);
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -76,25 +55,6 @@ namespace IO.Swagger.Api
|
||||
/// <returns>ApiResponse of Dictionary<string, int?></returns>
|
||||
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Object</returns>
|
||||
Object GetInventoryInObject ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Object</returns>
|
||||
ApiResponse<Object> GetInventoryInObjectWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -103,7 +63,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Order</returns>
|
||||
Order GetOrderById (string orderId);
|
||||
Order GetOrderById (long? orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
@@ -114,7 +74,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
ApiResponse<Order> GetOrderByIdWithHttpInfo (string orderId);
|
||||
ApiResponse<Order> GetOrderByIdWithHttpInfo (long? orderId);
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
@@ -122,9 +82,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Order</returns>
|
||||
Order PlaceOrder (Order body = null);
|
||||
Order PlaceOrder (Order body);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
@@ -133,9 +93,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body = null);
|
||||
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
@@ -160,27 +120,6 @@ namespace IO.Swagger.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId);
|
||||
/// <summary>
|
||||
/// Finds orders by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A single status value can be provided as a string
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>Task of List<Order></returns>
|
||||
System.Threading.Tasks.Task<List<Order>> FindOrdersByStatusAsync (string status = null);
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A single status value can be provided as a string
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>Task of ApiResponse (List<Order>)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<List<Order>>> FindOrdersByStatusAsyncWithHttpInfo (string status = null);
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -200,25 +139,6 @@ namespace IO.Swagger.Api
|
||||
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Object</returns>
|
||||
System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Object)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -227,7 +147,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (string orderId);
|
||||
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
@@ -238,7 +158,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (string orderId);
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId);
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
@@ -246,9 +166,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body = null);
|
||||
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
@@ -257,9 +177,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@@ -388,8 +308,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -458,8 +378,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -489,163 +409,6 @@ namespace IO.Swagger.Api
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status A single status value can be provided as a string
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>List<Order></returns>
|
||||
public List<Order> FindOrdersByStatus (string status = null)
|
||||
{
|
||||
ApiResponse<List<Order>> localVarResponse = FindOrdersByStatusWithHttpInfo(status);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status A single status value can be provided as a string
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>ApiResponse of List<Order></returns>
|
||||
public ApiResponse< List<Order> > FindOrdersByStatusWithHttpInfo (string status = null)
|
||||
{
|
||||
|
||||
var localVarPath = "/store/findByStatus";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
|
||||
|
||||
// authentication (test_api_client_id) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
|
||||
}
|
||||
|
||||
// authentication (test_api_client_secret) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<List<Order>>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(List<Order>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Order>)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status A single status value can be provided as a string
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>Task of List<Order></returns>
|
||||
public async System.Threading.Tasks.Task<List<Order>> FindOrdersByStatusAsync (string status = null)
|
||||
{
|
||||
ApiResponse<List<Order>> localVarResponse = await FindOrdersByStatusAsyncWithHttpInfo(status);
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds orders by status A single status value can be provided as a string
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
|
||||
/// <returns>Task of ApiResponse (List<Order>)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<List<Order>>> FindOrdersByStatusAsyncWithHttpInfo (string status = null)
|
||||
{
|
||||
|
||||
var localVarPath = "/store/findByStatus";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
|
||||
|
||||
// authentication (test_api_client_id) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
|
||||
}
|
||||
// authentication (test_api_client_secret) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<List<Order>>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(List<Order>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Order>)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
@@ -680,8 +443,7 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -751,8 +513,7 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -786,153 +547,13 @@ namespace IO.Swagger.Api
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Object</returns>
|
||||
public Object GetInventoryInObject ()
|
||||
{
|
||||
ApiResponse<Object> localVarResponse = GetInventoryInObjectWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Object</returns>
|
||||
public ApiResponse< Object > GetInventoryInObjectWithHttpInfo ()
|
||||
{
|
||||
|
||||
var localVarPath = "/store/inventory?response=arbitrary_object";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Object</returns>
|
||||
public async System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ()
|
||||
{
|
||||
ApiResponse<Object> localVarResponse = await GetInventoryInObjectAsyncWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Object)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ()
|
||||
{
|
||||
|
||||
var localVarPath = "/store/inventory?response=arbitrary_object";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Order</returns>
|
||||
public Order GetOrderById (string orderId)
|
||||
public Order GetOrderById (long? orderId)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
|
||||
return localVarResponse.Data;
|
||||
@@ -944,7 +565,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId)
|
||||
public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
@@ -965,8 +586,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -977,18 +598,6 @@ namespace IO.Swagger.Api
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
// authentication (test_api_key_query) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
|
||||
{
|
||||
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
|
||||
}
|
||||
|
||||
// authentication (test_api_key_header) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
|
||||
{
|
||||
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
@@ -1014,7 +623,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (string orderId)
|
||||
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
|
||||
return localVarResponse.Data;
|
||||
@@ -1027,7 +636,7 @@ namespace IO.Swagger.Api
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (string orderId)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
@@ -1048,8 +657,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1060,16 +669,6 @@ namespace IO.Swagger.Api
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
// authentication (test_api_key_query) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
|
||||
{
|
||||
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
|
||||
}
|
||||
// authentication (test_api_key_header) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
|
||||
{
|
||||
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
@@ -1093,9 +692,9 @@ namespace IO.Swagger.Api
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Order</returns>
|
||||
public Order PlaceOrder (Order body = null)
|
||||
public Order PlaceOrder (Order body)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
|
||||
return localVarResponse.Data;
|
||||
@@ -1105,10 +704,13 @@ namespace IO.Swagger.Api
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null)
|
||||
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
|
||||
|
||||
var localVarPath = "/store/order";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1125,8 +727,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1144,18 +746,6 @@ namespace IO.Swagger.Api
|
||||
localVarPostBody = body; // byte array
|
||||
}
|
||||
|
||||
// authentication (test_api_client_id) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
|
||||
}
|
||||
|
||||
// authentication (test_api_client_secret) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
@@ -1179,9 +769,9 @@ namespace IO.Swagger.Api
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body = null)
|
||||
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
|
||||
return localVarResponse.Data;
|
||||
@@ -1192,10 +782,13 @@ namespace IO.Swagger.Api
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet (optional)</param>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
|
||||
|
||||
var localVarPath = "/store/order";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1212,8 +805,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1231,16 +824,6 @@ namespace IO.Swagger.Api
|
||||
localVarPostBody = body; // byte array
|
||||
}
|
||||
|
||||
// authentication (test_api_client_id) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
|
||||
}
|
||||
// authentication (test_api_client_secret) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
|
||||
{
|
||||
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace IO.Swagger.Api
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns></returns>
|
||||
void CreateUser (User body = null);
|
||||
void CreateUser (User body);
|
||||
|
||||
/// <summary>
|
||||
/// Create user
|
||||
@@ -32,9 +32,9 @@ namespace IO.Swagger.Api
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> CreateUserWithHttpInfo (User body = null);
|
||||
ApiResponse<Object> CreateUserWithHttpInfo (User body);
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
@@ -42,9 +42,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
void CreateUsersWithArrayInput (List<User> body = null);
|
||||
void CreateUsersWithArrayInput (List<User> body);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -53,9 +53,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null);
|
||||
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body);
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
@@ -63,9 +63,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
void CreateUsersWithListInput (List<User> body = null);
|
||||
void CreateUsersWithListInput (List<User> body);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -74,9 +74,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null);
|
||||
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body);
|
||||
/// <summary>
|
||||
/// Delete user
|
||||
/// </summary>
|
||||
@@ -126,10 +126,10 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>string</returns>
|
||||
string LoginUser (string username = null, string password = null);
|
||||
string LoginUser (string username, string password);
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
@@ -138,10 +138,10 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> LoginUserWithHttpInfo (string username = null, string password = null);
|
||||
ApiResponse<string> LoginUserWithHttpInfo (string username, string password);
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
@@ -169,9 +169,9 @@ namespace IO.Swagger.Api
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns></returns>
|
||||
void UpdateUser (string username, User body = null);
|
||||
void UpdateUser (string username, User body);
|
||||
|
||||
/// <summary>
|
||||
/// Updated user
|
||||
@@ -181,9 +181,9 @@ namespace IO.Swagger.Api
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null);
|
||||
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
@@ -193,9 +193,9 @@ namespace IO.Swagger.Api
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task CreateUserAsync (User body = null);
|
||||
System.Threading.Tasks.Task CreateUserAsync (User body);
|
||||
|
||||
/// <summary>
|
||||
/// Create user
|
||||
@@ -204,9 +204,9 @@ namespace IO.Swagger.Api
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body);
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
@@ -214,9 +214,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body = null);
|
||||
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -225,9 +225,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body);
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
@@ -235,9 +235,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body = null);
|
||||
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -246,9 +246,9 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body);
|
||||
/// <summary>
|
||||
/// Delete user
|
||||
/// </summary>
|
||||
@@ -298,10 +298,10 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>Task of string</returns>
|
||||
System.Threading.Tasks.Task<string> LoginUserAsync (string username = null, string password = null);
|
||||
System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password);
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
@@ -310,10 +310,10 @@ namespace IO.Swagger.Api
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username = null, string password = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username, string password);
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
@@ -341,9 +341,9 @@ namespace IO.Swagger.Api
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null);
|
||||
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
|
||||
|
||||
/// <summary>
|
||||
/// Updated user
|
||||
@@ -353,9 +353,9 @@ namespace IO.Swagger.Api
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body = null);
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@@ -450,9 +450,9 @@ namespace IO.Swagger.Api
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns></returns>
|
||||
public void CreateUser (User body = null)
|
||||
public void CreateUser (User body)
|
||||
{
|
||||
CreateUserWithHttpInfo(body);
|
||||
}
|
||||
@@ -461,10 +461,13 @@ namespace IO.Swagger.Api
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> CreateUserWithHttpInfo (User body = null)
|
||||
public ApiResponse<Object> CreateUserWithHttpInfo (User body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
|
||||
|
||||
var localVarPath = "/user";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -481,8 +484,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -523,9 +526,9 @@ namespace IO.Swagger.Api
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task CreateUserAsync (User body = null)
|
||||
public async System.Threading.Tasks.Task CreateUserAsync (User body)
|
||||
{
|
||||
await CreateUserAsyncWithHttpInfo(body);
|
||||
|
||||
@@ -535,10 +538,13 @@ namespace IO.Swagger.Api
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">Created user object (optional)</param>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
|
||||
|
||||
var localVarPath = "/user";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -555,8 +561,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -597,9 +603,9 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
public void CreateUsersWithArrayInput (List<User> body = null)
|
||||
public void CreateUsersWithArrayInput (List<User> body)
|
||||
{
|
||||
CreateUsersWithArrayInputWithHttpInfo(body);
|
||||
}
|
||||
@@ -608,10 +614,13 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null)
|
||||
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
|
||||
|
||||
var localVarPath = "/user/createWithArray";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -628,8 +637,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -670,9 +679,9 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body = null)
|
||||
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
|
||||
{
|
||||
await CreateUsersWithArrayInputAsyncWithHttpInfo(body);
|
||||
|
||||
@@ -682,10 +691,13 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
|
||||
|
||||
var localVarPath = "/user/createWithArray";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -702,8 +714,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -744,9 +756,9 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
public void CreateUsersWithListInput (List<User> body = null)
|
||||
public void CreateUsersWithListInput (List<User> body)
|
||||
{
|
||||
CreateUsersWithListInputWithHttpInfo(body);
|
||||
}
|
||||
@@ -755,10 +767,13 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null)
|
||||
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
|
||||
|
||||
var localVarPath = "/user/createWithList";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -775,8 +790,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -817,9 +832,9 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body = null)
|
||||
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
|
||||
{
|
||||
await CreateUsersWithListInputAsyncWithHttpInfo(body);
|
||||
|
||||
@@ -829,10 +844,13 @@ namespace IO.Swagger.Api
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">List of user object (optional)</param>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
|
||||
|
||||
var localVarPath = "/user/createWithList";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -849,8 +867,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -925,8 +943,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -937,13 +955,6 @@ namespace IO.Swagger.Api
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
// authentication (test_http_basic) required
|
||||
// http basic authentication required
|
||||
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
@@ -1002,8 +1013,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1014,12 +1025,6 @@ namespace IO.Swagger.Api
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
// authentication (test_http_basic) required
|
||||
// http basic authentication required
|
||||
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
@@ -1078,8 +1083,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1149,8 +1154,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1184,10 +1189,10 @@ namespace IO.Swagger.Api
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>string</returns>
|
||||
public string LoginUser (string username = null, string password = null)
|
||||
public string LoginUser (string username, string password)
|
||||
{
|
||||
ApiResponse<string> localVarResponse = LoginUserWithHttpInfo(username, password);
|
||||
return localVarResponse.Data;
|
||||
@@ -1197,11 +1202,17 @@ namespace IO.Swagger.Api
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
public ApiResponse< string > LoginUserWithHttpInfo (string username = null, string password = null)
|
||||
public ApiResponse< string > LoginUserWithHttpInfo (string username, string password)
|
||||
{
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null)
|
||||
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser");
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null)
|
||||
throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser");
|
||||
|
||||
var localVarPath = "/user/login";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1218,8 +1229,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1254,10 +1265,10 @@ namespace IO.Swagger.Api
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>Task of string</returns>
|
||||
public async System.Threading.Tasks.Task<string> LoginUserAsync (string username = null, string password = null)
|
||||
public async System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password)
|
||||
{
|
||||
ApiResponse<string> localVarResponse = await LoginUserAsyncWithHttpInfo(username, password);
|
||||
return localVarResponse.Data;
|
||||
@@ -1268,11 +1279,17 @@ namespace IO.Swagger.Api
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login (optional)</param>
|
||||
/// <param name="password">The password for login in clear text (optional)</param>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username = null, string password = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username, string password)
|
||||
{
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null)
|
||||
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser");
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null)
|
||||
throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser");
|
||||
|
||||
var localVarPath = "/user/login";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1289,8 +1306,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1354,8 +1371,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1418,8 +1435,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1453,9 +1470,9 @@ namespace IO.Swagger.Api
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns></returns>
|
||||
public void UpdateUser (string username, User body = null)
|
||||
public void UpdateUser (string username, User body)
|
||||
{
|
||||
UpdateUserWithHttpInfo(username, body);
|
||||
}
|
||||
@@ -1465,13 +1482,16 @@ namespace IO.Swagger.Api
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null)
|
||||
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body)
|
||||
{
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null)
|
||||
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
|
||||
|
||||
var localVarPath = "/user/{username}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1488,8 +1508,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
@@ -1532,9 +1552,9 @@ namespace IO.Swagger.Api
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null)
|
||||
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
|
||||
{
|
||||
await UpdateUserAsyncWithHttpInfo(username, body);
|
||||
|
||||
@@ -1545,13 +1565,16 @@ namespace IO.Swagger.Api
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object (optional)</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body = null)
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body)
|
||||
{
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null)
|
||||
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
|
||||
|
||||
var localVarPath = "/user/{username}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
@@ -1568,8 +1591,8 @@ namespace IO.Swagger.Api
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json",
|
||||
"application/xml"
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ApiResponse : IEquatable<ApiResponse>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
|
||||
/// Initializes a new instance of the <see cref="ApiResponse" />class.
|
||||
/// </summary>
|
||||
/// <param name="Code">Code.</param>
|
||||
/// <param name="Type">Type.</param>
|
||||
/// <param name="Message">Message.</param>
|
||||
|
||||
public ApiResponse(int? Code = null, string Type = null, string Message = null)
|
||||
{
|
||||
this.Code = Code;
|
||||
this.Type = Type;
|
||||
this.Message = Message;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Code
|
||||
/// </summary>
|
||||
[DataMember(Name="code", EmitDefaultValue=false)]
|
||||
public int? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Type
|
||||
/// </summary>
|
||||
[DataMember(Name="type", EmitDefaultValue=false)]
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Message
|
||||
/// </summary>
|
||||
[DataMember(Name="message", EmitDefaultValue=false)]
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class ApiResponse {\n");
|
||||
sb.Append(" Code: ").Append(Code).Append("\n");
|
||||
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||
sb.Append(" Message: ").Append(Message).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as ApiResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ApiResponse instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ApiResponse to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ApiResponse other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Code == other.Code ||
|
||||
this.Code != null &&
|
||||
this.Code.Equals(other.Code)
|
||||
) &&
|
||||
(
|
||||
this.Type == other.Type ||
|
||||
this.Type != null &&
|
||||
this.Type.Equals(other.Type)
|
||||
) &&
|
||||
(
|
||||
this.Message == other.Message ||
|
||||
this.Message != null &&
|
||||
this.Message.Equals(other.Message)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Code != null)
|
||||
hash = hash * 59 + this.Code.GetHashCode();
|
||||
if (this.Type != null)
|
||||
hash = hash * 59 + this.Type.GetHashCode();
|
||||
if (this.Message != null)
|
||||
hash = hash * 59 + this.Message.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -47,19 +47,29 @@ namespace IO.Swagger.Model
|
||||
/// Initializes a new instance of the <see cref="Order" /> class.
|
||||
/// Initializes a new instance of the <see cref="Order" />class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="PetId">PetId.</param>
|
||||
/// <param name="Quantity">Quantity.</param>
|
||||
/// <param name="ShipDate">ShipDate.</param>
|
||||
/// <param name="Status">Order Status.</param>
|
||||
/// <param name="Complete">Complete.</param>
|
||||
/// <param name="Complete">Complete (default to false).</param>
|
||||
|
||||
public Order(long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
|
||||
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
|
||||
{
|
||||
this.Id = Id;
|
||||
this.PetId = PetId;
|
||||
this.Quantity = Quantity;
|
||||
this.ShipDate = ShipDate;
|
||||
this.Status = Status;
|
||||
this.Complete = Complete;
|
||||
// use default value if no "Complete" provided
|
||||
if (Complete == null)
|
||||
{
|
||||
this.Complete = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Complete = Complete;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +78,7 @@ namespace IO.Swagger.Model
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; private set; }
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetId
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Cat.cs" />
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Dog.cs" />
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\FormatTest.cs" />
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ApiResponse.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,9 +2,27 @@
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
||||
<Files>
|
||||
<File FileName="TestPet.cs" Line="216" Column="25" />
|
||||
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
||||
<File FileName="TestPet.cs" Line="29" Column="39" />
|
||||
<File FileName="TestOrder.cs" Line="99" Column="6" />
|
||||
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs" Line="711" Column="1" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="MonoDevelop.NUnit.TestPad">
|
||||
<State name="__root__">
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="SwaggerClientTest" expanded="True">
|
||||
<Node name="TestPet" expanded="True">
|
||||
<Node name="TestPet" expanded="True">
|
||||
<Node name="TestGetPetByIdAsyncWithHttpInfo" selected="True" />
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</State>
|
||||
</Pad>
|
||||
</Pads>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace SwaggerClientTest.TestOrder
|
||||
|
||||
}
|
||||
|
||||
/* comment out the test case as the method is not defined in original petstore spec
|
||||
* we will re-enable this after updating the petstore server
|
||||
*
|
||||
/// <summary>
|
||||
/// Test GetInvetoryInObject
|
||||
/// </summary>
|
||||
@@ -93,7 +96,7 @@ namespace SwaggerClientTest.TestOrder
|
||||
Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value));
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,9 @@ namespace SwaggerClientTest.TestPet
|
||||
|
||||
}
|
||||
|
||||
/* comment out the test case as the method is not defined in original petstore spec
|
||||
* we will re-enable this after updating the petstore server
|
||||
*
|
||||
/// <summary>
|
||||
/// Test GetPetByIdInObject
|
||||
/// </summary>
|
||||
@@ -187,8 +190,11 @@ namespace SwaggerClientTest.TestPet
|
||||
Assert.AreEqual (56, (int)category ["id"]);
|
||||
Assert.AreEqual ("sample category name2", (string) category["name"]);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
/* comment out the test case as the method is not defined in original petstore spec
|
||||
* we will re-enable this after updating the petstore server
|
||||
*
|
||||
/// <summary>
|
||||
/// Test GetPetByIdWithByteArray
|
||||
/// </summary>
|
||||
@@ -201,8 +207,11 @@ namespace SwaggerClientTest.TestPet
|
||||
PetApi petApi = new PetApi (c1);
|
||||
byte[] response = petApi.PetPetIdtestingByteArraytrueGet (petId);
|
||||
Assert.IsInstanceOf<byte[]> (response, "Response is byte array");
|
||||
}
|
||||
}*/
|
||||
|
||||
/* comment out the test case as the method is not defined in original petstore spec
|
||||
* we will re-enable this after updating the petstore server
|
||||
*
|
||||
/// <summary>
|
||||
/// Test AddPetUsingByteArray
|
||||
/// </summary>
|
||||
@@ -216,7 +225,7 @@ namespace SwaggerClientTest.TestPet
|
||||
Pet p = createPet ();
|
||||
byte[] petByteArray = GetBytes ((string)petApi.Configuration.ApiClient.Serialize (p));
|
||||
petApi.AddPetUsingByteArray (petByteArray);
|
||||
}
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Test UpdatePetWithForm
|
||||
@@ -225,7 +234,7 @@ namespace SwaggerClientTest.TestPet
|
||||
public void TestUpdatePetWithForm ()
|
||||
{
|
||||
PetApi petApi = new PetApi ();
|
||||
petApi.UpdatePetWithForm (petId.ToString(), "new form name", "pending");
|
||||
petApi.UpdatePetWithForm (petId, "new form name", "pending");
|
||||
|
||||
Pet response = petApi.GetPetById (petId);
|
||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||
@@ -239,7 +248,7 @@ namespace SwaggerClientTest.TestPet
|
||||
Assert.AreEqual (56, response.Category.Id);
|
||||
|
||||
// test optional parameter
|
||||
petApi.UpdatePetWithForm (petId.ToString(), "new form name2");
|
||||
petApi.UpdatePetWithForm (petId, "new form name2");
|
||||
Pet response2 = petApi.GetPetById (petId);
|
||||
Assert.AreEqual ("new form name2", response2.Name);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
|
||||
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
# VERSION
|
||||
|
||||
@@ -10,7 +10,7 @@ Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-12T12:54:53.924+08:00
|
||||
- Build date: 2016-04-13T22:41:41.133+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
## A note on Moose
|
||||
@@ -232,11 +232,11 @@ use WWW::SwaggerClient::UserApi;
|
||||
To load the models:
|
||||
```perl
|
||||
use WWW::SwaggerClient::Object::Animal;
|
||||
use WWW::SwaggerClient::Object::ApiResponse;
|
||||
use WWW::SwaggerClient::Object::Cat;
|
||||
use WWW::SwaggerClient::Object::Category;
|
||||
use WWW::SwaggerClient::Object::Dog;
|
||||
use WWW::SwaggerClient::Object::FormatTest;
|
||||
use WWW::SwaggerClient::Object::InlineResponse200;
|
||||
use WWW::SwaggerClient::Object::Model200Response;
|
||||
use WWW::SwaggerClient::Object::ModelReturn;
|
||||
use WWW::SwaggerClient::Object::Name;
|
||||
@@ -262,11 +262,11 @@ use WWW::SwaggerClient::UserApi;
|
||||
|
||||
# load the models
|
||||
use WWW::SwaggerClient::Object::Animal;
|
||||
use WWW::SwaggerClient::Object::ApiResponse;
|
||||
use WWW::SwaggerClient::Object::Cat;
|
||||
use WWW::SwaggerClient::Object::Category;
|
||||
use WWW::SwaggerClient::Object::Dog;
|
||||
use WWW::SwaggerClient::Object::FormatTest;
|
||||
use WWW::SwaggerClient::Object::InlineResponse200;
|
||||
use WWW::SwaggerClient::Object::Model200Response;
|
||||
use WWW::SwaggerClient::Object::ModelReturn;
|
||||
use WWW::SwaggerClient::Object::Name;
|
||||
@@ -301,20 +301,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||
@@ -329,11 +324,11 @@ Class | Method | HTTP request | Description
|
||||
|
||||
# DOCUMENTATION FOR MODELS
|
||||
- [WWW::SwaggerClient::Object::Animal](docs/Animal.md)
|
||||
- [WWW::SwaggerClient::Object::ApiResponse](docs/ApiResponse.md)
|
||||
- [WWW::SwaggerClient::Object::Cat](docs/Cat.md)
|
||||
- [WWW::SwaggerClient::Object::Category](docs/Category.md)
|
||||
- [WWW::SwaggerClient::Object::Dog](docs/Dog.md)
|
||||
- [WWW::SwaggerClient::Object::FormatTest](docs/FormatTest.md)
|
||||
- [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md)
|
||||
- [WWW::SwaggerClient::Object::Model200Response](docs/Model200Response.md)
|
||||
- [WWW::SwaggerClient::Object::ModelReturn](docs/ModelReturn.md)
|
||||
- [WWW::SwaggerClient::Object::Name](docs/Name.md)
|
||||
@@ -346,40 +341,12 @@ Class | Method | HTTP request | Description
|
||||
|
||||
# DOCUMENTATION FOR AUTHORIATION
|
||||
|
||||
## test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_http_basic
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
## test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
## petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
|
||||
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
||||
**quantity** | **int** | | [optional]
|
||||
**ship_date** | **DateTime** | | [optional]
|
||||
**status** | **string** | Order Status | [optional]
|
||||
**complete** | **boolean** | | [optional]
|
||||
**complete** | **boolean** | | [optional] [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -10,13 +10,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
@@ -51,7 +48,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -64,53 +61,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **add_pet_using_byte_array**
|
||||
> add_pet_using_byte_array(body => $body)
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $body = WWW::SwaggerClient::Object::string->new(); # string | Pet object in the form of byte array
|
||||
|
||||
eval {
|
||||
$api_instance->add_pet_using_byte_array(body => $body);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling PetApi->add_pet_using_byte_array: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **string**| Pet object in the form of byte array | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -158,7 +109,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -177,7 +128,7 @@ use Data::Dumper;
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $status = (); # ARRAY[string] | Status values that need to be considered for query
|
||||
my $status = (); # ARRAY[string] | Status values that need to be considered for filter
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->find_pets_by_status(status => $status);
|
||||
@@ -192,7 +143,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -205,7 +156,7 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -214,7 +165,7 @@ Name | Type | Description | Notes
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```perl
|
||||
@@ -239,7 +190,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by | [optional]
|
||||
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -252,7 +203,7 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -261,7 +212,7 @@ Name | Type | Description | Notes
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```perl
|
||||
@@ -271,11 +222,9 @@ use Data::Dumper;
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||
my $pet_id = 789; # int | ID of pet to return
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->get_pet_by_id(pet_id => $pet_id);
|
||||
@@ -290,7 +239,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
**pet_id** | **int**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -298,114 +247,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **get_pet_by_id_in_object**
|
||||
> InlineResponse200 get_pet_by_id_in_object(pet_id => $pet_id)
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->get_pet_by_id_in_object(pet_id => $pet_id);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling PetApi->get_pet_by_id_in_object: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineResponse200**](InlineResponse200.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||
> string pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id)
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -438,7 +285,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -451,7 +298,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -470,7 +317,7 @@ use Data::Dumper;
|
||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||
my $pet_id = 'pet_id_example'; # string | ID of pet that needs to be updated
|
||||
my $pet_id = 789; # int | ID of pet that needs to be updated
|
||||
my $name = 'name_example'; # string | Updated name of the pet
|
||||
my $status = 'status_example'; # string | Updated status of the pet
|
||||
|
||||
@@ -486,7 +333,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **string**| ID of pet that needs to be updated |
|
||||
**pet_id** | **int**| ID of pet that needs to be updated |
|
||||
**name** | **string**| Updated name of the pet | [optional]
|
||||
**status** | **string**| Updated status of the pet | [optional]
|
||||
|
||||
@@ -501,12 +348,12 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **upload_file**
|
||||
> upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
|
||||
> ApiResponse upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@@ -525,7 +372,8 @@ my $additional_metadata = 'additional_metadata_example'; # string | Additional d
|
||||
my $file = '/path/to/file.txt'; # File | file to upload
|
||||
|
||||
eval {
|
||||
$api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
|
||||
my $result = $api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling PetApi->upload_file: $@\n";
|
||||
@@ -542,7 +390,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -551,7 +399,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -10,9 +10,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
@@ -56,60 +54,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **find_orders_by_status**
|
||||
> ARRAY[Order] find_orders_by_status(status => $status)
|
||||
|
||||
Finds orders by status
|
||||
|
||||
A single status value can be provided as a string
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: test_api_client_id
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER";
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER";
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||
my $status = 'status_example'; # string | Status value that needs to be considered for query
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->find_orders_by_status(status => $status);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling StoreApi->find_orders_by_status: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | **string**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ARRAY[Order]**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -154,52 +99,7 @@ This endpoint does not need any parameter.
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **get_inventory_in_object**
|
||||
> object get_inventory_in_object()
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->get_inventory_in_object();
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling StoreApi->get_inventory_in_object: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -214,17 +114,8 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: test_api_key_header
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_header'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_header'} = "BEARER";
|
||||
# Configure API key authorization: test_api_key_query
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_query'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_query'} = "BEARER";
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||
my $order_id = 'order_id_example'; # string | ID of pet that needs to be fetched
|
||||
my $order_id = 789; # int | ID of pet that needs to be fetched
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->get_order_by_id(order_id => $order_id);
|
||||
@@ -239,7 +130,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order_id** | **string**| ID of pet that needs to be fetched |
|
||||
**order_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -247,12 +138,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -267,15 +158,6 @@ Place an order for a pet
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure API key authorization: test_api_client_id
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER";
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY';
|
||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER";
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||
my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
|
||||
|
||||
@@ -292,7 +174,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -300,12 +182,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object | [optional]
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -58,7 +58,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -88,7 +88,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**ARRAY[User]**](User.md)| List of user object | [optional]
|
||||
**body** | [**ARRAY[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -101,7 +101,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -131,7 +131,7 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**ARRAY[User]**](User.md)| List of user object | [optional]
|
||||
**body** | [**ARRAY[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -144,7 +144,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -159,10 +159,6 @@ This can only be done by the logged in user.
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
|
||||
# Configure HTTP basic authorization: test_http_basic
|
||||
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
|
||||
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
|
||||
|
||||
my $api_instance = WWW::SwaggerClient::UserApi->new();
|
||||
my $username = 'username_example'; # string | The name that needs to be deleted
|
||||
|
||||
@@ -186,12 +182,12 @@ void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -235,7 +231,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -267,8 +263,8 @@ if ($@) {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The user name for login | [optional]
|
||||
**password** | **string**| The password for login in clear text | [optional]
|
||||
**username** | **string**| The user name for login |
|
||||
**password** | **string**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -281,7 +277,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -320,7 +316,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -352,7 +348,7 @@ if ($@) {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object | [optional]
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -365,7 +361,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -319,47 +319,13 @@ sub update_params_for_auth {
|
||||
if (!defined($auth)) {
|
||||
# TODO show warning about auth setting not defined
|
||||
}
|
||||
elsif ($auth eq 'test_api_key_header') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('test_api_key_header');
|
||||
if ($api_key) {
|
||||
$header_params->{'test_api_key_header'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'api_key') {
|
||||
elsif ($auth eq 'api_key') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('api_key');
|
||||
if ($api_key) {
|
||||
$header_params->{'api_key'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'test_http_basic') {
|
||||
|
||||
if ($WWW::SwaggerClient::Configuration::username || $WWW::SwaggerClient::Configuration::password) {
|
||||
$header_params->{'Authorization'} = 'Basic ' . encode_base64($WWW::SwaggerClient::Configuration::username . ":" . $WWW::SwaggerClient::Configuration::password);
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'test_api_client_secret') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('x-test_api_client_secret');
|
||||
if ($api_key) {
|
||||
$header_params->{'x-test_api_client_secret'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'test_api_client_id') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('x-test_api_client_id');
|
||||
if ($api_key) {
|
||||
$header_params->{'x-test_api_client_id'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'test_api_key_query') {
|
||||
|
||||
my $api_key = $self->get_api_key_with_prefix('test_api_key_query');
|
||||
if ($api_key) {
|
||||
$query_params->{'test_api_key_query'} = $api_key;
|
||||
}
|
||||
}
|
||||
elsif ($auth eq 'petstore_auth') {
|
||||
|
||||
if ($WWW::SwaggerClient::Configuration::access_token) {
|
||||
|
||||
@@ -56,13 +56,13 @@ sub new {
|
||||
#
|
||||
# Add a new pet to the store
|
||||
#
|
||||
# @param Pet $body Pet object that needs to be added to the store (optional)
|
||||
# @param Pet $body Pet object that needs to be added to the store (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'Pet',
|
||||
description => 'Pet object that needs to be added to the store',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ add_pet } = {
|
||||
@@ -76,6 +76,11 @@ sub new {
|
||||
sub add_pet {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling add_pet");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -86,64 +91,7 @@ sub add_pet {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml');
|
||||
|
||||
my $_body_data;
|
||||
# body params
|
||||
if ( exists $args{'body'}) {
|
||||
$_body_data = $args{'body'};
|
||||
}
|
||||
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(petstore_auth )];
|
||||
|
||||
# make the API Call
|
||||
$self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# add_pet_using_byte_array
|
||||
#
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
#
|
||||
# @param string $body Pet object in the form of byte array (optional)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'string',
|
||||
description => 'Pet object in the form of byte array',
|
||||
required => '0',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ add_pet_using_byte_array } = {
|
||||
summary => 'Fake endpoint to test byte array in body parameter for adding a new pet to the store',
|
||||
params => $params,
|
||||
returns => undef,
|
||||
};
|
||||
}
|
||||
# @return void
|
||||
#
|
||||
sub add_pet_using_byte_array {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet?testing_byte_array=true';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'POST';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -211,7 +159,7 @@ sub delete_pet {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -245,13 +193,13 @@ sub delete_pet {
|
||||
#
|
||||
# Finds Pets by status
|
||||
#
|
||||
# @param ARRAY[string] $status Status values that need to be considered for query (optional, default to available)
|
||||
# @param ARRAY[string] $status Status values that need to be considered for filter (required)
|
||||
{
|
||||
my $params = {
|
||||
'status' => {
|
||||
data_type => 'ARRAY[string]',
|
||||
description => 'Status values that need to be considered for query',
|
||||
required => '0',
|
||||
description => 'Status values that need to be considered for filter',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ find_pets_by_status } = {
|
||||
@@ -265,6 +213,11 @@ sub delete_pet {
|
||||
sub find_pets_by_status {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'status' is set
|
||||
unless (exists $args{'status'}) {
|
||||
croak("Missing the required parameter 'status' when calling find_pets_by_status");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/findByStatus';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -275,7 +228,7 @@ sub find_pets_by_status {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -306,13 +259,13 @@ sub find_pets_by_status {
|
||||
#
|
||||
# Finds Pets by tags
|
||||
#
|
||||
# @param ARRAY[string] $tags Tags to filter by (optional)
|
||||
# @param ARRAY[string] $tags Tags to filter by (required)
|
||||
{
|
||||
my $params = {
|
||||
'tags' => {
|
||||
data_type => 'ARRAY[string]',
|
||||
description => 'Tags to filter by',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ find_pets_by_tags } = {
|
||||
@@ -326,6 +279,11 @@ sub find_pets_by_status {
|
||||
sub find_pets_by_tags {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'tags' is set
|
||||
unless (exists $args{'tags'}) {
|
||||
croak("Missing the required parameter 'tags' when calling find_pets_by_tags");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/findByTags';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -336,7 +294,7 @@ sub find_pets_by_tags {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -367,12 +325,12 @@ sub find_pets_by_tags {
|
||||
#
|
||||
# Find pet by ID
|
||||
#
|
||||
# @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
# @param int $pet_id ID of pet to return (required)
|
||||
{
|
||||
my $params = {
|
||||
'pet_id' => {
|
||||
data_type => 'int',
|
||||
description => 'ID of pet that needs to be fetched',
|
||||
description => 'ID of pet to return',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
@@ -402,7 +360,7 @@ sub get_pet_by_id {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -417,7 +375,7 @@ sub get_pet_by_id {
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(api_key petstore_auth )];
|
||||
my $auth_settings = [qw(api_key )];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
@@ -430,154 +388,18 @@ sub get_pet_by_id {
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# get_pet_by_id_in_object
|
||||
#
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
#
|
||||
# @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
{
|
||||
my $params = {
|
||||
'pet_id' => {
|
||||
data_type => 'int',
|
||||
description => 'ID of pet that needs to be fetched',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ get_pet_by_id_in_object } = {
|
||||
summary => 'Fake endpoint to test inline arbitrary object return by 'Find pet by ID'',
|
||||
params => $params,
|
||||
returns => 'InlineResponse200',
|
||||
};
|
||||
}
|
||||
# @return InlineResponse200
|
||||
#
|
||||
sub get_pet_by_id_in_object {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'pet_id' is set
|
||||
unless (exists $args{'pet_id'}) {
|
||||
croak("Missing the required parameter 'pet_id' when calling get_pet_by_id_in_object");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/{petId}?response=inline_arbitrary_object';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
|
||||
|
||||
# path params
|
||||
if ( exists $args{'pet_id'}) {
|
||||
my $_base_variable = "{" . "petId" . "}";
|
||||
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
|
||||
$_resource_path =~ s/$_base_variable/$_base_value/g;
|
||||
}
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(api_key petstore_auth )];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
if (!$response) {
|
||||
return;
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# pet_pet_idtesting_byte_arraytrue_get
|
||||
#
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
#
|
||||
# @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
{
|
||||
my $params = {
|
||||
'pet_id' => {
|
||||
data_type => 'int',
|
||||
description => 'ID of pet that needs to be fetched',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ pet_pet_idtesting_byte_arraytrue_get } = {
|
||||
summary => 'Fake endpoint to test byte array return by 'Find pet by ID'',
|
||||
params => $params,
|
||||
returns => 'string',
|
||||
};
|
||||
}
|
||||
# @return string
|
||||
#
|
||||
sub pet_pet_idtesting_byte_arraytrue_get {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'pet_id' is set
|
||||
unless (exists $args{'pet_id'}) {
|
||||
croak("Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet/{petId}?testing_byte_array=true';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
|
||||
|
||||
# path params
|
||||
if ( exists $args{'pet_id'}) {
|
||||
my $_base_variable = "{" . "petId" . "}";
|
||||
my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'});
|
||||
$_resource_path =~ s/$_base_variable/$_base_value/g;
|
||||
}
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(api_key petstore_auth )];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
if (!$response) {
|
||||
return;
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('string', $response);
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# update_pet
|
||||
#
|
||||
# Update an existing pet
|
||||
#
|
||||
# @param Pet $body Pet object that needs to be added to the store (optional)
|
||||
# @param Pet $body Pet object that needs to be added to the store (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'Pet',
|
||||
description => 'Pet object that needs to be added to the store',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ update_pet } = {
|
||||
@@ -591,6 +413,11 @@ sub pet_pet_idtesting_byte_arraytrue_get {
|
||||
sub update_pet {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling update_pet");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/pet';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -601,7 +428,7 @@ sub update_pet {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -628,13 +455,13 @@ sub update_pet {
|
||||
#
|
||||
# Updates a pet in the store with form data
|
||||
#
|
||||
# @param string $pet_id ID of pet that needs to be updated (required)
|
||||
# @param int $pet_id ID of pet that needs to be updated (required)
|
||||
# @param string $name Updated name of the pet (optional)
|
||||
# @param string $status Updated status of the pet (optional)
|
||||
{
|
||||
my $params = {
|
||||
'pet_id' => {
|
||||
data_type => 'string',
|
||||
data_type => 'int',
|
||||
description => 'ID of pet that needs to be updated',
|
||||
required => '1',
|
||||
},
|
||||
@@ -675,7 +502,7 @@ sub update_pet_with_form {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -738,10 +565,10 @@ sub update_pet_with_form {
|
||||
__PACKAGE__->method_documentation->{ upload_file } = {
|
||||
summary => 'uploads an image',
|
||||
params => $params,
|
||||
returns => undef,
|
||||
returns => 'ApiResponse',
|
||||
};
|
||||
}
|
||||
# @return void
|
||||
# @return ApiResponse
|
||||
#
|
||||
sub upload_file {
|
||||
my ($self, %args) = @_;
|
||||
@@ -761,7 +588,7 @@ sub upload_file {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -790,10 +617,14 @@ sub upload_file {
|
||||
my $auth_settings = [qw(petstore_auth )];
|
||||
|
||||
# make the API Call
|
||||
$self->{api_client}->call_api($_resource_path, $_method,
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
if (!$response) {
|
||||
return;
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('ApiResponse', $response);
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
|
||||
default => sub { {
|
||||
app_name => 'Swagger Petstore',
|
||||
app_version => '1.0.0',
|
||||
generated_date => '2016-04-12T12:54:53.924+08:00',
|
||||
generated_date => '2016-04-13T22:41:41.133+08:00',
|
||||
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
|
||||
} },
|
||||
documentation => 'Information about the application version and the codegen codebase version'
|
||||
@@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
|
||||
|
||||
=over 4
|
||||
|
||||
=item Build date: 2016-04-12T12:54:53.924+08:00
|
||||
=item Build date: 2016-04-13T22:41:41.133+08:00
|
||||
|
||||
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ sub delete_order {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -115,67 +115,6 @@ sub delete_order {
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# find_orders_by_status
|
||||
#
|
||||
# Finds orders by status
|
||||
#
|
||||
# @param string $status Status value that needs to be considered for query (optional, default to placed)
|
||||
{
|
||||
my $params = {
|
||||
'status' => {
|
||||
data_type => 'string',
|
||||
description => 'Status value that needs to be considered for query',
|
||||
required => '0',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ find_orders_by_status } = {
|
||||
summary => 'Finds orders by status',
|
||||
params => $params,
|
||||
returns => 'ARRAY[Order]',
|
||||
};
|
||||
}
|
||||
# @return ARRAY[Order]
|
||||
#
|
||||
sub find_orders_by_status {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/store/findByStatus';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
|
||||
|
||||
# query params
|
||||
if ( exists $args{'status'}) {
|
||||
$query_params->{'status'} = $self->{api_client}->to_query_value($args{'status'});
|
||||
}
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(test_api_client_id test_api_client_secret )];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
if (!$response) {
|
||||
return;
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('ARRAY[Order]', $response);
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# get_inventory
|
||||
#
|
||||
@@ -205,7 +144,7 @@ sub get_inventory {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -226,66 +165,16 @@ sub get_inventory {
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# get_inventory_in_object
|
||||
#
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
#
|
||||
{
|
||||
my $params = {
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ get_inventory_in_object } = {
|
||||
summary => 'Fake endpoint to test arbitrary object return by 'Get inventory'',
|
||||
params => $params,
|
||||
returns => 'object',
|
||||
};
|
||||
}
|
||||
# @return object
|
||||
#
|
||||
sub get_inventory_in_object {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/store/inventory?response=arbitrary_object';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
|
||||
my $_method = 'GET';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(api_key )];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
if (!$response) {
|
||||
return;
|
||||
}
|
||||
my $_response_object = $self->{api_client}->deserialize('object', $response);
|
||||
return $_response_object;
|
||||
}
|
||||
|
||||
#
|
||||
# get_order_by_id
|
||||
#
|
||||
# Find purchase order by ID
|
||||
#
|
||||
# @param string $order_id ID of pet that needs to be fetched (required)
|
||||
# @param int $order_id ID of pet that needs to be fetched (required)
|
||||
{
|
||||
my $params = {
|
||||
'order_id' => {
|
||||
data_type => 'string',
|
||||
data_type => 'int',
|
||||
description => 'ID of pet that needs to be fetched',
|
||||
required => '1',
|
||||
},
|
||||
@@ -316,7 +205,7 @@ sub get_order_by_id {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -331,7 +220,7 @@ sub get_order_by_id {
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(test_api_key_header test_api_key_query )];
|
||||
my $auth_settings = [qw()];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
@@ -349,13 +238,13 @@ sub get_order_by_id {
|
||||
#
|
||||
# Place an order for a pet
|
||||
#
|
||||
# @param Order $body order placed for purchasing the pet (optional)
|
||||
# @param Order $body order placed for purchasing the pet (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'Order',
|
||||
description => 'order placed for purchasing the pet',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ place_order } = {
|
||||
@@ -369,6 +258,11 @@ sub get_order_by_id {
|
||||
sub place_order {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling place_order");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/store/order';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -379,7 +273,7 @@ sub place_order {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -392,7 +286,7 @@ sub place_order {
|
||||
}
|
||||
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(test_api_client_id test_api_client_secret )];
|
||||
my $auth_settings = [qw()];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
|
||||
@@ -56,13 +56,13 @@ sub new {
|
||||
#
|
||||
# Create user
|
||||
#
|
||||
# @param User $body Created user object (optional)
|
||||
# @param User $body Created user object (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'User',
|
||||
description => 'Created user object',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ create_user } = {
|
||||
@@ -76,6 +76,11 @@ sub new {
|
||||
sub create_user {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling create_user");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/user';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -86,7 +91,7 @@ sub create_user {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -113,13 +118,13 @@ sub create_user {
|
||||
#
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param ARRAY[User] $body List of user object (optional)
|
||||
# @param ARRAY[User] $body List of user object (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'ARRAY[User]',
|
||||
description => 'List of user object',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ create_users_with_array_input } = {
|
||||
@@ -133,6 +138,11 @@ sub create_user {
|
||||
sub create_users_with_array_input {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling create_users_with_array_input");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/user/createWithArray';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -143,7 +153,7 @@ sub create_users_with_array_input {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -170,13 +180,13 @@ sub create_users_with_array_input {
|
||||
#
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param ARRAY[User] $body List of user object (optional)
|
||||
# @param ARRAY[User] $body List of user object (required)
|
||||
{
|
||||
my $params = {
|
||||
'body' => {
|
||||
data_type => 'ARRAY[User]',
|
||||
description => 'List of user object',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ create_users_with_list_input } = {
|
||||
@@ -190,6 +200,11 @@ sub create_users_with_array_input {
|
||||
sub create_users_with_list_input {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling create_users_with_list_input");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/user/createWithList';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -200,7 +215,7 @@ sub create_users_with_list_input {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -262,7 +277,7 @@ sub delete_user {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -277,7 +292,7 @@ sub delete_user {
|
||||
|
||||
my $_body_data;
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw(test_http_basic )];
|
||||
my $auth_settings = [qw()];
|
||||
|
||||
# make the API Call
|
||||
$self->{api_client}->call_api($_resource_path, $_method,
|
||||
@@ -326,7 +341,7 @@ sub get_user_by_name {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -359,19 +374,19 @@ sub get_user_by_name {
|
||||
#
|
||||
# Logs user into the system
|
||||
#
|
||||
# @param string $username The user name for login (optional)
|
||||
# @param string $password The password for login in clear text (optional)
|
||||
# @param string $username The user name for login (required)
|
||||
# @param string $password The password for login in clear text (required)
|
||||
{
|
||||
my $params = {
|
||||
'username' => {
|
||||
data_type => 'string',
|
||||
description => 'The user name for login',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
'password' => {
|
||||
data_type => 'string',
|
||||
description => 'The password for login in clear text',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ login_user } = {
|
||||
@@ -385,6 +400,16 @@ sub get_user_by_name {
|
||||
sub login_user {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'username' is set
|
||||
unless (exists $args{'username'}) {
|
||||
croak("Missing the required parameter 'username' when calling login_user");
|
||||
}
|
||||
|
||||
# verify the required parameter 'password' is set
|
||||
unless (exists $args{'password'}) {
|
||||
croak("Missing the required parameter 'password' when calling login_user");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/user/login';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -395,7 +420,7 @@ sub login_user {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -455,7 +480,7 @@ sub logout_user {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
@@ -478,7 +503,7 @@ sub logout_user {
|
||||
# Updated user
|
||||
#
|
||||
# @param string $username name that need to be deleted (required)
|
||||
# @param User $body Updated user object (optional)
|
||||
# @param User $body Updated user object (required)
|
||||
{
|
||||
my $params = {
|
||||
'username' => {
|
||||
@@ -489,7 +514,7 @@ sub logout_user {
|
||||
'body' => {
|
||||
data_type => 'User',
|
||||
description => 'Updated user object',
|
||||
required => '0',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ update_user } = {
|
||||
@@ -508,6 +533,11 @@ sub update_user {
|
||||
croak("Missing the required parameter 'username' when calling update_user");
|
||||
}
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
unless (exists $args{'body'}) {
|
||||
croak("Missing the required parameter 'body' when calling update_user");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/user/{username}';
|
||||
$_resource_path =~ s/{format}/json/; # default format to json
|
||||
@@ -518,7 +548,7 @@ sub update_user {
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml');
|
||||
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json');
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
|
||||
@@ -37,14 +37,6 @@ isa_ok($api, 'WWW::SwaggerClient::PetApi');
|
||||
my $result = $api->add_pet(body => $body);
|
||||
}
|
||||
|
||||
#
|
||||
# add_pet_using_byte_array test
|
||||
#
|
||||
{
|
||||
my $body = undef; # replace NULL with a proper value
|
||||
my $result = $api->add_pet_using_byte_array(body => $body);
|
||||
}
|
||||
|
||||
#
|
||||
# delete_pet test
|
||||
#
|
||||
@@ -78,22 +70,6 @@ isa_ok($api, 'WWW::SwaggerClient::PetApi');
|
||||
my $result = $api->get_pet_by_id(pet_id => $pet_id);
|
||||
}
|
||||
|
||||
#
|
||||
# get_pet_by_id_in_object test
|
||||
#
|
||||
{
|
||||
my $pet_id = undef; # replace NULL with a proper value
|
||||
my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id);
|
||||
}
|
||||
|
||||
#
|
||||
# pet_pet_idtesting_byte_arraytrue_get test
|
||||
#
|
||||
{
|
||||
my $pet_id = undef; # replace NULL with a proper value
|
||||
my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id);
|
||||
}
|
||||
|
||||
#
|
||||
# update_pet test
|
||||
#
|
||||
|
||||
@@ -37,14 +37,6 @@ isa_ok($api, 'WWW::SwaggerClient::StoreApi');
|
||||
my $result = $api->delete_order(order_id => $order_id);
|
||||
}
|
||||
|
||||
#
|
||||
# find_orders_by_status test
|
||||
#
|
||||
{
|
||||
my $status = undef; # replace NULL with a proper value
|
||||
my $result = $api->find_orders_by_status(status => $status);
|
||||
}
|
||||
|
||||
#
|
||||
# get_inventory test
|
||||
#
|
||||
@@ -52,13 +44,6 @@ isa_ok($api, 'WWW::SwaggerClient::StoreApi');
|
||||
my $result = $api->get_inventory();
|
||||
}
|
||||
|
||||
#
|
||||
# get_inventory_in_object test
|
||||
#
|
||||
{
|
||||
my $result = $api->get_inventory_in_object();
|
||||
}
|
||||
|
||||
#
|
||||
# get_order_by_id test
|
||||
#
|
||||
|
||||
@@ -76,7 +76,7 @@ my $get_pet_after_update = $api->get_pet_by_id(pet_id => $pet_id);
|
||||
is $get_pet_after_update->{status}, 'sold', 'get the updated status after update_pet_with_form';
|
||||
|
||||
my $upload_pet = $api->upload_file(pet_id => $pet_id, additional_metadata => 'testabc', file => 'test.pl');
|
||||
is $upload_pet, undef, 'get the null response from upload_pet';
|
||||
isa_ok($upload_pet, 'WWW::SwaggerClient::Object::ApiResponse');
|
||||
|
||||
my $delete_pet = $api->delete_pet(pet_id => $pet_id);
|
||||
is $delete_pet, undef, 'get the null response from delete_pet';
|
||||
|
||||
@@ -50,10 +50,10 @@ is $get_pet->tags->[0]->id, '11', 'stored and retrieved: got the proper tag id';
|
||||
|
||||
# API method docs
|
||||
is_deeply( [sort keys %{$api->pet_api->method_documentation}],
|
||||
[ 'add_pet', 'add_pet_using_byte_array', 'delete_pet', 'find_pets_by_status', 'find_pets_by_tags', 'get_pet_by_id', 'get_pet_by_id_in_object', 'pet_pet_idtesting_byte_arraytrue_get', 'update_pet', 'update_pet_with_form', 'upload_file'],
|
||||
[ 'add_pet', 'delete_pet', 'find_pets_by_status', 'find_pets_by_tags', 'get_pet_by_id', 'update_pet', 'update_pet_with_form', 'upload_file'],
|
||||
"Pet API method_documentation has the correct keys");
|
||||
is $api->pet_api->method_documentation->{get_pet_by_id}->{params}->{pet_id}->{description},
|
||||
'ID of pet that needs to be fetched', 'get_pet_by_id parameter pet_id description is correct';
|
||||
'ID of pet to return', 'get_pet_by_id parameter pet_id description is correct';
|
||||
is $api->pet_api->method_documentation->{get_pet_by_id}->{params}->{pet_id}->{required},
|
||||
1, 'get_pet_by_id parameter pet_id is required';
|
||||
is $api->pet_api->method_documentation->{get_pet_by_id}->{params}->{pet_id}->{data_type},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# SwaggerClient-php
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-11T16:59:06.544+08:00
|
||||
- Build date: 2016-04-12T20:01:35.068+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
@@ -80,20 +80,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status
|
||||
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
||||
@@ -109,11 +104,11 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [Animal](docs/Animal.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [Dog](docs/Dog.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [InlineResponse200](docs/InlineResponse200.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
@@ -127,40 +122,12 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_http_basic
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
## test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
## test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
## petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
|
||||
@@ -13,7 +13,8 @@ Name | Type | Description | Notes
|
||||
**byte** | **string** | | [optional]
|
||||
**binary** | **string** | | [optional]
|
||||
**date** | [**\DateTime**](Date.md) | | [optional]
|
||||
**date_time** | **string** | | [optional]
|
||||
**date_time** | [**\DateTime**](\DateTime.md) | | [optional]
|
||||
**password** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
|
||||
**quantity** | **int** | | [optional]
|
||||
**ship_date** | [**\DateTime**](\DateTime.md) | | [optional]
|
||||
**status** | **string** | Order Status | [optional]
|
||||
**complete** | **bool** | | [optional]
|
||||
**complete** | **bool** | | [optional] [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -5,13 +5,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
@@ -47,7 +44,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -60,54 +57,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **addPetUsingByteArray**
|
||||
> addPetUsingByteArray($body)
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$body = "B"; // string | Pet object in the form of byte array
|
||||
|
||||
try {
|
||||
$api_instance->addPetUsingByteArray($body);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling PetApi->addPetUsingByteArray: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **string**| Pet object in the form of byte array | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -156,7 +106,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -176,7 +126,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$status = array("available"); // string[] | Status values that need to be considered for query
|
||||
$status = array("status_example"); // string[] | Status values that need to be considered for filter
|
||||
|
||||
try {
|
||||
$result = $api_instance->findPetsByStatus($status);
|
||||
@@ -191,7 +141,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**string[]**](string.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||
**status** | [**string[]**](string.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -204,7 +154,7 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -213,7 +163,7 @@ Name | Type | Description | Notes
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```php
|
||||
@@ -239,7 +189,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**string[]**](string.md)| Tags to filter by | [optional]
|
||||
**tags** | [**string[]**](string.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -252,7 +202,7 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -261,7 +211,7 @@ Name | Type | Description | Notes
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```php
|
||||
@@ -272,11 +222,9 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
$pet_id = 789; // int | ID of pet to return
|
||||
|
||||
try {
|
||||
$result = $api_instance->getPetById($pet_id);
|
||||
@@ -291,7 +239,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
**pet_id** | **int**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -299,116 +247,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **getPetByIdInObject**
|
||||
> \Swagger\Client\Model\InlineResponse200 getPetByIdInObject($pet_id)
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
|
||||
try {
|
||||
$result = $api_instance->getPetByIdInObject($pet_id);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling PetApi->getPetByIdInObject: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\Swagger\Client\Model\InlineResponse200**](InlineResponse200.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **petPetIdtestingByteArraytrueGet**
|
||||
> string petPetIdtestingByteArraytrueGet($pet_id)
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||
|
||||
try {
|
||||
$result = $api_instance->petPetIdtestingByteArraytrueGet($pet_id);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling PetApi->petPetIdtestingByteArraytrueGet: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -442,7 +286,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -455,7 +299,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -475,7 +319,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\PetApi();
|
||||
$pet_id = "pet_id_example"; // string | ID of pet that needs to be updated
|
||||
$pet_id = 789; // int | ID of pet that needs to be updated
|
||||
$name = "name_example"; // string | Updated name of the pet
|
||||
$status = "status_example"; // string | Updated status of the pet
|
||||
|
||||
@@ -491,7 +335,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **string**| ID of pet that needs to be updated |
|
||||
**pet_id** | **int**| ID of pet that needs to be updated |
|
||||
**name** | **string**| Updated name of the pet | [optional]
|
||||
**status** | **string**| Updated status of the pet | [optional]
|
||||
|
||||
@@ -506,12 +350,12 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **uploadFile**
|
||||
> uploadFile($pet_id, $additional_metadata, $file)
|
||||
> \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@@ -531,7 +375,8 @@ $additional_metadata = "additional_metadata_example"; // string | Additional dat
|
||||
$file = "/path/to/file.txt"; // \SplFileObject | file to upload
|
||||
|
||||
try {
|
||||
$api_instance->uploadFile($pet_id, $additional_metadata, $file);
|
||||
$result = $api_instance->uploadFile($pet_id, $additional_metadata, $file);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n";
|
||||
}
|
||||
@@ -548,7 +393,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
[**\Swagger\Client\Model\ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -557,7 +402,7 @@ void (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -5,9 +5,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
@@ -52,61 +50,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **findOrdersByStatus**
|
||||
> \Swagger\Client\Model\Order[] findOrdersByStatus($status)
|
||||
|
||||
Finds orders by status
|
||||
|
||||
A single status value can be provided as a string
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: test_api_client_id
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||
// Configure API key authorization: test_api_client_secret
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||
$status = "placed"; // string | Status value that needs to be considered for query
|
||||
|
||||
try {
|
||||
$result = $api_instance->findOrdersByStatus($status);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling StoreApi->findOrdersByStatus: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | **string**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||
|
||||
### Return type
|
||||
|
||||
[**\Swagger\Client\Model\Order[]**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -152,53 +96,7 @@ This endpoint does not need any parameter.
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **getInventoryInObject**
|
||||
> object getInventoryInObject()
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||
|
||||
try {
|
||||
$result = $api_instance->getInventoryInObject();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling StoreApi->getInventoryInObject: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -214,17 +112,8 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: test_api_key_header
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
||||
// Configure API key authorization: test_api_key_query
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
||||
$order_id = 789; // int | ID of pet that needs to be fetched
|
||||
|
||||
try {
|
||||
$result = $api_instance->getOrderById($order_id);
|
||||
@@ -239,7 +128,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order_id** | **string**| ID of pet that needs to be fetched |
|
||||
**order_id** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -247,12 +136,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -268,15 +157,6 @@ Place an order for a pet
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure API key authorization: test_api_client_id
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||
// Configure API key authorization: test_api_client_secret
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
|
||||
|
||||
@@ -293,7 +173,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\Order**](\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | [optional]
|
||||
**body** | [**\Swagger\Client\Model\Order**](\Swagger\Client\Model\Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -301,12 +181,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Created user object | [optional]
|
||||
**body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -54,7 +54,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -85,7 +85,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | [optional]
|
||||
**body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -98,7 +98,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -129,7 +129,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object | [optional]
|
||||
**body** | [**\Swagger\Client\Model\User[]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -142,7 +142,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -158,10 +158,6 @@ This can only be done by the logged in user.
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
// Configure HTTP basic authorization: test_http_basic
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
|
||||
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\UserApi();
|
||||
$username = "username_example"; // string | The name that needs to be deleted
|
||||
|
||||
@@ -185,12 +181,12 @@ void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -235,7 +231,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -268,8 +264,8 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The user name for login | [optional]
|
||||
**password** | **string**| The password for login in clear text | [optional]
|
||||
**username** | **string**| The user name for login |
|
||||
**password** | **string**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -282,7 +278,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -322,7 +318,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -355,7 +351,7 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| name that need to be deleted |
|
||||
**body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Updated user object | [optional]
|
||||
**body** | [**\Swagger\Client\Model\User**](\Swagger\Client\Model\User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -368,7 +364,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -95,11 +95,11 @@ class PetApi
|
||||
*
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPet($body = null)
|
||||
public function addPet($body)
|
||||
{
|
||||
list($response) = $this->addPetWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -111,13 +111,17 @@ class PetApi
|
||||
*
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetWithHttpInfo($body = null)
|
||||
public function addPetWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet";
|
||||
@@ -125,88 +129,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml'));
|
||||
|
||||
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($body)) {
|
||||
$_tempBody = $body;
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* addPetUsingByteArray
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArray($body = null)
|
||||
{
|
||||
list($response) = $this->addPetUsingByteArrayWithHttpInfo ($body);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPetUsingByteArrayWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
* @param string $body Pet object in the form of byte array (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function addPetUsingByteArrayWithHttpInfo($body = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet?testing_byte_array=true";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -293,7 +216,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -350,11 +273,11 @@ class PetApi
|
||||
*
|
||||
* Finds Pets by status
|
||||
*
|
||||
* @param string[] $status Status values that need to be considered for query (optional, default to available)
|
||||
* @param string[] $status Status values that need to be considered for filter (required)
|
||||
* @return \Swagger\Client\Model\Pet[]
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findPetsByStatus($status = null)
|
||||
public function findPetsByStatus($status)
|
||||
{
|
||||
list($response) = $this->findPetsByStatusWithHttpInfo ($status);
|
||||
return $response;
|
||||
@@ -366,13 +289,17 @@ class PetApi
|
||||
*
|
||||
* Finds Pets by status
|
||||
*
|
||||
* @param string[] $status Status values that need to be considered for query (optional, default to available)
|
||||
* @param string[] $status Status values that need to be considered for filter (required)
|
||||
* @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findPetsByStatusWithHttpInfo($status = null)
|
||||
public function findPetsByStatusWithHttpInfo($status)
|
||||
{
|
||||
|
||||
// verify the required parameter 'status' is set
|
||||
if ($status === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/findByStatus";
|
||||
@@ -380,7 +307,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -388,7 +315,7 @@ class PetApi
|
||||
|
||||
// query params
|
||||
if (is_array($status)) {
|
||||
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true);
|
||||
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'csv', true);
|
||||
}
|
||||
if ($status !== null) {
|
||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||
@@ -440,11 +367,11 @@ class PetApi
|
||||
*
|
||||
* Finds Pets by tags
|
||||
*
|
||||
* @param string[] $tags Tags to filter by (optional)
|
||||
* @param string[] $tags Tags to filter by (required)
|
||||
* @return \Swagger\Client\Model\Pet[]
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findPetsByTags($tags = null)
|
||||
public function findPetsByTags($tags)
|
||||
{
|
||||
list($response) = $this->findPetsByTagsWithHttpInfo ($tags);
|
||||
return $response;
|
||||
@@ -456,13 +383,17 @@ class PetApi
|
||||
*
|
||||
* Finds Pets by tags
|
||||
*
|
||||
* @param string[] $tags Tags to filter by (optional)
|
||||
* @param string[] $tags Tags to filter by (required)
|
||||
* @return Array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findPetsByTagsWithHttpInfo($tags = null)
|
||||
public function findPetsByTagsWithHttpInfo($tags)
|
||||
{
|
||||
|
||||
// verify the required parameter 'tags' is set
|
||||
if ($tags === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/findByTags";
|
||||
@@ -470,7 +401,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -478,7 +409,7 @@ class PetApi
|
||||
|
||||
// query params
|
||||
if (is_array($tags)) {
|
||||
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true);
|
||||
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'csv', true);
|
||||
}
|
||||
if ($tags !== null) {
|
||||
$queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags);
|
||||
@@ -530,7 +461,7 @@ class PetApi
|
||||
*
|
||||
* Find pet by ID
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @param int $pet_id ID of pet to return (required)
|
||||
* @return \Swagger\Client\Model\Pet
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -546,7 +477,7 @@ class PetApi
|
||||
*
|
||||
* Find pet by ID
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @param int $pet_id ID of pet to return (required)
|
||||
* @return Array of \Swagger\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -564,7 +495,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -599,11 +530,6 @@ class PetApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -627,220 +553,16 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* getPetByIdInObject
|
||||
*
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @return \Swagger\Client\Model\InlineResponse200
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getPetByIdInObject($pet_id)
|
||||
{
|
||||
list($response) = $this->getPetByIdInObjectWithHttpInfo ($pet_id);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getPetByIdInObjectWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @return Array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getPetByIdInObjectWithHttpInfo($pet_id)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetByIdInObject');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\InlineResponse200'
|
||||
);
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* petPetIdtestingByteArraytrueGet
|
||||
*
|
||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @return string
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function petPetIdtestingByteArraytrueGet($pet_id)
|
||||
{
|
||||
list($response) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* petPetIdtestingByteArraytrueGetWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*
|
||||
* @param int $pet_id ID of pet that needs to be fetched (required)
|
||||
* @return Array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function petPetIdtestingByteArraytrueGetWithHttpInfo($pet_id)
|
||||
{
|
||||
|
||||
// verify the required parameter 'pet_id' is set
|
||||
if ($pet_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling petPetIdtestingByteArraytrueGet');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}?testing_byte_array=true";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
$this->apiClient->getSerializer()->toPathValue($pet_id),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'string'
|
||||
);
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* updatePet
|
||||
*
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePet($body = null)
|
||||
public function updatePet($body)
|
||||
{
|
||||
list($response) = $this->updatePetWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -852,13 +574,17 @@ class PetApi
|
||||
*
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (optional)
|
||||
* @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updatePetWithHttpInfo($body = null)
|
||||
public function updatePetWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet";
|
||||
@@ -866,7 +592,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -917,7 +643,7 @@ class PetApi
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param int $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return void
|
||||
@@ -935,7 +661,7 @@ class PetApi
|
||||
*
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param string $pet_id ID of pet that needs to be updated (required)
|
||||
* @param int $pet_id ID of pet that needs to be updated (required)
|
||||
* @param string $name Updated name of the pet (optional)
|
||||
* @param string $status Updated status of the pet (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
@@ -955,7 +681,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -1018,7 +744,7 @@ class PetApi
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return void
|
||||
* @return \Swagger\Client\Model\ApiResponse
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFile($pet_id, $additional_metadata = null, $file = null)
|
||||
@@ -1036,7 +762,7 @@ class PetApi
|
||||
* @param int $pet_id ID of pet to update (required)
|
||||
* @param string $additional_metadata Additional data to pass to server (optional)
|
||||
* @param \SplFileObject $file file to upload (optional)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @return Array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null)
|
||||
@@ -1053,7 +779,7 @@ class PetApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -1103,12 +829,19 @@ class PetApi
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
$headerParams, '\Swagger\Client\Model\ApiResponse'
|
||||
);
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\ApiResponse', $httpHeader), $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\ApiResponse', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
|
||||
@@ -129,7 +129,7 @@ class StoreApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -173,102 +173,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* findOrdersByStatus
|
||||
*
|
||||
* Finds orders by status
|
||||
*
|
||||
* @param string $status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return \Swagger\Client\Model\Order[]
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findOrdersByStatus($status = null)
|
||||
{
|
||||
list($response) = $this->findOrdersByStatusWithHttpInfo ($status);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* findOrdersByStatusWithHttpInfo
|
||||
*
|
||||
* Finds orders by status
|
||||
*
|
||||
* @param string $status Status value that needs to be considered for query (optional, default to placed)
|
||||
* @return Array of \Swagger\Client\Model\Order[], HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function findOrdersByStatusWithHttpInfo($status = null)
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/findByStatus";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
// query params
|
||||
if ($status !== null) {
|
||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||
}
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_id');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Order[]'
|
||||
);
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order[]', $httpHeader), $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* getInventory
|
||||
*
|
||||
@@ -302,7 +206,7 @@ class StoreApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -353,96 +257,12 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* getInventoryInObject
|
||||
*
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*
|
||||
* @return object
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getInventoryInObject()
|
||||
{
|
||||
list($response) = $this->getInventoryInObjectWithHttpInfo ();
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getInventoryInObjectWithHttpInfo
|
||||
*
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*
|
||||
* @return Array of object, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function getInventoryInObjectWithHttpInfo()
|
||||
{
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/inventory?response=arbitrary_object";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
|
||||
|
||||
|
||||
// default format to json
|
||||
$resourcePath = str_replace("{format}", "json", $resourcePath);
|
||||
|
||||
|
||||
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'object'
|
||||
);
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* getOrderById
|
||||
*
|
||||
* Find purchase order by ID
|
||||
*
|
||||
* @param string $order_id ID of pet that needs to be fetched (required)
|
||||
* @param int $order_id ID of pet that needs to be fetched (required)
|
||||
* @return \Swagger\Client\Model\Order
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -458,7 +278,7 @@ class StoreApi
|
||||
*
|
||||
* Find purchase order by ID
|
||||
*
|
||||
* @param string $order_id ID of pet that needs to be fetched (required)
|
||||
* @param int $order_id ID of pet that needs to be fetched (required)
|
||||
* @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -476,7 +296,7 @@ class StoreApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -504,21 +324,7 @@ class StoreApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['test_api_key_header'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$queryParams['test_api_key_query'] = $apiKey;
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
@@ -546,11 +352,11 @@ class StoreApi
|
||||
*
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required)
|
||||
* @return \Swagger\Client\Model\Order
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function placeOrder($body = null)
|
||||
public function placeOrder($body)
|
||||
{
|
||||
list($response) = $this->placeOrderWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -562,13 +368,17 @@ class StoreApi
|
||||
*
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (optional)
|
||||
* @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required)
|
||||
* @return Array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function placeOrderWithHttpInfo($body = null)
|
||||
public function placeOrderWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/order";
|
||||
@@ -576,7 +386,7 @@ class StoreApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -601,21 +411,7 @@ class StoreApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_id');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
|
||||
@@ -95,11 +95,11 @@ class UserApi
|
||||
*
|
||||
* Create user
|
||||
*
|
||||
* @param \Swagger\Client\Model\User $body Created user object (optional)
|
||||
* @param \Swagger\Client\Model\User $body Created user object (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUser($body = null)
|
||||
public function createUser($body)
|
||||
{
|
||||
list($response) = $this->createUserWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -111,13 +111,17 @@ class UserApi
|
||||
*
|
||||
* Create user
|
||||
*
|
||||
* @param \Swagger\Client\Model\User $body Created user object (optional)
|
||||
* @param \Swagger\Client\Model\User $body Created user object (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUserWithHttpInfo($body = null)
|
||||
public function createUserWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user";
|
||||
@@ -125,7 +129,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -171,11 +175,11 @@ class UserApi
|
||||
*
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUsersWithArrayInput($body = null)
|
||||
public function createUsersWithArrayInput($body)
|
||||
{
|
||||
list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -187,13 +191,17 @@ class UserApi
|
||||
*
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUsersWithArrayInputWithHttpInfo($body = null)
|
||||
public function createUsersWithArrayInputWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/createWithArray";
|
||||
@@ -201,7 +209,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -247,11 +255,11 @@ class UserApi
|
||||
*
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUsersWithListInput($body = null)
|
||||
public function createUsersWithListInput($body)
|
||||
{
|
||||
list($response) = $this->createUsersWithListInputWithHttpInfo ($body);
|
||||
return $response;
|
||||
@@ -263,13 +271,17 @@ class UserApi
|
||||
*
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (optional)
|
||||
* @param \Swagger\Client\Model\User[] $body List of user object (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function createUsersWithListInputWithHttpInfo($body = null)
|
||||
public function createUsersWithListInputWithHttpInfo($body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/createWithList";
|
||||
@@ -277,7 +289,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -357,7 +369,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -385,12 +397,7 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// this endpoint requires HTTP basic authentication
|
||||
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
|
||||
}
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
@@ -445,7 +452,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -501,12 +508,12 @@ class UserApi
|
||||
*
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param string $username The user name for login (optional)
|
||||
* @param string $password The password for login in clear text (optional)
|
||||
* @param string $username The user name for login (required)
|
||||
* @param string $password The password for login in clear text (required)
|
||||
* @return string
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function loginUser($username = null, $password = null)
|
||||
public function loginUser($username, $password)
|
||||
{
|
||||
list($response) = $this->loginUserWithHttpInfo ($username, $password);
|
||||
return $response;
|
||||
@@ -518,14 +525,22 @@ class UserApi
|
||||
*
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param string $username The user name for login (optional)
|
||||
* @param string $password The password for login in clear text (optional)
|
||||
* @param string $username The user name for login (required)
|
||||
* @param string $password The password for login in clear text (required)
|
||||
* @return Array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function loginUserWithHttpInfo($username = null, $password = null)
|
||||
public function loginUserWithHttpInfo($username, $password)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling loginUser');
|
||||
}
|
||||
// verify the required parameter 'password' is set
|
||||
if ($password === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/login";
|
||||
@@ -533,7 +548,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -616,7 +631,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
@@ -659,11 +674,11 @@ class UserApi
|
||||
* Updated user
|
||||
*
|
||||
* @param string $username name that need to be deleted (required)
|
||||
* @param \Swagger\Client\Model\User $body Updated user object (optional)
|
||||
* @param \Swagger\Client\Model\User $body Updated user object (required)
|
||||
* @return void
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updateUser($username, $body = null)
|
||||
public function updateUser($username, $body)
|
||||
{
|
||||
list($response) = $this->updateUserWithHttpInfo ($username, $body);
|
||||
return $response;
|
||||
@@ -676,17 +691,21 @@ class UserApi
|
||||
* Updated user
|
||||
*
|
||||
* @param string $username name that need to be deleted (required)
|
||||
* @param \Swagger\Client\Model\User $body Updated user object (optional)
|
||||
* @param \Swagger\Client\Model\User $body Updated user object (required)
|
||||
* @return Array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
public function updateUserWithHttpInfo($username, $body = null)
|
||||
public function updateUserWithHttpInfo($username, $body)
|
||||
{
|
||||
|
||||
// verify the required parameter 'username' is set
|
||||
if ($username === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $username when calling updateUser');
|
||||
}
|
||||
// verify the required parameter 'body' is set
|
||||
if ($body === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/user/{username}";
|
||||
@@ -694,7 +713,7 @@ class UserApi
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$formParams = array();
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml'));
|
||||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json'));
|
||||
if (!is_null($_header_accept)) {
|
||||
$headerParams['Accept'] = $_header_accept;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ class FormatTest implements ArrayAccess
|
||||
'byte' => 'string',
|
||||
'binary' => 'string',
|
||||
'date' => '\DateTime',
|
||||
'date_time' => 'string'
|
||||
'date_time' => '\DateTime',
|
||||
'password' => 'string'
|
||||
);
|
||||
|
||||
static function swaggerTypes() {
|
||||
@@ -89,7 +90,8 @@ class FormatTest implements ArrayAccess
|
||||
'byte' => 'byte',
|
||||
'binary' => 'binary',
|
||||
'date' => 'date',
|
||||
'date_time' => 'dateTime'
|
||||
'date_time' => 'dateTime',
|
||||
'password' => 'password'
|
||||
);
|
||||
|
||||
static function attributeMap() {
|
||||
@@ -111,7 +113,8 @@ class FormatTest implements ArrayAccess
|
||||
'byte' => 'setByte',
|
||||
'binary' => 'setBinary',
|
||||
'date' => 'setDate',
|
||||
'date_time' => 'setDateTime'
|
||||
'date_time' => 'setDateTime',
|
||||
'password' => 'setPassword'
|
||||
);
|
||||
|
||||
static function setters() {
|
||||
@@ -133,7 +136,8 @@ class FormatTest implements ArrayAccess
|
||||
'byte' => 'getByte',
|
||||
'binary' => 'getBinary',
|
||||
'date' => 'getDate',
|
||||
'date_time' => 'getDateTime'
|
||||
'date_time' => 'getDateTime',
|
||||
'password' => 'getPassword'
|
||||
);
|
||||
|
||||
static function getters() {
|
||||
@@ -192,9 +196,14 @@ class FormatTest implements ArrayAccess
|
||||
protected $date;
|
||||
/**
|
||||
* $date_time
|
||||
* @var string
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $date_time;
|
||||
/**
|
||||
* $password
|
||||
* @var string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -216,6 +225,7 @@ class FormatTest implements ArrayAccess
|
||||
$this->binary = $data["binary"];
|
||||
$this->date = $data["date"];
|
||||
$this->date_time = $data["date_time"];
|
||||
$this->password = $data["password"];
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -420,7 +430,7 @@ class FormatTest implements ArrayAccess
|
||||
}
|
||||
/**
|
||||
* Gets date_time
|
||||
* @return string
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDateTime()
|
||||
{
|
||||
@@ -429,7 +439,7 @@ class FormatTest implements ArrayAccess
|
||||
|
||||
/**
|
||||
* Sets date_time
|
||||
* @param string $date_time
|
||||
* @param \DateTime $date_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setDateTime($date_time)
|
||||
@@ -438,6 +448,26 @@ class FormatTest implements ArrayAccess
|
||||
$this->date_time = $date_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets password
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets password
|
||||
* @param string $password
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
* @param integer $offset Offset
|
||||
|
||||
@@ -149,7 +149,7 @@ class Order implements ArrayAccess
|
||||
* $complete
|
||||
* @var bool
|
||||
*/
|
||||
protected $complete;
|
||||
protected $complete = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@@ -72,15 +72,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function test_addPet() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for addPetUsingByteArray
|
||||
*
|
||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*
|
||||
*/
|
||||
public function test_addPetUsingByteArray() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for deletePet
|
||||
@@ -117,24 +108,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function test_getPetById() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for getPetByIdInObject
|
||||
*
|
||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*
|
||||
*/
|
||||
public function test_getPetByIdInObject() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for petPetIdtestingByteArraytrueGet
|
||||
*
|
||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*
|
||||
*/
|
||||
public function test_petPetIdtestingByteArraytrueGet() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for updatePet
|
||||
|
||||
@@ -72,15 +72,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function test_deleteOrder() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for findOrdersByStatus
|
||||
*
|
||||
* Finds orders by status
|
||||
*
|
||||
*/
|
||||
public function test_findOrdersByStatus() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for getInventory
|
||||
@@ -90,15 +81,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function test_getInventory() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for getInventoryInObject
|
||||
*
|
||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*
|
||||
*/
|
||||
public function test_getInventoryInObject() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Test case for getOrderById
|
||||
|
||||
@@ -111,6 +111,10 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($response->getTags()[0]->getName(), 'test php tag');
|
||||
}
|
||||
|
||||
/*
|
||||
* comment out as we've removed invalid endpoints from the spec, we'll introduce something
|
||||
* similar in the future when we've time to update the petstore server
|
||||
*
|
||||
// test getPetById with a Pet object (id 10005)
|
||||
public function testGetPetByIdInObject()
|
||||
{
|
||||
@@ -133,6 +137,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($response->getTags()[0]->getId(), $pet_id);
|
||||
$this->assertSame($response->getTags()[0]->getName(), 'test php tag');
|
||||
}
|
||||
*/
|
||||
|
||||
// test getPetByIdWithHttpInfo with a Pet object (id 10005)
|
||||
public function testGetPetByIdWithHttpInfo()
|
||||
@@ -274,7 +279,11 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($response->getId(), $new_pet_id);
|
||||
$this->assertSame($response->getName(), 'PHP Unit Test 2');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* comment out as we've removed invalid endpoints from the spec, we'll introduce something
|
||||
* similar in the future when we've time to update the petstore server
|
||||
*
|
||||
// test addPetUsingByteArray and verify by the "id" and "name" of the response
|
||||
public function testAddPetUsingByteArray()
|
||||
{
|
||||
@@ -310,8 +319,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($response->getId(), $new_pet_id);
|
||||
$this->assertSame($response->getName(), 'PHP Unit Test 3');
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// test upload file
|
||||
public function testUploadFile()
|
||||
@@ -322,9 +330,10 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$pet_api = new Swagger\Client\Api\PetApi($api_client);
|
||||
// upload file
|
||||
$pet_id = 10001;
|
||||
$add_response = $pet_api->uploadFile($pet_id, "test meta", "./composer.json");
|
||||
// return nothing (void)
|
||||
$this->assertSame($add_response, NULL);
|
||||
$response = $pet_api->uploadFile($pet_id, "test meta", "./composer.json");
|
||||
// return ApiResponse
|
||||
$this->assertInstanceOf('Swagger\Client\Model\ApiResponse', $response);
|
||||
|
||||
}
|
||||
|
||||
// test get inventory
|
||||
@@ -341,7 +350,11 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInternalType("int", $get_response['sold']);
|
||||
$this->assertInternalType("int", $get_response['pending']);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* comment out as we've removed invalid endpoints from the spec, we'll introduce something
|
||||
* similar in the future when we've time to update the petstore server
|
||||
*
|
||||
// test byte array response
|
||||
public function testGetPetByIdWithByteArray()
|
||||
{
|
||||
@@ -365,6 +378,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($json['tags'][0]['id'], $pet_id);
|
||||
$this->assertSame($json['tags'][0]['name'], 'test php tag');
|
||||
}
|
||||
*/
|
||||
|
||||
// test empty object serialization
|
||||
public function testEmptyPetSerialization()
|
||||
|
||||
@@ -47,6 +47,10 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInternalType("int", $get_response['available']);
|
||||
}
|
||||
|
||||
/*
|
||||
* comment out as we've removed invalid endpoints from the spec, we'll introduce something
|
||||
* similar in the future when we've time to update the petstore server
|
||||
*
|
||||
// test get inventory
|
||||
public function testGetInventoryInObject()
|
||||
{
|
||||
@@ -60,6 +64,7 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInternalType("array", $get_response);
|
||||
$this->assertInternalType("int", $get_response['available']);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
Petstore - the Ruby gem for the Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-11T17:03:41.311+08:00
|
||||
- Build date: 2016-04-13T17:44:36.129+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@@ -62,13 +62,12 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
body: Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
|
||||
|
||||
begin
|
||||
#Add a new pet to the store
|
||||
api_instance.add_pet(opts)
|
||||
api_instance.add_pet(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->add_pet: #{e}"
|
||||
end
|
||||
@@ -82,20 +81,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*Petstore::PetApi* | [**add_pet_using_byte_array**](docs/PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
*Petstore::PetApi* | [**get_pet_by_id_in_object**](docs/PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*Petstore::PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*Petstore::StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*Petstore::StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||
@@ -111,11 +105,11 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Models
|
||||
|
||||
- [Petstore::Animal](docs/Animal.md)
|
||||
- [Petstore::ApiResponse](docs/ApiResponse.md)
|
||||
- [Petstore::Cat](docs/Cat.md)
|
||||
- [Petstore::Category](docs/Category.md)
|
||||
- [Petstore::Dog](docs/Dog.md)
|
||||
- [Petstore::FormatTest](docs/FormatTest.md)
|
||||
- [Petstore::InlineResponse200](docs/InlineResponse200.md)
|
||||
- [Petstore::Model200Response](docs/Model200Response.md)
|
||||
- [Petstore::ModelReturn](docs/ModelReturn.md)
|
||||
- [Petstore::Name](docs/Name.md)
|
||||
@@ -129,40 +123,12 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_http_basic
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
|
||||
10
samples/client/petstore/ruby/docs/ApiResponse.md
Normal file
10
samples/client/petstore/ruby/docs/ApiResponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Petstore::ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **Integer** | | [optional]
|
||||
**type** | **String** | | [optional]
|
||||
**message** | **String** | | [optional]
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ Name | Type | Description | Notes
|
||||
**byte** | **String** | | [optional]
|
||||
**binary** | **String** | | [optional]
|
||||
**date** | **Date** | | [optional]
|
||||
**date_time** | **String** | | [optional]
|
||||
**date_time** | **DateTime** | | [optional]
|
||||
**password** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ Name | Type | Description | Notes
|
||||
**quantity** | **Integer** | | [optional]
|
||||
**ship_date** | **DateTime** | | [optional]
|
||||
**status** | **String** | Order Status | [optional]
|
||||
**complete** | **BOOLEAN** | | [optional]
|
||||
**complete** | **BOOLEAN** | | [optional] [default to false]
|
||||
|
||||
|
||||
|
||||
@@ -5,20 +5,17 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
|
||||
|
||||
# **add_pet**
|
||||
> add_pet(opts)
|
||||
> add_pet(body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
@@ -36,13 +33,12 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
body: Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
|
||||
|
||||
begin
|
||||
#Add a new pet to the store
|
||||
api_instance.add_pet(opts)
|
||||
api_instance.add_pet(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->add_pet: #{e}"
|
||||
end
|
||||
@@ -52,7 +48,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -65,59 +61,7 @@ nil (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
|
||||
|
||||
# **add_pet_using_byte_array**
|
||||
> add_pet_using_byte_array(opts)
|
||||
|
||||
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = 'YOUR ACCESS TOKEN'
|
||||
end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
body: "B" # String | Pet object in the form of byte array
|
||||
}
|
||||
|
||||
begin
|
||||
#Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
api_instance.add_pet_using_byte_array(opts)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->add_pet_using_byte_array: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **String**| Pet object in the form of byte array | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
nil (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -172,12 +116,12 @@ nil (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **find_pets_by_status**
|
||||
> Array<Pet> find_pets_by_status(opts)
|
||||
> Array<Pet> find_pets_by_status(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
@@ -195,13 +139,12 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
status: ["available"] # Array<String> | Status values that need to be considered for query
|
||||
}
|
||||
status = ["status_example"] # Array<String> | Status values that need to be considered for filter
|
||||
|
||||
|
||||
begin
|
||||
#Finds Pets by status
|
||||
result = api_instance.find_pets_by_status(opts)
|
||||
result = api_instance.find_pets_by_status(status)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->find_pets_by_status: #{e}"
|
||||
@@ -212,7 +155,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**Array<String>**](String.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||
**status** | [**Array<String>**](String.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -225,16 +168,16 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **find_pets_by_tags**
|
||||
> Array<Pet> find_pets_by_tags(opts)
|
||||
> Array<Pet> find_pets_by_tags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
@@ -248,13 +191,12 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
tags: ["tags_example"] # Array<String> | Tags to filter by
|
||||
}
|
||||
tags = ["tags_example"] # Array<String> | Tags to filter by
|
||||
|
||||
|
||||
begin
|
||||
#Finds Pets by tags
|
||||
result = api_instance.find_pets_by_tags(opts)
|
||||
result = api_instance.find_pets_by_tags(tags)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->find_pets_by_tags: #{e}"
|
||||
@@ -265,7 +207,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**Array<String>**](String.md)| Tags to filter by | [optional]
|
||||
**tags** | [**Array<String>**](String.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -278,7 +220,7 @@ Name | Type | Description | Notes
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -287,7 +229,7 @@ Name | Type | Description | Notes
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
@@ -299,14 +241,11 @@ Petstore.configure do |config|
|
||||
config.api_key['api_key'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = 'YOUR ACCESS TOKEN'
|
||||
end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||
pet_id = 789 # Integer | ID of pet to return
|
||||
|
||||
|
||||
begin
|
||||
@@ -322,7 +261,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||
**pet_id** | **Integer**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -330,131 +269,17 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
|
||||
|
||||
# **get_pet_by_id_in_object**
|
||||
> InlineResponse200 get_pet_by_id_in_object(pet_id)
|
||||
|
||||
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = 'YOUR ACCESS TOKEN'
|
||||
end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||
|
||||
|
||||
begin
|
||||
#Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
result = api_instance.get_pet_by_id_in_object(pet_id)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->get_pet_by_id_in_object: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineResponse200**](InlineResponse200.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
|
||||
|
||||
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||
> String pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||
|
||||
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
|
||||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
config.access_token = 'YOUR ACCESS TOKEN'
|
||||
end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||
|
||||
|
||||
begin
|
||||
#Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
result = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **update_pet**
|
||||
> update_pet(opts)
|
||||
> update_pet(body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
@@ -472,13 +297,12 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
opts = {
|
||||
body: Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||
|
||||
|
||||
begin
|
||||
#Update an existing pet
|
||||
api_instance.update_pet(opts)
|
||||
api_instance.update_pet(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->update_pet: #{e}"
|
||||
end
|
||||
@@ -488,7 +312,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -501,7 +325,7 @@ nil (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +348,7 @@ end
|
||||
|
||||
api_instance = Petstore::PetApi.new
|
||||
|
||||
pet_id = "pet_id_example" # String | ID of pet that needs to be updated
|
||||
pet_id = 789 # Integer | ID of pet that needs to be updated
|
||||
|
||||
opts = {
|
||||
name: "name_example", # String | Updated name of the pet
|
||||
@@ -543,7 +367,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **String**| ID of pet that needs to be updated |
|
||||
**pet_id** | **Integer**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
@@ -558,12 +382,12 @@ nil (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **upload_file**
|
||||
> upload_file(pet_id, opts)
|
||||
> ApiResponse upload_file(pet_id, opts)
|
||||
|
||||
uploads an image
|
||||
|
||||
@@ -590,7 +414,8 @@ opts = {
|
||||
|
||||
begin
|
||||
#uploads an image
|
||||
api_instance.upload_file(pet_id, opts)
|
||||
result = api_instance.upload_file(pet_id, opts)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling PetApi->upload_file: #{e}"
|
||||
end
|
||||
@@ -606,7 +431,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
nil (empty response body)
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -615,7 +440,7 @@ nil (empty response body)
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
@@ -54,67 +52,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
|
||||
|
||||
# **find_orders_by_status**
|
||||
> Array<Order> find_orders_by_status(opts)
|
||||
|
||||
Finds orders by status
|
||||
|
||||
A single status value can be provided as a string
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: test_api_client_id
|
||||
config.api_key['x-test_api_client_id'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
config.api_key['x-test_api_client_secret'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||
end
|
||||
|
||||
api_instance = Petstore::StoreApi.new
|
||||
|
||||
opts = {
|
||||
status: "placed" # String | Status value that needs to be considered for query
|
||||
}
|
||||
|
||||
begin
|
||||
#Finds orders by status
|
||||
result = api_instance.find_orders_by_status(opts)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling StoreApi->find_orders_by_status: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | **String**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Array<Order>**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -162,55 +100,7 @@ This endpoint does not need any parameter.
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
|
||||
|
||||
# **get_inventory_in_object**
|
||||
> Object get_inventory_in_object
|
||||
|
||||
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
|
||||
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: api_key
|
||||
config.api_key['api_key'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||
end
|
||||
|
||||
api_instance = Petstore::StoreApi.new
|
||||
|
||||
begin
|
||||
#Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
result = api_instance.get_inventory_in_object
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling StoreApi->get_inventory_in_object: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**Object**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
|
||||
@@ -225,22 +115,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: test_api_key_header
|
||||
config.api_key['test_api_key_header'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['test_api_key_header'] = 'BEARER'
|
||||
|
||||
# Configure API key authorization: test_api_key_query
|
||||
config.api_key['test_api_key_query'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['test_api_key_query'] = 'BEARER'
|
||||
end
|
||||
|
||||
api_instance = Petstore::StoreApi.new
|
||||
|
||||
order_id = "order_id_example" # String | ID of pet that needs to be fetched
|
||||
order_id = 789 # Integer | ID of pet that needs to be fetched
|
||||
|
||||
|
||||
begin
|
||||
@@ -256,7 +134,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order_id** | **String**| ID of pet that needs to be fetched |
|
||||
**order_id** | **Integer**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -264,17 +142,17 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **place_order**
|
||||
> Order place_order(opts)
|
||||
> Order place_order(body)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
@@ -284,28 +162,15 @@ Place an order for a pet
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure API key authorization: test_api_client_id
|
||||
config.api_key['x-test_api_client_id'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||
|
||||
# Configure API key authorization: test_api_client_secret
|
||||
config.api_key['x-test_api_client_secret'] = 'YOUR API KEY'
|
||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||
#config.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||
end
|
||||
|
||||
api_instance = Petstore::StoreApi.new
|
||||
|
||||
opts = {
|
||||
body: Petstore::Order.new # Order | order placed for purchasing the pet
|
||||
}
|
||||
body = Petstore::Order.new # Order | order placed for purchasing the pet
|
||||
|
||||
|
||||
begin
|
||||
#Place an order for a pet
|
||||
result = api_instance.place_order(opts)
|
||||
result = api_instance.place_order(body)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling StoreApi->place_order: #{e}"
|
||||
@@ -316,7 +181,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -324,12 +189,12 @@ Name | Type | Description | Notes
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **create_user**
|
||||
> create_user(opts)
|
||||
> create_user(body)
|
||||
|
||||
Create user
|
||||
|
||||
@@ -28,13 +28,12 @@ require 'petstore'
|
||||
|
||||
api_instance = Petstore::UserApi.new
|
||||
|
||||
opts = {
|
||||
body: Petstore::User.new # User | Created user object
|
||||
}
|
||||
body = Petstore::User.new # User | Created user object
|
||||
|
||||
|
||||
begin
|
||||
#Create user
|
||||
api_instance.create_user(opts)
|
||||
api_instance.create_user(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UserApi->create_user: #{e}"
|
||||
end
|
||||
@@ -44,7 +43,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object | [optional]
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -57,12 +56,12 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **create_users_with_array_input**
|
||||
> create_users_with_array_input(opts)
|
||||
> create_users_with_array_input(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
@@ -75,13 +74,12 @@ require 'petstore'
|
||||
|
||||
api_instance = Petstore::UserApi.new
|
||||
|
||||
opts = {
|
||||
body: [Petstore::User.new] # Array<User> | List of user object
|
||||
}
|
||||
body = [Petstore::User.new] # Array<User> | List of user object
|
||||
|
||||
|
||||
begin
|
||||
#Creates list of users with given input array
|
||||
api_instance.create_users_with_array_input(opts)
|
||||
api_instance.create_users_with_array_input(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UserApi->create_users_with_array_input: #{e}"
|
||||
end
|
||||
@@ -91,7 +89,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Array<User>**](User.md)| List of user object | [optional]
|
||||
**body** | [**Array<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -104,12 +102,12 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **create_users_with_list_input**
|
||||
> create_users_with_list_input(opts)
|
||||
> create_users_with_list_input(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
@@ -122,13 +120,12 @@ require 'petstore'
|
||||
|
||||
api_instance = Petstore::UserApi.new
|
||||
|
||||
opts = {
|
||||
body: [Petstore::User.new] # Array<User> | List of user object
|
||||
}
|
||||
body = [Petstore::User.new] # Array<User> | List of user object
|
||||
|
||||
|
||||
begin
|
||||
#Creates list of users with given input array
|
||||
api_instance.create_users_with_list_input(opts)
|
||||
api_instance.create_users_with_list_input(body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UserApi->create_users_with_list_input: #{e}"
|
||||
end
|
||||
@@ -138,7 +135,7 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Array<User>**](User.md)| List of user object | [optional]
|
||||
**body** | [**Array<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -151,7 +148,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -166,12 +163,6 @@ This can only be done by the logged in user.
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
# setup authorization
|
||||
Petstore.configure do |config|
|
||||
# Configure HTTP basic authorization: test_http_basic
|
||||
config.username = 'YOUR USERNAME'
|
||||
config.password = 'YOUR PASSWORD'
|
||||
end
|
||||
|
||||
api_instance = Petstore::UserApi.new
|
||||
|
||||
@@ -198,12 +189,12 @@ nil (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -250,12 +241,12 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **login_user**
|
||||
> String login_user(opts)
|
||||
> String login_user(username, password)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
@@ -268,14 +259,14 @@ require 'petstore'
|
||||
|
||||
api_instance = Petstore::UserApi.new
|
||||
|
||||
opts = {
|
||||
username: "username_example", # String | The user name for login
|
||||
password: "password_example" # String | The password for login in clear text
|
||||
}
|
||||
username = "username_example" # String | The user name for login
|
||||
|
||||
password = "password_example" # String | The password for login in clear text
|
||||
|
||||
|
||||
begin
|
||||
#Logs user into the system
|
||||
result = api_instance.login_user(opts)
|
||||
result = api_instance.login_user(username, password)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UserApi->login_user: #{e}"
|
||||
@@ -286,8 +277,8 @@ end
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The user name for login | [optional]
|
||||
**password** | **String**| The password for login in clear text | [optional]
|
||||
**username** | **String**| The user name for login |
|
||||
**password** | **String**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -300,7 +291,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
@@ -340,12 +331,12 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
# **update_user**
|
||||
> update_user(username, opts)
|
||||
> update_user(username, body)
|
||||
|
||||
Updated user
|
||||
|
||||
@@ -360,13 +351,12 @@ api_instance = Petstore::UserApi.new
|
||||
|
||||
username = "username_example" # String | name that need to be deleted
|
||||
|
||||
opts = {
|
||||
body: Petstore::User.new # User | Updated user object
|
||||
}
|
||||
body = Petstore::User.new # User | Updated user object
|
||||
|
||||
|
||||
begin
|
||||
#Updated user
|
||||
api_instance.update_user(username, opts)
|
||||
api_instance.update_user(username, body)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UserApi->update_user: #{e}"
|
||||
end
|
||||
@@ -377,7 +367,7 @@ end
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object | [optional]
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -390,7 +380,7 @@ No authorization required
|
||||
### HTTP reuqest headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -22,11 +22,11 @@ require 'petstore/configuration'
|
||||
|
||||
# Models
|
||||
require 'petstore/models/animal'
|
||||
require 'petstore/models/api_response'
|
||||
require 'petstore/models/cat'
|
||||
require 'petstore/models/category'
|
||||
require 'petstore/models/dog'
|
||||
require 'petstore/models/format_test'
|
||||
require 'petstore/models/inline_response_200'
|
||||
require 'petstore/models/model_200_response'
|
||||
require 'petstore/models/model_return'
|
||||
require 'petstore/models/name'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -26,24 +26,27 @@ module Petstore
|
||||
|
||||
# Add a new pet to the store
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [nil]
|
||||
def add_pet(opts = {})
|
||||
add_pet_with_http_info(opts)
|
||||
def add_pet(body, opts = {})
|
||||
add_pet_with_http_info(body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Add a new pet to the store
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def add_pet_with_http_info(opts = {})
|
||||
def add_pet_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#add_pet ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling add_pet" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet".sub('{format}','json')
|
||||
|
||||
@@ -54,7 +57,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -65,7 +68,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = ['petstore_auth']
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
@@ -79,61 +82,6 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :body Pet object in the form of byte array
|
||||
# @return [nil]
|
||||
def add_pet_using_byte_array(opts = {})
|
||||
add_pet_using_byte_array_with_http_info(opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :body Pet object in the form of byte array
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def add_pet_using_byte_array_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#add_pet_using_byte_array ..."
|
||||
end
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet?testing_byte_array=true".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = ['application/json', 'application/xml']
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
auth_names = ['petstore_auth']
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: PetApi#add_pet_using_byte_array\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Deletes a pet
|
||||
#
|
||||
# @param pet_id Pet id to delete
|
||||
@@ -169,7 +117,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -197,36 +145,39 @@ module Petstore
|
||||
|
||||
# Finds Pets by status
|
||||
# Multiple status values can be provided with comma separated strings
|
||||
# @param status Status values that need to be considered for filter
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query (default to available)
|
||||
# @return [Array<Pet>]
|
||||
def find_pets_by_status(opts = {})
|
||||
data, _status_code, _headers = find_pets_by_status_with_http_info(opts)
|
||||
def find_pets_by_status(status, opts = {})
|
||||
data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Finds Pets by status
|
||||
# Multiple status values can be provided with comma separated strings
|
||||
# @param status Status values that need to be considered for filter
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query
|
||||
# @return [Array<(Array<Pet>, Fixnum, Hash)>] Array<Pet> data, response status code and response headers
|
||||
def find_pets_by_status_with_http_info(opts = {})
|
||||
def find_pets_by_status_with_http_info(status, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#find_pets_by_status ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'status' is set
|
||||
fail "Missing the required parameter 'status' when calling find_pets_by_status" if status.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet/findByStatus".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :multi) if opts[:'status']
|
||||
query_params[:'status'] = @api_client.build_collection_param(status, :csv)
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -253,37 +204,40 @@ module Petstore
|
||||
end
|
||||
|
||||
# Finds Pets by tags
|
||||
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
# Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
# @param tags Tags to filter by
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :tags Tags to filter by
|
||||
# @return [Array<Pet>]
|
||||
def find_pets_by_tags(opts = {})
|
||||
data, _status_code, _headers = find_pets_by_tags_with_http_info(opts)
|
||||
def find_pets_by_tags(tags, opts = {})
|
||||
data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Finds Pets by tags
|
||||
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
# Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
# @param tags Tags to filter by
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :tags Tags to filter by
|
||||
# @return [Array<(Array<Pet>, Fixnum, Hash)>] Array<Pet> data, response status code and response headers
|
||||
def find_pets_by_tags_with_http_info(opts = {})
|
||||
def find_pets_by_tags_with_http_info(tags, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#find_pets_by_tags ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'tags' is set
|
||||
fail "Missing the required parameter 'tags' when calling find_pets_by_tags" if tags.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet/findByTags".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if opts[:'tags']
|
||||
query_params[:'tags'] = @api_client.build_collection_param(tags, :csv)
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -310,8 +264,8 @@ module Petstore
|
||||
end
|
||||
|
||||
# Find pet by ID
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# Returns a single pet
|
||||
# @param pet_id ID of pet to return
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Pet]
|
||||
def get_pet_by_id(pet_id, opts = {})
|
||||
@@ -320,8 +274,8 @@ module Petstore
|
||||
end
|
||||
|
||||
# Find pet by ID
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# Returns a single pet
|
||||
# @param pet_id ID of pet to return
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(Pet, Fixnum, Hash)>] Pet data, response status code and response headers
|
||||
def get_pet_by_id_with_http_info(pet_id, opts = {})
|
||||
@@ -342,7 +296,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -354,7 +308,7 @@ module Petstore
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
auth_names = ['api_key']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
@@ -368,144 +322,29 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [InlineResponse200]
|
||||
def get_pet_by_id_in_object(pet_id, opts = {})
|
||||
data, _status_code, _headers = get_pet_by_id_in_object_with_http_info(pet_id, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
||||
def get_pet_by_id_in_object_with_http_info(pet_id, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#get_pet_by_id_in_object ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'pet_id' is set
|
||||
fail "Missing the required parameter 'pet_id' when calling get_pet_by_id_in_object" if pet_id.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet/{petId}?response=inline_arbitrary_object".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = []
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names,
|
||||
:return_type => 'InlineResponse200')
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: PetApi#get_pet_by_id_in_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
def pet_pet_idtesting_byte_arraytrue_get(pet_id, opts = {})
|
||||
data, _status_code, _headers = pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
||||
def pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#pet_pet_idtesting_byte_arraytrue_get ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'pet_id' is set
|
||||
fail "Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get" if pet_id.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet/{petId}?testing_byte_array=true".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = []
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names,
|
||||
:return_type => 'String')
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: PetApi#pet_pet_idtesting_byte_arraytrue_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Update an existing pet
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [nil]
|
||||
def update_pet(opts = {})
|
||||
update_pet_with_http_info(opts)
|
||||
def update_pet(body, opts = {})
|
||||
update_pet_with_http_info(body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Update an existing pet
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def update_pet_with_http_info(opts = {})
|
||||
def update_pet_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#update_pet ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling update_pet" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/pet".sub('{format}','json')
|
||||
|
||||
@@ -516,7 +355,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -527,7 +366,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = ['petstore_auth']
|
||||
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
||||
:header_params => header_params,
|
||||
@@ -578,7 +417,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -611,10 +450,10 @@ module Petstore
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :additional_metadata Additional data to pass to server
|
||||
# @option opts [File] :file file to upload
|
||||
# @return [nil]
|
||||
# @return [ApiResponse]
|
||||
def upload_file(pet_id, opts = {})
|
||||
upload_file_with_http_info(pet_id, opts)
|
||||
return nil
|
||||
data, _status_code, _headers = upload_file_with_http_info(pet_id, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# uploads an image
|
||||
@@ -623,7 +462,7 @@ module Petstore
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :additional_metadata Additional data to pass to server
|
||||
# @option opts [File] :file file to upload
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
# @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers
|
||||
def upload_file_with_http_info(pet_id, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: PetApi#upload_file ..."
|
||||
@@ -642,7 +481,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -662,7 +501,8 @@ module Petstore
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names)
|
||||
:auth_names => auth_names,
|
||||
:return_type => 'ApiResponse')
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -57,7 +57,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -82,67 +82,6 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Finds orders by status
|
||||
# A single status value can be provided as a string
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :status Status value that needs to be considered for query (default to placed)
|
||||
# @return [Array<Order>]
|
||||
def find_orders_by_status(opts = {})
|
||||
data, _status_code, _headers = find_orders_by_status_with_http_info(opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Finds orders by status
|
||||
# A single status value can be provided as a string
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :status Status value that needs to be considered for query
|
||||
# @return [Array<(Array<Order>, Fixnum, Hash)>] Array<Order> data, response status code and response headers
|
||||
def find_orders_by_status_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: StoreApi#find_orders_by_status ..."
|
||||
end
|
||||
|
||||
if opts[:'status'] && !['placed', 'approved', 'delivered'].include?(opts[:'status'])
|
||||
fail 'invalid value for "status", must be one of placed, approved, delivered'
|
||||
end
|
||||
|
||||
# resource path
|
||||
local_var_path = "/store/findByStatus".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
query_params[:'status'] = opts[:'status'] if opts[:'status']
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = []
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names,
|
||||
:return_type => 'Array<Order>')
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: StoreApi#find_orders_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Returns pet inventories by status
|
||||
# Returns a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
@@ -171,7 +110,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -197,60 +136,6 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
# Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Object]
|
||||
def get_inventory_in_object(opts = {})
|
||||
data, _status_code, _headers = get_inventory_in_object_with_http_info(opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
# Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
||||
def get_inventory_in_object_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: StoreApi#get_inventory_in_object ..."
|
||||
end
|
||||
|
||||
# resource path
|
||||
local_var_path = "/store/inventory?response=arbitrary_object".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
local_header_content_type = []
|
||||
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
||||
|
||||
# form parameters
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['api_key']
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
:form_params => form_params,
|
||||
:body => post_body,
|
||||
:auth_names => auth_names,
|
||||
:return_type => 'Object')
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: StoreApi#get_inventory_in_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Find purchase order by ID
|
||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
# @param order_id ID of pet that needs to be fetched
|
||||
@@ -284,7 +169,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -296,7 +181,7 @@ module Petstore
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['test_api_key_header', 'test_api_key_query']
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
@@ -312,24 +197,27 @@ module Petstore
|
||||
|
||||
# Place an order for a pet
|
||||
#
|
||||
# @param body order placed for purchasing the pet
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Order] :body order placed for purchasing the pet
|
||||
# @return [Order]
|
||||
def place_order(opts = {})
|
||||
data, _status_code, _headers = place_order_with_http_info(opts)
|
||||
def place_order(body, opts = {})
|
||||
data, _status_code, _headers = place_order_with_http_info(body, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Place an order for a pet
|
||||
#
|
||||
# @param body order placed for purchasing the pet
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Order] :body order placed for purchasing the pet
|
||||
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
||||
def place_order_with_http_info(opts = {})
|
||||
def place_order_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: StoreApi#place_order ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling place_order" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/store/order".sub('{format}','json')
|
||||
|
||||
@@ -340,7 +228,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -351,8 +239,8 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -26,24 +26,27 @@ module Petstore
|
||||
|
||||
# Create user
|
||||
# This can only be done by the logged in user.
|
||||
# @param body Created user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Created user object
|
||||
# @return [nil]
|
||||
def create_user(opts = {})
|
||||
create_user_with_http_info(opts)
|
||||
def create_user(body, opts = {})
|
||||
create_user_with_http_info(body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Create user
|
||||
# This can only be done by the logged in user.
|
||||
# @param body Created user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Created user object
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def create_user_with_http_info(opts = {})
|
||||
def create_user_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: UserApi#create_user ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling create_user" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/user".sub('{format}','json')
|
||||
|
||||
@@ -54,7 +57,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -65,7 +68,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
@@ -81,24 +84,27 @@ module Petstore
|
||||
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [nil]
|
||||
def create_users_with_array_input(opts = {})
|
||||
create_users_with_array_input_with_http_info(opts)
|
||||
def create_users_with_array_input(body, opts = {})
|
||||
create_users_with_array_input_with_http_info(body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def create_users_with_array_input_with_http_info(opts = {})
|
||||
def create_users_with_array_input_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: UserApi#create_users_with_array_input ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling create_users_with_array_input" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/user/createWithArray".sub('{format}','json')
|
||||
|
||||
@@ -109,7 +115,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -120,7 +126,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
@@ -136,24 +142,27 @@ module Petstore
|
||||
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [nil]
|
||||
def create_users_with_list_input(opts = {})
|
||||
create_users_with_list_input_with_http_info(opts)
|
||||
def create_users_with_list_input(body, opts = {})
|
||||
create_users_with_list_input_with_http_info(body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def create_users_with_list_input_with_http_info(opts = {})
|
||||
def create_users_with_list_input_with_http_info(body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: UserApi#create_users_with_list_input ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling create_users_with_list_input" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/user/createWithList".sub('{format}','json')
|
||||
|
||||
@@ -164,7 +173,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -175,7 +184,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||
:header_params => header_params,
|
||||
@@ -222,7 +231,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -234,7 +243,7 @@ module Petstore
|
||||
|
||||
# http body (model)
|
||||
post_body = nil
|
||||
auth_names = ['test_http_basic']
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
||||
:header_params => header_params,
|
||||
:query_params => query_params,
|
||||
@@ -280,7 +289,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -308,39 +317,45 @@ module Petstore
|
||||
|
||||
# Logs user into the system
|
||||
#
|
||||
# @param username The user name for login
|
||||
# @param password The password for login in clear text
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :username The user name for login
|
||||
# @option opts [String] :password The password for login in clear text
|
||||
# @return [String]
|
||||
def login_user(opts = {})
|
||||
data, _status_code, _headers = login_user_with_http_info(opts)
|
||||
def login_user(username, password, opts = {})
|
||||
data, _status_code, _headers = login_user_with_http_info(username, password, opts)
|
||||
return data
|
||||
end
|
||||
|
||||
# Logs user into the system
|
||||
#
|
||||
# @param username The user name for login
|
||||
# @param password The password for login in clear text
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :username The user name for login
|
||||
# @option opts [String] :password The password for login in clear text
|
||||
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
||||
def login_user_with_http_info(opts = {})
|
||||
def login_user_with_http_info(username, password, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: UserApi#login_user ..."
|
||||
end
|
||||
|
||||
# verify the required parameter 'username' is set
|
||||
fail "Missing the required parameter 'username' when calling login_user" if username.nil?
|
||||
|
||||
# verify the required parameter 'password' is set
|
||||
fail "Missing the required parameter 'password' when calling login_user" if password.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/user/login".sub('{format}','json')
|
||||
|
||||
# query parameters
|
||||
query_params = {}
|
||||
query_params[:'username'] = opts[:'username'] if opts[:'username']
|
||||
query_params[:'password'] = opts[:'password'] if opts[:'password']
|
||||
query_params[:'username'] = username
|
||||
query_params[:'password'] = password
|
||||
|
||||
# header parameters
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -394,7 +409,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -422,21 +437,21 @@ module Petstore
|
||||
# Updated user
|
||||
# This can only be done by the logged in user.
|
||||
# @param username name that need to be deleted
|
||||
# @param body Updated user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Updated user object
|
||||
# @return [nil]
|
||||
def update_user(username, opts = {})
|
||||
update_user_with_http_info(username, opts)
|
||||
def update_user(username, body, opts = {})
|
||||
update_user_with_http_info(username, body, opts)
|
||||
return nil
|
||||
end
|
||||
|
||||
# Updated user
|
||||
# This can only be done by the logged in user.
|
||||
# @param username name that need to be deleted
|
||||
# @param body Updated user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Updated user object
|
||||
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
||||
def update_user_with_http_info(username, opts = {})
|
||||
def update_user_with_http_info(username, body, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "Calling API: UserApi#update_user ..."
|
||||
end
|
||||
@@ -444,6 +459,9 @@ module Petstore
|
||||
# verify the required parameter 'username' is set
|
||||
fail "Missing the required parameter 'username' when calling update_user" if username.nil?
|
||||
|
||||
# verify the required parameter 'body' is set
|
||||
fail "Missing the required parameter 'body' when calling update_user" if body.nil?
|
||||
|
||||
# resource path
|
||||
local_var_path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username.to_s)
|
||||
|
||||
@@ -454,7 +472,7 @@ module Petstore
|
||||
header_params = {}
|
||||
|
||||
# HTTP header 'Accept' (if needed)
|
||||
local_header_accept = ['application/json', 'application/xml']
|
||||
local_header_accept = ['application/xml', 'application/json']
|
||||
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
@@ -465,7 +483,7 @@ module Petstore
|
||||
form_params = {}
|
||||
|
||||
# http body (model)
|
||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||
post_body = @api_client.object_to_http_body(body)
|
||||
auth_names = []
|
||||
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
||||
:header_params => header_params,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -157,13 +157,6 @@ module Petstore
|
||||
# Returns Auth Settings hash for api client.
|
||||
def auth_settings
|
||||
{
|
||||
'test_api_key_header' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'test_api_key_header',
|
||||
value: api_key_with_prefix('test_api_key_header')
|
||||
},
|
||||
'api_key' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
@@ -171,34 +164,6 @@ module Petstore
|
||||
key: 'api_key',
|
||||
value: api_key_with_prefix('api_key')
|
||||
},
|
||||
'test_http_basic' =>
|
||||
{
|
||||
type: 'basic',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: basic_auth_token
|
||||
},
|
||||
'test_api_client_secret' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'x-test_api_client_secret',
|
||||
value: api_key_with_prefix('x-test_api_client_secret')
|
||||
},
|
||||
'test_api_client_id' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'header',
|
||||
key: 'x-test_api_client_id',
|
||||
value: api_key_with_prefix('x-test_api_client_id')
|
||||
},
|
||||
'test_api_key_query' =>
|
||||
{
|
||||
type: 'api_key',
|
||||
in: 'query',
|
||||
key: 'test_api_key_query',
|
||||
value: api_key_with_prefix('test_api_key_query')
|
||||
},
|
||||
'petstore_auth' =>
|
||||
{
|
||||
type: 'oauth2',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
191
samples/client/petstore/ruby/lib/petstore/models/api_response.rb
Normal file
191
samples/client/petstore/ruby/lib/petstore/models/api_response.rb
Normal file
@@ -0,0 +1,191 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
|
||||
License: Apache 2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Terms of Service: http://swagger.io/terms/
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
|
||||
module Petstore
|
||||
class ApiResponse
|
||||
attr_accessor :code
|
||||
|
||||
attr_accessor :type
|
||||
|
||||
attr_accessor :message
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'code' => :'code',
|
||||
:'type' => :'type',
|
||||
:'message' => :'message'
|
||||
}
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'code' => :'Integer',
|
||||
:'type' => :'String',
|
||||
:'message' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
return unless attributes.is_a?(Hash)
|
||||
|
||||
# convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes[:'code']
|
||||
self.code = attributes[:'code']
|
||||
end
|
||||
if attributes[:'type']
|
||||
self.type = attributes[:'type']
|
||||
end
|
||||
if attributes[:'message']
|
||||
self.message = attributes[:'message']
|
||||
end
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
code == o.code &&
|
||||
type == o.type &&
|
||||
message == o.message
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[code, type, message].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
self.class.swagger_types.each_pair do |key, type|
|
||||
if type =~ /^Array<(.*)>/i
|
||||
# check to ensure the input is an array given that the the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||
end
|
||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||
end
|
||||
|
||||
self
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def _deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :DateTime
|
||||
DateTime.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :BOOLEAN
|
||||
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
temp_model = Petstore.const_get(type).new
|
||||
temp_model.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
next if value.nil?
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map{ |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -40,6 +40,8 @@ module Petstore
|
||||
|
||||
attr_accessor :date_time
|
||||
|
||||
attr_accessor :password
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
@@ -53,7 +55,8 @@ module Petstore
|
||||
:'byte' => :'byte',
|
||||
:'binary' => :'binary',
|
||||
:'date' => :'date',
|
||||
:'date_time' => :'dateTime'
|
||||
:'date_time' => :'dateTime',
|
||||
:'password' => :'password'
|
||||
}
|
||||
end
|
||||
|
||||
@@ -70,7 +73,8 @@ module Petstore
|
||||
:'byte' => :'String',
|
||||
:'binary' => :'String',
|
||||
:'date' => :'Date',
|
||||
:'date_time' => :'String'
|
||||
:'date_time' => :'DateTime',
|
||||
:'password' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
@@ -115,6 +119,9 @@ module Petstore
|
||||
if attributes[:'dateTime']
|
||||
self.date_time = attributes[:'dateTime']
|
||||
end
|
||||
if attributes[:'password']
|
||||
self.password = attributes[:'password']
|
||||
end
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
@@ -132,7 +139,8 @@ module Petstore
|
||||
byte == o.byte &&
|
||||
binary == o.binary &&
|
||||
date == o.date &&
|
||||
date_time == o.date_time
|
||||
date_time == o.date_time &&
|
||||
password == o.password
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@@ -144,7 +152,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time].hash
|
||||
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time, password].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -80,6 +80,8 @@ module Petstore
|
||||
end
|
||||
if attributes[:'complete']
|
||||
self.complete = attributes[:'complete']
|
||||
else
|
||||
self.complete = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -39,8 +39,8 @@ describe 'PetApi' do
|
||||
# unit tests for add_pet
|
||||
# Add a new pet to the store
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [nil]
|
||||
describe 'add_pet test' do
|
||||
it "should work" do
|
||||
@@ -52,22 +52,6 @@ describe 'PetApi' do
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for add_pet_using_byte_array
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :body Pet object in the form of byte array
|
||||
# @return [nil]
|
||||
describe 'add_pet_using_byte_array test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for delete_pet
|
||||
# Deletes a pet
|
||||
#
|
||||
@@ -88,8 +72,8 @@ describe 'PetApi' do
|
||||
# unit tests for find_pets_by_status
|
||||
# Finds Pets by status
|
||||
# Multiple status values can be provided with comma separated strings
|
||||
# @param status Status values that need to be considered for filter
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query
|
||||
# @return [Array<Pet>]
|
||||
describe 'find_pets_by_status test' do
|
||||
it "should work" do
|
||||
@@ -103,9 +87,9 @@ describe 'PetApi' do
|
||||
|
||||
# unit tests for find_pets_by_tags
|
||||
# Finds Pets by tags
|
||||
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
# Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
# @param tags Tags to filter by
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :tags Tags to filter by
|
||||
# @return [Array<Pet>]
|
||||
describe 'find_pets_by_tags test' do
|
||||
it "should work" do
|
||||
@@ -119,8 +103,8 @@ describe 'PetApi' do
|
||||
|
||||
# unit tests for get_pet_by_id
|
||||
# Find pet by ID
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# Returns a single pet
|
||||
# @param pet_id ID of pet to return
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Pet]
|
||||
describe 'get_pet_by_id test' do
|
||||
@@ -133,43 +117,11 @@ describe 'PetApi' do
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for get_pet_by_id_in_object
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [InlineResponse200]
|
||||
describe 'get_pet_by_id_in_object test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for pet_pet_idtesting_byte_arraytrue_get
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
describe 'pet_pet_idtesting_byte_arraytrue_get test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for update_pet
|
||||
# Update an existing pet
|
||||
#
|
||||
# @param body Pet object that needs to be added to the store
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
# @return [nil]
|
||||
describe 'update_pet test' do
|
||||
it "should work" do
|
||||
@@ -206,7 +158,7 @@ describe 'PetApi' do
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :additional_metadata Additional data to pass to server
|
||||
# @option opts [File] :file file to upload
|
||||
# @return [nil]
|
||||
# @return [ApiResponse]
|
||||
describe 'upload_file test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -52,22 +52,6 @@ describe 'StoreApi' do
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for find_orders_by_status
|
||||
# Finds orders by status
|
||||
# A single status value can be provided as a string
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :status Status value that needs to be considered for query
|
||||
# @return [Array<Order>]
|
||||
describe 'find_orders_by_status test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for get_inventory
|
||||
# Returns pet inventories by status
|
||||
# Returns a map of status codes to quantities
|
||||
@@ -83,21 +67,6 @@ describe 'StoreApi' do
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for get_inventory_in_object
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
# Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Object]
|
||||
describe 'get_inventory_in_object test' do
|
||||
it "should work" do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for get_order_by_id
|
||||
# Find purchase order by ID
|
||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
@@ -117,8 +86,8 @@ describe 'StoreApi' do
|
||||
# unit tests for place_order
|
||||
# Place an order for a pet
|
||||
#
|
||||
# @param body order placed for purchasing the pet
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Order] :body order placed for purchasing the pet
|
||||
# @return [Order]
|
||||
describe 'place_order test' do
|
||||
it "should work" do
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -39,8 +39,8 @@ describe 'UserApi' do
|
||||
# unit tests for create_user
|
||||
# Create user
|
||||
# This can only be done by the logged in user.
|
||||
# @param body Created user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Created user object
|
||||
# @return [nil]
|
||||
describe 'create_user test' do
|
||||
it "should work" do
|
||||
@@ -55,8 +55,8 @@ describe 'UserApi' do
|
||||
# unit tests for create_users_with_array_input
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [nil]
|
||||
describe 'create_users_with_array_input test' do
|
||||
it "should work" do
|
||||
@@ -71,8 +71,8 @@ describe 'UserApi' do
|
||||
# unit tests for create_users_with_list_input
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param body List of user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
# @return [nil]
|
||||
describe 'create_users_with_list_input test' do
|
||||
it "should work" do
|
||||
@@ -119,9 +119,9 @@ describe 'UserApi' do
|
||||
# unit tests for login_user
|
||||
# Logs user into the system
|
||||
#
|
||||
# @param username The user name for login
|
||||
# @param password The password for login in clear text
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :username The user name for login
|
||||
# @option opts [String] :password The password for login in clear text
|
||||
# @return [String]
|
||||
describe 'login_user test' do
|
||||
it "should work" do
|
||||
@@ -152,8 +152,8 @@ describe 'UserApi' do
|
||||
# Updated user
|
||||
# This can only be done by the logged in user.
|
||||
# @param username name that need to be deleted
|
||||
# @param body Updated user object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Updated user object
|
||||
# @return [nil]
|
||||
describe 'update_user test' do
|
||||
it "should work" do
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
|
||||
License: Apache 2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Terms of Service: http://swagger.io/terms/
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for Petstore::ApiResponse
|
||||
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
||||
# Please update as you see appropriate
|
||||
describe 'ApiResponse' do
|
||||
before do
|
||||
# run before each test
|
||||
@instance = Petstore::ApiResponse.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of ApiResponse' do
|
||||
it 'should create an instact of ApiResponse' do
|
||||
@instance.should be_a(Petstore::ApiResponse)
|
||||
end
|
||||
end
|
||||
describe 'test attribute "code"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "type"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "message"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
@@ -146,5 +146,15 @@ describe 'FormatTest' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "password"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ require 'date'
|
||||
# Unit tests for Petstore::InlineResponse200
|
||||
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
||||
# Please update as you see appropriate
|
||||
describe 'InlineResponse200' do
|
||||
describe 'InlineResponse200', pending: "Original spec does not have InlineResponse200 and we'll renable this after updating Petstore server" do
|
||||
before do
|
||||
# run before each test
|
||||
@instance = Petstore::InlineResponse200.new
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=begin
|
||||
Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user