sdksio-apimatic-sdk 3.0.0 → 3.0.1
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/LICENSE +1 -1
- data/README.md +165 -77
- data/bin/console +15 -0
- data/lib/apimatic_api/api_helper.rb +10 -10
- data/lib/apimatic_api/client.rb +108 -96
- data/lib/apimatic_api/configuration.rb +198 -125
- data/lib/apimatic_api/controllers/api_validation_external_apis_controller.rb +90 -84
- data/lib/apimatic_api/controllers/api_validation_v2_external_apis_controller.rb +89 -0
- data/lib/apimatic_api/controllers/base_controller.rb +55 -66
- data/lib/apimatic_api/controllers/code_generation_external_apis_controller.rb +201 -178
- data/lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb +110 -0
- data/lib/apimatic_api/controllers/docs_portal_management_controller.rb +56 -198
- data/lib/apimatic_api/controllers/sdk_generation_async_controller.rb +112 -0
- data/lib/apimatic_api/controllers/transformation_controller.rb +180 -174
- data/lib/apimatic_api/exceptions/api_exception.rb +21 -10
- data/lib/apimatic_api/exceptions/bad_request_response_sdk_exception.rb +46 -0
- data/lib/apimatic_api/exceptions/internal_server_error_response_exception.rb +46 -0
- data/lib/apimatic_api/exceptions/problem_details_exception.rb +74 -0
- data/lib/apimatic_api/exceptions/unauthorized_response_exception.rb +46 -0
- data/lib/apimatic_api/http/api_response.rb +19 -0
- data/lib/apimatic_api/http/auth/custom_header_authentication.rb +48 -38
- data/lib/apimatic_api/http/http_call_back.rb +10 -10
- data/lib/apimatic_api/http/http_method_enum.rb +10 -10
- data/lib/apimatic_api/http/http_request.rb +10 -10
- data/lib/apimatic_api/http/http_response.rb +10 -10
- data/lib/apimatic_api/http/proxy_settings.rb +22 -0
- data/lib/apimatic_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/apimatic_api/logging/sdk_logger.rb +17 -0
- data/lib/apimatic_api/models/accept.rb +26 -0
- data/lib/apimatic_api/models/api_validation_summary.rb +100 -75
- data/lib/apimatic_api/models/base_model.rb +110 -62
- data/lib/apimatic_api/models/content_type.rb +26 -0
- data/lib/apimatic_api/models/export_formats.rb +85 -60
- data/lib/apimatic_api/models/generate_sdk_via_url_request.rb +85 -59
- data/lib/apimatic_api/models/line_info.rb +105 -0
- data/lib/apimatic_api/models/links.rb +82 -0
- data/lib/apimatic_api/models/platforms.rb +57 -39
- data/lib/apimatic_api/models/portal_generation_async_response.rb +68 -0
- data/lib/apimatic_api/models/portal_generation_status_response.rb +70 -0
- data/lib/apimatic_api/models/sdk_generation_async_response.rb +68 -0
- data/lib/apimatic_api/models/sdk_generation_status_response.rb +70 -0
- data/lib/apimatic_api/models/sdk_languages.rb +56 -0
- data/lib/apimatic_api/models/status.rb +48 -0
- data/lib/apimatic_api/models/transform_via_url_request.rb +85 -60
- data/lib/apimatic_api/models/transformation.rb +180 -152
- data/lib/apimatic_api/models/user_code_generation.rb +167 -140
- data/lib/apimatic_api/models/validate_api_result.rb +82 -0
- data/lib/apimatic_api/models/validation_entry.rb +143 -0
- data/lib/apimatic_api/models/validation_summary.rb +145 -0
- data/lib/apimatic_api/utilities/date_time_helper.rb +11 -11
- data/lib/apimatic_api/utilities/file_wrapper.rb +28 -16
- data/lib/apimatic_api.rb +79 -86
- metadata +39 -89
- data/lib/apimatic_api/controllers/api_validation_imported_apis_controller.rb +0 -74
- data/lib/apimatic_api/controllers/apis_management_controller.rb +0 -260
- data/lib/apimatic_api/controllers/code_generation_imported_apis_controller.rb +0 -136
- data/lib/apimatic_api/models/api_entity.rb +0 -220
- data/lib/apimatic_api/models/api_entity_code_generation.rb +0 -131
- data/lib/apimatic_api/models/api_entity_identifier.rb +0 -48
- data/lib/apimatic_api/models/attributes.rb +0 -48
- data/lib/apimatic_api/models/auth_scope.rb +0 -75
- data/lib/apimatic_api/models/authentication.rb +0 -112
- data/lib/apimatic_api/models/code_gen_settings.rb +0 -541
- data/lib/apimatic_api/models/code_generation.rb +0 -122
- data/lib/apimatic_api/models/docs_validation_summary.rb +0 -75
- data/lib/apimatic_api/models/endpoints_group.rb +0 -57
- data/lib/apimatic_api/models/environment.rb +0 -79
- data/lib/apimatic_api/models/field.rb +0 -156
- data/lib/apimatic_api/models/generate_on_prem_portal_via_build_input_request_body.rb +0 -48
- data/lib/apimatic_api/models/generate_sdk_via_file_request_body.rb +0 -61
- data/lib/apimatic_api/models/import_api_version_via_url_request.rb +0 -64
- data/lib/apimatic_api/models/import_api_via_file_request_body.rb +0 -51
- data/lib/apimatic_api/models/import_api_via_url_request.rb +0 -49
- data/lib/apimatic_api/models/import_new_api_version_via_file_request_body.rb +0 -66
- data/lib/apimatic_api/models/import_validation_summary.rb +0 -75
- data/lib/apimatic_api/models/inplace_api_import_binary_file.rb +0 -51
- data/lib/apimatic_api/models/inplace_import_api_via_url_request.rb +0 -49
- data/lib/apimatic_api/models/meta_data.rb +0 -70
- data/lib/apimatic_api/models/parameter.rb +0 -165
- data/lib/apimatic_api/models/paramter_format_details.rb +0 -48
- data/lib/apimatic_api/models/platforms_template.rb +0 -49
- data/lib/apimatic_api/models/server.rb +0 -69
- data/lib/apimatic_api/models/server_configuration.rb +0 -105
- data/lib/apimatic_api/models/test_gen_settings.rb +0 -70
- data/lib/apimatic_api/models/transform_via_file_request_body.rb +0 -61
- data/lib/apimatic_api/models/user_code_generation_requirements.rb +0 -57
- data/lib/apimatic_api/models/validate_api_via_file_request_body.rb +0 -51
- data/test/controllers/controller_test_base.rb +0 -29
- data/test/controllers/test_api_validation_external_apis_controller.rb +0 -144
- data/test/controllers/test_api_validation_imported_apis_controller.rb +0 -2971
- data/test/controllers/test_code_generation_external_apis_controller.rb +0 -32
- data/test/controllers/test_docs_portal_management_controller.rb +0 -94
- data/test/controllers/test_transformation_controller.rb +0 -32
- data/test/http_response_catcher.rb +0 -19
|
@@ -1,174 +1,180 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# TransformationController
|
|
8
|
-
class TransformationController < BaseController
|
|
9
|
-
# Transform an API into any of the supported API specification formats by
|
|
10
|
-
# uploading the API specification file.
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# [
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
# @
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
#
|
|
158
|
-
#
|
|
159
|
-
#
|
|
160
|
-
#
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# TransformationController
|
|
8
|
+
class TransformationController < BaseController
|
|
9
|
+
# Transform an API into any of the supported API specification formats by
|
|
10
|
+
# uploading the API specification file.
|
|
11
|
+
# This endpoint transforms and then uploads the transformed API
|
|
12
|
+
# specification to APIMatic's cloud storage. An ID for the transformation
|
|
13
|
+
# performed is returned as part of the response.
|
|
14
|
+
# @param [ContentType] content_type Required parameter: Example:
|
|
15
|
+
# @param [File | UploadIO] file Required parameter: The API specification
|
|
16
|
+
# file.<br>The type of the specification file should be any of the
|
|
17
|
+
# [supported
|
|
18
|
+
# formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
|
|
19
|
+
# ported-input-formats).
|
|
20
|
+
# @param [ExportFormats] export_format Required parameter: The structure
|
|
21
|
+
# contains API specification formats that Transformer can convert to.
|
|
22
|
+
# @param [Hash] _query_parameters Additional optional query parameters are
|
|
23
|
+
# supported by this endpoint.
|
|
24
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
25
|
+
def transform_via_file(content_type,
|
|
26
|
+
file,
|
|
27
|
+
export_format,
|
|
28
|
+
_query_parameters: nil)
|
|
29
|
+
@api_call
|
|
30
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
31
|
+
'/transformations/transform-via-file',
|
|
32
|
+
Server::DEFAULT)
|
|
33
|
+
.multipart_param(new_parameter(file, key: 'file')
|
|
34
|
+
.is_required(true)
|
|
35
|
+
.default_content_type('application/octet-stream'))
|
|
36
|
+
.form_param(new_parameter(export_format, key: 'export_format')
|
|
37
|
+
.is_required(true))
|
|
38
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
39
|
+
.additional_query_params(_query_parameters)
|
|
40
|
+
.auth(Single.new('Authorization')))
|
|
41
|
+
.response(new_response_handler
|
|
42
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
43
|
+
.deserialize_into(Transformation.method(:from_hash))
|
|
44
|
+
.is_api_response(true))
|
|
45
|
+
.execute
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Transform an API into any of the supported API specification formats by
|
|
49
|
+
# providing the URL of the API specification file.
|
|
50
|
+
# This endpoint transforms and then uploads the transformed API
|
|
51
|
+
# specification to APIMatic's cloud storage. An ID for the transformation
|
|
52
|
+
# performed is returned as part of the response.
|
|
53
|
+
# @param [TransformViaUrlRequest] body Required parameter: Request Body
|
|
54
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
55
|
+
def transform_via_url(body)
|
|
56
|
+
@api_call
|
|
57
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
58
|
+
'/transformations/transform-via-url',
|
|
59
|
+
Server::DEFAULT)
|
|
60
|
+
.header_param(new_parameter('application/vnd.apimatic.urlTransformDto.v1+json', key: 'Content-Type'))
|
|
61
|
+
.body_param(new_parameter(body)
|
|
62
|
+
.is_required(true))
|
|
63
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
64
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
65
|
+
.auth(Single.new('Authorization')))
|
|
66
|
+
.response(new_response_handler
|
|
67
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
68
|
+
.deserialize_into(Transformation.method(:from_hash))
|
|
69
|
+
.is_api_response(true))
|
|
70
|
+
.execute
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Download the transformed API specification file transformed via the
|
|
74
|
+
# Transformation endpoints.
|
|
75
|
+
# @param [String] transformation_id Required parameter: The ID of
|
|
76
|
+
# transformation received in the response of the [Transform Via File
|
|
77
|
+
# ]($e/Transformation/Transform%20via%20File) or [Transform Via URL
|
|
78
|
+
# ]($e/Transformation/Transform%20via%20URL) calls.
|
|
79
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
80
|
+
def download_transformed_file(transformation_id)
|
|
81
|
+
@api_call
|
|
82
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
83
|
+
'/transformations/{transformation_id}/converted-file',
|
|
84
|
+
Server::DEFAULT)
|
|
85
|
+
.template_param(new_parameter(transformation_id, key: 'transformation_id')
|
|
86
|
+
.is_required(true)
|
|
87
|
+
.should_encode(true))
|
|
88
|
+
.auth(Single.new('Authorization')))
|
|
89
|
+
.response(new_response_handler
|
|
90
|
+
.is_api_response(true))
|
|
91
|
+
.execute
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Download the API Specification file used as input for a particular
|
|
95
|
+
# Transformation performed via the Transformation endpoints.
|
|
96
|
+
# @param [String] transformation_id Required parameter: The ID of the
|
|
97
|
+
# transformation to download the API specification for. The transformation
|
|
98
|
+
# ID is received in the response of the [Transform Via File
|
|
99
|
+
# ]($e/Transformation/Transform%20via%20File) or [Transform Via
|
|
100
|
+
# URL]($e/Transformation/Transform%20via%20URL) calls.
|
|
101
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
102
|
+
def download_input_file(transformation_id)
|
|
103
|
+
@api_call
|
|
104
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
105
|
+
'/transformations/{transformation_id}/input-file',
|
|
106
|
+
Server::DEFAULT)
|
|
107
|
+
.template_param(new_parameter(transformation_id, key: 'transformation_id')
|
|
108
|
+
.is_required(true)
|
|
109
|
+
.should_encode(true))
|
|
110
|
+
.auth(Single.new('Authorization')))
|
|
111
|
+
.response(new_response_handler
|
|
112
|
+
.is_api_response(true))
|
|
113
|
+
.execute
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Get a list of all API transformations performed.
|
|
117
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
118
|
+
def list_all_transformations
|
|
119
|
+
@api_call
|
|
120
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
121
|
+
'/transformations',
|
|
122
|
+
Server::DEFAULT)
|
|
123
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
124
|
+
.auth(Single.new('Authorization')))
|
|
125
|
+
.response(new_response_handler
|
|
126
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
127
|
+
.deserialize_into(Transformation.method(:from_hash))
|
|
128
|
+
.is_api_response(true)
|
|
129
|
+
.is_response_array(true))
|
|
130
|
+
.execute
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Get details on a particular Transformation performed via the
|
|
134
|
+
# Transformation endpoints.
|
|
135
|
+
# @param [String] transformation_id Required parameter: The ID of the
|
|
136
|
+
# transformation to fetch. The transformation ID is received in the response
|
|
137
|
+
# of the [Transform Via File ]($e/Transformation/Transform%20via%20File) or
|
|
138
|
+
# [Transform Via URL ]($e/Transformation/Transform%20via%20URL) calls.
|
|
139
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
140
|
+
def get_a_transformation(transformation_id)
|
|
141
|
+
@api_call
|
|
142
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
143
|
+
'/transformations/{transformation_id}',
|
|
144
|
+
Server::DEFAULT)
|
|
145
|
+
.template_param(new_parameter(transformation_id, key: 'transformation_id')
|
|
146
|
+
.is_required(true)
|
|
147
|
+
.should_encode(true))
|
|
148
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
149
|
+
.auth(Single.new('Authorization')))
|
|
150
|
+
.response(new_response_handler
|
|
151
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
152
|
+
.deserialize_into(Transformation.method(:from_hash))
|
|
153
|
+
.is_api_response(true))
|
|
154
|
+
.execute
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Delete a particular Transformation performed for an API via the
|
|
158
|
+
# Transformation endpoints.
|
|
159
|
+
# @param [String] transformation_id Required parameter: The ID of the
|
|
160
|
+
# transformation to delete. The transformation ID is received in the
|
|
161
|
+
# response of the [Transform Via File
|
|
162
|
+
# ]($e/Transformation/Transform%20via%20File) or [Transform Via
|
|
163
|
+
# URL]($e/Transformation/Transform%20via%20URL) calls.
|
|
164
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
165
|
+
def delete_transformation(transformation_id)
|
|
166
|
+
@api_call
|
|
167
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
168
|
+
'/transformations/{transformation_id}',
|
|
169
|
+
Server::DEFAULT)
|
|
170
|
+
.template_param(new_parameter(transformation_id, key: 'transformation_id')
|
|
171
|
+
.is_required(true)
|
|
172
|
+
.should_encode(true))
|
|
173
|
+
.auth(Single.new('Authorization')))
|
|
174
|
+
.response(new_response_handler
|
|
175
|
+
.is_response_void(true)
|
|
176
|
+
.is_api_response(true))
|
|
177
|
+
.execute
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# Class for exceptions when there is a network error, status code error, etc.
|
|
8
|
-
class APIException < CoreLibrary::ApiException
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# Class for exceptions when there is a network error, status code error, etc.
|
|
8
|
+
class APIException < CoreLibrary::ApiException
|
|
9
|
+
# Provides a human-readable string representation of the object.
|
|
10
|
+
def to_s
|
|
11
|
+
class_name = self.class.name.split('::').last
|
|
12
|
+
"<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
16
|
+
def inspect
|
|
17
|
+
class_name = self.class.name.split('::').last
|
|
18
|
+
"<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# Standard JSON error response for bad requests
|
|
8
|
+
class BadRequestResponseSdkException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Error message describing the bad request
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# The constructor.
|
|
17
|
+
# @param [String] reason The reason for raising an exception.
|
|
18
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
19
|
+
def initialize(reason, response)
|
|
20
|
+
super(reason, response)
|
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
22
|
+
unbox(hash)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Populates this object by extracting properties from a hash.
|
|
26
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
27
|
+
# response body.
|
|
28
|
+
def unbox(hash)
|
|
29
|
+
return nil unless hash
|
|
30
|
+
|
|
31
|
+
@message = hash.key?('message') ? hash['message'] : SKIP
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Provides a human-readable string representation of the object.
|
|
35
|
+
def to_s
|
|
36
|
+
class_name = self.class.name.split('::').last
|
|
37
|
+
"<#{class_name} message: #{@message}>"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
41
|
+
def inspect
|
|
42
|
+
class_name = self.class.name.split('::').last
|
|
43
|
+
"<#{class_name} message: #{@message.inspect}>"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# InternalServerErrorResponse class.
|
|
8
|
+
class InternalServerErrorResponseException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# The constructor.
|
|
17
|
+
# @param [String] reason The reason for raising an exception.
|
|
18
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
19
|
+
def initialize(reason, response)
|
|
20
|
+
super(reason, response)
|
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
22
|
+
unbox(hash)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Populates this object by extracting properties from a hash.
|
|
26
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
27
|
+
# response body.
|
|
28
|
+
def unbox(hash)
|
|
29
|
+
return nil unless hash
|
|
30
|
+
|
|
31
|
+
@message = hash.key?('message') ? hash['message'] : SKIP
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Provides a human-readable string representation of the object.
|
|
35
|
+
def to_s
|
|
36
|
+
class_name = self.class.name.split('::').last
|
|
37
|
+
"<#{class_name} message: #{@message}>"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
41
|
+
def inspect
|
|
42
|
+
class_name = self.class.name.split('::').last
|
|
43
|
+
"<#{class_name} message: #{@message.inspect}>"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# ProblemDetails class.
|
|
8
|
+
class ProblemDetailsException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :type
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :title
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :status
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :detail
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for this method
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :instance
|
|
31
|
+
|
|
32
|
+
# TODO: Write general description for this method
|
|
33
|
+
# @return [Hash[String, Object]]
|
|
34
|
+
attr_accessor :errors
|
|
35
|
+
|
|
36
|
+
# The constructor.
|
|
37
|
+
# @param [String] reason The reason for raising an exception.
|
|
38
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
39
|
+
def initialize(reason, response)
|
|
40
|
+
super(reason, response)
|
|
41
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
42
|
+
unbox(hash)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Populates this object by extracting properties from a hash.
|
|
46
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
47
|
+
# response body.
|
|
48
|
+
def unbox(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
@type = hash.key?('type') ? hash['type'] : SKIP
|
|
52
|
+
@title = hash.key?('title') ? hash['title'] : SKIP
|
|
53
|
+
@status = hash.key?('status') ? hash['status'] : SKIP
|
|
54
|
+
@detail = hash.key?('detail') ? hash['detail'] : SKIP
|
|
55
|
+
@instance = hash.key?('instance') ? hash['instance'] : SKIP
|
|
56
|
+
@errors = hash.key?('errors') ? hash['errors'] : SKIP
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} type: #{@type}, title: #{@title}, status: #{@status}, detail: #{@detail},"\
|
|
63
|
+
" instance: #{@instance}, errors: #{@errors}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} type: #{@type.inspect}, title: #{@title.inspect}, status:"\
|
|
70
|
+
" #{@status.inspect}, detail: #{@detail.inspect}, instance: #{@instance.inspect}, errors:"\
|
|
71
|
+
" #{@errors.inspect}>"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# UnauthorizedResponse class.
|
|
8
|
+
class UnauthorizedResponseException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# The constructor.
|
|
17
|
+
# @param [String] reason The reason for raising an exception.
|
|
18
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
19
|
+
def initialize(reason, response)
|
|
20
|
+
super(reason, response)
|
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
22
|
+
unbox(hash)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Populates this object by extracting properties from a hash.
|
|
26
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
27
|
+
# response body.
|
|
28
|
+
def unbox(hash)
|
|
29
|
+
return nil unless hash
|
|
30
|
+
|
|
31
|
+
@message = hash.key?('message') ? hash['message'] : SKIP
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Provides a human-readable string representation of the object.
|
|
35
|
+
def to_s
|
|
36
|
+
class_name = self.class.name.split('::').last
|
|
37
|
+
"<#{class_name} message: #{@message}>"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
41
|
+
def inspect
|
|
42
|
+
class_name = self.class.name.split('::').last
|
|
43
|
+
"<#{class_name} message: #{@message.inspect}>"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# Http response received.
|
|
8
|
+
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
|
+
# The constructor
|
|
10
|
+
# @param [HttpResponse] http_response The original, raw response from the api.
|
|
11
|
+
# @param [Object] data The data field specified for the response.
|
|
12
|
+
# @param [Array<String>] errors Any errors returned by the server.
|
|
13
|
+
def initialize(http_response,
|
|
14
|
+
data: nil,
|
|
15
|
+
errors: nil)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|