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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +165 -77
  4. data/bin/console +15 -0
  5. data/lib/apimatic_api/api_helper.rb +10 -10
  6. data/lib/apimatic_api/client.rb +108 -96
  7. data/lib/apimatic_api/configuration.rb +198 -125
  8. data/lib/apimatic_api/controllers/api_validation_external_apis_controller.rb +90 -84
  9. data/lib/apimatic_api/controllers/api_validation_v2_external_apis_controller.rb +89 -0
  10. data/lib/apimatic_api/controllers/base_controller.rb +55 -66
  11. data/lib/apimatic_api/controllers/code_generation_external_apis_controller.rb +201 -178
  12. data/lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb +110 -0
  13. data/lib/apimatic_api/controllers/docs_portal_management_controller.rb +56 -198
  14. data/lib/apimatic_api/controllers/sdk_generation_async_controller.rb +112 -0
  15. data/lib/apimatic_api/controllers/transformation_controller.rb +180 -174
  16. data/lib/apimatic_api/exceptions/api_exception.rb +21 -10
  17. data/lib/apimatic_api/exceptions/bad_request_response_sdk_exception.rb +46 -0
  18. data/lib/apimatic_api/exceptions/internal_server_error_response_exception.rb +46 -0
  19. data/lib/apimatic_api/exceptions/problem_details_exception.rb +74 -0
  20. data/lib/apimatic_api/exceptions/unauthorized_response_exception.rb +46 -0
  21. data/lib/apimatic_api/http/api_response.rb +19 -0
  22. data/lib/apimatic_api/http/auth/custom_header_authentication.rb +48 -38
  23. data/lib/apimatic_api/http/http_call_back.rb +10 -10
  24. data/lib/apimatic_api/http/http_method_enum.rb +10 -10
  25. data/lib/apimatic_api/http/http_request.rb +10 -10
  26. data/lib/apimatic_api/http/http_response.rb +10 -10
  27. data/lib/apimatic_api/http/proxy_settings.rb +22 -0
  28. data/lib/apimatic_api/logging/configuration/api_logging_configuration.rb +186 -0
  29. data/lib/apimatic_api/logging/sdk_logger.rb +17 -0
  30. data/lib/apimatic_api/models/accept.rb +26 -0
  31. data/lib/apimatic_api/models/api_validation_summary.rb +100 -75
  32. data/lib/apimatic_api/models/base_model.rb +110 -62
  33. data/lib/apimatic_api/models/content_type.rb +26 -0
  34. data/lib/apimatic_api/models/export_formats.rb +85 -60
  35. data/lib/apimatic_api/models/generate_sdk_via_url_request.rb +85 -59
  36. data/lib/apimatic_api/models/line_info.rb +105 -0
  37. data/lib/apimatic_api/models/links.rb +82 -0
  38. data/lib/apimatic_api/models/platforms.rb +57 -39
  39. data/lib/apimatic_api/models/portal_generation_async_response.rb +68 -0
  40. data/lib/apimatic_api/models/portal_generation_status_response.rb +70 -0
  41. data/lib/apimatic_api/models/sdk_generation_async_response.rb +68 -0
  42. data/lib/apimatic_api/models/sdk_generation_status_response.rb +70 -0
  43. data/lib/apimatic_api/models/sdk_languages.rb +56 -0
  44. data/lib/apimatic_api/models/status.rb +48 -0
  45. data/lib/apimatic_api/models/transform_via_url_request.rb +85 -60
  46. data/lib/apimatic_api/models/transformation.rb +180 -152
  47. data/lib/apimatic_api/models/user_code_generation.rb +167 -140
  48. data/lib/apimatic_api/models/validate_api_result.rb +82 -0
  49. data/lib/apimatic_api/models/validation_entry.rb +143 -0
  50. data/lib/apimatic_api/models/validation_summary.rb +145 -0
  51. data/lib/apimatic_api/utilities/date_time_helper.rb +11 -11
  52. data/lib/apimatic_api/utilities/file_wrapper.rb +28 -16
  53. data/lib/apimatic_api.rb +79 -86
  54. metadata +39 -89
  55. data/lib/apimatic_api/controllers/api_validation_imported_apis_controller.rb +0 -74
  56. data/lib/apimatic_api/controllers/apis_management_controller.rb +0 -260
  57. data/lib/apimatic_api/controllers/code_generation_imported_apis_controller.rb +0 -136
  58. data/lib/apimatic_api/models/api_entity.rb +0 -220
  59. data/lib/apimatic_api/models/api_entity_code_generation.rb +0 -131
  60. data/lib/apimatic_api/models/api_entity_identifier.rb +0 -48
  61. data/lib/apimatic_api/models/attributes.rb +0 -48
  62. data/lib/apimatic_api/models/auth_scope.rb +0 -75
  63. data/lib/apimatic_api/models/authentication.rb +0 -112
  64. data/lib/apimatic_api/models/code_gen_settings.rb +0 -541
  65. data/lib/apimatic_api/models/code_generation.rb +0 -122
  66. data/lib/apimatic_api/models/docs_validation_summary.rb +0 -75
  67. data/lib/apimatic_api/models/endpoints_group.rb +0 -57
  68. data/lib/apimatic_api/models/environment.rb +0 -79
  69. data/lib/apimatic_api/models/field.rb +0 -156
  70. data/lib/apimatic_api/models/generate_on_prem_portal_via_build_input_request_body.rb +0 -48
  71. data/lib/apimatic_api/models/generate_sdk_via_file_request_body.rb +0 -61
  72. data/lib/apimatic_api/models/import_api_version_via_url_request.rb +0 -64
  73. data/lib/apimatic_api/models/import_api_via_file_request_body.rb +0 -51
  74. data/lib/apimatic_api/models/import_api_via_url_request.rb +0 -49
  75. data/lib/apimatic_api/models/import_new_api_version_via_file_request_body.rb +0 -66
  76. data/lib/apimatic_api/models/import_validation_summary.rb +0 -75
  77. data/lib/apimatic_api/models/inplace_api_import_binary_file.rb +0 -51
  78. data/lib/apimatic_api/models/inplace_import_api_via_url_request.rb +0 -49
  79. data/lib/apimatic_api/models/meta_data.rb +0 -70
  80. data/lib/apimatic_api/models/parameter.rb +0 -165
  81. data/lib/apimatic_api/models/paramter_format_details.rb +0 -48
  82. data/lib/apimatic_api/models/platforms_template.rb +0 -49
  83. data/lib/apimatic_api/models/server.rb +0 -69
  84. data/lib/apimatic_api/models/server_configuration.rb +0 -105
  85. data/lib/apimatic_api/models/test_gen_settings.rb +0 -70
  86. data/lib/apimatic_api/models/transform_via_file_request_body.rb +0 -61
  87. data/lib/apimatic_api/models/user_code_generation_requirements.rb +0 -57
  88. data/lib/apimatic_api/models/validate_api_via_file_request_body.rb +0 -51
  89. data/test/controllers/controller_test_base.rb +0 -29
  90. data/test/controllers/test_api_validation_external_apis_controller.rb +0 -144
  91. data/test/controllers/test_api_validation_imported_apis_controller.rb +0 -2971
  92. data/test/controllers/test_code_generation_external_apis_controller.rb +0 -32
  93. data/test/controllers/test_docs_portal_management_controller.rb +0 -94
  94. data/test/controllers/test_transformation_controller.rb +0 -32
  95. data/test/http_response_catcher.rb +0 -19
