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,66 +1,55 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# BaseController.
|
|
8
|
-
class BaseController
|
|
9
|
-
include CoreLibrary
|
|
10
|
-
attr_accessor :config, :http_call_back
|
|
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
|
-
# Creates a new instance of the parameter.
|
|
57
|
-
# @param [String|optional] key The key of the parameter.
|
|
58
|
-
# @param [Object] value The value of the parameter.
|
|
59
|
-
# @return [Parameter] The instance of Parameter.
|
|
60
|
-
def new_parameter(value, key: nil)
|
|
61
|
-
Parameter.new
|
|
62
|
-
.key(key)
|
|
63
|
-
.value(value)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
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
|
+
# BaseController.
|
|
8
|
+
class BaseController
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_accessor :config, :http_call_back
|
|
11
|
+
|
|
12
|
+
GLOBAL_ERRORS = {
|
|
13
|
+
'default' => ErrorCase.new
|
|
14
|
+
.error_message('HTTP response not OK.')
|
|
15
|
+
.exception_type(APIException)
|
|
16
|
+
}.freeze
|
|
17
|
+
|
|
18
|
+
# Initialization constructor.
|
|
19
|
+
# @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
|
|
20
|
+
def initialize(global_configuration)
|
|
21
|
+
@global_configuration = global_configuration
|
|
22
|
+
@config = @global_configuration.client_configuration
|
|
23
|
+
@http_call_back = @config.http_callback
|
|
24
|
+
@api_call = ApiCall.new(@global_configuration)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Creates a new instance of the request builder.
|
|
28
|
+
# @param [String] http_method The HTTP method to use in the request.
|
|
29
|
+
# @param [String] path The endpoint path to use in the request.
|
|
30
|
+
# @param [String] server The server to extract the base uri for the request.
|
|
31
|
+
# @return [RequestBuilder] The instance of RequestBuilder.
|
|
32
|
+
def new_request_builder(http_method, path, server)
|
|
33
|
+
RequestBuilder.new
|
|
34
|
+
.http_method(http_method)
|
|
35
|
+
.path(path)
|
|
36
|
+
.server(server)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates a new instance of the response handler.
|
|
40
|
+
# @return [ResponseHandler] The instance of ResponseHandler.
|
|
41
|
+
def new_response_handler
|
|
42
|
+
ResponseHandler.new
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Creates a new instance of the parameter.
|
|
46
|
+
# @param [String|optional] key The key of the parameter.
|
|
47
|
+
# @param [Object] value The value of the parameter.
|
|
48
|
+
# @return [Parameter] The instance of Parameter.
|
|
49
|
+
def new_parameter(value, key: nil)
|
|
50
|
+
Parameter.new
|
|
51
|
+
.key(key)
|
|
52
|
+
.value(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -1,178 +1,201 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# CodeGenerationExternalApisController
|
|
8
|
-
class CodeGenerationExternalApisController < BaseController
|
|
9
|
-
# Generate an SDK for an API by by uploading the API specification file.
|
|
10
|
-
# This endpoint generates and then uploads the generated SDK to APIMatic's
|
|
11
|
-
# cloud storage. An ID for the generation performed is returned as part of
|
|
12
|
-
# the response.
|
|
13
|
-
# This endpoint does not import an API into APIMatic.
|
|
14
|
-
# @param [
|
|
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
|
-
.execute
|
|
83
|
-
end
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# CodeGenerationExternalApisController
|
|
8
|
+
class CodeGenerationExternalApisController < BaseController
|
|
9
|
+
# Generate an SDK for an API by by uploading the API specification file.
|
|
10
|
+
# This endpoint generates and then uploads the generated SDK to APIMatic's
|
|
11
|
+
# cloud storage. An ID for the generation performed is returned as part of
|
|
12
|
+
# the response.
|
|
13
|
+
# This endpoint does not import an API into APIMatic.
|
|
14
|
+
# @param [Accept] accept Required parameter: Must be set to
|
|
15
|
+
# 'application/json' to ensure JSON response format
|
|
16
|
+
# @param [File | UploadIO] file Required parameter: The API specification
|
|
17
|
+
# file.<br>The type of the specification file should be any of the
|
|
18
|
+
# [supported
|
|
19
|
+
# formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
|
|
20
|
+
# ported-input-formats).
|
|
21
|
+
# @param [Platforms] template Required parameter: The structure contains
|
|
22
|
+
# platforms that APIMatic CodeGen can generate SDKs and Docs in.
|
|
23
|
+
# @param [Hash] _query_parameters Additional optional query parameters are
|
|
24
|
+
# supported by this endpoint.
|
|
25
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
26
|
+
def generate_sdk_via_file(accept,
|
|
27
|
+
file,
|
|
28
|
+
template,
|
|
29
|
+
_query_parameters: nil)
|
|
30
|
+
@api_call
|
|
31
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
32
|
+
'/code-generations/generate-via-file',
|
|
33
|
+
Server::DEFAULT)
|
|
34
|
+
.header_param(new_parameter(accept, key: 'Accept')
|
|
35
|
+
.is_required(true))
|
|
36
|
+
.multipart_param(new_parameter(file, key: 'file')
|
|
37
|
+
.is_required(true)
|
|
38
|
+
.default_content_type('application/octet-stream'))
|
|
39
|
+
.form_param(new_parameter(template, key: 'template')
|
|
40
|
+
.is_required(true))
|
|
41
|
+
.additional_query_params(_query_parameters)
|
|
42
|
+
.auth(Single.new('Authorization')))
|
|
43
|
+
.response(new_response_handler
|
|
44
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
45
|
+
.deserialize_into(UserCodeGeneration.method(:from_hash))
|
|
46
|
+
.is_api_response(true)
|
|
47
|
+
.local_error('400',
|
|
48
|
+
'Bad Request',
|
|
49
|
+
BadRequestResponseSdkException)
|
|
50
|
+
.local_error('401',
|
|
51
|
+
'Unauthorized',
|
|
52
|
+
UnauthorizedResponseException)
|
|
53
|
+
.local_error('403',
|
|
54
|
+
'Subscription Issue',
|
|
55
|
+
ProblemDetailsException))
|
|
56
|
+
.execute
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Generate an SDK for an API by providing the URL of the API specification
|
|
60
|
+
# file.
|
|
61
|
+
# This endpoint generates and then uploads the generated SDK to APIMatic's
|
|
62
|
+
# cloud storage. An ID for the generation performed is returned as part of
|
|
63
|
+
# the response.
|
|
64
|
+
# This endpoint does not import an API into APIMatic.
|
|
65
|
+
# @param [GenerateSdkViaUrlRequest] body Required parameter: Request Body
|
|
66
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
67
|
+
def generate_sdk_via_url(body)
|
|
68
|
+
@api_call
|
|
69
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
70
|
+
'/code-generations/generate-via-url',
|
|
71
|
+
Server::DEFAULT)
|
|
72
|
+
.header_param(new_parameter('application/vnd.apimatic.userCodeGenerationDto.v1+json', key: 'Content-Type'))
|
|
73
|
+
.body_param(new_parameter(body)
|
|
74
|
+
.is_required(true))
|
|
75
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
76
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
77
|
+
.auth(Single.new('Authorization')))
|
|
78
|
+
.response(new_response_handler
|
|
79
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
80
|
+
.deserialize_into(UserCodeGeneration.method(:from_hash))
|
|
81
|
+
.is_api_response(true))
|
|
82
|
+
.execute
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Download the SDK generated via the Generate SDK endpoints.
|
|
86
|
+
# @param [String] codegen_id Required parameter: The ID of code generation
|
|
87
|
+
# received in the response of the [Generate SDK Via
|
|
88
|
+
# File]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20Fi
|
|
89
|
+
# le) or [Generate SDK Via URL
|
|
90
|
+
# ]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20URL)
|
|
91
|
+
# calls.
|
|
92
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
93
|
+
def download_sdk(codegen_id)
|
|
94
|
+
@api_call
|
|
95
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
96
|
+
'/code-generations/{codegen_id}/generated-sdk',
|
|
97
|
+
Server::DEFAULT)
|
|
98
|
+
.template_param(new_parameter(codegen_id, key: 'codegen_id')
|
|
99
|
+
.is_required(true)
|
|
100
|
+
.should_encode(true))
|
|
101
|
+
.auth(Single.new('Authorization')))
|
|
102
|
+
.response(new_response_handler
|
|
103
|
+
.is_api_response(true))
|
|
104
|
+
.execute
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Get a list of all SDK generations performed with external APIs via the
|
|
108
|
+
# Generate SDK endpoints.
|
|
109
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
110
|
+
def list_all_code_generations
|
|
111
|
+
@api_call
|
|
112
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
113
|
+
'/code-generations',
|
|
114
|
+
Server::DEFAULT)
|
|
115
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
116
|
+
.auth(Single.new('Authorization')))
|
|
117
|
+
.response(new_response_handler
|
|
118
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
119
|
+
.deserialize_into(UserCodeGeneration.method(:from_hash))
|
|
120
|
+
.is_api_response(true)
|
|
121
|
+
.is_response_array(true))
|
|
122
|
+
.execute
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Download the API Specification file used as input for a specific SDK
|
|
126
|
+
# generation performed via the Generate SDK endpoints.
|
|
127
|
+
# @param [String] codegen_id Required parameter: The ID of the code
|
|
128
|
+
# generation to download the API specification for. The code generation ID
|
|
129
|
+
# is received in the response of the [Generate SDK Via
|
|
130
|
+
# File]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20Fi
|
|
131
|
+
# le) or [Generate SDK Via URL
|
|
132
|
+
# ]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20URL)
|
|
133
|
+
# calls
|
|
134
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
135
|
+
def download_input_file(codegen_id)
|
|
136
|
+
@api_call
|
|
137
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
138
|
+
'/code-generations/{codegen_id}/input-file',
|
|
139
|
+
Server::DEFAULT)
|
|
140
|
+
.template_param(new_parameter(codegen_id, key: 'codegen_id')
|
|
141
|
+
.is_required(true)
|
|
142
|
+
.should_encode(true))
|
|
143
|
+
.auth(Single.new('Authorization')))
|
|
144
|
+
.response(new_response_handler
|
|
145
|
+
.is_api_response(true))
|
|
146
|
+
.execute
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Get details on an SDK generation performed for an external API via the
|
|
150
|
+
# Generate SDK endpoints.
|
|
151
|
+
# @param [String] codegen_id Required parameter: The ID of the code
|
|
152
|
+
# generation to fetch. The code generation ID is received in the response of
|
|
153
|
+
# the [Generate SDK Via
|
|
154
|
+
# File]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20Fi
|
|
155
|
+
# le) or [Generate SDK Via URL
|
|
156
|
+
# ]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20URL)
|
|
157
|
+
# calls.
|
|
158
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
159
|
+
def get_a_code_generation(codegen_id)
|
|
160
|
+
@api_call
|
|
161
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
162
|
+
'/code-generations/{codegen_id}',
|
|
163
|
+
Server::DEFAULT)
|
|
164
|
+
.template_param(new_parameter(codegen_id, key: 'codegen_id')
|
|
165
|
+
.is_required(true)
|
|
166
|
+
.should_encode(true))
|
|
167
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
168
|
+
.auth(Single.new('Authorization')))
|
|
169
|
+
.response(new_response_handler
|
|
170
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
171
|
+
.deserialize_into(UserCodeGeneration.method(:from_hash))
|
|
172
|
+
.is_api_response(true))
|
|
173
|
+
.execute
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Delete an SDK generation performed for an API via the Generate SDK
|
|
177
|
+
# endpoints.
|
|
178
|
+
# @param [String] codegen_id Required parameter: The ID of the code
|
|
179
|
+
# generation to delete. The code generation ID is received in the response
|
|
180
|
+
# of the [Generate SDK Via
|
|
181
|
+
# File]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20Fi
|
|
182
|
+
# le) or [Generate SDK Via URL
|
|
183
|
+
# ]($e/Code%20Generation%20-%20External%20APIs/Generate%20SDK%20via%20URL)
|
|
184
|
+
# calls.
|
|
185
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
186
|
+
def delete_code_generation_for_external_apis(codegen_id)
|
|
187
|
+
@api_call
|
|
188
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
189
|
+
'/code-generations/{codegen_id}',
|
|
190
|
+
Server::DEFAULT)
|
|
191
|
+
.template_param(new_parameter(codegen_id, key: 'codegen_id')
|
|
192
|
+
.is_required(true)
|
|
193
|
+
.should_encode(true))
|
|
194
|
+
.auth(Single.new('Authorization')))
|
|
195
|
+
.response(new_response_handler
|
|
196
|
+
.is_response_void(true)
|
|
197
|
+
.is_api_response(true))
|
|
198
|
+
.execute
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# DocsPortalGenerationAsyncController
|
|
8
|
+
class DocsPortalGenerationAsyncController < BaseController
|
|
9
|
+
# Create an async On-premise Documentation Portal Generation request by
|
|
10
|
+
# providing a Portal Build Input
|
|
11
|
+
# @param [ContentType] content_type Required parameter: Example:
|
|
12
|
+
# @param [File | UploadIO] file Required parameter: The input file to the
|
|
13
|
+
# Portal Generator. Must contain the build file.
|
|
14
|
+
# @param [String] x_api_matic_callback_url Optional parameter: Optional
|
|
15
|
+
# header containing callback url. This url will be called by the server once
|
|
16
|
+
# the portal generation completes
|
|
17
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
18
|
+
def generate_on_prem_portal_via_build_input_async(content_type,
|
|
19
|
+
file,
|
|
20
|
+
x_api_matic_callback_url: nil)
|
|
21
|
+
@api_call
|
|
22
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
23
|
+
'/portal/v2',
|
|
24
|
+
Server::DEFAULT)
|
|
25
|
+
.multipart_param(new_parameter(file, key: 'file')
|
|
26
|
+
.is_required(true)
|
|
27
|
+
.default_content_type('application/octet-stream'))
|
|
28
|
+
.header_param(new_parameter(x_api_matic_callback_url, key: 'X-APIMatic-CallbackUrl'))
|
|
29
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
30
|
+
.auth(Single.new('Authorization')))
|
|
31
|
+
.response(new_response_handler
|
|
32
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
33
|
+
.deserialize_into(PortalGenerationAsyncResponse.method(:from_hash))
|
|
34
|
+
.is_api_response(true)
|
|
35
|
+
.local_error('400',
|
|
36
|
+
'Bad Request',
|
|
37
|
+
ProblemDetailsException)
|
|
38
|
+
.local_error('401',
|
|
39
|
+
'Unauthorized',
|
|
40
|
+
UnauthorizedResponseException)
|
|
41
|
+
.local_error('500',
|
|
42
|
+
'Internal Server Error',
|
|
43
|
+
InternalServerErrorResponseException))
|
|
44
|
+
.execute
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Get the status of a portal generation request
|
|
48
|
+
# @param [String] id Required parameter: TODO: type description here
|
|
49
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
50
|
+
def get_portal_generation_status(id)
|
|
51
|
+
@api_call
|
|
52
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
53
|
+
'/portal/v2/{id}/status',
|
|
54
|
+
Server::DEFAULT)
|
|
55
|
+
.template_param(new_parameter(id, key: 'id')
|
|
56
|
+
.is_required(true)
|
|
57
|
+
.should_encode(true))
|
|
58
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
59
|
+
.auth(Single.new('Authorization')))
|
|
60
|
+
.response(new_response_handler
|
|
61
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
62
|
+
.deserialize_into(PortalGenerationStatusResponse.method(:from_hash))
|
|
63
|
+
.is_api_response(true)
|
|
64
|
+
.local_error('400',
|
|
65
|
+
'Bad Request',
|
|
66
|
+
ProblemDetailsException)
|
|
67
|
+
.local_error('401',
|
|
68
|
+
'Unauthorized',
|
|
69
|
+
UnauthorizedResponseException)
|
|
70
|
+
.local_error('500',
|
|
71
|
+
'Internal Server Error',
|
|
72
|
+
InternalServerErrorResponseException))
|
|
73
|
+
.execute
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Downloads the portal artifacts. The generated artifacts include:
|
|
77
|
+
# 1. SDKs
|
|
78
|
+
# 2. Docs
|
|
79
|
+
# 3. API Specification files
|
|
80
|
+
# The endpoint returns a zip file that contains a static Site and can be
|
|
81
|
+
# hosted on any Web Server.
|
|
82
|
+
# @param [String] id Required parameter: TODO: type description here
|
|
83
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
84
|
+
def download_generated_portal(id)
|
|
85
|
+
@api_call
|
|
86
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
87
|
+
'/portal/v2/{id}/download',
|
|
88
|
+
Server::DEFAULT)
|
|
89
|
+
.template_param(new_parameter(id, key: 'id')
|
|
90
|
+
.is_required(true)
|
|
91
|
+
.should_encode(true))
|
|
92
|
+
.auth(Single.new('Authorization')))
|
|
93
|
+
.response(new_response_handler
|
|
94
|
+
.is_api_response(true)
|
|
95
|
+
.local_error('400',
|
|
96
|
+
'Bad Request',
|
|
97
|
+
ProblemDetailsException)
|
|
98
|
+
.local_error('401',
|
|
99
|
+
'Unauthorized',
|
|
100
|
+
UnauthorizedResponseException)
|
|
101
|
+
.local_error('422',
|
|
102
|
+
'Unprocessable Entity - Contains error.zip for build issues',
|
|
103
|
+
APIException)
|
|
104
|
+
.local_error('500',
|
|
105
|
+
'Internal Server Error',
|
|
106
|
+
InternalServerErrorResponseException))
|
|
107
|
+
.execute
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|