wesley-key-sdk 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +67 -25
- data/bin/console +4 -4
- data/lib/{cypress_test_api → swagger_petstore}/api_helper.rb +2 -2
- data/lib/swagger_petstore/client.rb +95 -0
- data/lib/{cypress_test_api → swagger_petstore}/configuration.rb +61 -20
- data/lib/{cypress_test_api → swagger_petstore}/controllers/base_controller.rb +2 -2
- data/lib/swagger_petstore/controllers/pet_controller.rb +206 -0
- data/lib/swagger_petstore/controllers/store_controller.rb +94 -0
- data/lib/swagger_petstore/controllers/user_controller.rb +165 -0
- data/lib/{cypress_test_api → swagger_petstore}/exceptions/api_exception.rb +2 -2
- data/lib/swagger_petstore/exceptions/o_auth_provider_exception.rb +64 -0
- data/lib/swagger_petstore/http/auth/api_key.rb +52 -0
- data/lib/swagger_petstore/http/auth/http_basic.rb +62 -0
- data/lib/swagger_petstore/http/auth/petstore_auth.rb +113 -0
- data/lib/{cypress_test_api → swagger_petstore}/http/http_call_back.rb +2 -2
- data/lib/{cypress_test_api → swagger_petstore}/http/http_method_enum.rb +2 -2
- data/lib/{cypress_test_api → swagger_petstore}/http/http_request.rb +2 -2
- data/lib/{cypress_test_api → swagger_petstore}/http/http_response.rb +2 -2
- data/lib/{cypress_test_api → swagger_petstore}/http/proxy_settings.rb +2 -2
- data/lib/{cypress_test_api/models/message2.rb → swagger_petstore/models/api_response.rb} +24 -14
- data/lib/{cypress_test_api → swagger_petstore}/models/base_model.rb +2 -2
- data/lib/{cypress_test_api/models/item_response.rb → swagger_petstore/models/category.rb} +10 -19
- data/lib/{cypress_test_api/models/deer.rb → swagger_petstore/models/category2.rb} +21 -18
- data/lib/swagger_petstore/models/content_type_enum.rb +26 -0
- data/lib/swagger_petstore/models/o_auth_provider_error_enum.rb +62 -0
- data/lib/swagger_petstore/models/o_auth_scope_petstore_auth_enum.rb +36 -0
- data/lib/swagger_petstore/models/o_auth_token.rb +96 -0
- data/lib/swagger_petstore/models/order.rb +120 -0
- data/lib/swagger_petstore/models/pet.rb +117 -0
- data/lib/swagger_petstore/models/pet_request.rb +117 -0
- data/lib/swagger_petstore/models/status1_enum.rb +40 -0
- data/lib/swagger_petstore/models/status2_enum.rb +40 -0
- data/lib/{cypress_test_api → swagger_petstore}/models/status_enum.rb +12 -12
- data/lib/swagger_petstore/models/store_order_request.rb +120 -0
- data/lib/{cypress_test_api/models/response_http404.rb → swagger_petstore/models/tag.rb} +18 -9
- data/lib/swagger_petstore/models/user.rb +132 -0
- data/lib/swagger_petstore/models/user_request.rb +132 -0
- data/lib/{cypress_test_api → swagger_petstore}/utilities/date_time_helper.rb +2 -2
- data/lib/{cypress_test_api → swagger_petstore}/utilities/file_wrapper.rb +2 -2
- data/lib/swagger_petstore.rb +62 -0
- data/test/controllers/controller_test_base.rb +14 -5
- data/test/controllers/test_store_controller.rb +31 -0
- data/test/http_response_catcher.rb +2 -2
- metadata +41 -34
- data/lib/cypress_test_api/client.rb +0 -58
- data/lib/cypress_test_api/controllers/api_controller.rb +0 -102
- data/lib/cypress_test_api/models/custom_enum.rb +0 -40
- data/lib/cypress_test_api/models/item.rb +0 -166
- data/lib/cypress_test_api/models/lion.rb +0 -68
- data/lib/cypress_test_api/models/message.rb +0 -68
- data/lib/cypress_test_api/models/multiple_arrays_request.rb +0 -70
- data/lib/cypress_test_api/models/nac_tag.rb +0 -265
- data/lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb +0 -44
- data/lib/cypress_test_api/models/response_http400.rb +0 -62
- data/lib/cypress_test_api/models/status11_enum.rb +0 -40
- data/lib/cypress_test_api/models/status1_enum.rb +0 -40
- data/lib/cypress_test_api/models/tokens_request.rb +0 -60
- data/lib/cypress_test_api.rb +0 -55
- data/test/controllers/test_api_controller.rb +0 -40
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module CypressTestApi
|
|
7
|
-
# APIController
|
|
8
|
-
class APIController < BaseController
|
|
9
|
-
# Creates a new resource in the system.
|
|
10
|
-
# @param [Status11Enum] status Required parameter: The status of the items
|
|
11
|
-
# to filter by.
|
|
12
|
-
# @param [Item] body Optional parameter: Custom model with additional
|
|
13
|
-
# properties
|
|
14
|
-
# @return [Object] Response from the API call.
|
|
15
|
-
def createanitem(status,
|
|
16
|
-
body: nil)
|
|
17
|
-
@api_call
|
|
18
|
-
.request(new_request_builder(HttpMethodEnum::POST,
|
|
19
|
-
'/items/{status}',
|
|
20
|
-
Server::DEFAULT)
|
|
21
|
-
.template_param(new_parameter(status, key: 'status')
|
|
22
|
-
.should_encode(true))
|
|
23
|
-
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
24
|
-
.body_param(new_parameter(body))
|
|
25
|
-
.header_param(new_parameter('application/json', key: 'accept'))
|
|
26
|
-
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
|
27
|
-
.response(new_response_handler
|
|
28
|
-
.deserializer(APIHelper.method(:json_deserialize))
|
|
29
|
-
.local_error('400',
|
|
30
|
-
'Bad Syntax',
|
|
31
|
-
APIException)
|
|
32
|
-
.local_error('401',
|
|
33
|
-
'Unauthorized',
|
|
34
|
-
APIException)
|
|
35
|
-
.local_error('403',
|
|
36
|
-
'Permission Denied',
|
|
37
|
-
APIException))
|
|
38
|
-
.execute
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# TODO: type endpoint description here
|
|
42
|
-
# @param [String] id Required parameter: The ID of the item to retrieve
|
|
43
|
-
# @param [String] value Required parameter: The value of the item to
|
|
44
|
-
# retrieve
|
|
45
|
-
# @return [Item] Response from the API call.
|
|
46
|
-
def getanitemby_id(id,
|
|
47
|
-
value)
|
|
48
|
-
@api_call
|
|
49
|
-
.request(new_request_builder(HttpMethodEnum::GET,
|
|
50
|
-
'/items/{id}',
|
|
51
|
-
Server::DEFAULT)
|
|
52
|
-
.template_param(new_parameter(id, key: 'id')
|
|
53
|
-
.should_encode(true))
|
|
54
|
-
.query_param(new_parameter(value, key: 'value'))
|
|
55
|
-
.header_param(new_parameter('application/json', key: 'accept')))
|
|
56
|
-
.response(new_response_handler
|
|
57
|
-
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
58
|
-
.deserialize_into(Item.method(:from_hash)))
|
|
59
|
-
.execute
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Generates a new OAuth token with the specified scopes.
|
|
63
|
-
# @param [TokensRequest] body Optional parameter: TODO: type description
|
|
64
|
-
# here
|
|
65
|
-
# @return [void] Response from the API call.
|
|
66
|
-
def create_o_auth_token(body: nil)
|
|
67
|
-
@api_call
|
|
68
|
-
.request(new_request_builder(HttpMethodEnum::POST,
|
|
69
|
-
'/tokens',
|
|
70
|
-
Server::DEFAULT)
|
|
71
|
-
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
72
|
-
.body_param(new_parameter(body))
|
|
73
|
-
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
|
74
|
-
.response(new_response_handler
|
|
75
|
-
.is_response_void(true)
|
|
76
|
-
.local_error('400',
|
|
77
|
-
'Bad request',
|
|
78
|
-
APIException))
|
|
79
|
-
.execute
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
# This endpoint accepts a complex structure with multiple arrays.
|
|
83
|
-
# @param [MultipleArraysRequest] body Optional parameter: TODO: type
|
|
84
|
-
# description here
|
|
85
|
-
# @return [void] Response from the API call.
|
|
86
|
-
def test_endpointwith_arrays(body: nil)
|
|
87
|
-
@api_call
|
|
88
|
-
.request(new_request_builder(HttpMethodEnum::POST,
|
|
89
|
-
'/multiple-arrays',
|
|
90
|
-
Server::DEFAULT)
|
|
91
|
-
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
92
|
-
.body_param(new_parameter(body))
|
|
93
|
-
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
|
94
|
-
.response(new_response_handler
|
|
95
|
-
.is_response_void(true)
|
|
96
|
-
.local_error('400',
|
|
97
|
-
'Bad request',
|
|
98
|
-
APIException))
|
|
99
|
-
.execute
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module CypressTestApi
|
|
7
|
-
# CustomEnum.
|
|
8
|
-
class CustomEnum
|
|
9
|
-
CUSTOM_ENUM = [
|
|
10
|
-
# TODO: Write general description for VALUE1
|
|
11
|
-
VALUE1 = 'VALUE1'.freeze,
|
|
12
|
-
|
|
13
|
-
# TODO: Write general description for VALUE2
|
|
14
|
-
VALUE2 = 'VALUE2'.freeze,
|
|
15
|
-
|
|
16
|
-
# TODO: Write general description for VALUE3
|
|
17
|
-
VALUE3 = 'VALUE3'.freeze
|
|
18
|
-
].freeze
|
|
19
|
-
|
|
20
|
-
def self.validate(value)
|
|
21
|
-
return false if value.nil?
|
|
22
|
-
|
|
23
|
-
CUSTOM_ENUM.include?(value)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.from_value(value, default_value = VALUE1)
|
|
27
|
-
return default_value if value.nil?
|
|
28
|
-
|
|
29
|
-
str = value.to_s.strip
|
|
30
|
-
|
|
31
|
-
case str.downcase
|
|
32
|
-
when 'value1' then VALUE1
|
|
33
|
-
when 'value2' then VALUE2
|
|
34
|
-
when 'value3' then VALUE3
|
|
35
|
-
else
|
|
36
|
-
default_value
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
require 'date'
|
|
7
|
-
module CypressTestApi
|
|
8
|
-
# Item Model.
|
|
9
|
-
class Item < BaseModel
|
|
10
|
-
SKIP = Object.new
|
|
11
|
-
private_constant :SKIP
|
|
12
|
-
|
|
13
|
-
# TODO: Write general description for this method
|
|
14
|
-
# @return [UUID | String]
|
|
15
|
-
attr_accessor :id
|
|
16
|
-
|
|
17
|
-
# TODO: Write general description for this method
|
|
18
|
-
# @return [String]
|
|
19
|
-
attr_accessor :name
|
|
20
|
-
|
|
21
|
-
# TODO: Write general description for this method
|
|
22
|
-
# @return [Date]
|
|
23
|
-
attr_accessor :date
|
|
24
|
-
|
|
25
|
-
# TODO: Write general description for this method
|
|
26
|
-
# @return [DateTime]
|
|
27
|
-
attr_accessor :date_time
|
|
28
|
-
|
|
29
|
-
# TODO: Write general description for this method
|
|
30
|
-
# @return [Float]
|
|
31
|
-
attr_accessor :decimal
|
|
32
|
-
|
|
33
|
-
# TODO: Write general description for this method
|
|
34
|
-
# @return [Integer]
|
|
35
|
-
attr_accessor :long
|
|
36
|
-
|
|
37
|
-
# TODO: Write general description for this method
|
|
38
|
-
# @return [TrueClass | FalseClass]
|
|
39
|
-
attr_accessor :bool
|
|
40
|
-
|
|
41
|
-
# TODO: Write general description for this method
|
|
42
|
-
# @return [CustomEnum]
|
|
43
|
-
attr_accessor :custom_enum
|
|
44
|
-
|
|
45
|
-
# TODO: Write general description for this method
|
|
46
|
-
# @return [StatusEnum]
|
|
47
|
-
attr_accessor :status
|
|
48
|
-
|
|
49
|
-
# A generic JSON object
|
|
50
|
-
# @return [Object]
|
|
51
|
-
attr_accessor :json_object
|
|
52
|
-
|
|
53
|
-
# A generic JSON object
|
|
54
|
-
# @return [Object]
|
|
55
|
-
attr_accessor :animal
|
|
56
|
-
|
|
57
|
-
# A generic JSON object
|
|
58
|
-
# @return [Hash[String, Message]]
|
|
59
|
-
attr_accessor :map
|
|
60
|
-
|
|
61
|
-
# A mapping from model property names to API property names.
|
|
62
|
-
def self.names
|
|
63
|
-
@_hash = {} if @_hash.nil?
|
|
64
|
-
@_hash['id'] = 'id'
|
|
65
|
-
@_hash['name'] = 'name'
|
|
66
|
-
@_hash['date'] = 'date'
|
|
67
|
-
@_hash['date_time'] = 'dateTime'
|
|
68
|
-
@_hash['decimal'] = 'decimal'
|
|
69
|
-
@_hash['long'] = 'long'
|
|
70
|
-
@_hash['bool'] = 'bool'
|
|
71
|
-
@_hash['custom_enum'] = 'CustomEnum'
|
|
72
|
-
@_hash['status'] = 'status'
|
|
73
|
-
@_hash['json_object'] = 'jsonObject'
|
|
74
|
-
@_hash['animal'] = 'Animal'
|
|
75
|
-
@_hash['map'] = 'Map'
|
|
76
|
-
@_hash
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# An array for optional fields
|
|
80
|
-
def self.optionals
|
|
81
|
-
%w[
|
|
82
|
-
status
|
|
83
|
-
]
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# An array for nullable fields
|
|
87
|
-
def self.nullables
|
|
88
|
-
[]
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def initialize(id = nil, name = nil, date = nil, date_time = nil,
|
|
92
|
-
decimal = nil, long = nil, bool = nil, custom_enum = nil,
|
|
93
|
-
json_object = nil, animal = nil, map = nil, status = SKIP)
|
|
94
|
-
@id = id
|
|
95
|
-
@name = name
|
|
96
|
-
@date = date
|
|
97
|
-
@date_time = date_time
|
|
98
|
-
@decimal = decimal
|
|
99
|
-
@long = long
|
|
100
|
-
@bool = bool
|
|
101
|
-
@custom_enum = custom_enum
|
|
102
|
-
@status = status unless status == SKIP
|
|
103
|
-
@json_object = json_object
|
|
104
|
-
@animal = animal
|
|
105
|
-
@map = map
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
# Creates an instance of the object from a hash.
|
|
109
|
-
def self.from_hash(hash)
|
|
110
|
-
return nil unless hash
|
|
111
|
-
|
|
112
|
-
# Extract variables from the hash.
|
|
113
|
-
id = hash.key?('id') ? hash['id'] : nil
|
|
114
|
-
name = hash.key?('name') ? hash['name'] : nil
|
|
115
|
-
date = hash.key?('date') ? hash['date'] : nil
|
|
116
|
-
date_time = if hash.key?('dateTime')
|
|
117
|
-
(DateTimeHelper.from_rfc3339(hash['dateTime']) if hash['dateTime'])
|
|
118
|
-
end
|
|
119
|
-
decimal = hash.key?('decimal') ? hash['decimal'] : nil
|
|
120
|
-
long = hash.key?('long') ? hash['long'] : nil
|
|
121
|
-
bool = hash.key?('bool') ? hash['bool'] : nil
|
|
122
|
-
custom_enum = hash.key?('CustomEnum') ? hash['CustomEnum'] : nil
|
|
123
|
-
json_object = hash.key?('jsonObject') ? hash['jsonObject'] : nil
|
|
124
|
-
animal = hash.key?('Animal') ? hash['Animal'] : nil
|
|
125
|
-
map = Message.from_hash(hash['Map']) if hash['Map']
|
|
126
|
-
|
|
127
|
-
map = nil unless hash.key?('Map')
|
|
128
|
-
status = hash.key?('status') ? hash['status'] : SKIP
|
|
129
|
-
|
|
130
|
-
# Create object from extracted values.
|
|
131
|
-
Item.new(id,
|
|
132
|
-
name,
|
|
133
|
-
date,
|
|
134
|
-
date_time,
|
|
135
|
-
decimal,
|
|
136
|
-
long,
|
|
137
|
-
bool,
|
|
138
|
-
custom_enum,
|
|
139
|
-
json_object,
|
|
140
|
-
animal,
|
|
141
|
-
map,
|
|
142
|
-
status)
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def to_custom_date_time
|
|
146
|
-
DateTimeHelper.to_rfc3339(date_time)
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# Provides a human-readable string representation of the object.
|
|
150
|
-
def to_s
|
|
151
|
-
class_name = self.class.name.split('::').last
|
|
152
|
-
"<#{class_name} id: #{@id}, name: #{@name}, date: #{@date}, date_time: #{@date_time},"\
|
|
153
|
-
" decimal: #{@decimal}, long: #{@long}, bool: #{@bool}, custom_enum: #{@custom_enum},"\
|
|
154
|
-
" status: #{@status}, json_object: #{@json_object}, animal: #{@animal}, map: #{@map}>"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
# Provides a debugging-friendly string with detailed object information.
|
|
158
|
-
def inspect
|
|
159
|
-
class_name = self.class.name.split('::').last
|
|
160
|
-
"<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, date: #{@date.inspect},"\
|
|
161
|
-
" date_time: #{@date_time.inspect}, decimal: #{@decimal.inspect}, long: #{@long.inspect},"\
|
|
162
|
-
" bool: #{@bool.inspect}, custom_enum: #{@custom_enum.inspect}, status: #{@status.inspect},"\
|
|
163
|
-
" json_object: #{@json_object.inspect}, animal: #{@animal.inspect}, map: #{@map.inspect}>"
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
end
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module CypressTestApi
|
|
7
|
-
# Lion Model.
|
|
8
|
-
class Lion < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# TODO: Write general description for this method
|
|
13
|
-
# @return [String]
|
|
14
|
-
attr_accessor :id
|
|
15
|
-
|
|
16
|
-
# TODO: Write general description for this method
|
|
17
|
-
# @return [String]
|
|
18
|
-
attr_accessor :type
|
|
19
|
-
|
|
20
|
-
# A mapping from model property names to API property names.
|
|
21
|
-
def self.names
|
|
22
|
-
@_hash = {} if @_hash.nil?
|
|
23
|
-
@_hash['id'] = 'id'
|
|
24
|
-
@_hash['type'] = 'type'
|
|
25
|
-
@_hash
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# An array for optional fields
|
|
29
|
-
def self.optionals
|
|
30
|
-
[]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# An array for nullable fields
|
|
34
|
-
def self.nullables
|
|
35
|
-
[]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def initialize(id = nil, type = nil)
|
|
39
|
-
@id = id
|
|
40
|
-
@type = type
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Creates an instance of the object from a hash.
|
|
44
|
-
def self.from_hash(hash)
|
|
45
|
-
return nil unless hash
|
|
46
|
-
|
|
47
|
-
# Extract variables from the hash.
|
|
48
|
-
id = hash.key?('id') ? hash['id'] : nil
|
|
49
|
-
type = hash.key?('type') ? hash['type'] : nil
|
|
50
|
-
|
|
51
|
-
# Create object from extracted values.
|
|
52
|
-
Lion.new(id,
|
|
53
|
-
type)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Provides a human-readable string representation of the object.
|
|
57
|
-
def to_s
|
|
58
|
-
class_name = self.class.name.split('::').last
|
|
59
|
-
"<#{class_name} id: #{@id}, type: #{@type}>"
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Provides a debugging-friendly string with detailed object information.
|
|
63
|
-
def inspect
|
|
64
|
-
class_name = self.class.name.split('::').last
|
|
65
|
-
"<#{class_name} id: #{@id.inspect}, type: #{@type.inspect}>"
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module CypressTestApi
|
|
7
|
-
# Message Model.
|
|
8
|
-
class Message < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# TODO: Write general description for this method
|
|
13
|
-
# @return [Integer]
|
|
14
|
-
attr_accessor :code
|
|
15
|
-
|
|
16
|
-
# TODO: Write general description for this method
|
|
17
|
-
# @return [String]
|
|
18
|
-
attr_accessor :text
|
|
19
|
-
|
|
20
|
-
# A mapping from model property names to API property names.
|
|
21
|
-
def self.names
|
|
22
|
-
@_hash = {} if @_hash.nil?
|
|
23
|
-
@_hash['code'] = 'code'
|
|
24
|
-
@_hash['text'] = 'text'
|
|
25
|
-
@_hash
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# An array for optional fields
|
|
29
|
-
def self.optionals
|
|
30
|
-
[]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# An array for nullable fields
|
|
34
|
-
def self.nullables
|
|
35
|
-
[]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def initialize(code = nil, text = nil)
|
|
39
|
-
@code = code
|
|
40
|
-
@text = text
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Creates an instance of the object from a hash.
|
|
44
|
-
def self.from_hash(hash)
|
|
45
|
-
return nil unless hash
|
|
46
|
-
|
|
47
|
-
# Extract variables from the hash.
|
|
48
|
-
code = hash.key?('code') ? hash['code'] : nil
|
|
49
|
-
text = hash.key?('text') ? hash['text'] : nil
|
|
50
|
-
|
|
51
|
-
# Create object from extracted values.
|
|
52
|
-
Message.new(code,
|
|
53
|
-
text)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Provides a human-readable string representation of the object.
|
|
57
|
-
def to_s
|
|
58
|
-
class_name = self.class.name.split('::').last
|
|
59
|
-
"<#{class_name} code: #{@code}, text: #{@text}>"
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Provides a debugging-friendly string with detailed object information.
|
|
63
|
-
def inspect
|
|
64
|
-
class_name = self.class.name.split('::').last
|
|
65
|
-
"<#{class_name} code: #{@code.inspect}, text: #{@text.inspect}>"
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# cypress_test_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v3.0
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module CypressTestApi
|
|
7
|
-
# MultipleArraysRequest Model.
|
|
8
|
-
class MultipleArraysRequest < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# An array containing items of type string
|
|
13
|
-
# @return [Array[String]]
|
|
14
|
-
attr_accessor :array1
|
|
15
|
-
|
|
16
|
-
# An array containing items of type integer
|
|
17
|
-
# @return [Array[Integer]]
|
|
18
|
-
attr_accessor :array2
|
|
19
|
-
|
|
20
|
-
# A mapping from model property names to API property names.
|
|
21
|
-
def self.names
|
|
22
|
-
@_hash = {} if @_hash.nil?
|
|
23
|
-
@_hash['array1'] = 'Array1'
|
|
24
|
-
@_hash['array2'] = 'Array2'
|
|
25
|
-
@_hash
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# An array for optional fields
|
|
29
|
-
def self.optionals
|
|
30
|
-
%w[
|
|
31
|
-
array2
|
|
32
|
-
]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# An array for nullable fields
|
|
36
|
-
def self.nullables
|
|
37
|
-
[]
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def initialize(array1 = nil, array2 = SKIP)
|
|
41
|
-
@array1 = array1
|
|
42
|
-
@array2 = array2 unless array2 == SKIP
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Creates an instance of the object from a hash.
|
|
46
|
-
def self.from_hash(hash)
|
|
47
|
-
return nil unless hash
|
|
48
|
-
|
|
49
|
-
# Extract variables from the hash.
|
|
50
|
-
array1 = hash.key?('Array1') ? hash['Array1'] : nil
|
|
51
|
-
array2 = hash.key?('Array2') ? hash['Array2'] : SKIP
|
|
52
|
-
|
|
53
|
-
# Create object from extracted values.
|
|
54
|
-
MultipleArraysRequest.new(array1,
|
|
55
|
-
array2)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# Provides a human-readable string representation of the object.
|
|
59
|
-
def to_s
|
|
60
|
-
class_name = self.class.name.split('::').last
|
|
61
|
-
"<#{class_name} array1: #{@array1}, array2: #{@array2}>"
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Provides a debugging-friendly string with detailed object information.
|
|
65
|
-
def inspect
|
|
66
|
-
class_name = self.class.name.split('::').last
|
|
67
|
-
"<#{class_name} array1: #{@array1.inspect}, array2: #{@array2.inspect}>"
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|