wesley-key-sdk 4.0.0 → 4.2.0
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 +47 -34
- data/bin/console +4 -4
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/api_helper.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/apis/base_api.rb +3 -3
- data/lib/swagger_petstore_open_api30/apis/pet_api.rb +287 -0
- data/lib/swagger_petstore_open_api30/apis/store_api.rb +131 -0
- data/lib/swagger_petstore_open_api30/apis/user_api.rb +233 -0
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/client.rb +34 -15
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/configuration.rb +30 -20
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/exceptions/api_exception.rb +2 -2
- data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/api_response.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/auth/api_key.rb +15 -15
- data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +112 -0
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_call_back.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_method_enum.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_request.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_response.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/proxy_settings.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/logging/configuration/api_logging_configuration.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/logging/sdk_logger.rb +2 -2
- data/lib/swagger_petstore_open_api30/models/api_response.rb +118 -0
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/models/base_model.rb +2 -2
- data/lib/{webhooks_and_callbacks_api/models/package.rb → swagger_petstore_open_api30/models/category.rb} +39 -29
- data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +62 -0
- data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +36 -0
- data/lib/swagger_petstore_open_api30/models/oauth_token.rb +125 -0
- data/lib/swagger_petstore_open_api30/models/order.rb +167 -0
- data/lib/swagger_petstore_open_api30/models/order_status.rb +40 -0
- data/lib/swagger_petstore_open_api30/models/pet.rb +168 -0
- data/lib/swagger_petstore_open_api30/models/pet_status.rb +40 -0
- data/lib/{webhooks_and_callbacks_api/models/delivery_details.rb → swagger_petstore_open_api30/models/tag.rb} +36 -35
- data/lib/swagger_petstore_open_api30/models/user.rb +182 -0
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/utilities/date_time_helper.rb +2 -2
- data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/utilities/file_wrapper.rb +2 -2
- data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +12 -0
- data/lib/swagger_petstore_open_api30.rb +62 -0
- metadata +37 -78
- data/lib/webhooks_and_callbacks_api/apis/orders_api.rb +0 -34
- data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_a_handler.rb +0 -66
- data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_b_handler.rb +0 -78
- data/lib/webhooks_and_callbacks_api/events/signature_verification_failure.rb +0 -33
- data/lib/webhooks_and_callbacks_api/events/signature_verification_result.rb +0 -14
- data/lib/webhooks_and_callbacks_api/events/unknown_event.rb +0 -32
- data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_a_handler.rb +0 -67
- data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_b_handler.rb +0 -86
- data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_c_handler.rb +0 -79
- data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_handler.rb +0 -67
- data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_no_verification_handler.rb +0 -39
- data/lib/webhooks_and_callbacks_api/exceptions/error_exception.rb +0 -57
- data/lib/webhooks_and_callbacks_api/http/auth/bearer_auth.rb +0 -53
- data/lib/webhooks_and_callbacks_api/models/address.rb +0 -114
- data/lib/webhooks_and_callbacks_api/models/audit_log_event.rb +0 -115
- data/lib/webhooks_and_callbacks_api/models/create_order_request.rb +0 -131
- data/lib/webhooks_and_callbacks_api/models/email_notification_callback.rb +0 -97
- data/lib/webhooks_and_callbacks_api/models/event.rb +0 -52
- data/lib/webhooks_and_callbacks_api/models/event_type.rb +0 -26
- data/lib/webhooks_and_callbacks_api/models/event_type1.rb +0 -26
- data/lib/webhooks_and_callbacks_api/models/event_type2.rb +0 -26
- data/lib/webhooks_and_callbacks_api/models/event_type3.rb +0 -26
- data/lib/webhooks_and_callbacks_api/models/fulfillment_callback.rb +0 -411
- data/lib/webhooks_and_callbacks_api/models/fulfillment_status.rb +0 -40
- data/lib/webhooks_and_callbacks_api/models/fulfillment_statuss.rb +0 -40
- data/lib/webhooks_and_callbacks_api/models/inventory_stock_decrease_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/inventory_stock_depleted_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/inventory_stock_increase_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/notification_callback.rb +0 -119
- data/lib/webhooks_and_callbacks_api/models/oauth_scope_oauth_acg.rb +0 -44
- data/lib/webhooks_and_callbacks_api/models/order.rb +0 -161
- data/lib/webhooks_and_callbacks_api/models/order_created_event.rb +0 -314
- data/lib/webhooks_and_callbacks_api/models/order_item.rb +0 -102
- data/lib/webhooks_and_callbacks_api/models/order_updated_event.rb +0 -100
- data/lib/webhooks_and_callbacks_api/models/payment_callback.rb +0 -167
- data/lib/webhooks_and_callbacks_api/models/payment_completed_event.rb +0 -98
- data/lib/webhooks_and_callbacks_api/models/payment_status.rb +0 -40
- data/lib/webhooks_and_callbacks_api/models/payment_status_created_event.rb +0 -89
- data/lib/webhooks_and_callbacks_api/models/payment_status_updated_event.rb +0 -89
- data/lib/webhooks_and_callbacks_api/models/primitive_collection_event.rb +0 -98
- data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request.rb +0 -40
- data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request1.rb +0 -40
- data/lib/webhooks_and_callbacks_api/models/sms_notification_callback.rb +0 -95
- data/lib/webhooks_and_callbacks_api/models/status.rb +0 -44
- data/lib/webhooks_and_callbacks_api/models/status1.rb +0 -36
- data/lib/webhooks_and_callbacks_api/models/status2.rb +0 -36
- data/lib/webhooks_and_callbacks_api/models/system_alert_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/system_maintenance_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/system_performance_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/user_action_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/user_preference_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/user_status_notification_event.rb +0 -90
- data/lib/webhooks_and_callbacks_api/models/webhook.rb +0 -142
- data/lib/webhooks_and_callbacks_api/models/webhook_registration.rb +0 -103
- data/lib/webhooks_and_callbacks_api/models/webhook_update.rb +0 -105
- data/lib/webhooks_and_callbacks_api/utilities/union_type_lookup.rb +0 -172
- data/lib/webhooks_and_callbacks_api.rb +0 -122
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
|
+
# UserApi
|
|
8
|
+
class UserApi < BaseApi
|
|
9
|
+
# This can only be done by the logged in user.
|
|
10
|
+
# @param [Integer] id Optional parameter: TODO: type description here
|
|
11
|
+
# @param [String] username Optional parameter: TODO: type description here
|
|
12
|
+
# @param [String] first_name Optional parameter: TODO: type description
|
|
13
|
+
# here
|
|
14
|
+
# @param [String] last_name Optional parameter: TODO: type description
|
|
15
|
+
# here
|
|
16
|
+
# @param [String] email Optional parameter: TODO: type description here
|
|
17
|
+
# @param [String] password Optional parameter: TODO: type description here
|
|
18
|
+
# @param [String] phone Optional parameter: TODO: type description here
|
|
19
|
+
# @param [Integer] user_status Optional parameter: User Status
|
|
20
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
21
|
+
def create_user(id: nil,
|
|
22
|
+
username: nil,
|
|
23
|
+
first_name: nil,
|
|
24
|
+
last_name: nil,
|
|
25
|
+
email: nil,
|
|
26
|
+
password: nil,
|
|
27
|
+
phone: nil,
|
|
28
|
+
user_status: nil)
|
|
29
|
+
@api_call
|
|
30
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
31
|
+
'/user',
|
|
32
|
+
Server::DEFAULT)
|
|
33
|
+
.form_param(new_parameter(id, key: 'id'))
|
|
34
|
+
.form_param(new_parameter(username, key: 'username'))
|
|
35
|
+
.form_param(new_parameter(first_name, key: 'firstName'))
|
|
36
|
+
.form_param(new_parameter(last_name, key: 'lastName'))
|
|
37
|
+
.form_param(new_parameter(email, key: 'email'))
|
|
38
|
+
.form_param(new_parameter(password, key: 'password'))
|
|
39
|
+
.form_param(new_parameter(phone, key: 'phone'))
|
|
40
|
+
.form_param(new_parameter(user_status, key: 'userStatus'))
|
|
41
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
42
|
+
.header_param(new_parameter('application/json', key: 'accept')))
|
|
43
|
+
.response(new_response_handler
|
|
44
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
45
|
+
.deserialize_into(User.method(:from_hash))
|
|
46
|
+
.is_api_response(true)
|
|
47
|
+
.local_error('default',
|
|
48
|
+
'Unexpected error',
|
|
49
|
+
APIException))
|
|
50
|
+
.execute
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Creates list of users with given input array.
|
|
54
|
+
# @param [Array[User]] body Optional parameter: TODO: type description
|
|
55
|
+
# here
|
|
56
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
57
|
+
def create_users_with_list_input(body: nil)
|
|
58
|
+
@api_call
|
|
59
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
60
|
+
'/user/createWithList',
|
|
61
|
+
Server::DEFAULT)
|
|
62
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
63
|
+
.body_param(new_parameter(body))
|
|
64
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
65
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
|
66
|
+
.response(new_response_handler
|
|
67
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
68
|
+
.deserialize_into(User.method(:from_hash))
|
|
69
|
+
.is_api_response(true)
|
|
70
|
+
.local_error('default',
|
|
71
|
+
'Unexpected error',
|
|
72
|
+
APIException))
|
|
73
|
+
.execute
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Log into the system.
|
|
77
|
+
# @param [String] username Optional parameter: The user name for login
|
|
78
|
+
# @param [String] password Optional parameter: The password for login in
|
|
79
|
+
# clear text
|
|
80
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
81
|
+
def login_user(username: nil,
|
|
82
|
+
password: nil)
|
|
83
|
+
@api_call
|
|
84
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
85
|
+
'/user/login',
|
|
86
|
+
Server::DEFAULT)
|
|
87
|
+
.query_param(new_parameter(username, key: 'username'))
|
|
88
|
+
.query_param(new_parameter(password, key: 'password'))
|
|
89
|
+
.header_param(new_parameter('application/xml', key: 'accept')))
|
|
90
|
+
.response(new_response_handler
|
|
91
|
+
.deserializer(XmlUtilities.method(:deserialize_xml))
|
|
92
|
+
.deserialize_into(String)
|
|
93
|
+
.is_xml_response(true)
|
|
94
|
+
.xml_attribute(XmlAttributes.new
|
|
95
|
+
.root_element_name('response'))
|
|
96
|
+
.is_api_response(true)
|
|
97
|
+
.is_primitive_response(true)
|
|
98
|
+
.local_error('400',
|
|
99
|
+
'Invalid username/password supplied',
|
|
100
|
+
APIException)
|
|
101
|
+
.local_error('default',
|
|
102
|
+
'Unexpected error',
|
|
103
|
+
APIException))
|
|
104
|
+
.execute
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Log user out of the system.
|
|
108
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
109
|
+
def logout_user
|
|
110
|
+
@api_call
|
|
111
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
112
|
+
'/user/logout',
|
|
113
|
+
Server::DEFAULT))
|
|
114
|
+
.response(new_response_handler
|
|
115
|
+
.is_response_void(true)
|
|
116
|
+
.is_api_response(true)
|
|
117
|
+
.local_error('default',
|
|
118
|
+
'Unexpected error',
|
|
119
|
+
APIException))
|
|
120
|
+
.execute
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Get user detail based on username.
|
|
124
|
+
# @param [String] usersname Required parameter: The username that needs to
|
|
125
|
+
# be processed
|
|
126
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
127
|
+
def get_user_by_name(usersname)
|
|
128
|
+
@api_call
|
|
129
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
130
|
+
'/user/{usersname}',
|
|
131
|
+
Server::DEFAULT)
|
|
132
|
+
.template_param(new_parameter(usersname, key: 'usersname')
|
|
133
|
+
.is_required(true)
|
|
134
|
+
.should_encode(true))
|
|
135
|
+
.header_param(new_parameter('application/json', key: 'accept')))
|
|
136
|
+
.response(new_response_handler
|
|
137
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
138
|
+
.deserialize_into(User.method(:from_hash))
|
|
139
|
+
.is_api_response(true)
|
|
140
|
+
.local_error('400',
|
|
141
|
+
'Invalid username supplied',
|
|
142
|
+
APIException)
|
|
143
|
+
.local_error('404',
|
|
144
|
+
'User not found',
|
|
145
|
+
APIException)
|
|
146
|
+
.local_error('default',
|
|
147
|
+
'Unexpected error',
|
|
148
|
+
APIException))
|
|
149
|
+
.execute
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# This can only be done by the logged in user.
|
|
153
|
+
# @param [String] usersname Required parameter: The username that needs to
|
|
154
|
+
# be processed
|
|
155
|
+
# @param [Integer] id Optional parameter: TODO: type description here
|
|
156
|
+
# @param [String] username Optional parameter: TODO: type description here
|
|
157
|
+
# @param [String] first_name Optional parameter: TODO: type description
|
|
158
|
+
# here
|
|
159
|
+
# @param [String] last_name Optional parameter: TODO: type description
|
|
160
|
+
# here
|
|
161
|
+
# @param [String] email Optional parameter: TODO: type description here
|
|
162
|
+
# @param [String] password Optional parameter: TODO: type description here
|
|
163
|
+
# @param [String] phone Optional parameter: TODO: type description here
|
|
164
|
+
# @param [Integer] user_status Optional parameter: User Status
|
|
165
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
166
|
+
def update_user(usersname,
|
|
167
|
+
id: nil,
|
|
168
|
+
username: nil,
|
|
169
|
+
first_name: nil,
|
|
170
|
+
last_name: nil,
|
|
171
|
+
email: nil,
|
|
172
|
+
password: nil,
|
|
173
|
+
phone: nil,
|
|
174
|
+
user_status: nil)
|
|
175
|
+
@api_call
|
|
176
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
177
|
+
'/user/{usersname}',
|
|
178
|
+
Server::DEFAULT)
|
|
179
|
+
.template_param(new_parameter(usersname, key: 'usersname')
|
|
180
|
+
.is_required(true)
|
|
181
|
+
.should_encode(true))
|
|
182
|
+
.form_param(new_parameter(id, key: 'id'))
|
|
183
|
+
.form_param(new_parameter(username, key: 'username'))
|
|
184
|
+
.form_param(new_parameter(first_name, key: 'firstName'))
|
|
185
|
+
.form_param(new_parameter(last_name, key: 'lastName'))
|
|
186
|
+
.form_param(new_parameter(email, key: 'email'))
|
|
187
|
+
.form_param(new_parameter(password, key: 'password'))
|
|
188
|
+
.form_param(new_parameter(phone, key: 'phone'))
|
|
189
|
+
.form_param(new_parameter(user_status, key: 'userStatus'))
|
|
190
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')))
|
|
191
|
+
.response(new_response_handler
|
|
192
|
+
.is_response_void(true)
|
|
193
|
+
.is_api_response(true)
|
|
194
|
+
.local_error('400',
|
|
195
|
+
'bad request',
|
|
196
|
+
APIException)
|
|
197
|
+
.local_error('404',
|
|
198
|
+
'user not found',
|
|
199
|
+
APIException)
|
|
200
|
+
.local_error('default',
|
|
201
|
+
'Unexpected error',
|
|
202
|
+
APIException))
|
|
203
|
+
.execute
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# This can only be done by the logged in user.
|
|
207
|
+
# @param [String] usersname Required parameter: The username that needs to
|
|
208
|
+
# be processed
|
|
209
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
210
|
+
def delete_user(usersname)
|
|
211
|
+
@api_call
|
|
212
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
213
|
+
'/user/{usersname}',
|
|
214
|
+
Server::DEFAULT)
|
|
215
|
+
.template_param(new_parameter(usersname, key: 'usersname')
|
|
216
|
+
.is_required(true)
|
|
217
|
+
.should_encode(true)))
|
|
218
|
+
.response(new_response_handler
|
|
219
|
+
.is_response_void(true)
|
|
220
|
+
.is_api_response(true)
|
|
221
|
+
.local_error('400',
|
|
222
|
+
'Invalid username supplied',
|
|
223
|
+
APIException)
|
|
224
|
+
.local_error('404',
|
|
225
|
+
'User not found',
|
|
226
|
+
APIException)
|
|
227
|
+
.local_error('default',
|
|
228
|
+
'Unexpected error',
|
|
229
|
+
APIException))
|
|
230
|
+
.execute
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
3
|
# This file was automatically generated by
|
|
4
4
|
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
7
|
-
#
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
|
+
# swagger_petstore_open_api30 client class.
|
|
8
8
|
class Client
|
|
9
9
|
include CoreLibrary
|
|
10
10
|
attr_reader :config, :auth_managers
|
|
@@ -12,21 +12,38 @@ module WebhooksAndCallbacksApi
|
|
|
12
12
|
def user_agent_detail
|
|
13
13
|
config.user_agent_detail
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
# Returns the configured authentication petstore_auth instance.
|
|
17
|
+
def petstore_auth
|
|
18
|
+
@auth_managers['petstore_auth']
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Access to pet controller.
|
|
22
|
+
# @return [PetApi] Returns the controller instance.
|
|
23
|
+
def pet
|
|
24
|
+
@pet ||= PetApi.new @global_configuration
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Access to store controller.
|
|
28
|
+
# @return [StoreApi] Returns the controller instance.
|
|
29
|
+
def store
|
|
30
|
+
@store ||= StoreApi.new @global_configuration
|
|
31
|
+
end
|
|
15
32
|
|
|
16
|
-
# Access to
|
|
17
|
-
# @return [
|
|
18
|
-
def
|
|
19
|
-
@
|
|
33
|
+
# Access to user controller.
|
|
34
|
+
# @return [UserApi] Returns the controller instance.
|
|
35
|
+
def user
|
|
36
|
+
@user ||= UserApi.new @global_configuration
|
|
20
37
|
end
|
|
21
38
|
|
|
22
39
|
def initialize(
|
|
23
|
-
connection: nil, adapter: :net_http_persistent, timeout:
|
|
40
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
24
41
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
25
42
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
26
43
|
retry_methods: %i[get put get put], http_callback: nil,
|
|
27
44
|
proxy_settings: nil, logging_configuration: nil,
|
|
28
|
-
environment: Environment::PRODUCTION,
|
|
29
|
-
|
|
45
|
+
environment: Environment::PRODUCTION, petstore_auth_credentials: nil,
|
|
46
|
+
api_key_credentials: nil, config: nil
|
|
30
47
|
)
|
|
31
48
|
@config = if config.nil?
|
|
32
49
|
Configuration.new(
|
|
@@ -38,8 +55,8 @@ module WebhooksAndCallbacksApi
|
|
|
38
55
|
proxy_settings: proxy_settings,
|
|
39
56
|
logging_configuration: logging_configuration,
|
|
40
57
|
environment: environment,
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
petstore_auth_credentials: petstore_auth_credentials,
|
|
59
|
+
api_key_credentials: api_key_credentials
|
|
43
60
|
)
|
|
44
61
|
else
|
|
45
62
|
config
|
|
@@ -61,9 +78,11 @@ module WebhooksAndCallbacksApi
|
|
|
61
78
|
def initialize_auth_managers(global_config)
|
|
62
79
|
@auth_managers = {}
|
|
63
80
|
http_client_config = global_config.client_configuration
|
|
64
|
-
%w[
|
|
65
|
-
@auth_managers['
|
|
66
|
-
|
|
81
|
+
%w[petstore_auth api_key].each { |auth| @auth_managers[auth] = nil }
|
|
82
|
+
@auth_managers['petstore_auth'] = PetstoreAuth.new(
|
|
83
|
+
http_client_config.petstore_auth_credentials, global_config
|
|
84
|
+
)
|
|
85
|
+
@auth_managers['api_key'] = ApiKey.new(http_client_config.api_key_credentials)
|
|
67
86
|
end
|
|
68
87
|
|
|
69
88
|
# Creates a client directly from environment variables.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
3
|
# This file was automatically generated by
|
|
4
4
|
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
7
|
# An enum for SDK environments.
|
|
8
8
|
class Environment
|
|
9
9
|
ENVIRONMENT = [
|
|
@@ -21,14 +21,23 @@ module WebhooksAndCallbacksApi
|
|
|
21
21
|
# An enum for API servers.
|
|
22
22
|
class Server
|
|
23
23
|
SERVER = [
|
|
24
|
-
DEFAULT = 'default'.freeze
|
|
24
|
+
DEFAULT = 'default'.freeze,
|
|
25
|
+
AUTH_SERVER = 'auth server'.freeze
|
|
25
26
|
].freeze
|
|
26
27
|
|
|
27
28
|
# Converts a string or symbol into a valid Server constant.
|
|
28
29
|
def self.from_value(value, default_value = DEFAULT)
|
|
29
30
|
return default_value if value.nil?
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
str = value.to_s.strip.downcase
|
|
33
|
+
case str
|
|
34
|
+
when 'default' then DEFAULT
|
|
35
|
+
when 'auth_server' then AUTH_SERVER
|
|
36
|
+
|
|
37
|
+
else
|
|
38
|
+
warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
|
|
39
|
+
default_value
|
|
40
|
+
end
|
|
32
41
|
end
|
|
33
42
|
end
|
|
34
43
|
|
|
@@ -36,20 +45,20 @@ module WebhooksAndCallbacksApi
|
|
|
36
45
|
# are configured in this class.
|
|
37
46
|
class Configuration < CoreLibrary::HttpClientConfiguration
|
|
38
47
|
# The attribute readers for properties.
|
|
39
|
-
attr_reader :environment, :
|
|
48
|
+
attr_reader :environment, :petstore_auth_credentials, :api_key_credentials
|
|
40
49
|
|
|
41
50
|
class << self
|
|
42
51
|
attr_reader :environments
|
|
43
52
|
end
|
|
44
53
|
|
|
45
54
|
def initialize(
|
|
46
|
-
connection: nil, adapter: :net_http_persistent, timeout:
|
|
55
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
47
56
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
48
57
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
49
58
|
retry_methods: %i[get put get put], http_callback: nil,
|
|
50
59
|
proxy_settings: nil, logging_configuration: nil,
|
|
51
|
-
environment: Environment::PRODUCTION,
|
|
52
|
-
|
|
60
|
+
environment: Environment::PRODUCTION, petstore_auth_credentials: nil,
|
|
61
|
+
api_key_credentials: nil
|
|
53
62
|
)
|
|
54
63
|
super connection: connection, adapter: adapter, timeout: timeout,
|
|
55
64
|
max_retries: max_retries, retry_interval: retry_interval,
|
|
@@ -61,12 +70,12 @@ module WebhooksAndCallbacksApi
|
|
|
61
70
|
# Current API environment
|
|
62
71
|
@environment = String(environment)
|
|
63
72
|
|
|
73
|
+
# The object holding OAuth 2 Implicit Grant credentials
|
|
74
|
+
@petstore_auth_credentials = petstore_auth_credentials
|
|
75
|
+
|
|
64
76
|
# The object holding Custom Header Signature credentials
|
|
65
77
|
@api_key_credentials = api_key_credentials
|
|
66
78
|
|
|
67
|
-
# The object holding OAuth 2 Bearer token credentials
|
|
68
|
-
@bearer_auth_credentials = bearer_auth_credentials
|
|
69
|
-
|
|
70
79
|
# The Http Client to use for making requests.
|
|
71
80
|
set_http_client CoreLibrary::FaradayClient.new(self)
|
|
72
81
|
end
|
|
@@ -75,8 +84,8 @@ module WebhooksAndCallbacksApi
|
|
|
75
84
|
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
|
76
85
|
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
|
77
86
|
proxy_settings: nil, logging_configuration: nil,
|
|
78
|
-
environment: nil,
|
|
79
|
-
|
|
87
|
+
environment: nil, petstore_auth_credentials: nil,
|
|
88
|
+
api_key_credentials: nil)
|
|
80
89
|
connection ||= self.connection
|
|
81
90
|
adapter ||= self.adapter
|
|
82
91
|
timeout ||= self.timeout
|
|
@@ -89,8 +98,8 @@ module WebhooksAndCallbacksApi
|
|
|
89
98
|
proxy_settings ||= self.proxy_settings
|
|
90
99
|
logging_configuration ||= self.logging_configuration
|
|
91
100
|
environment ||= self.environment
|
|
101
|
+
petstore_auth_credentials ||= self.petstore_auth_credentials
|
|
92
102
|
api_key_credentials ||= self.api_key_credentials
|
|
93
|
-
bearer_auth_credentials ||= self.bearer_auth_credentials
|
|
94
103
|
|
|
95
104
|
Configuration.new(connection: connection, adapter: adapter,
|
|
96
105
|
timeout: timeout, max_retries: max_retries,
|
|
@@ -102,15 +111,16 @@ module WebhooksAndCallbacksApi
|
|
|
102
111
|
proxy_settings: proxy_settings,
|
|
103
112
|
logging_configuration: logging_configuration,
|
|
104
113
|
environment: environment,
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
petstore_auth_credentials: petstore_auth_credentials,
|
|
115
|
+
api_key_credentials: api_key_credentials)
|
|
107
116
|
end
|
|
108
117
|
|
|
109
118
|
|
|
110
119
|
# All the environments the SDK can run in.
|
|
111
120
|
ENVIRONMENTS = {
|
|
112
121
|
Environment::PRODUCTION => {
|
|
113
|
-
Server::DEFAULT => '
|
|
122
|
+
Server::DEFAULT => 'https://petstore3.swagger.io/api/v3',
|
|
123
|
+
Server::AUTH_SERVER => 'https://petstore3.swagger.io/oauth'
|
|
114
124
|
}
|
|
115
125
|
}.freeze
|
|
116
126
|
|
|
@@ -126,7 +136,7 @@ module WebhooksAndCallbacksApi
|
|
|
126
136
|
def self.build_default_config_from_env
|
|
127
137
|
# === Core environment ===
|
|
128
138
|
environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
|
|
129
|
-
timeout = (ENV['TIMEOUT'] ||
|
|
139
|
+
timeout = (ENV['TIMEOUT'] || 30).to_f
|
|
130
140
|
max_retries = (ENV['MAX_RETRIES'] || 0).to_i
|
|
131
141
|
retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
|
|
132
142
|
backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
|
|
@@ -145,8 +155,8 @@ module WebhooksAndCallbacksApi
|
|
|
145
155
|
end
|
|
146
156
|
|
|
147
157
|
# === Authentication credentials ===
|
|
158
|
+
petstore_auth_credentials = PetstoreAuthCredentials.from_env
|
|
148
159
|
api_key_credentials = ApiKeyCredentials.from_env
|
|
149
|
-
bearer_auth_credentials = BearerAuthCredentials.from_env
|
|
150
160
|
|
|
151
161
|
# === Proxy settings ===
|
|
152
162
|
proxy_settings = ProxySettings.from_env
|
|
@@ -161,8 +171,8 @@ module WebhooksAndCallbacksApi
|
|
|
161
171
|
backoff_factor: backoff_factor,
|
|
162
172
|
retry_statuses: retry_statuses,
|
|
163
173
|
retry_methods: retry_methods,
|
|
174
|
+
petstore_auth_credentials: petstore_auth_credentials,
|
|
164
175
|
api_key_credentials: api_key_credentials,
|
|
165
|
-
bearer_auth_credentials: bearer_auth_credentials,
|
|
166
176
|
proxy_settings: proxy_settings,
|
|
167
177
|
logging_configuration: logging_configuration
|
|
168
178
|
)
|
data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/exceptions/api_exception.rb
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
3
|
# This file was automatically generated by
|
|
4
4
|
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
7
|
# Class for exceptions when there is a network error, status code error, etc.
|
|
8
8
|
class APIException < CoreLibrary::ApiException
|
|
9
9
|
# Provides a human-readable string representation of the object.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
|
+
# OAuth 2 Authorization endpoint exception.
|
|
8
|
+
class OauthProviderException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Gets or sets error code.
|
|
13
|
+
# @return [OauthProviderError]
|
|
14
|
+
attr_accessor :error
|
|
15
|
+
|
|
16
|
+
# Gets or sets human-readable text providing additional information on
|
|
17
|
+
# error.
|
|
18
|
+
# Used to assist the client developer in understanding the error that
|
|
19
|
+
# occurred.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :error_description
|
|
22
|
+
|
|
23
|
+
# Gets or sets a URI identifying a human-readable web page with information
|
|
24
|
+
# about the error, used to provide the client developer with additional
|
|
25
|
+
# information about the error.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :error_uri
|
|
28
|
+
|
|
29
|
+
# The constructor.
|
|
30
|
+
# @param [String] reason The reason for raising an exception.
|
|
31
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
32
|
+
def initialize(reason, response)
|
|
33
|
+
super(reason, response)
|
|
34
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
35
|
+
unbox(hash)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Populates this object by extracting properties from a hash.
|
|
39
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
40
|
+
# response body.
|
|
41
|
+
def unbox(hash)
|
|
42
|
+
return nil unless hash
|
|
43
|
+
|
|
44
|
+
@error = hash.key?('error') ? hash['error'] : nil
|
|
45
|
+
@error_description =
|
|
46
|
+
hash.key?('error_description') ? hash['error_description'] : SKIP
|
|
47
|
+
@error_uri = hash.key?('error_uri') ? hash['error_uri'] : SKIP
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides a human-readable string representation of the object.
|
|
51
|
+
def to_s
|
|
52
|
+
class_name = self.class.name.split('::').last
|
|
53
|
+
"<#{class_name} error: #{@error}, error_description: #{@error_description}, error_uri:"\
|
|
54
|
+
" #{@error_uri}>"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
58
|
+
def inspect
|
|
59
|
+
class_name = self.class.name.split('::').last
|
|
60
|
+
"<#{class_name} error: #{@error.inspect}, error_description: #{@error_description.inspect},"\
|
|
61
|
+
" error_uri: #{@error_uri.inspect}>"
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
3
|
# This file was automatically generated by
|
|
4
4
|
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
7
|
# Http response received.
|
|
8
8
|
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
9
|
# The constructor
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
3
|
# This file was automatically generated by
|
|
4
4
|
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
7
|
# Utility class for custom header authorization.
|
|
8
8
|
class ApiKey < CoreLibrary::HeaderAuth
|
|
9
9
|
# Display error message on occurrence of authentication failure.
|
|
10
10
|
# @returns [String] The oAuth error message.
|
|
11
11
|
def error_message
|
|
12
|
-
'ApiKey:
|
|
12
|
+
'ApiKey: api_key is undefined.'
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# Initialization constructor.
|
|
16
16
|
def initialize(api_key_credentials)
|
|
17
17
|
auth_params = {}
|
|
18
|
-
auth_params['
|
|
19
|
-
api_key_credentials.nil? || api_key_credentials.
|
|
18
|
+
auth_params['api_key'] = api_key_credentials.api_key unless
|
|
19
|
+
api_key_credentials.nil? || api_key_credentials.api_key.nil?
|
|
20
20
|
|
|
21
21
|
super auth_params
|
|
22
22
|
end
|
|
@@ -25,28 +25,28 @@ module WebhooksAndCallbacksApi
|
|
|
25
25
|
# Data class for ApiKeyCredentials.
|
|
26
26
|
# Data class for ApiKeyCredentials.
|
|
27
27
|
class ApiKeyCredentials
|
|
28
|
-
attr_reader :
|
|
28
|
+
attr_reader :api_key
|
|
29
29
|
|
|
30
|
-
def initialize(
|
|
31
|
-
raise ArgumentError, '
|
|
30
|
+
def initialize(api_key:)
|
|
31
|
+
raise ArgumentError, 'api_key cannot be nil' if api_key.nil?
|
|
32
32
|
|
|
33
|
-
@
|
|
33
|
+
@api_key = api_key
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def self.from_env
|
|
37
|
-
|
|
37
|
+
api_key = ENV['API_KEY_API_KEY']
|
|
38
38
|
all_nil = [
|
|
39
|
-
|
|
39
|
+
api_key
|
|
40
40
|
].all?(&:nil?)
|
|
41
41
|
return nil if all_nil
|
|
42
42
|
|
|
43
|
-
new(
|
|
43
|
+
new(api_key: api_key)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def clone_with(
|
|
47
|
-
|
|
46
|
+
def clone_with(api_key: nil)
|
|
47
|
+
api_key ||= self.api_key
|
|
48
48
|
|
|
49
|
-
ApiKeyCredentials.new(
|
|
49
|
+
ApiKeyCredentials.new(api_key: api_key)
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
end
|