@@ -1,174 +1,180 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://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. This endpoint transforms and then
11
- # uploads the transformed API specification to APIMatic's cloud storage. An
12
- # ID for the transformation performed is returned as part of the response.
13
- # @param [File | UploadIO] file Required parameter: The API specification
14
- # file.<br>The type of the specification file should be any of the
15
- # [supported
16
- # formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
17
- # ported-input-formats).
18
- # @param [ExportFormats] export_format Required parameter: The structure
19
- # contains API specification formats that Transformer can convert to.
20
- # @return [Transformation] response from the API call
21
- def transform_via_file(file,
22
- export_format)
23
- new_api_call_builder
24
- .request(new_request_builder(HttpMethodEnum::POST,
25
- '/transformations/transform-via-file',
26
- Server::DEFAULT)
27
- .multipart_param(new_parameter(file, key: 'file')
28
- .default_content_type('application/octet-stream'))
29
- .form_param(new_parameter(export_format, key: 'export_format'))
30
- .header_param(new_parameter('application/json', key: 'accept'))
31
- .auth(Single.new('Authorization')))
32
- .response(new_response_handler
33
- .deserializer(APIHelper.method(:custom_type_deserializer))
34
- .deserialize_into(Transformation.method(:from_hash)))
35
- .execute
36
- end
37
-
38
- # Transform an API into any of the supported API specification formats by
39
- # providing the URL of the API specification file.
40
- # This endpoint transforms and then uploads the transformed API
41
- # specification to APIMatic's cloud storage. An ID for the transformation
42
- # performed is returned as part of the response.
43
- # @param [TransformViaUrlRequest] body Required parameter: Request Body
44
- # @return [Transformation] response from the API call
45
- def transform_via_url(body)
46
- new_api_call_builder
47
- .request(new_request_builder(HttpMethodEnum::POST,
48
- '/transformations/transform-via-url',
49
- Server::DEFAULT)
50
- .header_param(new_parameter('application/vnd.apimatic.urlTransformDto.v1+json', key: 'Content-Type'))
51
- .body_param(new_parameter(body))
52
- .header_param(new_parameter('application/json', key: 'accept'))
53
- .body_serializer(proc do |param| param.to_json unless param.nil? end)
54
- .auth(Single.new('Authorization')))
55
- .response(new_response_handler
56
- .deserializer(APIHelper.method(:custom_type_deserializer))
57
- .deserialize_into(Transformation.method(:from_hash)))
58
- .execute
59
- end
60
-
61
- # Download the transformed API specification file transformed via the
62
- # Transformation endpoints.
63
- # @param [String] transformation_id Required parameter: The ID of
64
- # transformation received in the response of the [Transform Via File
65
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
66
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-file) or
67
- # [Transform Via URL
68
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
69
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-url) calls.
70
- # @return [Binary] response from the API call
71
- def download_transformed_file(transformation_id)
72
- new_api_call_builder
73
- .request(new_request_builder(HttpMethodEnum::GET,
74
- '/transformations/{transformation_id}/converted-file',
75
- Server::DEFAULT)
76
- .template_param(new_parameter(transformation_id, key: 'transformation_id')
77
- .should_encode(true))
78
- .auth(Single.new('Authorization')))
79
- .response(new_response_handler)
80
- .execute
81
- end
82
-
83
- # Download the API Specification file used as input for a particular
84
- # Transformation performed via the Transformation endpoints.
85
- # @param [String] transformation_id Required parameter: The ID of the
86
- # transformation to download the API specification for. The transformation
87
- # ID is received in the response of the [Transform Via File
88
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
89
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-file) or
90
- # [Transform Via
91
- # URL](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c305
92
- # 2d961b/v/3_0#/http/api-endpoints/transformation/transform-via-url)
93
- # calls.
94
- # @return [Binary] response from the API call
95
- def download_input_file_transformation(transformation_id)
96
- new_api_call_builder
97
- .request(new_request_builder(HttpMethodEnum::GET,
98
- '/transformations/{transformation_id}/input-file',
99
- Server::DEFAULT)
100
- .template_param(new_parameter(transformation_id, key: 'transformation_id')
101
- .should_encode(true))
102
- .auth(Single.new('Authorization')))
103
- .response(new_response_handler)
104
- .execute
105
- end
106
-
107
- # Get a list of all API transformations performed.
108
- # @return [Array[Transformation]] response from the API call
109
- def list_all_transformations
110
- new_api_call_builder
111
- .request(new_request_builder(HttpMethodEnum::GET,
112
- '/transformations',
113
- Server::DEFAULT)
114
- .header_param(new_parameter('application/json', key: 'accept'))
115
- .auth(Single.new('Authorization')))
116
- .response(new_response_handler
117
- .deserializer(APIHelper.method(:custom_type_deserializer))
118
- .deserialize_into(Transformation.method(:from_hash))
119
- .is_response_array(true))
120
- .execute
121
- end
122
-
123
- # Get details on a particular Transformation performed via the
124
- # Transformation endpoints.
125
- # @param [String] transformation_id Required parameter: The ID of the
126
- # transformation to fetch. The transformation ID is received in the response
127
- # of the [Transform Via File
128
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
129
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-file) or
130
- # [Transform Via URL
131
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
132
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-url) calls.
133
- # @return [Transformation] response from the API call
134
- def get_a_transformation(transformation_id)
135
- new_api_call_builder
136
- .request(new_request_builder(HttpMethodEnum::GET,
137
- '/transformations/{transformation_id}',
138
- Server::DEFAULT)
139
- .template_param(new_parameter(transformation_id, key: 'transformation_id')
140
- .should_encode(true))
141
- .header_param(new_parameter('application/json', key: 'accept'))
142
- .auth(Single.new('Authorization')))
143
- .response(new_response_handler
144
- .deserializer(APIHelper.method(:custom_type_deserializer))
145
- .deserialize_into(Transformation.method(:from_hash)))
146
- .execute
147
- end
148
-
149
- # Delete a particular Transformation performed for an API via the
150
- # Transformation endpoints.
151
- # @param [String] transformation_id Required parameter: The ID of the
152
- # transformation to delete. The transformation ID is received in the
153
- # response of the [Transform Via File
154
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
155
- # 61b/v/3_0#/http/api-endpoints/transformation/transform-via-file) or
156
- # [Transform Via
157
- # URL](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c305
158
- # 2d961b/v/3_0#/http/api-endpoints/transformation/transform-via-url)
159
- # calls.
160
- # @return [void] response from the API call
161
- def delete_transformation(transformation_id)
162
- new_api_call_builder
163
- .request(new_request_builder(HttpMethodEnum::DELETE,
164
- '/transformations/{transformation_id}',
165
- Server::DEFAULT)
166
- .template_param(new_parameter(transformation_id, key: 'transformation_id')
167
- .should_encode(true))
168
- .auth(Single.new('Authorization')))
169
- .response(new_response_handler
170
- .is_response_void(true))
171
- .execute
172
- end
173
- end
174
- end
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 v2.0
4
- # ( https://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
- end
10
- end
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