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,69 +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 user can specify multiple servers within an environment. A server
|
|
8
|
-
# comprises of a name and a URL. The names of the hosts remain consistent over
|
|
9
|
-
# different environments but their values may vary. The URL values can contain
|
|
10
|
-
# any number of parameters defined.
|
|
11
|
-
class Server < BaseModel
|
|
12
|
-
SKIP = Object.new
|
|
13
|
-
private_constant :SKIP
|
|
14
|
-
|
|
15
|
-
# Unique Server identifier
|
|
16
|
-
# @return [String]
|
|
17
|
-
attr_accessor :id
|
|
18
|
-
|
|
19
|
-
# Server Name
|
|
20
|
-
# @return [String]
|
|
21
|
-
attr_accessor :name
|
|
22
|
-
|
|
23
|
-
# Server URL
|
|
24
|
-
# @return [String]
|
|
25
|
-
attr_accessor :url
|
|
26
|
-
|
|
27
|
-
# A mapping from model property names to API property names.
|
|
28
|
-
def self.names
|
|
29
|
-
@_hash = {} if @_hash.nil?
|
|
30
|
-
@_hash['id'] = 'id'
|
|
31
|
-
@_hash['name'] = 'name'
|
|
32
|
-
@_hash['url'] = 'url'
|
|
33
|
-
@_hash
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# An array for optional fields
|
|
37
|
-
def self.optionals
|
|
38
|
-
[]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# An array for nullable fields
|
|
42
|
-
def self.nullables
|
|
43
|
-
[]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def initialize(id = nil,
|
|
47
|
-
name = nil,
|
|
48
|
-
url = nil)
|
|
49
|
-
@id = id
|
|
50
|
-
@name = name
|
|
51
|
-
@url = url
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Creates an instance of the object from a hash.
|
|
55
|
-
def self.from_hash(hash)
|
|
56
|
-
return nil unless hash
|
|
57
|
-
|
|
58
|
-
# Extract variables from the hash.
|
|
59
|
-
id = hash.key?('id') ? hash['id'] : nil
|
|
60
|
-
name = hash.key?('name') ? hash['name'] : nil
|
|
61
|
-
url = hash.key?('url') ? hash['url'] : nil
|
|
62
|
-
|
|
63
|
-
# Create object from extracted values.
|
|
64
|
-
Server.new(id,
|
|
65
|
-
name,
|
|
66
|
-
url)
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
@@ -1,105 +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
|
-
# Server configurations can be used to create multiple environments, multiple
|
|
8
|
-
# servers that can be used with specific endpoints and server URLs with
|
|
9
|
-
# template paramters.
|
|
10
|
-
class ServerConfiguration < BaseModel
|
|
11
|
-
SKIP = Object.new
|
|
12
|
-
private_constant :SKIP
|
|
13
|
-
|
|
14
|
-
# Server Config Identifier
|
|
15
|
-
# @return [String]
|
|
16
|
-
attr_accessor :id
|
|
17
|
-
|
|
18
|
-
# Default Environment
|
|
19
|
-
# @return [String]
|
|
20
|
-
attr_accessor :default_environment
|
|
21
|
-
|
|
22
|
-
# Default Server
|
|
23
|
-
# @return [String]
|
|
24
|
-
attr_accessor :default_server
|
|
25
|
-
|
|
26
|
-
# Environment Identifier and Name
|
|
27
|
-
# @return [Array[Environment]]
|
|
28
|
-
attr_accessor :environments
|
|
29
|
-
|
|
30
|
-
# Parameter Attributes
|
|
31
|
-
# @return [Array[Parameter]]
|
|
32
|
-
attr_accessor :parameters
|
|
33
|
-
|
|
34
|
-
# A mapping from model property names to API property names.
|
|
35
|
-
def self.names
|
|
36
|
-
@_hash = {} if @_hash.nil?
|
|
37
|
-
@_hash['id'] = 'id'
|
|
38
|
-
@_hash['default_environment'] = 'defaultEnvironment'
|
|
39
|
-
@_hash['default_server'] = 'defaultServer'
|
|
40
|
-
@_hash['environments'] = 'environments'
|
|
41
|
-
@_hash['parameters'] = 'parameters'
|
|
42
|
-
@_hash
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# An array for optional fields
|
|
46
|
-
def self.optionals
|
|
47
|
-
[]
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# An array for nullable fields
|
|
51
|
-
def self.nullables
|
|
52
|
-
[]
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def initialize(id = nil,
|
|
56
|
-
default_environment = nil,
|
|
57
|
-
default_server = nil,
|
|
58
|
-
environments = nil,
|
|
59
|
-
parameters = nil)
|
|
60
|
-
@id = id
|
|
61
|
-
@default_environment = default_environment
|
|
62
|
-
@default_server = default_server
|
|
63
|
-
@environments = environments
|
|
64
|
-
@parameters = parameters
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Creates an instance of the object from a hash.
|
|
68
|
-
def self.from_hash(hash)
|
|
69
|
-
return nil unless hash
|
|
70
|
-
|
|
71
|
-
# Extract variables from the hash.
|
|
72
|
-
id = hash.key?('id') ? hash['id'] : nil
|
|
73
|
-
default_environment =
|
|
74
|
-
hash.key?('defaultEnvironment') ? hash['defaultEnvironment'] : nil
|
|
75
|
-
default_server = hash.key?('defaultServer') ? hash['defaultServer'] : nil
|
|
76
|
-
# Parameter is an array, so we need to iterate through it
|
|
77
|
-
environments = nil
|
|
78
|
-
unless hash['environments'].nil?
|
|
79
|
-
environments = []
|
|
80
|
-
hash['environments'].each do |structure|
|
|
81
|
-
environments << (Environment.from_hash(structure) if structure)
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
environments = nil unless hash.key?('environments')
|
|
86
|
-
# Parameter is an array, so we need to iterate through it
|
|
87
|
-
parameters = nil
|
|
88
|
-
unless hash['parameters'].nil?
|
|
89
|
-
parameters = []
|
|
90
|
-
hash['parameters'].each do |structure|
|
|
91
|
-
parameters << (Parameter.from_hash(structure) if structure)
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
parameters = nil unless hash.key?('parameters')
|
|
96
|
-
|
|
97
|
-
# Create object from extracted values.
|
|
98
|
-
ServerConfiguration.new(id,
|
|
99
|
-
default_environment,
|
|
100
|
-
default_server,
|
|
101
|
-
environments,
|
|
102
|
-
parameters)
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
end
|
|
@@ -1,70 +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
|
-
# This structure helps specify additional test configurations which affects
|
|
8
|
-
# how test cases are generated.
|
|
9
|
-
class TestGenSettings < BaseModel
|
|
10
|
-
SKIP = Object.new
|
|
11
|
-
private_constant :SKIP
|
|
12
|
-
|
|
13
|
-
# Error margin for comparing values in decimal places
|
|
14
|
-
# @return [Float]
|
|
15
|
-
attr_accessor :precision_delta
|
|
16
|
-
|
|
17
|
-
# Number of seconds after which if the endpoint is not returning any
|
|
18
|
-
# response, the test is forced to fail e.g. a timeout of 60
|
|
19
|
-
# @return [Integer]
|
|
20
|
-
attr_accessor :test_timeout
|
|
21
|
-
|
|
22
|
-
# The parameters allows to provide values for configuration file for use in
|
|
23
|
-
# the test environment
|
|
24
|
-
# @return [Object]
|
|
25
|
-
attr_accessor :configuration
|
|
26
|
-
|
|
27
|
-
# A mapping from model property names to API property names.
|
|
28
|
-
def self.names
|
|
29
|
-
@_hash = {} if @_hash.nil?
|
|
30
|
-
@_hash['precision_delta'] = 'precisionDelta'
|
|
31
|
-
@_hash['test_timeout'] = 'testTimeout'
|
|
32
|
-
@_hash['configuration'] = 'configuration'
|
|
33
|
-
@_hash
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# An array for optional fields
|
|
37
|
-
def self.optionals
|
|
38
|
-
[]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# An array for nullable fields
|
|
42
|
-
def self.nullables
|
|
43
|
-
[]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def initialize(precision_delta = nil,
|
|
47
|
-
test_timeout = nil,
|
|
48
|
-
configuration = nil)
|
|
49
|
-
@precision_delta = precision_delta
|
|
50
|
-
@test_timeout = test_timeout
|
|
51
|
-
@configuration = configuration
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Creates an instance of the object from a hash.
|
|
55
|
-
def self.from_hash(hash)
|
|
56
|
-
return nil unless hash
|
|
57
|
-
|
|
58
|
-
# Extract variables from the hash.
|
|
59
|
-
precision_delta =
|
|
60
|
-
hash.key?('precisionDelta') ? hash['precisionDelta'] : nil
|
|
61
|
-
test_timeout = hash.key?('testTimeout') ? hash['testTimeout'] : nil
|
|
62
|
-
configuration = hash.key?('configuration') ? hash['configuration'] : nil
|
|
63
|
-
|
|
64
|
-
# Create object from extracted values.
|
|
65
|
-
TestGenSettings.new(precision_delta,
|
|
66
|
-
test_timeout,
|
|
67
|
-
configuration)
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
@@ -1,61 +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
|
-
# TransformViaFileRequestBody Model.
|
|
8
|
-
class TransformViaFileRequestBody < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# The API specification file.<br>The type of the specification file should
|
|
13
|
-
# be any of the [supported
|
|
14
|
-
# formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
|
|
15
|
-
# ported-input-formats).
|
|
16
|
-
# @return [Binary]
|
|
17
|
-
attr_accessor :file
|
|
18
|
-
|
|
19
|
-
# The structure contains API specification formats that Transformer can
|
|
20
|
-
# convert to.
|
|
21
|
-
# @return [ExportFormats]
|
|
22
|
-
attr_accessor :export_format
|
|
23
|
-
|
|
24
|
-
# A mapping from model property names to API property names.
|
|
25
|
-
def self.names
|
|
26
|
-
@_hash = {} if @_hash.nil?
|
|
27
|
-
@_hash['file'] = 'file'
|
|
28
|
-
@_hash['export_format'] = 'export_format'
|
|
29
|
-
@_hash
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# An array for optional fields
|
|
33
|
-
def self.optionals
|
|
34
|
-
[]
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# An array for nullable fields
|
|
38
|
-
def self.nullables
|
|
39
|
-
[]
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def initialize(file = nil,
|
|
43
|
-
export_format = nil)
|
|
44
|
-
@file = file
|
|
45
|
-
@export_format = export_format
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Creates an instance of the object from a hash.
|
|
49
|
-
def self.from_hash(hash)
|
|
50
|
-
return nil unless hash
|
|
51
|
-
|
|
52
|
-
# Extract variables from the hash.
|
|
53
|
-
file = hash.key?('file') ? hash['file'] : nil
|
|
54
|
-
export_format = hash.key?('export_format') ? hash['export_format'] : nil
|
|
55
|
-
|
|
56
|
-
# Create object from extracted values.
|
|
57
|
-
TransformViaFileRequestBody.new(file,
|
|
58
|
-
export_format)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
@@ -1,57 +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
|
-
# UserCodeGenerationRequirements Model.
|
|
8
|
-
class UserCodeGenerationRequirements < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# Unique User Identifier
|
|
13
|
-
# @return [String]
|
|
14
|
-
attr_accessor :user_id
|
|
15
|
-
|
|
16
|
-
# API Specification file in a supported format
|
|
17
|
-
# @return [String]
|
|
18
|
-
attr_accessor :input_file
|
|
19
|
-
|
|
20
|
-
# A mapping from model property names to API property names.
|
|
21
|
-
def self.names
|
|
22
|
-
@_hash = {} if @_hash.nil?
|
|
23
|
-
@_hash['user_id'] = 'userId'
|
|
24
|
-
@_hash['input_file'] = 'inputFile'
|
|
25
|
-
@_hash
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# An array for optional fields
|
|
29
|
-
def self.optionals
|
|
30
|
-
[]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# An array for nullable fields
|
|
34
|
-
def self.nullables
|
|
35
|
-
[]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def initialize(user_id = nil,
|
|
39
|
-
input_file = nil)
|
|
40
|
-
@user_id = user_id
|
|
41
|
-
@input_file = input_file
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Creates an instance of the object from a hash.
|
|
45
|
-
def self.from_hash(hash)
|
|
46
|
-
return nil unless hash
|
|
47
|
-
|
|
48
|
-
# Extract variables from the hash.
|
|
49
|
-
user_id = hash.key?('userId') ? hash['userId'] : nil
|
|
50
|
-
input_file = hash.key?('inputFile') ? hash['inputFile'] : nil
|
|
51
|
-
|
|
52
|
-
# Create object from extracted values.
|
|
53
|
-
UserCodeGenerationRequirements.new(user_id,
|
|
54
|
-
input_file)
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,51 +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
|
-
# ValidateAPIViaFileRequestBody Model.
|
|
8
|
-
class ValidateAPIViaFileRequestBody < BaseModel
|
|
9
|
-
SKIP = Object.new
|
|
10
|
-
private_constant :SKIP
|
|
11
|
-
|
|
12
|
-
# The API specification file.<br>The type of the specification file should
|
|
13
|
-
# be any of the [supported
|
|
14
|
-
# formats](https://docs.apimatic.io/api-transformer/overview-transformer#sup
|
|
15
|
-
# ported-input-formats).
|
|
16
|
-
# @return [Binary]
|
|
17
|
-
attr_accessor :file
|
|
18
|
-
|
|
19
|
-
# A mapping from model property names to API property names.
|
|
20
|
-
def self.names
|
|
21
|
-
@_hash = {} if @_hash.nil?
|
|
22
|
-
@_hash['file'] = 'file'
|
|
23
|
-
@_hash
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# An array for optional fields
|
|
27
|
-
def self.optionals
|
|
28
|
-
[]
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# An array for nullable fields
|
|
32
|
-
def self.nullables
|
|
33
|
-
[]
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def initialize(file = nil)
|
|
37
|
-
@file = file
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Creates an instance of the object from a hash.
|
|
41
|
-
def self.from_hash(hash)
|
|
42
|
-
return nil unless hash
|
|
43
|
-
|
|
44
|
-
# Extract variables from the hash.
|
|
45
|
-
file = hash.key?('file') ? hash['file'] : nil
|
|
46
|
-
|
|
47
|
-
# Create object from extracted values.
|
|
48
|
-
ValidateAPIViaFileRequestBody.new(file)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
-
# ( https://apimatic.io ).
|
|
5
|
-
|
|
6
|
-
require 'json'
|
|
7
|
-
require 'minitest/autorun'
|
|
8
|
-
require 'minitest/hell'
|
|
9
|
-
require 'minitest/pride'
|
|
10
|
-
require 'minitest/proveit'
|
|
11
|
-
require 'apimatic_api'
|
|
12
|
-
require_relative '../http_response_catcher'
|
|
13
|
-
|
|
14
|
-
class ControllerTestBase < Minitest::Test
|
|
15
|
-
parallelize_me!
|
|
16
|
-
include ApimaticApi
|
|
17
|
-
include CoreLibrary
|
|
18
|
-
|
|
19
|
-
# Create configuration and set any test parameters
|
|
20
|
-
def create_configuration
|
|
21
|
-
Configuration.new(http_callback: HttpResponseCatcher.new)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Initializes the base test controller
|
|
25
|
-
def setup_class
|
|
26
|
-
_config = create_configuration
|
|
27
|
-
@client = Client.new(config: _config)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
-
# ( https://apimatic.io ).
|
|
5
|
-
|
|
6
|
-
require_relative 'controller_test_base'
|
|
7
|
-
|
|
8
|
-
class APIValidationExternalApisControllerTests < ControllerTestBase
|
|
9
|
-
# Called only once for the class before any test has executed
|
|
10
|
-
def setup
|
|
11
|
-
setup_class
|
|
12
|
-
@controller = @client.api_validation_external_apis
|
|
13
|
-
@response_catcher = @controller.http_call_back
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Validate an API by providing the URL of the API specification file.
|
|
17
|
-
#
|
|
18
|
-
#You can also specify [API Metadata](https://docs.apimatic.io/manage-apis/apimatic-metadata) while validating the API using this endpoint. When specifying Metadata, the URL provided will be that of a zip file containing the API specification file and the `APIMATIC-META` json file.
|
|
19
|
-
def test_validate_api_via_url
|
|
20
|
-
# Parameters for the API call
|
|
21
|
-
description_url = 'https://petstore.swagger.io/v2/swagger.json'
|
|
22
|
-
|
|
23
|
-
# Perform the API call through the SDK function
|
|
24
|
-
result = @controller.validate_api_via_url(description_url)
|
|
25
|
-
|
|
26
|
-
# Test response code
|
|
27
|
-
assert_equal(200, @response_catcher.response.status_code)
|
|
28
|
-
|
|
29
|
-
# Test headers
|
|
30
|
-
expected_headers = {}
|
|
31
|
-
expected_headers['content-type'] = 'application/json'
|
|
32
|
-
|
|
33
|
-
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
34
|
-
|
|
35
|
-
# Test whether the captured response is as we expected
|
|
36
|
-
refute_nil(result)
|
|
37
|
-
expected_body = JSON.parse(
|
|
38
|
-
'{"success":true,"errors":[],"warnings":["Media type <i><code>applicatio'\
|
|
39
|
-
'n/json; charset=utf-8</code></i> content definition of response code <i'\
|
|
40
|
-
'><code>429</code></i> in endpoint <i><code>getRealTimeData</code></i> o'\
|
|
41
|
-
'f group <i><code>data</code></i> contains an example value with followi'\
|
|
42
|
-
'ng undeclared fields: <i><code>detail</i></code>.","Endpoint <i><code>g'\
|
|
43
|
-
'etRealTimeData</code></i> has an example specified for error code <i><c'\
|
|
44
|
-
'ode>429</code></i> which contains following undeclared fields: <i><code'\
|
|
45
|
-
'>detail</i></code>.","Media type <i><code>application/json; charset=utf'\
|
|
46
|
-
'-8</code></i> content definition of response code <i><code>429</code></'\
|
|
47
|
-
'i> in endpoint <i><code>getDataPerCategory</code></i> of group <i><code'\
|
|
48
|
-
'>data</code></i> contains an example value with following undeclared fi'\
|
|
49
|
-
'elds: <i><code>detail</i></code>.","Endpoint <i><code>getDataPerCategor'\
|
|
50
|
-
'y</code></i> has an example specified for error code <i><code>429</code'\
|
|
51
|
-
'></i> which contains following undeclared fields: <i><code>detail</i></'\
|
|
52
|
-
'code>.","Media type <i><code>application/json; charset=utf-8</code></i>'\
|
|
53
|
-
' content definition of response code <i><code>429</code></i> in endpoin'\
|
|
54
|
-
't <i><code>getData</code></i> of group <i><code>data</code></i> contain'\
|
|
55
|
-
's an example value with following undeclared fields: <i><code>detail</i'\
|
|
56
|
-
'></code>.","Endpoint <i><code>getData</code></i> has an example specifi'\
|
|
57
|
-
'ed for error code <i><code>429</code></i> which contains following unde'\
|
|
58
|
-
'clared fields: <i><code>detail</i></code>.","Media type <i><code>applic'\
|
|
59
|
-
'ation/json; charset=utf-8</code></i> content definition of response cod'\
|
|
60
|
-
'e <i><code>429</code></i> in endpoint <i><code>getActiveStatuses</code>'\
|
|
61
|
-
'</i> of group <i><code>statuses</code></i> contains an example value wi'\
|
|
62
|
-
'th following undeclared fields: <i><code>detail</i></code>.","Endpoint '\
|
|
63
|
-
'<i><code>getActiveStatuses</code></i> has an example specified for erro'\
|
|
64
|
-
'r code <i><code>429</code></i> which contains following undeclared fiel'\
|
|
65
|
-
'ds: <i><code>detail</i></code>.","Media type <i><code>application/json;'\
|
|
66
|
-
' charset=utf-8</code></i> content definition of response code <i><code>'\
|
|
67
|
-
'200</code></i> in endpoint <i><code>getDevices</code></i> of group <i><'\
|
|
68
|
-
'code>assets</code></i> contains an example value with following undecla'\
|
|
69
|
-
'red fields: <i><code>deviceModelId</code></i>, <i><code>manufacturer</c'\
|
|
70
|
-
'ode></i>, <i><code>model</i></code>.","Media type <i><code>application/'\
|
|
71
|
-
'json; charset=utf-8</code></i> content definition of response code <i><'\
|
|
72
|
-
'code>429</code></i> in endpoint <i><code>getDevices</code></i> of group'\
|
|
73
|
-
' <i><code>assets</code></i> contains an example value with following un'\
|
|
74
|
-
'declared fields: <i><code>detail</i></code>.","Endpoint <i><code>getDev'\
|
|
75
|
-
'ices</code></i> has an example specified for error code <i><code>429</c'\
|
|
76
|
-
'ode></i> which contains following undeclared fields: <i><code>detail</i'\
|
|
77
|
-
'></code>.","Media type <i><code>application/json; charset=utf-8</code><'\
|
|
78
|
-
'/i> content definition of response code <i><code>429</code></i> in endp'\
|
|
79
|
-
'oint <i><code>getAlarms</code></i> of group <i><code>alerts</code></i> '\
|
|
80
|
-
'contains an example value with following undeclared fields: <i><code>de'\
|
|
81
|
-
'tail</i></code>.","Endpoint <i><code>getAlarms</code></i> has an exampl'\
|
|
82
|
-
'e specified for error code <i><code>429</code></i> which contains follo'\
|
|
83
|
-
'wing undeclared fields: <i><code>detail</i></code>.","Media type <i><co'\
|
|
84
|
-
'de>application/json; charset=utf-8</code></i> content definition of res'\
|
|
85
|
-
'ponse code <i><code>429</code></i> in endpoint <i><code>getActiveAlerts'\
|
|
86
|
-
'</code></i> of group <i><code>alerts</code></i> contains an example val'\
|
|
87
|
-
'ue with following undeclared fields: <i><code>detail</i></code>.","Endp'\
|
|
88
|
-
'oint <i><code>getActiveAlerts</code></i> has an example specified for e'\
|
|
89
|
-
'rror code <i><code>429</code></i> which contains following undeclared f'\
|
|
90
|
-
'ields: <i><code>detail</i></code>.","Media type <i><code>application/js'\
|
|
91
|
-
'on; charset=utf-8</code></i> content definition of response code <i><co'\
|
|
92
|
-
'de>429</code></i> in endpoint <i><code>getAlerts</code></i> of group <i'\
|
|
93
|
-
'><code>alerts</code></i> contains an example value with following undec'\
|
|
94
|
-
'lared fields: <i><code>detail</i></code>.","Endpoint <i><code>getAlerts'\
|
|
95
|
-
'</code></i> has an example specified for error code <i><code>429</code>'\
|
|
96
|
-
'</i> which contains following undeclared fields: <i><code>detail</i></c'\
|
|
97
|
-
'ode>.","Media type <i><code>application/json; charset=utf-8</code></i> '\
|
|
98
|
-
'content definition of response code <i><code>429</code></i> in endpoint'\
|
|
99
|
-
' <i><code>getConfiguration</code></i> of group <i><code>configuration d'\
|
|
100
|
-
'ata</code></i> contains an example value with following undeclared fiel'\
|
|
101
|
-
'ds: <i><code>detail</i></code>.","Endpoint <i><code>getConfiguration</c'\
|
|
102
|
-
'ode></i> has an example specified for error code <i><code>429</code></i'\
|
|
103
|
-
'> which contains following undeclared fields: <i><code>detail</i></code'\
|
|
104
|
-
'>.","Media type <i><code>application/json; charset=utf-8</code></i> con'\
|
|
105
|
-
'tent definition of response code <i><code>429</code></i> in endpoint <i'\
|
|
106
|
-
'><code>getActiveAlarms</code></i> of group <i><code>alerts</code></i> c'\
|
|
107
|
-
'ontains an example value with following undeclared fields: <i><code>det'\
|
|
108
|
-
'ail</i></code>.","Endpoint <i><code>getActiveAlarms</code></i> has an e'\
|
|
109
|
-
'xample specified for error code <i><code>429</code></i> which contains '\
|
|
110
|
-
'following undeclared fields: <i><code>detail</i></code>.","Media type <'\
|
|
111
|
-
'i><code>application/json; charset=utf-8</code></i> content definition o'\
|
|
112
|
-
'f response code <i><code>429</code></i> in endpoint <i><code>getPowerCu'\
|
|
113
|
-
'rves</code></i> of group <i><code>assets</code></i> contains an example'\
|
|
114
|
-
' value with following undeclared fields: <i><code>detail</i></code>.","'\
|
|
115
|
-
'Endpoint <i><code>getPowerCurves</code></i> has an example specified fo'\
|
|
116
|
-
'r error code <i><code>429</code></i> which contains following undeclare'\
|
|
117
|
-
'd fields: <i><code>detail</i></code>.","Media type <i><code>application'\
|
|
118
|
-
'/json; charset=utf-8</code></i> content definition of response code <i>'\
|
|
119
|
-
'<code>429</code></i> in endpoint <i><code>getDataSignals</code></i> of '\
|
|
120
|
-
'group <i><code>data</code></i> contains an example value with following'\
|
|
121
|
-
' undeclared fields: <i><code>detail</i></code>.","Endpoint <i><code>get'\
|
|
122
|
-
'DataSignals</code></i> has an example specified for error code <i><code'\
|
|
123
|
-
'>429</code></i> which contains following undeclared fields: <i><code>de'\
|
|
124
|
-
'tail</i></code>.","Media type <i><code>application/json; charset=utf-8<'\
|
|
125
|
-
'/code></i> content definition of response code <i><code>429</code></i> '\
|
|
126
|
-
'in endpoint <i><code>getStatuses</code></i> of group <i><code>statuses<'\
|
|
127
|
-
'/code></i> contains an example value with following undeclared fields: '\
|
|
128
|
-
'<i><code>detail</i></code>.","Endpoint <i><code>getStatuses</code></i> '\
|
|
129
|
-
'has an example specified for error code <i><code>429</code></i> which c'\
|
|
130
|
-
'ontains following undeclared fields: <i><code>detail</i></code>.","Medi'\
|
|
131
|
-
'a type <i><code>application/json; charset=utf-8</code></i> content defi'\
|
|
132
|
-
'nition of response code <i><code>429</code></i> in endpoint <i><code>ge'\
|
|
133
|
-
'tSites</code></i> of group <i><code>assets</code></i> contains an examp'\
|
|
134
|
-
'le value with following undeclared fields: <i><code>detail</i></code>."'\
|
|
135
|
-
',"Endpoint <i><code>getSites</code></i> has an example specified for er'\
|
|
136
|
-
'ror code <i><code>429</code></i> which contains following undeclared fi'\
|
|
137
|
-
'elds: <i><code>detail</i></code>."],"messages":["One or more elements i'\
|
|
138
|
-
'n the API specification has a missing description field."]}'
|
|
139
|
-
)
|
|
140
|
-
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
141
|
-
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
end
|