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,136 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # CodeGenerationImportedApisController
8
- class CodeGenerationImportedApisController < BaseController
9
- # Generate an SDK for an API Version.
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
- # @param [String] api_entity_id Required parameter: The ID of the API Entity
14
- # to generate the SDK for.
15
- # @param [Platforms] template Required parameter: The structure contains
16
- # platforms that APIMatic CodeGen can generate SDKs and Docs in.
17
- # @return [APIEntityCodeGeneration] response from the API call
18
- def generate_sdk(api_entity_id,
19
- template)
20
- new_api_call_builder
21
- .request(new_request_builder(HttpMethodEnum::POST,
22
- '/api-entities/{api_entity_id}/code-generations/generate',
23
- Server::DEFAULT)
24
- .template_param(new_parameter(api_entity_id, key: 'api_entity_id')
25
- .should_encode(true))
26
- .form_param(new_parameter(template, key: 'template'))
27
- .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
28
- .header_param(new_parameter('application/json', key: 'accept'))
29
- .auth(Single.new('Authorization')))
30
- .response(new_response_handler
31
- .deserializer(APIHelper.method(:custom_type_deserializer))
32
- .deserialize_into(APIEntityCodeGeneration.method(:from_hash)))
33
- .execute
34
- end
35
-
36
- # Download the SDK generated via the Generate SDK endpoint.
37
- # @param [String] api_entity_id Required parameter: The ID of the API Entity
38
- # for which the SDK was generated.
39
- # @param [String] codegen_id Required parameter: The ID of code generation
40
- # received in the response of the [SDK generation
41
- # call](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
42
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-imported-apis/generate-s
43
- # dk).
44
- # @return [Binary] response from the API call
45
- def download_sdk(api_entity_id,
46
- codegen_id)
47
- new_api_call_builder
48
- .request(new_request_builder(HttpMethodEnum::GET,
49
- '/api-entities/{api_entity_id}/code-generations/{codegen_id}/generated-sdk',
50
- Server::DEFAULT)
51
- .template_param(new_parameter(api_entity_id, key: 'api_entity_id')
52
- .should_encode(true))
53
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
54
- .should_encode(true))
55
- .auth(Single.new('Authorization')))
56
- .response(new_response_handler)
57
- .execute
58
- end
59
-
60
- # Get a list of all SDK generations done against an API Version via the
61
- # Generate SDK endpoint.
62
- # @param [String] api_entity_id Required parameter: The ID of the API Entity
63
- # for which to list code generations.
64
- # @return [Array[APIEntityCodeGeneration]] response from the API call
65
- def list_all_code_generations_imported(api_entity_id)
66
- new_api_call_builder
67
- .request(new_request_builder(HttpMethodEnum::GET,
68
- '/api-entities/{api_entity_id}/code-generations',
69
- Server::DEFAULT)
70
- .template_param(new_parameter(api_entity_id, key: 'api_entity_id')
71
- .should_encode(true))
72
- .header_param(new_parameter('application/json', key: 'accept'))
73
- .auth(Single.new('Authorization')))
74
- .response(new_response_handler
75
- .deserializer(APIHelper.method(:custom_type_deserializer))
76
- .deserialize_into(APIEntityCodeGeneration.method(:from_hash))
77
- .is_response_array(true))
78
- .execute
79
- end
80
-
81
- # Get details on an SDK generation performed via the Generate SDK endpoint.
82
- # @param [String] api_entity_id Required parameter: The ID of the API Entity
83
- # to fetch the code generation for.
84
- # @param [String] codegen_id Required parameter: The ID of the code
85
- # generation to fetch. The code generation ID is received in the response of
86
- # the [SDK generation
87
- # call](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
88
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-imported-apis/generate-s
89
- # dk).
90
- # @return [APIEntityCodeGeneration] response from the API call
91
- def get_a_code_generation_imported(api_entity_id,
92
- codegen_id)
93
- new_api_call_builder
94
- .request(new_request_builder(HttpMethodEnum::GET,
95
- '/api-entities/{api_entity_id}/code-generations/{codegen_id}',
96
- Server::DEFAULT)
97
- .template_param(new_parameter(api_entity_id, key: 'api_entity_id')
98
- .should_encode(true))
99
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
100
- .should_encode(true))
101
- .header_param(new_parameter('application/json', key: 'accept'))
102
- .auth(Single.new('Authorization')))
103
- .response(new_response_handler
104
- .deserializer(APIHelper.method(:custom_type_deserializer))
105
- .deserialize_into(APIEntityCodeGeneration.method(:from_hash)))
106
- .execute
107
- end
108
-
109
- # Delete an SDK generation performed for an API Version via the Generate SDK
110
- # endpoint.
111
- # @param [String] api_entity_id Required parameter: The ID of the API Entity
112
- # to delete the code generation for.
113
- # @param [String] codegen_id Required parameter: The ID of the code
114
- # generation to delete. The code generation ID is received in the response
115
- # of the [SDK generation
116
- # call](https://www.apimatic.io/api-docs-preview/dashboard/60eea3b7a73395c30
117
- # 52d961b/v/3_0#/http/api-endpoints/code-generation-imported-apis/generate-s
118
- # dk).
119
- # @return [void] response from the API call
120
- def delete_code_generation(api_entity_id,
121
- codegen_id)
122
- new_api_call_builder
123
- .request(new_request_builder(HttpMethodEnum::DELETE,
124
- '/api-entities/{api_entity_id}/code-generations/{codegen_id}',
125
- Server::DEFAULT)
126
- .template_param(new_parameter(api_entity_id, key: 'api_entity_id')
127
- .should_encode(true))
128
- .template_param(new_parameter(codegen_id, key: 'codegen_id')
129
- .should_encode(true))
130
- .auth(Single.new('Authorization')))
131
- .response(new_response_handler
132
- .is_response_void(true))
133
- .execute
134
- end
135
- end
136
- end
@@ -1,220 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # The API Entity Structure encapsulates all the details of an API Entity. An
8
- # API entity is a unique API Version.
9
- class ApiEntity < BaseModel
10
- SKIP = Object.new
11
- private_constant :SKIP
12
-
13
- # Unique API Entity identifier
14
- # @return [String]
15
- attr_accessor :id
16
-
17
- # Enrcypted API Entity Id
18
- # @return [String]
19
- attr_accessor :encrypted_id
20
-
21
- # API Integration Key. Obtain from API Card on Dashboard.
22
- # @return [String]
23
- attr_accessor :api_key
24
-
25
- # Unique API Group Identifier
26
- # @return [String]
27
- attr_accessor :api_group_id
28
-
29
- # Cover Image
30
- # @return [String]
31
- attr_accessor :image_uri
32
-
33
- # Entity creation date
34
- # @return [String]
35
- attr_accessor :creation_date
36
-
37
- # API Status (Deprecated)
38
- # @return [TrueClass | FalseClass]
39
- attr_accessor :public
40
-
41
- # API Entity Name
42
- # @return [String]
43
- attr_accessor :name
44
-
45
- # Description of the API
46
- # @return [String]
47
- attr_accessor :description
48
-
49
- # Entity Version Number
50
- # @return [String]
51
- attr_accessor :version
52
-
53
- # Header Content
54
- # @return [Array[String]]
55
- attr_accessor :additional_headers
56
-
57
- # This Structure encapsulates all details of API authentication.
58
- # @return [Authentication]
59
- attr_accessor :authentication
60
-
61
- # APIMatic’s code generation engine has various code generation
62
- # configurations to customise the behaviour and outlook across the generated
63
- # SDKS. This structure encapsulates all settings for CodeGeneration.
64
- # @return [CodeGenSettings]
65
- attr_accessor :code_gen_settings
66
-
67
- # This structure helps specify additional test configurations which affects
68
- # how test cases are generated.
69
- # @return [TestGenSettings]
70
- attr_accessor :test_gen_settings
71
-
72
- # API Errors
73
- # @return [Array[String]]
74
- attr_accessor :errors
75
-
76
- # Server configurations can be used to create multiple environments,
77
- # multiple servers that can be used with specific endpoints and server URLs
78
- # with template paramters.
79
- # @return [ServerConfiguration]
80
- attr_accessor :server_configuration
81
-
82
- # API Endpoint Groups
83
- # @return [Array[EndpointsGroup]]
84
- attr_accessor :endpoints_group
85
-
86
- # API Endpoint Groups
87
- # @return [MetaData]
88
- attr_accessor :meta_data
89
-
90
- # A mapping from model property names to API property names.
91
- def self.names
92
- @_hash = {} if @_hash.nil?
93
- @_hash['id'] = 'id'
94
- @_hash['encrypted_id'] = 'encryptedId'
95
- @_hash['api_key'] = 'apiKey'
96
- @_hash['api_group_id'] = 'apiGroupId'
97
- @_hash['image_uri'] = 'imageUri'
98
- @_hash['creation_date'] = 'creationDate'
99
- @_hash['public'] = 'public'
100
- @_hash['name'] = 'name'
101
- @_hash['description'] = 'description'
102
- @_hash['version'] = 'version'
103
- @_hash['additional_headers'] = 'additionalHeaders'
104
- @_hash['authentication'] = 'authentication'
105
- @_hash['code_gen_settings'] = 'codeGenSettings'
106
- @_hash['test_gen_settings'] = 'testGenSettings'
107
- @_hash['errors'] = 'errors'
108
- @_hash['server_configuration'] = 'serverConfiguration'
109
- @_hash['endpoints_group'] = 'endpointsGroup'
110
- @_hash['meta_data'] = 'metaData'
111
- @_hash
112
- end
113
-
114
- # An array for optional fields
115
- def self.optionals
116
- []
117
- end
118
-
119
- # An array for nullable fields
120
- def self.nullables
121
- []
122
- end
123
-
124
- def initialize(id = nil,
125
- encrypted_id = nil,
126
- api_key = nil,
127
- api_group_id = nil,
128
- image_uri = nil,
129
- creation_date = nil,
130
- public = nil,
131
- name = nil,
132
- description = nil,
133
- version = nil,
134
- additional_headers = nil,
135
- authentication = nil,
136
- code_gen_settings = nil,
137
- test_gen_settings = nil,
138
- errors = nil,
139
- server_configuration = nil,
140
- endpoints_group = nil,
141
- meta_data = nil)
142
- @id = id
143
- @encrypted_id = encrypted_id
144
- @api_key = api_key
145
- @api_group_id = api_group_id
146
- @image_uri = image_uri
147
- @creation_date = creation_date
148
- @public = public
149
- @name = name
150
- @description = description
151
- @version = version
152
- @additional_headers = additional_headers
153
- @authentication = authentication
154
- @code_gen_settings = code_gen_settings
155
- @test_gen_settings = test_gen_settings
156
- @errors = errors
157
- @server_configuration = server_configuration
158
- @endpoints_group = endpoints_group
159
- @meta_data = meta_data
160
- end
161
-
162
- # Creates an instance of the object from a hash.
163
- def self.from_hash(hash)
164
- return nil unless hash
165
-
166
- # Extract variables from the hash.
167
- id = hash.key?('id') ? hash['id'] : nil
168
- encrypted_id = hash.key?('encryptedId') ? hash['encryptedId'] : nil
169
- api_key = hash.key?('apiKey') ? hash['apiKey'] : nil
170
- api_group_id = hash.key?('apiGroupId') ? hash['apiGroupId'] : nil
171
- image_uri = hash.key?('imageUri') ? hash['imageUri'] : nil
172
- creation_date = hash.key?('creationDate') ? hash['creationDate'] : nil
173
- public = hash.key?('public') ? hash['public'] : nil
174
- name = hash.key?('name') ? hash['name'] : nil
175
- description = hash.key?('description') ? hash['description'] : nil
176
- version = hash.key?('version') ? hash['version'] : nil
177
- additional_headers =
178
- hash.key?('additionalHeaders') ? hash['additionalHeaders'] : nil
179
- authentication = Authentication.from_hash(hash['authentication']) if hash['authentication']
180
- code_gen_settings = CodeGenSettings.from_hash(hash['codeGenSettings']) if
181
- hash['codeGenSettings']
182
- test_gen_settings = TestGenSettings.from_hash(hash['testGenSettings']) if
183
- hash['testGenSettings']
184
- errors = hash.key?('errors') ? hash['errors'] : nil
185
- server_configuration = ServerConfiguration.from_hash(hash['serverConfiguration']) if
186
- hash['serverConfiguration']
187
- # Parameter is an array, so we need to iterate through it
188
- endpoints_group = nil
189
- unless hash['endpointsGroup'].nil?
190
- endpoints_group = []
191
- hash['endpointsGroup'].each do |structure|
192
- endpoints_group << (EndpointsGroup.from_hash(structure) if structure)
193
- end
194
- end
195
-
196
- endpoints_group = nil unless hash.key?('endpointsGroup')
197
- meta_data = MetaData.from_hash(hash['metaData']) if hash['metaData']
198
-
199
- # Create object from extracted values.
200
- ApiEntity.new(id,
201
- encrypted_id,
202
- api_key,
203
- api_group_id,
204
- image_uri,
205
- creation_date,
206
- public,
207
- name,
208
- description,
209
- version,
210
- additional_headers,
211
- authentication,
212
- code_gen_settings,
213
- test_gen_settings,
214
- errors,
215
- server_configuration,
216
- endpoints_group,
217
- meta_data)
218
- end
219
- end
220
- end
@@ -1,131 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- require 'date'
7
- module ApimaticApi
8
- # The Code Generation structure encapsulates all the the details of an SDK
9
- # generation performed against an API Entity
10
- class APIEntityCodeGeneration < BaseModel
11
- SKIP = Object.new
12
- private_constant :SKIP
13
-
14
- # Unique Code Generation Identifier
15
- # @return [String]
16
- attr_accessor :id
17
-
18
- # The structure contains platforms that APIMatic CodeGen can generate SDKs
19
- # and Docs in.
20
- # @return [Platforms]
21
- attr_accessor :template
22
-
23
- # The generated SDK
24
- # @return [String]
25
- attr_accessor :generated_file
26
-
27
- # Generation Date and Time
28
- # @return [DateTime]
29
- attr_accessor :generated_on
30
-
31
- # The md5 hash of the API Description
32
- # @return [String]
33
- attr_accessor :hash_code
34
-
35
- # Generation Source
36
- # @return [String]
37
- attr_accessor :code_generation_source
38
-
39
- # Generation Version
40
- # @return [String]
41
- attr_accessor :code_gen_version
42
-
43
- # Generation Status
44
- # @return [TrueClass | FalseClass]
45
- attr_accessor :success
46
-
47
- # Unique API Entity Identifier
48
- # @return [String]
49
- attr_accessor :api_entity_id
50
-
51
- # A mapping from model property names to API property names.
52
- def self.names
53
- @_hash = {} if @_hash.nil?
54
- @_hash['id'] = 'id'
55
- @_hash['template'] = 'template'
56
- @_hash['generated_file'] = 'generatedFile'
57
- @_hash['generated_on'] = 'generatedOn'
58
- @_hash['hash_code'] = 'hashCode'
59
- @_hash['code_generation_source'] = 'codeGenerationSource'
60
- @_hash['code_gen_version'] = 'codeGenVersion'
61
- @_hash['success'] = 'success'
62
- @_hash['api_entity_id'] = 'apiEntityId'
63
- @_hash
64
- end
65
-
66
- # An array for optional fields
67
- def self.optionals
68
- []
69
- end
70
-
71
- # An array for nullable fields
72
- def self.nullables
73
- []
74
- end
75
-
76
- def initialize(id = nil,
77
- template = Platforms::CS_NET_STANDARD_LIB,
78
- generated_file = nil,
79
- generated_on = nil,
80
- hash_code = nil,
81
- code_generation_source = nil,
82
- code_gen_version = nil,
83
- success = nil,
84
- api_entity_id = nil)
85
- @id = id
86
- @template = template
87
- @generated_file = generated_file
88
- @generated_on = generated_on
89
- @hash_code = hash_code
90
- @code_generation_source = code_generation_source
91
- @code_gen_version = code_gen_version
92
- @success = success
93
- @api_entity_id = api_entity_id
94
- end
95
-
96
- # Creates an instance of the object from a hash.
97
- def self.from_hash(hash)
98
- return nil unless hash
99
-
100
- # Extract variables from the hash.
101
- id = hash.key?('id') ? hash['id'] : nil
102
- template = hash['template'] ||= Platforms::CS_NET_STANDARD_LIB
103
- generated_file = hash.key?('generatedFile') ? hash['generatedFile'] : nil
104
- generated_on = if hash.key?('generatedOn')
105
- (DateTimeHelper.from_rfc3339(hash['generatedOn']) if hash['generatedOn'])
106
- end
107
- hash_code = hash.key?('hashCode') ? hash['hashCode'] : nil
108
- code_generation_source =
109
- hash.key?('codeGenerationSource') ? hash['codeGenerationSource'] : nil
110
- code_gen_version =
111
- hash.key?('codeGenVersion') ? hash['codeGenVersion'] : nil
112
- success = hash.key?('success') ? hash['success'] : nil
113
- api_entity_id = hash.key?('apiEntityId') ? hash['apiEntityId'] : nil
114
-
115
- # Create object from extracted values.
116
- APIEntityCodeGeneration.new(id,
117
- template,
118
- generated_file,
119
- generated_on,
120
- hash_code,
121
- code_generation_source,
122
- code_gen_version,
123
- success,
124
- api_entity_id)
125
- end
126
-
127
- def to_custom_generated_on
128
- DateTimeHelper.to_rfc3339(generated_on)
129
- end
130
- end
131
- end
@@ -1,48 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # APIEntityIdentifier Model.
8
- class APIEntityIdentifier < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Unique API Entity Identifier
13
- # @return [String]
14
- attr_accessor :api_entity_id
15
-
16
- # A mapping from model property names to API property names.
17
- def self.names
18
- @_hash = {} if @_hash.nil?
19
- @_hash['api_entity_id'] = 'apiEntityId'
20
- @_hash
21
- end
22
-
23
- # An array for optional fields
24
- def self.optionals
25
- []
26
- end
27
-
28
- # An array for nullable fields
29
- def self.nullables
30
- []
31
- end
32
-
33
- def initialize(api_entity_id = nil)
34
- @api_entity_id = api_entity_id
35
- end
36
-
37
- # Creates an instance of the object from a hash.
38
- def self.from_hash(hash)
39
- return nil unless hash
40
-
41
- # Extract variables from the hash.
42
- api_entity_id = hash.key?('apiEntityId') ? hash['apiEntityId'] : nil
43
-
44
- # Create object from extracted values.
45
- APIEntityIdentifier.new(api_entity_id)
46
- end
47
- end
48
- end
@@ -1,48 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # The structure contain attribute details of a parameter type.
8
- class Attributes < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Unique Attribute Identifier
13
- # @return [String]
14
- attr_accessor :id
15
-
16
- # A mapping from model property names to API property names.
17
- def self.names
18
- @_hash = {} if @_hash.nil?
19
- @_hash['id'] = 'id'
20
- @_hash
21
- end
22
-
23
- # An array for optional fields
24
- def self.optionals
25
- []
26
- end
27
-
28
- # An array for nullable fields
29
- def self.nullables
30
- []
31
- end
32
-
33
- def initialize(id = nil)
34
- @id = id
35
- end
36
-
37
- # Creates an instance of the object from a hash.
38
- def self.from_hash(hash)
39
- return nil unless hash
40
-
41
- # Extract variables from the hash.
42
- id = hash.key?('id') ? hash['id'] : nil
43
-
44
- # Create object from extracted values.
45
- Attributes.new(id)
46
- end
47
- end
48
- end
@@ -1,75 +0,0 @@
1
- # apimatic_api
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module ApimaticApi
7
- # AuthScope Model.
8
- class AuthScope < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Scope Id
13
- # @return [String]
14
- attr_accessor :id
15
-
16
- # Scope Name
17
- # @return [String]
18
- attr_accessor :name
19
-
20
- # Scope Value
21
- # @return [String]
22
- attr_accessor :value
23
-
24
- # Scope Description
25
- # @return [String]
26
- attr_accessor :description
27
-
28
- # A mapping from model property names to API property names.
29
- def self.names
30
- @_hash = {} if @_hash.nil?
31
- @_hash['id'] = 'id'
32
- @_hash['name'] = 'name'
33
- @_hash['value'] = 'value'
34
- @_hash['description'] = 'description'
35
- @_hash
36
- end
37
-
38
- # An array for optional fields
39
- def self.optionals
40
- []
41
- end
42
-
43
- # An array for nullable fields
44
- def self.nullables
45
- []
46
- end
47
-
48
- def initialize(id = nil,
49
- name = nil,
50
- value = nil,
51
- description = nil)
52
- @id = id
53
- @name = name
54
- @value = value
55
- @description = description
56
- end
57
-
58
- # Creates an instance of the object from a hash.
59
- def self.from_hash(hash)
60
- return nil unless hash
61
-
62
- # Extract variables from the hash.
63
- id = hash.key?('id') ? hash['id'] : nil
64
- name = hash.key?('name') ? hash['name'] : nil
65
- value = hash.key?('value') ? hash['value'] : nil
66
- description = hash.key?('description') ? hash['description'] : nil
67
-
68
- # Create object from extracted values.
69
- AuthScope.new(id,
70
- name,
71
- value,
72
- description)
73
- end
74
- end
75
- end