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,66 +1,55 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # BaseController.
8
- class BaseController
9
- include CoreLibrary
10
- attr_accessor :config, :http_call_back
11
-
12
- def self.user_agent
13
- 'APIMatic CLI'
14
- end
15
-
16
-
17
- GLOBAL_ERRORS = {
18
- 'default' => ErrorCase.new
19
- .error_message('HTTP response not OK.')
20
- .exception_type(APIException)
21
- }.freeze
22
-
23
- # Initialization constructor.
24
- # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
25
- def initialize(global_configuration)
26
- @global_configuration = global_configuration
27
- @config = @global_configuration.client_configuration
28
- @http_call_back = @config.http_callback
29
- @api_call = ApiCall.new(@global_configuration)
30
- end
31
-
32
- # Creates a new builder for the Api Call instance.
33
- # @return [ApiCall] The instance of ApiCall.
34
- def new_api_call_builder
35
- @api_call.new_builder
36
- end
37
-
38
- # Creates a new instance of the request builder.
39
- # @param [String] http_method The HTTP method to use in the request.
40
- # @param [String] path The endpoint path to use in the request.
41
- # @param [String] server The server to extract the base uri for the request.
42
- # @return [RequestBuilder] The instance of RequestBuilder.
43
- def new_request_builder(http_method, path, server)
44
- RequestBuilder.new
45
- .http_method(http_method)
46
- .path(path)
47
- .server(server)
48
- end
49
-
50
- # Creates a new instance of the response handler.
51
- # @return [ResponseHandler] The instance of ResponseHandler.
52
- def new_response_handler
53
- ResponseHandler.new
54
- end
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 v2.0
4
- # ( https://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 [File | UploadIO] file Required parameter: The API specification
15
- # file.<br>The type of the specification file should be any of the
16
- # [supported
17
- # formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
18
- # ported-input-formats).
19
- # @param [Platforms] template Required parameter: The structure contains
20
- # platforms that APIMatic CodeGen can generate SDKs and Docs in.
21
- # @return [UserCodeGeneration] response from the API call
22
- def generate_sdk_via_file(file,
23
- template)
24
- new_api_call_builder
25
- .request(new_request_builder(HttpMethodEnum::POST,
26
- '/code-generations/generate-via-file',
27
- Server::DEFAULT)
28
- .multipart_param(new_parameter(file, key: 'file')
29
- .default_content_type('application/octet-stream'))
30
- .form_param(new_parameter(template, key: 'template'))
31
- .header_param(new_parameter('application/json', key: 'accept'))
32
- .auth(Single.new('Authorization')))
33
- .response(new_response_handler
34
- .deserializer(APIHelper.method(:custom_type_deserializer))
35
- .deserialize_into(UserCodeGeneration.method(:from_hash)))
36
- .execute
37
- end
38
-
39
- # Generate an SDK for an API by providing the URL of the API specification
40
- # file.
41
- # This endpoint generates and then uploads the generated SDK to APIMatic's
42
- # cloud storage. An ID for the generation performed is returned as part of
43
- # the response.
44
- # This endpoint does not import an API into APIMatic.
45
- # @param [GenerateSdkViaUrlRequest] body Required parameter: Request Body
46
- # @return [UserCodeGeneration] response from the API call
47
- def generate_sdk_via_url(body)
48
- new_api_call_builder
49
- .request(new_request_builder(HttpMethodEnum::POST,
50
- '/code-generations/generate-via-url',
51
- Server::DEFAULT)
52
- .header_param(new_parameter('application/vnd.apimatic.userCodeGenerationDto.v1+json', key: 'Content-Type'))
53
- .body_param(new_parameter(body))
54
- .header_param(new_parameter('application/json', key: 'accept'))
55
- .body_serializer(proc do |param| param.to_json unless param.nil? end)
56
- .auth(Single.new('Authorization')))
57
- .response(new_response_handler
58
- .deserializer(APIHelper.method(:custom_type_deserializer))
59
- .deserialize_into(UserCodeGeneration.method(:from_hash)))
60
- .execute
61
- end
62
-
63
- # Download the SDK generated via the Generate SDK endpoints.
64
- # @param [String] codegen_id Required parameter: The ID of code generation
65
- # received in the response of the [Generate SDK Via
66
- # File](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
67
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-s
68
- # dk-via-file) or [Generate SDK Via URL
69
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
70
- # 61b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-sdk-v
71
- # ia-url) calls.
72
- # @return [Binary] response from the API call
73
- def download_generated_sdk(codegen_id)
74
- new_api_call_builder
75
- .request(new_request_builder(HttpMethodEnum::GET,
76
- '/code-generations/{codegen_id}/generated-sdk',
77
- Server::DEFAULT)
78
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
79
- .should_encode(true))
80
- .auth(Single.new('Authorization')))
81
- .response(new_response_handler)
82
- .execute
83
- end
84
-
85
- # Get a list of all SDK generations performed with external APIs via the
86
- # Generate SDK endpoints.
87
- # @return [Array[UserCodeGeneration]] response from the API call
88
- def list_all_code_generations_external
89
- new_api_call_builder
90
- .request(new_request_builder(HttpMethodEnum::GET,
91
- '/code-generations',
92
- Server::DEFAULT)
93
- .header_param(new_parameter('application/json', key: 'accept'))
94
- .auth(Single.new('Authorization')))
95
- .response(new_response_handler
96
- .deserializer(APIHelper.method(:custom_type_deserializer))
97
- .deserialize_into(UserCodeGeneration.method(:from_hash))
98
- .is_response_array(true))
99
- .execute
100
- end
101
-
102
- # Download the API Specification file used as input for a specific SDK
103
- # generation performed via the Generate SDK endpoints.
104
- # @param [String] codegen_id Required parameter: The ID of the code
105
- # generation to download the API specification for. The code generation ID
106
- # is received in the response of the [Generate SDK Via
107
- # File](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
108
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-s
109
- # dk-via-file) or [Generate SDK Via URL
110
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
111
- # 61b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-sdk-v
112
- # ia-url) calls
113
- # @return [Binary] response from the API call
114
- def download_input_file_codegen(codegen_id)
115
- new_api_call_builder
116
- .request(new_request_builder(HttpMethodEnum::GET,
117
- '/code-generations/{codegen_id}/input-file',
118
- Server::DEFAULT)
119
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
120
- .should_encode(true))
121
- .auth(Single.new('Authorization')))
122
- .response(new_response_handler)
123
- .execute
124
- end
125
-
126
- # Get details on an SDK generation performed for an external API via the
127
- # Generate SDK endpoints.
128
- # @param [String] codegen_id Required parameter: The ID of the code
129
- # generation to fetch. The code generation ID is received in the response of
130
- # the [Generate SDK Via
131
- # File](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
132
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-s
133
- # dk-via-file) or [Generate SDK Via URL
134
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
135
- # 61b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-sdk-v
136
- # ia-url) calls.
137
- # @return [UserCodeGeneration] response from the API call
138
- def get_a_code_generation_codegen(codegen_id)
139
- new_api_call_builder
140
- .request(new_request_builder(HttpMethodEnum::GET,
141
- '/code-generations/{codegen_id}',
142
- Server::DEFAULT)
143
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
144
- .should_encode(true))
145
- .header_param(new_parameter('application/json', key: 'accept'))
146
- .auth(Single.new('Authorization')))
147
- .response(new_response_handler
148
- .deserializer(APIHelper.method(:custom_type_deserializer))
149
- .deserialize_into(UserCodeGeneration.method(:from_hash)))
150
- .execute
151
- end
152
-
153
- # Delete an SDK generation performed for an API via the Generate SDK
154
- # endpoints.
155
- # @param [String] codegen_id Required parameter: The ID of the code
156
- # generation to delete. The code generation ID is received in the response
157
- # of the [Generate SDK Via
158
- # File](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
159
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-s
160
- # dk-via-file) or [Generate SDK Via URL
161
- # ](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c3052d9
162
- # 61b/v/3_0#/http/api-endpoints/code-generation-external-apis/generate-sdk-v
163
- # ia-url) calls.
164
- # @return [void] response from the API call
165
- def delete_code_generation1(codegen_id)
166
- new_api_call_builder
167
- .request(new_request_builder(HttpMethodEnum::DELETE,
168
- '/code-generations/{codegen_id}',
169
- Server::DEFAULT)
170
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
171
- .should_encode(true))
172
- .auth(Single.new('Authorization')))
173
- .response(new_response_handler
174
- .is_response_void(true))
175
- .execute
176
- end
177
- end
178
- 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
+ # 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