forked from loafle/openapi-generator-original
update ruby sample
This commit is contained in:
parent
dd8b581827
commit
e3c73f5819
@ -6,9 +6,9 @@ This is a sample server Petstore server. You can find out more about Swagger at
|
|||||||
|
|
||||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
- API verion: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-03-29T21:03:44.069+08:00
|
- Build date: 2016-04-09T17:50:53.781+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@ -82,20 +82,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Class | Method | HTTP request | Description
|
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**](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* | [**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* | [**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_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* | [**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**](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* | [**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* | [**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**](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* | [**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::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* | [**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* | [**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**](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_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* | [**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::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
|
*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||||
|
@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
[**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
|
[**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
|
[**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_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
|
[**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**](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'
|
[**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'
|
[**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**](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
|
[**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
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
@ -7,7 +7,7 @@ Method | HTTP request | Description
|
|||||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**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
|
[**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**](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_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
|
[**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
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ require 'petstore'
|
|||||||
|
|
||||||
api_instance = Petstore::UserApi.new
|
api_instance = Petstore::UserApi.new
|
||||||
|
|
||||||
username = "username_example" # String | The name that needs to be fetched. Use user1 for testing.
|
username = "username_example" # String | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -237,7 +237,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -66,7 +66,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -101,7 +100,7 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# resource path
|
# resource path
|
||||||
local_var_path = "/pet?testing_byte_array=true".sub('{format}','json')
|
local_var_path = "/pet?testing_byte_array=true".sub('{format}','json')
|
||||||
|
|
||||||
# query parameters
|
# query parameters
|
||||||
query_params = {}
|
query_params = {}
|
||||||
@ -122,7 +121,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -184,8 +182,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['petstore_auth']
|
||||||
auth_names = ['petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -241,8 +238,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['petstore_auth']
|
||||||
auth_names = ['petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -299,8 +295,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['petstore_auth']
|
||||||
auth_names = ['petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -359,8 +354,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['api_key', 'petstore_auth']
|
||||||
auth_names = ['api_key', 'petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -398,7 +392,7 @@ module Petstore
|
|||||||
fail "Missing the required parameter 'pet_id' when calling get_pet_by_id_in_object" if pet_id.nil?
|
fail "Missing the required parameter 'pet_id' when calling get_pet_by_id_in_object" if pet_id.nil?
|
||||||
|
|
||||||
# resource path
|
# resource path
|
||||||
local_var_path = "/pet/{petId}?response=inline_arbitrary_object".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
local_var_path = "/pet/{petId}?response=inline_arbitrary_object".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
||||||
|
|
||||||
# query parameters
|
# query parameters
|
||||||
query_params = {}
|
query_params = {}
|
||||||
@ -419,8 +413,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['api_key', 'petstore_auth']
|
||||||
auth_names = ['api_key', 'petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -458,7 +451,7 @@ module Petstore
|
|||||||
fail "Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get" if pet_id.nil?
|
fail "Missing the required parameter 'pet_id' when calling pet_pet_idtesting_byte_arraytrue_get" if pet_id.nil?
|
||||||
|
|
||||||
# resource path
|
# resource path
|
||||||
local_var_path = "/pet/{petId}?testing_byte_array=true".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
local_var_path = "/pet/{petId}?testing_byte_array=true".sub('{format}','json').sub('{' + 'petId' + '}', pet_id.to_s)
|
||||||
|
|
||||||
# query parameters
|
# query parameters
|
||||||
query_params = {}
|
query_params = {}
|
||||||
@ -479,8 +472,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['api_key', 'petstore_auth']
|
||||||
auth_names = ['api_key', 'petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -536,7 +528,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = ['petstore_auth']
|
auth_names = ['petstore_auth']
|
||||||
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -601,8 +592,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['petstore_auth']
|
||||||
auth_names = ['petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -666,8 +656,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['petstore_auth']
|
||||||
auth_names = ['petstore_auth']
|
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
|
@ -69,8 +69,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = []
|
||||||
auth_names = []
|
|
||||||
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -130,8 +129,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
||||||
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -185,8 +183,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['api_key']
|
||||||
auth_names = ['api_key']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -219,7 +216,7 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# resource path
|
# resource path
|
||||||
local_var_path = "/store/inventory?response=arbitrary_object".sub('{format}','json')
|
local_var_path = "/store/inventory?response=arbitrary_object".sub('{format}','json')
|
||||||
|
|
||||||
# query parameters
|
# query parameters
|
||||||
query_params = {}
|
query_params = {}
|
||||||
@ -240,8 +237,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['api_key']
|
||||||
auth_names = ['api_key']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -266,7 +262,7 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Find purchase order by ID
|
# Find purchase order by ID
|
||||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
# 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
|
# @param order_id ID of pet that needs to be fetched
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
||||||
@ -300,8 +296,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['test_api_key_header', 'test_api_key_query']
|
||||||
auth_names = ['test_api_key_header', 'test_api_key_query']
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -357,7 +352,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
auth_names = ['test_api_client_id', 'test_api_client_secret']
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
|
@ -66,7 +66,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -122,7 +121,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -178,7 +176,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
@ -237,8 +234,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = ['test_http_basic']
|
||||||
auth_names = ['test_http_basic']
|
|
||||||
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -253,7 +249,7 @@ module Petstore
|
|||||||
|
|
||||||
# Get user by user name
|
# Get user by user name
|
||||||
#
|
#
|
||||||
# @param username The name that needs to be fetched. Use user1 for testing.
|
# @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [User]
|
# @return [User]
|
||||||
def get_user_by_name(username, opts = {})
|
def get_user_by_name(username, opts = {})
|
||||||
@ -263,7 +259,7 @@ module Petstore
|
|||||||
|
|
||||||
# Get user by user name
|
# Get user by user name
|
||||||
#
|
#
|
||||||
# @param username The name that needs to be fetched. Use user1 for testing.
|
# @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
||||||
def get_user_by_name_with_http_info(username, opts = {})
|
def get_user_by_name_with_http_info(username, opts = {})
|
||||||
@ -296,8 +292,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = []
|
||||||
auth_names = []
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -357,8 +352,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = []
|
||||||
auth_names = []
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -412,8 +406,7 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
auth_names = []
|
||||||
auth_names = []
|
|
||||||
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -473,7 +466,6 @@ module Petstore
|
|||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
post_body = @api_client.object_to_http_body(opts[:'body'])
|
||||||
|
|
||||||
auth_names = []
|
auth_names = []
|
||||||
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
|
@ -90,9 +90,7 @@ module Petstore
|
|||||||
query_params = opts[:query_params] || {}
|
query_params = opts[:query_params] || {}
|
||||||
form_params = opts[:form_params] || {}
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
|
|
||||||
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
||||||
|
|
||||||
|
|
||||||
req_opts = {
|
req_opts = {
|
||||||
:method => http_method,
|
:method => http_method,
|
||||||
|
@ -23,9 +23,7 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'class_name' => :'className'
|
:'class_name' => :'className'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,24 +31,24 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'class_name' => :'String'
|
:'class_name' => :'String'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
def initialize(attributes = {})
|
def initialize(attributes = {})
|
||||||
return unless attributes.is_a?(Hash)
|
return unless attributes.is_a?(Hash)
|
||||||
|
|
||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'className']
|
if attributes[:'className']
|
||||||
self.class_name = attributes[:'className']
|
self.class_name = attributes[:'className']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def ==(o)
|
def ==(o)
|
||||||
return true if self.equal?(o)
|
return true if self.equal?(o)
|
||||||
self.class == o.class &&
|
self.class == o.class &&
|
||||||
@ -58,35 +56,41 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @see the `==` method
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def eql?(o)
|
def eql?(o)
|
||||||
self == o
|
self == o
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculate hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[class_name].hash
|
[class_name].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# build the object from hash
|
# 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)
|
def build_from_hash(attributes)
|
||||||
return nil unless attributes.is_a?(Hash)
|
return nil unless attributes.is_a?(Hash)
|
||||||
self.class.swagger_types.each_pair do |key, type|
|
self.class.swagger_types.each_pair do |key, type|
|
||||||
if type =~ /^Array<(.*)>/i
|
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)
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||||
else
|
|
||||||
#TODO show warning in debug mode
|
|
||||||
end
|
end
|
||||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
else
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||||
# data not found in attributes(hash), not an issue as the data can be optional
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
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)
|
def _deserialize(type, value)
|
||||||
case type.to_sym
|
case type.to_sym
|
||||||
when :DateTime
|
when :DateTime
|
||||||
@ -120,21 +124,25 @@ module Petstore
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else # model
|
else # model
|
||||||
_model = Petstore.const_get(type).new
|
temp_model = Petstore.const_get(type).new
|
||||||
_model.build_from_hash(value)
|
temp_model.build_from_hash(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the string representation of the object
|
||||||
|
# @return [String] String presentation of the object
|
||||||
def to_s
|
def to_s
|
||||||
to_hash.to_s
|
to_hash.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# to_body is an alias to to_body (backward compatibility))
|
# to_body is an alias to to_hash (backward compatibility)
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_body
|
def to_body
|
||||||
to_hash
|
to_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# return the object in the form of hash
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {}
|
hash = {}
|
||||||
self.class.attribute_map.each_pair do |attr, param|
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
@ -145,8 +153,10 @@ module Petstore
|
|||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Method to output non-array value in the form of hash
|
# Outputs non-array value in the form of hash
|
||||||
# For object, use to_hash. Otherwise, just return the value
|
# 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)
|
def _to_hash(value)
|
||||||
if value.is_a?(Array)
|
if value.is_a?(Array)
|
||||||
value.compact.map{ |v| _to_hash(v) }
|
value.compact.map{ |v| _to_hash(v) }
|
||||||
|
@ -25,11 +25,8 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'class_name' => :'className',
|
:'class_name' => :'className',
|
||||||
|
|
||||||
:'declawed' => :'declawed'
|
:'declawed' => :'declawed'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,29 +34,28 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'class_name' => :'String',
|
:'class_name' => :'String',
|
||||||
:'declawed' => :'BOOLEAN'
|
:'declawed' => :'BOOLEAN'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
def initialize(attributes = {})
|
def initialize(attributes = {})
|
||||||
return unless attributes.is_a?(Hash)
|
return unless attributes.is_a?(Hash)
|
||||||
|
|
||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'className']
|
if attributes[:'className']
|
||||||
self.class_name = attributes[:'className']
|
self.class_name = attributes[:'className']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'declawed']
|
if attributes[:'declawed']
|
||||||
self.declawed = attributes[:'declawed']
|
self.declawed = attributes[:'declawed']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def ==(o)
|
def ==(o)
|
||||||
return true if self.equal?(o)
|
return true if self.equal?(o)
|
||||||
self.class == o.class &&
|
self.class == o.class &&
|
||||||
@ -68,35 +64,41 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @see the `==` method
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def eql?(o)
|
def eql?(o)
|
||||||
self == o
|
self == o
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculate hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[class_name, declawed].hash
|
[class_name, declawed].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# build the object from hash
|
# 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)
|
def build_from_hash(attributes)
|
||||||
return nil unless attributes.is_a?(Hash)
|
return nil unless attributes.is_a?(Hash)
|
||||||
self.class.swagger_types.each_pair do |key, type|
|
self.class.swagger_types.each_pair do |key, type|
|
||||||
if type =~ /^Array<(.*)>/i
|
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)
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||||
else
|
|
||||||
#TODO show warning in debug mode
|
|
||||||
end
|
end
|
||||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
else
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||||
# data not found in attributes(hash), not an issue as the data can be optional
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
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)
|
def _deserialize(type, value)
|
||||||
case type.to_sym
|
case type.to_sym
|
||||||
when :DateTime
|
when :DateTime
|
||||||
@ -130,21 +132,25 @@ module Petstore
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else # model
|
else # model
|
||||||
_model = Petstore.const_get(type).new
|
temp_model = Petstore.const_get(type).new
|
||||||
_model.build_from_hash(value)
|
temp_model.build_from_hash(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the string representation of the object
|
||||||
|
# @return [String] String presentation of the object
|
||||||
def to_s
|
def to_s
|
||||||
to_hash.to_s
|
to_hash.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# to_body is an alias to to_body (backward compatibility))
|
# to_body is an alias to to_hash (backward compatibility)
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_body
|
def to_body
|
||||||
to_hash
|
to_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# return the object in the form of hash
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {}
|
hash = {}
|
||||||
self.class.attribute_map.each_pair do |attr, param|
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
@ -155,8 +161,10 @@ module Petstore
|
|||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Method to output non-array value in the form of hash
|
# Outputs non-array value in the form of hash
|
||||||
# For object, use to_hash. Otherwise, just return the value
|
# 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)
|
def _to_hash(value)
|
||||||
if value.is_a?(Array)
|
if value.is_a?(Array)
|
||||||
value.compact.map{ |v| _to_hash(v) }
|
value.compact.map{ |v| _to_hash(v) }
|
||||||
|
@ -25,11 +25,8 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'name' => :'name'
|
:'name' => :'name'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,8 +34,7 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'name' => :'String'
|
:'name' => :'String'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -50,15 +46,12 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -25,11 +25,8 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'class_name' => :'className',
|
:'class_name' => :'className',
|
||||||
|
|
||||||
:'breed' => :'breed'
|
:'breed' => :'breed'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,29 +34,28 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'class_name' => :'String',
|
:'class_name' => :'String',
|
||||||
:'breed' => :'String'
|
:'breed' => :'String'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
def initialize(attributes = {})
|
def initialize(attributes = {})
|
||||||
return unless attributes.is_a?(Hash)
|
return unless attributes.is_a?(Hash)
|
||||||
|
|
||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'className']
|
if attributes[:'className']
|
||||||
self.class_name = attributes[:'className']
|
self.class_name = attributes[:'className']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'breed']
|
if attributes[:'breed']
|
||||||
self.breed = attributes[:'breed']
|
self.breed = attributes[:'breed']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def ==(o)
|
def ==(o)
|
||||||
return true if self.equal?(o)
|
return true if self.equal?(o)
|
||||||
self.class == o.class &&
|
self.class == o.class &&
|
||||||
@ -68,35 +64,41 @@ module Petstore
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @see the `==` method
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
def eql?(o)
|
def eql?(o)
|
||||||
self == o
|
self == o
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculate hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[class_name, breed].hash
|
[class_name, breed].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# build the object from hash
|
# 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)
|
def build_from_hash(attributes)
|
||||||
return nil unless attributes.is_a?(Hash)
|
return nil unless attributes.is_a?(Hash)
|
||||||
self.class.swagger_types.each_pair do |key, type|
|
self.class.swagger_types.each_pair do |key, type|
|
||||||
if type =~ /^Array<(.*)>/i
|
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)
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||||
else
|
|
||||||
#TODO show warning in debug mode
|
|
||||||
end
|
end
|
||||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
else
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||||
# data not found in attributes(hash), not an issue as the data can be optional
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
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)
|
def _deserialize(type, value)
|
||||||
case type.to_sym
|
case type.to_sym
|
||||||
when :DateTime
|
when :DateTime
|
||||||
@ -130,21 +132,25 @@ module Petstore
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else # model
|
else # model
|
||||||
_model = Petstore.const_get(type).new
|
temp_model = Petstore.const_get(type).new
|
||||||
_model.build_from_hash(value)
|
temp_model.build_from_hash(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the string representation of the object
|
||||||
|
# @return [String] String presentation of the object
|
||||||
def to_s
|
def to_s
|
||||||
to_hash.to_s
|
to_hash.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# to_body is an alias to to_body (backward compatibility))
|
# to_body is an alias to to_hash (backward compatibility)
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_body
|
def to_body
|
||||||
to_hash
|
to_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# return the object in the form of hash
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {}
|
hash = {}
|
||||||
self.class.attribute_map.each_pair do |attr, param|
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
@ -155,8 +161,10 @@ module Petstore
|
|||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Method to output non-array value in the form of hash
|
# Outputs non-array value in the form of hash
|
||||||
# For object, use to_hash. Otherwise, just return the value
|
# 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)
|
def _to_hash(value)
|
||||||
if value.is_a?(Array)
|
if value.is_a?(Array)
|
||||||
value.compact.map{ |v| _to_hash(v) }
|
value.compact.map{ |v| _to_hash(v) }
|
||||||
|
@ -34,19 +34,12 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'tags' => :'tags',
|
:'tags' => :'tags',
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'category' => :'category',
|
:'category' => :'category',
|
||||||
|
|
||||||
:'status' => :'status',
|
:'status' => :'status',
|
||||||
|
|
||||||
:'name' => :'name',
|
:'name' => :'name',
|
||||||
|
|
||||||
:'photo_urls' => :'photoUrls'
|
:'photo_urls' => :'photoUrls'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,12 +47,11 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'tags' => :'Array<Tag>',
|
:'tags' => :'Array<Tag>',
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'category' => :'Object',
|
:'category' => :'Object',
|
||||||
:'status' => :'String',
|
:'status' => :'String',
|
||||||
:'name' => :'String',
|
:'name' => :'String',
|
||||||
:'photo_urls' => :'Array<String>'
|
:'photo_urls' => :'Array<String>'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -71,35 +63,28 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'tags']
|
if attributes[:'tags']
|
||||||
if (value = attributes[:'tags']).is_a?(Array)
|
if (value = attributes[:'tags']).is_a?(Array)
|
||||||
self.tags = value
|
self.tags = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'category']
|
if attributes[:'category']
|
||||||
self.category = attributes[:'category']
|
self.category = attributes[:'category']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'status']
|
if attributes[:'status']
|
||||||
self.status = attributes[:'status']
|
self.status = attributes[:'status']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'photoUrls']
|
if attributes[:'photoUrls']
|
||||||
if (value = attributes[:'photoUrls']).is_a?(Array)
|
if (value = attributes[:'photoUrls']).is_a?(Array)
|
||||||
self.photo_urls = value
|
self.photo_urls = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
|
@ -17,15 +17,14 @@ Terms of Service: http://swagger.io/terms/
|
|||||||
require 'date'
|
require 'date'
|
||||||
|
|
||||||
module Petstore
|
module Petstore
|
||||||
|
# Model for testing model name starting with number
|
||||||
class Model200Response
|
class Model200Response
|
||||||
attr_accessor :name
|
attr_accessor :name
|
||||||
|
|
||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'name' => :'name'
|
:'name' => :'name'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'name' => :'Integer'
|
:'name' => :'Integer'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -45,11 +43,9 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -17,15 +17,14 @@ Terms of Service: http://swagger.io/terms/
|
|||||||
require 'date'
|
require 'date'
|
||||||
|
|
||||||
module Petstore
|
module Petstore
|
||||||
|
# Model for testing reserved words
|
||||||
class ModelReturn
|
class ModelReturn
|
||||||
attr_accessor :_return
|
attr_accessor :_return
|
||||||
|
|
||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'_return' => :'return'
|
:'_return' => :'return'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'_return' => :'Integer'
|
:'_return' => :'Integer'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -45,11 +43,9 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'return']
|
if attributes[:'return']
|
||||||
self._return = attributes[:'return']
|
self._return = attributes[:'return']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -17,6 +17,7 @@ Terms of Service: http://swagger.io/terms/
|
|||||||
require 'date'
|
require 'date'
|
||||||
|
|
||||||
module Petstore
|
module Petstore
|
||||||
|
# Model for testing model name same as property name
|
||||||
class Name
|
class Name
|
||||||
attr_accessor :name
|
attr_accessor :name
|
||||||
|
|
||||||
@ -25,11 +26,8 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'name' => :'name',
|
:'name' => :'name',
|
||||||
|
|
||||||
:'snake_case' => :'snake_case'
|
:'snake_case' => :'snake_case'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,8 +35,7 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'name' => :'Integer',
|
:'name' => :'Integer',
|
||||||
:'snake_case' => :'Integer'
|
:'snake_case' => :'Integer'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -50,15 +47,12 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'snake_case']
|
if attributes[:'snake_case']
|
||||||
self.snake_case = attributes[:'snake_case']
|
self.snake_case = attributes[:'snake_case']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -34,19 +34,12 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'pet_id' => :'petId',
|
:'pet_id' => :'petId',
|
||||||
|
|
||||||
:'quantity' => :'quantity',
|
:'quantity' => :'quantity',
|
||||||
|
|
||||||
:'ship_date' => :'shipDate',
|
:'ship_date' => :'shipDate',
|
||||||
|
|
||||||
:'status' => :'status',
|
:'status' => :'status',
|
||||||
|
|
||||||
:'complete' => :'complete'
|
:'complete' => :'complete'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,12 +47,11 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'pet_id' => :'Integer',
|
:'pet_id' => :'Integer',
|
||||||
:'quantity' => :'Integer',
|
:'quantity' => :'Integer',
|
||||||
:'ship_date' => :'DateTime',
|
:'ship_date' => :'DateTime',
|
||||||
:'status' => :'String',
|
:'status' => :'String',
|
||||||
:'complete' => :'BOOLEAN'
|
:'complete' => :'BOOLEAN'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -71,31 +63,24 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'petId']
|
if attributes[:'petId']
|
||||||
self.pet_id = attributes[:'petId']
|
self.pet_id = attributes[:'petId']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'quantity']
|
if attributes[:'quantity']
|
||||||
self.quantity = attributes[:'quantity']
|
self.quantity = attributes[:'quantity']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'shipDate']
|
if attributes[:'shipDate']
|
||||||
self.ship_date = attributes[:'shipDate']
|
self.ship_date = attributes[:'shipDate']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'status']
|
if attributes[:'status']
|
||||||
self.status = attributes[:'status']
|
self.status = attributes[:'status']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'complete']
|
if attributes[:'complete']
|
||||||
self.complete = attributes[:'complete']
|
self.complete = attributes[:'complete']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
|
@ -34,19 +34,12 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'category' => :'category',
|
:'category' => :'category',
|
||||||
|
|
||||||
:'name' => :'name',
|
:'name' => :'name',
|
||||||
|
|
||||||
:'photo_urls' => :'photoUrls',
|
:'photo_urls' => :'photoUrls',
|
||||||
|
|
||||||
:'tags' => :'tags',
|
:'tags' => :'tags',
|
||||||
|
|
||||||
:'status' => :'status'
|
:'status' => :'status'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,12 +47,11 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'category' => :'Category',
|
:'category' => :'Category',
|
||||||
:'name' => :'String',
|
:'name' => :'String',
|
||||||
:'photo_urls' => :'Array<String>',
|
:'photo_urls' => :'Array<String>',
|
||||||
:'tags' => :'Array<Tag>',
|
:'tags' => :'Array<Tag>',
|
||||||
:'status' => :'String'
|
:'status' => :'String'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -71,35 +63,28 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'category']
|
if attributes[:'category']
|
||||||
self.category = attributes[:'category']
|
self.category = attributes[:'category']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'photoUrls']
|
if attributes[:'photoUrls']
|
||||||
if (value = attributes[:'photoUrls']).is_a?(Array)
|
if (value = attributes[:'photoUrls']).is_a?(Array)
|
||||||
self.photo_urls = value
|
self.photo_urls = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'tags']
|
if attributes[:'tags']
|
||||||
if (value = attributes[:'tags']).is_a?(Array)
|
if (value = attributes[:'tags']).is_a?(Array)
|
||||||
self.tags = value
|
self.tags = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'status']
|
if attributes[:'status']
|
||||||
self.status = attributes[:'status']
|
self.status = attributes[:'status']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
|
@ -23,9 +23,7 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'special_property_name' => :'$special[property.name]'
|
:'special_property_name' => :'$special[property.name]'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,7 +31,6 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'special_property_name' => :'Integer'
|
:'special_property_name' => :'Integer'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -45,11 +42,9 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'$special[property.name]']
|
if attributes[:'$special[property.name]']
|
||||||
self.special_property_name = attributes[:'$special[property.name]']
|
self.special_property_name = attributes[:'$special[property.name]']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -25,11 +25,8 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'name' => :'name'
|
:'name' => :'name'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,8 +34,7 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'name' => :'String'
|
:'name' => :'String'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -50,15 +46,12 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'name']
|
if attributes[:'name']
|
||||||
self.name = attributes[:'name']
|
self.name = attributes[:'name']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -38,23 +38,14 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
|
|
||||||
:'id' => :'id',
|
:'id' => :'id',
|
||||||
|
|
||||||
:'username' => :'username',
|
:'username' => :'username',
|
||||||
|
|
||||||
:'first_name' => :'firstName',
|
:'first_name' => :'firstName',
|
||||||
|
|
||||||
:'last_name' => :'lastName',
|
:'last_name' => :'lastName',
|
||||||
|
|
||||||
:'email' => :'email',
|
:'email' => :'email',
|
||||||
|
|
||||||
:'password' => :'password',
|
:'password' => :'password',
|
||||||
|
|
||||||
:'phone' => :'phone',
|
:'phone' => :'phone',
|
||||||
|
|
||||||
:'user_status' => :'userStatus'
|
:'user_status' => :'userStatus'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -62,14 +53,13 @@ module Petstore
|
|||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'id' => :'Integer',
|
:'id' => :'Integer',
|
||||||
:'username' => :'String',
|
:'username' => :'String',
|
||||||
:'first_name' => :'String',
|
:'first_name' => :'String',
|
||||||
:'last_name' => :'String',
|
:'last_name' => :'String',
|
||||||
:'email' => :'String',
|
:'email' => :'String',
|
||||||
:'password' => :'String',
|
:'password' => :'String',
|
||||||
:'phone' => :'String',
|
:'phone' => :'String',
|
||||||
:'user_status' => :'Integer'
|
:'user_status' => :'Integer'
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -81,39 +71,30 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
|
|
||||||
if attributes[:'id']
|
if attributes[:'id']
|
||||||
self.id = attributes[:'id']
|
self.id = attributes[:'id']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'username']
|
if attributes[:'username']
|
||||||
self.username = attributes[:'username']
|
self.username = attributes[:'username']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'firstName']
|
if attributes[:'firstName']
|
||||||
self.first_name = attributes[:'firstName']
|
self.first_name = attributes[:'firstName']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'lastName']
|
if attributes[:'lastName']
|
||||||
self.last_name = attributes[:'lastName']
|
self.last_name = attributes[:'lastName']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'email']
|
if attributes[:'email']
|
||||||
self.email = attributes[:'email']
|
self.email = attributes[:'email']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'password']
|
if attributes[:'password']
|
||||||
self.password = attributes[:'password']
|
self.password = attributes[:'password']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'phone']
|
if attributes[:'phone']
|
||||||
self.phone = attributes[:'phone']
|
self.phone = attributes[:'phone']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[:'userStatus']
|
if attributes[:'userStatus']
|
||||||
self.user_status = attributes[:'userStatus']
|
self.user_status = attributes[:'userStatus']
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
|
@ -100,7 +100,7 @@ describe 'StoreApi' do
|
|||||||
|
|
||||||
# unit tests for get_order_by_id
|
# unit tests for get_order_by_id
|
||||||
# Find purchase order by ID
|
# Find purchase order by ID
|
||||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
# 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
|
# @param order_id ID of pet that needs to be fetched
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [Order]
|
# @return [Order]
|
||||||
|
@ -103,7 +103,7 @@ describe 'UserApi' do
|
|||||||
# unit tests for get_user_by_name
|
# unit tests for get_user_by_name
|
||||||
# Get user by user name
|
# Get user by user name
|
||||||
#
|
#
|
||||||
# @param username The name that needs to be fetched. Use user1 for testing.
|
# @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
# @param [Hash] opts the optional parameters
|
# @param [Hash] opts the optional parameters
|
||||||
# @return [User]
|
# @return [User]
|
||||||
describe 'get_user_by_name test' do
|
describe 'get_user_by_name test' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user