sdksio-apimatic-sdk 3.0.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 +7 -0
- data/LICENSE +28 -0
- data/README.md +82 -0
- data/lib/apimatic_api/api_helper.rb +10 -0
- data/lib/apimatic_api/client.rb +96 -0
- data/lib/apimatic_api/configuration.rb +125 -0
- data/lib/apimatic_api/controllers/api_validation_external_apis_controller.rb +84 -0
- data/lib/apimatic_api/controllers/api_validation_imported_apis_controller.rb +74 -0
- data/lib/apimatic_api/controllers/apis_management_controller.rb +260 -0
- data/lib/apimatic_api/controllers/base_controller.rb +66 -0
- data/lib/apimatic_api/controllers/code_generation_external_apis_controller.rb +178 -0
- data/lib/apimatic_api/controllers/code_generation_imported_apis_controller.rb +136 -0
- data/lib/apimatic_api/controllers/docs_portal_management_controller.rb +198 -0
- data/lib/apimatic_api/controllers/transformation_controller.rb +174 -0
- data/lib/apimatic_api/exceptions/api_exception.rb +10 -0
- data/lib/apimatic_api/http/auth/custom_header_authentication.rb +42 -0
- data/lib/apimatic_api/http/http_call_back.rb +10 -0
- data/lib/apimatic_api/http/http_method_enum.rb +10 -0
- data/lib/apimatic_api/http/http_request.rb +10 -0
- data/lib/apimatic_api/http/http_response.rb +10 -0
- data/lib/apimatic_api/models/api_entity.rb +220 -0
- data/lib/apimatic_api/models/api_entity_code_generation.rb +131 -0
- data/lib/apimatic_api/models/api_entity_identifier.rb +48 -0
- data/lib/apimatic_api/models/api_validation_summary.rb +75 -0
- data/lib/apimatic_api/models/attributes.rb +48 -0
- data/lib/apimatic_api/models/auth_scope.rb +75 -0
- data/lib/apimatic_api/models/authentication.rb +112 -0
- data/lib/apimatic_api/models/base_model.rb +62 -0
- data/lib/apimatic_api/models/code_gen_settings.rb +541 -0
- data/lib/apimatic_api/models/code_generation.rb +122 -0
- data/lib/apimatic_api/models/docs_validation_summary.rb +75 -0
- data/lib/apimatic_api/models/endpoints_group.rb +57 -0
- data/lib/apimatic_api/models/environment.rb +79 -0
- data/lib/apimatic_api/models/export_formats.rb +60 -0
- data/lib/apimatic_api/models/field.rb +156 -0
- data/lib/apimatic_api/models/generate_on_prem_portal_via_build_input_request_body.rb +48 -0
- data/lib/apimatic_api/models/generate_sdk_via_file_request_body.rb +61 -0
- data/lib/apimatic_api/models/generate_sdk_via_url_request.rb +59 -0
- data/lib/apimatic_api/models/import_api_version_via_url_request.rb +64 -0
- data/lib/apimatic_api/models/import_api_via_file_request_body.rb +51 -0
- data/lib/apimatic_api/models/import_api_via_url_request.rb +49 -0
- data/lib/apimatic_api/models/import_new_api_version_via_file_request_body.rb +66 -0
- data/lib/apimatic_api/models/import_validation_summary.rb +75 -0
- data/lib/apimatic_api/models/inplace_api_import_binary_file.rb +51 -0
- data/lib/apimatic_api/models/inplace_import_api_via_url_request.rb +49 -0
- data/lib/apimatic_api/models/meta_data.rb +70 -0
- data/lib/apimatic_api/models/parameter.rb +165 -0
- data/lib/apimatic_api/models/paramter_format_details.rb +48 -0
- data/lib/apimatic_api/models/platforms.rb +39 -0
- data/lib/apimatic_api/models/platforms_template.rb +49 -0
- data/lib/apimatic_api/models/server.rb +69 -0
- data/lib/apimatic_api/models/server_configuration.rb +105 -0
- data/lib/apimatic_api/models/test_gen_settings.rb +70 -0
- data/lib/apimatic_api/models/transform_via_file_request_body.rb +61 -0
- data/lib/apimatic_api/models/transform_via_url_request.rb +60 -0
- data/lib/apimatic_api/models/transformation.rb +152 -0
- data/lib/apimatic_api/models/user_code_generation.rb +140 -0
- data/lib/apimatic_api/models/user_code_generation_requirements.rb +57 -0
- data/lib/apimatic_api/models/validate_api_via_file_request_body.rb +51 -0
- data/lib/apimatic_api/utilities/date_time_helper.rb +11 -0
- data/lib/apimatic_api/utilities/file_wrapper.rb +16 -0
- data/lib/apimatic_api.rb +86 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_api_validation_external_apis_controller.rb +144 -0
- data/test/controllers/test_api_validation_imported_apis_controller.rb +2971 -0
- data/test/controllers/test_code_generation_external_apis_controller.rb +32 -0
- data/test/controllers/test_docs_portal_management_controller.rb +94 -0
- data/test/controllers/test_transformation_controller.rb +32 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +187 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# DocsPortalManagementController
|
|
8
|
+
class DocsPortalManagementController < BaseController
|
|
9
|
+
# Publish artifacts for a Hosted Portal.
|
|
10
|
+
# This endpoint regenerates all the artifacts for a hosted portal and
|
|
11
|
+
# uploads them to APIMatic's cloud storage, from where the Portal fetches
|
|
12
|
+
# them. These artifacts include:
|
|
13
|
+
# 1. SDKs
|
|
14
|
+
# 2. Docs
|
|
15
|
+
# 3. API Specification files
|
|
16
|
+
# Call this endpoint to update your Hosted Portal after you update an API
|
|
17
|
+
# Entity via any of the Import API Endpoints.
|
|
18
|
+
# __**Note: If you have an embedded portal against the same API Entity,
|
|
19
|
+
# artifacts for that portal will get updated as well.**__
|
|
20
|
+
# @param [String] api_entity_id Required parameter: The ID of the API Entity
|
|
21
|
+
# to update the portal artifacts for.
|
|
22
|
+
# @return [void] response from the API call
|
|
23
|
+
def publish_hosted_portal(api_entity_id)
|
|
24
|
+
new_api_call_builder
|
|
25
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
26
|
+
'/api-entities/{api_entity_id}/hosted-portal',
|
|
27
|
+
Server::DEFAULT)
|
|
28
|
+
.template_param(new_parameter(api_entity_id, key: 'api_entity_id')
|
|
29
|
+
.should_encode(true))
|
|
30
|
+
.auth(Single.new('Authorization')))
|
|
31
|
+
.response(new_response_handler
|
|
32
|
+
.is_response_void(true))
|
|
33
|
+
.execute
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Publish artifacts for an Embedded Portal and get the Portal Embed script.
|
|
37
|
+
# This endpoint regenerates all the artifacts for an embedded portal and
|
|
38
|
+
# uploads them to APIMatic's cloud storage, from where the Portal fetches
|
|
39
|
+
# them. These artifacts include:
|
|
40
|
+
# 1. SDKs
|
|
41
|
+
# 2. Docs
|
|
42
|
+
# 3. API Specification files
|
|
43
|
+
# Call this endpoint to update your Embedded Portal after you update an API
|
|
44
|
+
# Entity via any of the Import API Endpoints. This endpoint returns the
|
|
45
|
+
# Portal Embed script in the response.
|
|
46
|
+
# __**Note: If you have a hosted portal against the same API Entity,
|
|
47
|
+
# artifacts for that portal will get updated as well.**__
|
|
48
|
+
# @param [String] api_entity_id Required parameter: The ID of the API Entity
|
|
49
|
+
# to update the portal artifacts for.
|
|
50
|
+
# @return [void] response from the API call
|
|
51
|
+
def publish_embedded_portal(api_entity_id)
|
|
52
|
+
new_api_call_builder
|
|
53
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
54
|
+
'/api-entities/{api_entity_id}/embedded-portal',
|
|
55
|
+
Server::DEFAULT)
|
|
56
|
+
.template_param(new_parameter(api_entity_id, key: 'api_entity_id')
|
|
57
|
+
.should_encode(true))
|
|
58
|
+
.auth(Single.new('Authorization')))
|
|
59
|
+
.response(new_response_handler
|
|
60
|
+
.is_response_void(true))
|
|
61
|
+
.execute
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Generate an On-premise Documentation Portal for an API Entity. This
|
|
65
|
+
# endpoint generates all artifacts for the Portal and packages them together
|
|
66
|
+
# into a zip file along with the required HTML, CSS and JS files. The
|
|
67
|
+
# generated artifacts include:
|
|
68
|
+
# 1. SDKs
|
|
69
|
+
# 2. Docs
|
|
70
|
+
# 3. API Specification files
|
|
71
|
+
# The endpoint returns a zip file that contains a static Site and can be
|
|
72
|
+
# hosted on any Web Server.
|
|
73
|
+
# @param [String] api_entity_id Required parameter: The ID of the API Entity
|
|
74
|
+
# to generate the Portal for.
|
|
75
|
+
# @return [void] response from the API call
|
|
76
|
+
def generate_on_prem_portal_via_api_entity(api_entity_id)
|
|
77
|
+
new_api_call_builder
|
|
78
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
79
|
+
'/api-entities/{api_entity_id}/on-prem-portal',
|
|
80
|
+
Server::DEFAULT)
|
|
81
|
+
.template_param(new_parameter(api_entity_id, key: 'api_entity_id')
|
|
82
|
+
.should_encode(true))
|
|
83
|
+
.auth(Single.new('Authorization')))
|
|
84
|
+
.response(new_response_handler
|
|
85
|
+
.is_response_void(true))
|
|
86
|
+
.execute
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Generate an On-premise Documentation Portal by uploading a Portal Build
|
|
90
|
+
# Input. This endpoint generates all artifacts for the Portal and packages
|
|
91
|
+
# them together into a zip file along with the required HTML, CSS and JS
|
|
92
|
+
# files. The generated artifacts include:
|
|
93
|
+
# 1. SDKs
|
|
94
|
+
# 2. Docs
|
|
95
|
+
# 3. API Specification files
|
|
96
|
+
# The endpoint returns a zip file that contains a static Site and can be
|
|
97
|
+
# hosted on any Web Server.
|
|
98
|
+
# @param [File | UploadIO] file Required parameter: The input file to the
|
|
99
|
+
# Portal Generator. Must contain the build file.
|
|
100
|
+
# @return [Binary] response from the API call
|
|
101
|
+
def generate_on_prem_portal_via_build_input(file)
|
|
102
|
+
new_api_call_builder
|
|
103
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
104
|
+
'/portal',
|
|
105
|
+
Server::DEFAULT)
|
|
106
|
+
.multipart_param(new_parameter(file, key: 'file')
|
|
107
|
+
.default_content_type('application/octet-stream'))
|
|
108
|
+
.auth(Single.new('Authorization')))
|
|
109
|
+
.response(new_response_handler
|
|
110
|
+
.local_error('400',
|
|
111
|
+
'Bad Request',
|
|
112
|
+
APIException)
|
|
113
|
+
.local_error('401',
|
|
114
|
+
'Unauthorized',
|
|
115
|
+
APIException)
|
|
116
|
+
.local_error('402',
|
|
117
|
+
'Subscription Issue',
|
|
118
|
+
APIException)
|
|
119
|
+
.local_error('422',
|
|
120
|
+
'Unprocessable Entity',
|
|
121
|
+
APIException))
|
|
122
|
+
.execute
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Generate Build Input for a Portal created using the UI workflow. The
|
|
126
|
+
# Build Input will correspond to the draft version of the Portal i.e.
|
|
127
|
+
# unpublished changes will also be included.
|
|
128
|
+
# This can be used to create a backup of your Portal or to migrate from the
|
|
129
|
+
# UI workflow to the docs as code workflow.
|
|
130
|
+
# @param [String] api_group_id Required parameter: Example:
|
|
131
|
+
# @param [Array[String]] api_entities Optional parameter: Example:
|
|
132
|
+
# @return [String] response from the API call
|
|
133
|
+
def generate_build_input_for_unpublished_portal(api_group_id,
|
|
134
|
+
api_entities: nil)
|
|
135
|
+
new_api_call_builder
|
|
136
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
137
|
+
'/portal/build/{apiGroupId}/draft',
|
|
138
|
+
Server::DEFAULT)
|
|
139
|
+
.template_param(new_parameter(api_group_id, key: 'apiGroupId')
|
|
140
|
+
.should_encode(true))
|
|
141
|
+
.query_param(new_parameter(api_entities, key: 'apiEntities'))
|
|
142
|
+
.auth(Single.new('Authorization')))
|
|
143
|
+
.response(new_response_handler
|
|
144
|
+
.deserializer(APIHelper.method(:deserialize_primitive_types))
|
|
145
|
+
.deserialize_into(proc do |response| response.to_s end)
|
|
146
|
+
.is_primitive_response(true))
|
|
147
|
+
.execute
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Generate Build Input for a Portal created using the UI workflow. The
|
|
151
|
+
# Build Input will correspond to the published version of the Portal i.e.
|
|
152
|
+
# unpublished changes will not be inlcuded.
|
|
153
|
+
# This can be used to create a backup of your Portal or to migrate from the
|
|
154
|
+
# UI workflow to the docs as code workflow.
|
|
155
|
+
# @param [String] api_group_id Required parameter: Example:
|
|
156
|
+
# @param [Array[String]] api_entities Optional parameter: Example:
|
|
157
|
+
# @return [String] response from the API call
|
|
158
|
+
def generate_build_input_for_published_portal(api_group_id,
|
|
159
|
+
api_entities: nil)
|
|
160
|
+
new_api_call_builder
|
|
161
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
162
|
+
'/portal/build/{apiGroupId}/published',
|
|
163
|
+
Server::DEFAULT)
|
|
164
|
+
.template_param(new_parameter(api_group_id, key: 'apiGroupId')
|
|
165
|
+
.should_encode(true))
|
|
166
|
+
.query_param(new_parameter(api_entities, key: 'apiEntities'))
|
|
167
|
+
.auth(Single.new('Authorization')))
|
|
168
|
+
.response(new_response_handler
|
|
169
|
+
.deserializer(APIHelper.method(:deserialize_primitive_types))
|
|
170
|
+
.deserialize_into(proc do |response| response.to_s end)
|
|
171
|
+
.is_primitive_response(true))
|
|
172
|
+
.execute
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Unpublish a Hosted or Embedded Portal published for an API Entity. Calling
|
|
176
|
+
# this endpoint deletes all the published artifacts for a Portal from
|
|
177
|
+
# APIMatic's cloud storage.
|
|
178
|
+
# In case of a Hosted Portal, to completely remove the Portal, this endpoint
|
|
179
|
+
# needs to be called against all API versions that the Portal hosts.
|
|
180
|
+
# In case of an Embedded Portal, to completely remove the Portal, the user
|
|
181
|
+
# needs to manually remove the Portal Embed script from the embedding site.
|
|
182
|
+
# @param [String] api_entity_id Required parameter: The ID of the API Entity
|
|
183
|
+
# to unpublish the Portal artifacts for.
|
|
184
|
+
# @return [void] response from the API call
|
|
185
|
+
def unpublish_portal(api_entity_id)
|
|
186
|
+
new_api_call_builder
|
|
187
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
188
|
+
'/api-entities/{api_entity_id}/portal',
|
|
189
|
+
Server::DEFAULT)
|
|
190
|
+
.template_param(new_parameter(api_entity_id, key: 'api_entity_id')
|
|
191
|
+
.should_encode(true))
|
|
192
|
+
.auth(Single.new('Authorization')))
|
|
193
|
+
.response(new_response_handler
|
|
194
|
+
.is_response_void(true))
|
|
195
|
+
.execute
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
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
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# Utility class for custom header authorization.
|
|
8
|
+
class CustomHeaderAuthentication < CoreLibrary::HeaderAuth
|
|
9
|
+
# Display error message on occurrence of authentication failure.
|
|
10
|
+
# @returns [String] The oAuth error message.
|
|
11
|
+
def error_message
|
|
12
|
+
'CustomHeaderAuthentication: authorization is undefined.'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Initialization constructor.
|
|
16
|
+
def initialize(custom_header_authentication_credentials)
|
|
17
|
+
auth_params = {}
|
|
18
|
+
auth_params['Authorization'] = custom_header_authentication_credentials.authorization unless
|
|
19
|
+
custom_header_authentication_credentials.nil? || custom_header_authentication_credentials.authorization.nil?
|
|
20
|
+
|
|
21
|
+
super auth_params
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Data class for CustomHeaderAuthenticationCredentials.
|
|
26
|
+
# Data class for CustomHeaderAuthenticationCredentials.
|
|
27
|
+
class CustomHeaderAuthenticationCredentials
|
|
28
|
+
attr_reader :authorization
|
|
29
|
+
|
|
30
|
+
def initialize(authorization:)
|
|
31
|
+
raise ArgumentError, 'authorization cannot be nil' if authorization.nil?
|
|
32
|
+
|
|
33
|
+
@authorization = authorization
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def clone_with(authorization: nil)
|
|
37
|
+
authorization ||= self.authorization
|
|
38
|
+
|
|
39
|
+
CustomHeaderAuthenticationCredentials.new(authorization: authorization)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# HttpCallBack allows defining callables for pre and post API calls.
|
|
8
|
+
class HttpCallBack < CoreLibrary::HttpCallback
|
|
9
|
+
end
|
|
10
|
+
end
|