sdksio-apimatic-sdk 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +82 -0
  4. data/lib/apimatic_api/api_helper.rb +10 -0
  5. data/lib/apimatic_api/client.rb +96 -0
  6. data/lib/apimatic_api/configuration.rb +125 -0
  7. data/lib/apimatic_api/controllers/api_validation_external_apis_controller.rb +84 -0
  8. data/lib/apimatic_api/controllers/api_validation_imported_apis_controller.rb +74 -0
  9. data/lib/apimatic_api/controllers/apis_management_controller.rb +260 -0
  10. data/lib/apimatic_api/controllers/base_controller.rb +66 -0
  11. data/lib/apimatic_api/controllers/code_generation_external_apis_controller.rb +178 -0
  12. data/lib/apimatic_api/controllers/code_generation_imported_apis_controller.rb +136 -0
  13. data/lib/apimatic_api/controllers/docs_portal_management_controller.rb +198 -0
  14. data/lib/apimatic_api/controllers/transformation_controller.rb +174 -0
  15. data/lib/apimatic_api/exceptions/api_exception.rb +10 -0
  16. data/lib/apimatic_api/http/auth/custom_header_authentication.rb +42 -0
  17. data/lib/apimatic_api/http/http_call_back.rb +10 -0
  18. data/lib/apimatic_api/http/http_method_enum.rb +10 -0
  19. data/lib/apimatic_api/http/http_request.rb +10 -0
  20. data/lib/apimatic_api/http/http_response.rb +10 -0
  21. data/lib/apimatic_api/models/api_entity.rb +220 -0
  22. data/lib/apimatic_api/models/api_entity_code_generation.rb +131 -0
  23. data/lib/apimatic_api/models/api_entity_identifier.rb +48 -0
  24. data/lib/apimatic_api/models/api_validation_summary.rb +75 -0
  25. data/lib/apimatic_api/models/attributes.rb +48 -0
  26. data/lib/apimatic_api/models/auth_scope.rb +75 -0
  27. data/lib/apimatic_api/models/authentication.rb +112 -0
  28. data/lib/apimatic_api/models/base_model.rb +62 -0
  29. data/lib/apimatic_api/models/code_gen_settings.rb +541 -0
  30. data/lib/apimatic_api/models/code_generation.rb +122 -0
  31. data/lib/apimatic_api/models/docs_validation_summary.rb +75 -0
  32. data/lib/apimatic_api/models/endpoints_group.rb +57 -0
  33. data/lib/apimatic_api/models/environment.rb +79 -0
  34. data/lib/apimatic_api/models/export_formats.rb +60 -0
  35. data/lib/apimatic_api/models/field.rb +156 -0
  36. data/lib/apimatic_api/models/generate_on_prem_portal_via_build_input_request_body.rb +48 -0
  37. data/lib/apimatic_api/models/generate_sdk_via_file_request_body.rb +61 -0
  38. data/lib/apimatic_api/models/generate_sdk_via_url_request.rb +59 -0
  39. data/lib/apimatic_api/models/import_api_version_via_url_request.rb +64 -0
  40. data/lib/apimatic_api/models/import_api_via_file_request_body.rb +51 -0
  41. data/lib/apimatic_api/models/import_api_via_url_request.rb +49 -0
  42. data/lib/apimatic_api/models/import_new_api_version_via_file_request_body.rb +66 -0
  43. data/lib/apimatic_api/models/import_validation_summary.rb +75 -0
  44. data/lib/apimatic_api/models/inplace_api_import_binary_file.rb +51 -0
  45. data/lib/apimatic_api/models/inplace_import_api_via_url_request.rb +49 -0
  46. data/lib/apimatic_api/models/meta_data.rb +70 -0
  47. data/lib/apimatic_api/models/parameter.rb +165 -0
  48. data/lib/apimatic_api/models/paramter_format_details.rb +48 -0
  49. data/lib/apimatic_api/models/platforms.rb +39 -0
  50. data/lib/apimatic_api/models/platforms_template.rb +49 -0
  51. data/lib/apimatic_api/models/server.rb +69 -0
  52. data/lib/apimatic_api/models/server_configuration.rb +105 -0
  53. data/lib/apimatic_api/models/test_gen_settings.rb +70 -0
  54. data/lib/apimatic_api/models/transform_via_file_request_body.rb +61 -0
  55. data/lib/apimatic_api/models/transform_via_url_request.rb +60 -0
  56. data/lib/apimatic_api/models/transformation.rb +152 -0
  57. data/lib/apimatic_api/models/user_code_generation.rb +140 -0
  58. data/lib/apimatic_api/models/user_code_generation_requirements.rb +57 -0
  59. data/lib/apimatic_api/models/validate_api_via_file_request_body.rb +51 -0
  60. data/lib/apimatic_api/utilities/date_time_helper.rb +11 -0
  61. data/lib/apimatic_api/utilities/file_wrapper.rb +16 -0
  62. data/lib/apimatic_api.rb +86 -0
  63. data/test/controllers/controller_test_base.rb +29 -0
  64. data/test/controllers/test_api_validation_external_apis_controller.rb +144 -0
  65. data/test/controllers/test_api_validation_imported_apis_controller.rb +2971 -0
  66. data/test/controllers/test_code_generation_external_apis_controller.rb +32 -0
  67. data/test/controllers/test_docs_portal_management_controller.rb +94 -0
  68. data/test/controllers/test_transformation_controller.rb +32 -0
  69. data/test/http_response_catcher.rb +19 -0
  70. metadata +187 -0
@@ -0,0 +1,122 @@
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 CodeGeneration < 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
+ # A mapping from model property names to API property names.
48
+ def self.names
49
+ @_hash = {} if @_hash.nil?
50
+ @_hash['id'] = 'id'
51
+ @_hash['template'] = 'template'
52
+ @_hash['generated_file'] = 'generatedFile'
53
+ @_hash['generated_on'] = 'generatedOn'
54
+ @_hash['hash_code'] = 'hashCode'
55
+ @_hash['code_generation_source'] = 'codeGenerationSource'
56
+ @_hash['code_gen_version'] = 'codeGenVersion'
57
+ @_hash['success'] = 'success'
58
+ @_hash
59
+ end
60
+
61
+ # An array for optional fields
62
+ def self.optionals
63
+ []
64
+ end
65
+
66
+ # An array for nullable fields
67
+ def self.nullables
68
+ []
69
+ end
70
+
71
+ def initialize(id = nil,
72
+ template = Platforms::CS_NET_STANDARD_LIB,
73
+ generated_file = nil,
74
+ generated_on = nil,
75
+ hash_code = nil,
76
+ code_generation_source = nil,
77
+ code_gen_version = nil,
78
+ success = nil)
79
+ @id = id
80
+ @template = template
81
+ @generated_file = generated_file
82
+ @generated_on = generated_on
83
+ @hash_code = hash_code
84
+ @code_generation_source = code_generation_source
85
+ @code_gen_version = code_gen_version
86
+ @success = success
87
+ end
88
+
89
+ # Creates an instance of the object from a hash.
90
+ def self.from_hash(hash)
91
+ return nil unless hash
92
+
93
+ # Extract variables from the hash.
94
+ id = hash.key?('id') ? hash['id'] : nil
95
+ template = hash['template'] ||= Platforms::CS_NET_STANDARD_LIB
96
+ generated_file = hash.key?('generatedFile') ? hash['generatedFile'] : nil
97
+ generated_on = if hash.key?('generatedOn')
98
+ (DateTimeHelper.from_rfc3339(hash['generatedOn']) if hash['generatedOn'])
99
+ end
100
+ hash_code = hash.key?('hashCode') ? hash['hashCode'] : nil
101
+ code_generation_source =
102
+ hash.key?('codeGenerationSource') ? hash['codeGenerationSource'] : nil
103
+ code_gen_version =
104
+ hash.key?('codeGenVersion') ? hash['codeGenVersion'] : nil
105
+ success = hash.key?('success') ? hash['success'] : nil
106
+
107
+ # Create object from extracted values.
108
+ CodeGeneration.new(id,
109
+ template,
110
+ generated_file,
111
+ generated_on,
112
+ hash_code,
113
+ code_generation_source,
114
+ code_gen_version,
115
+ success)
116
+ end
117
+
118
+ def to_custom_generated_on
119
+ DateTimeHelper.to_rfc3339(generated_on)
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,75 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # DocsValidationSummary Model.
8
+ class DocsValidationSummary < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :success
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[String]]
18
+ attr_accessor :errors
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Array[String]]
22
+ attr_accessor :warnings
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Array[String]]
26
+ attr_accessor :messages
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['success'] = 'success'
32
+ @_hash['errors'] = 'errors'
33
+ @_hash['warnings'] = 'warnings'
34
+ @_hash['messages'] = 'messages'
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(success = nil,
49
+ errors = nil,
50
+ warnings = nil,
51
+ messages = nil)
52
+ @success = success
53
+ @errors = errors
54
+ @warnings = warnings
55
+ @messages = messages
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
+ success = hash.key?('success') ? hash['success'] : nil
64
+ errors = hash.key?('errors') ? hash['errors'] : nil
65
+ warnings = hash.key?('warnings') ? hash['warnings'] : nil
66
+ messages = hash.key?('messages') ? hash['messages'] : nil
67
+
68
+ # Create object from extracted values.
69
+ DocsValidationSummary.new(success,
70
+ errors,
71
+ warnings,
72
+ messages)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,57 @@
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 encapsulates all the attributes of an API Endpoints Group.
8
+ class EndpointsGroup < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :description
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['name'] = 'name'
24
+ @_hash['description'] = 'description'
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(name = nil,
39
+ description = nil)
40
+ @name = name
41
+ @description = description
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
+ name = hash.key?('name') ? hash['name'] : nil
50
+ description = hash.key?('description') ? hash['description'] : nil
51
+
52
+ # Create object from extracted values.
53
+ EndpointsGroup.new(name,
54
+ description)
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,79 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # An environment consists of a set of servers with base URL values. The
8
+ # environment can be changed programatically allowing rapid switching between
9
+ # different environments. For example the user can specify a Production and
10
+ # Testing Environment and switch between them in the generated SDK.
11
+ class Environment < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Unique Environment Identifier
16
+ # @return [String]
17
+ attr_accessor :id
18
+
19
+ # Environment Name
20
+ # @return [String]
21
+ attr_accessor :name
22
+
23
+ # The user can specify multiple servers within an environment. A server
24
+ # comprises of a name and a url.
25
+ # @return [Array[Server]]
26
+ attr_accessor :servers
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['servers'] = 'servers'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ []
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(id = nil,
48
+ name = nil,
49
+ servers = nil)
50
+ @id = id
51
+ @name = name
52
+ @servers = servers
53
+ end
54
+
55
+ # Creates an instance of the object from a hash.
56
+ def self.from_hash(hash)
57
+ return nil unless hash
58
+
59
+ # Extract variables from the hash.
60
+ id = hash.key?('id') ? hash['id'] : nil
61
+ name = hash.key?('name') ? hash['name'] : nil
62
+ # Parameter is an array, so we need to iterate through it
63
+ servers = nil
64
+ unless hash['servers'].nil?
65
+ servers = []
66
+ hash['servers'].each do |structure|
67
+ servers << (Server.from_hash(structure) if structure)
68
+ end
69
+ end
70
+
71
+ servers = nil unless hash.key?('servers')
72
+
73
+ # Create object from extracted values.
74
+ Environment.new(id,
75
+ name,
76
+ servers)
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,60 @@
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 contains API specification formats that Transformer can
8
+ # convert to.
9
+ class ExportFormats
10
+ EXPORT_FORMATS = [
11
+ # TODO: Write general description for APIMATIC
12
+ APIMATIC = 'APIMATIC'.freeze,
13
+
14
+ # TODO: Write general description for WADL2009
15
+ WADL2009 = 'WADL2009'.freeze,
16
+
17
+ # TODO: Write general description for WSDL
18
+ WSDL = 'WSDL'.freeze,
19
+
20
+ # TODO: Write general description for SWAGGER10
21
+ SWAGGER10 = 'Swagger10'.freeze,
22
+
23
+ # TODO: Write general description for SWAGGER20
24
+ SWAGGER20 = 'Swagger20'.freeze,
25
+
26
+ # TODO: Write general description for SWAGGERYAML
27
+ SWAGGERYAML = 'SwaggerYaml'.freeze,
28
+
29
+ # OpenAPI v3.0 (JSON)
30
+ OAS3 = 'OpenApi3Json'.freeze,
31
+
32
+ # TODO: Write general description for OPENAPI3YAML
33
+ OPENAPI3YAML = 'OpenApi3Yaml'.freeze,
34
+
35
+ # TODO: Write general description for APIBLUEPRINT
36
+ APIBLUEPRINT = 'APIBluePrint'.freeze,
37
+
38
+ # TODO: Write general description for RAML
39
+ RAML = 'RAML'.freeze,
40
+
41
+ # TODO: Write general description for RAML10
42
+ RAML10 = 'RAML10'.freeze,
43
+
44
+ # TODO: Write general description for POSTMAN10
45
+ POSTMAN10 = 'Postman10'.freeze,
46
+
47
+ # TODO: Write general description for POSTMAN20
48
+ POSTMAN20 = 'Postman20'.freeze,
49
+
50
+ # TODO: Write general description for GRAPHQLSCHEMA
51
+ GRAPHQLSCHEMA = 'GraphQlSchema'.freeze
52
+ ].freeze
53
+
54
+ def self.validate(value)
55
+ return false if value.nil?
56
+
57
+ EXPORT_FORMATS.include?(value)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,156 @@
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 encapsulates all details of a parameter.
8
+ class Field < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # If parameter is optional
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :optional
15
+
16
+ # Type of Parameter
17
+ # @return [String]
18
+ attr_accessor :type
19
+
20
+ # IF Parameter is constant
21
+ # @return [TrueClass | FalseClass]
22
+ attr_accessor :constant
23
+
24
+ # If Param is collected as array
25
+ # @return [TrueClass | FalseClass]
26
+ attr_accessor :is_array
27
+
28
+ # If Param is collected as array
29
+ # @return [TrueClass | FalseClass]
30
+ attr_accessor :is_stream
31
+
32
+ # If Param is collected as array
33
+ # @return [TrueClass | FalseClass]
34
+ attr_accessor :is_attribute
35
+
36
+ # If Param is collected as array
37
+ # @return [TrueClass | FalseClass]
38
+ attr_accessor :is_map
39
+
40
+ # The structure contain attribute details of a parameter type.
41
+ # @return [Attributes]
42
+ attr_accessor :attributes
43
+
44
+ # If Parameter is nullable
45
+ # @return [TrueClass | FalseClass]
46
+ attr_accessor :nullable
47
+
48
+ # Unique Parameter identifier
49
+ # @return [String]
50
+ attr_accessor :id
51
+
52
+ # Parameter Name
53
+ # @return [String]
54
+ attr_accessor :name
55
+
56
+ # Parameter Description
57
+ # @return [String]
58
+ attr_accessor :description
59
+
60
+ # Default Values of a Parameter
61
+ # @return [String]
62
+ attr_accessor :default_value
63
+
64
+ # A mapping from model property names to API property names.
65
+ def self.names
66
+ @_hash = {} if @_hash.nil?
67
+ @_hash['optional'] = 'optional'
68
+ @_hash['type'] = 'type'
69
+ @_hash['constant'] = 'constant'
70
+ @_hash['is_array'] = 'isArray'
71
+ @_hash['is_stream'] = 'isStream'
72
+ @_hash['is_attribute'] = 'isAttribute'
73
+ @_hash['is_map'] = 'isMap'
74
+ @_hash['attributes'] = 'attributes'
75
+ @_hash['nullable'] = 'nullable'
76
+ @_hash['id'] = 'id'
77
+ @_hash['name'] = 'name'
78
+ @_hash['description'] = 'description'
79
+ @_hash['default_value'] = 'defaultValue'
80
+ @_hash
81
+ end
82
+
83
+ # An array for optional fields
84
+ def self.optionals
85
+ []
86
+ end
87
+
88
+ # An array for nullable fields
89
+ def self.nullables
90
+ []
91
+ end
92
+
93
+ def initialize(optional = nil,
94
+ type = nil,
95
+ constant = nil,
96
+ is_array = nil,
97
+ is_stream = nil,
98
+ is_attribute = nil,
99
+ is_map = nil,
100
+ attributes = nil,
101
+ nullable = nil,
102
+ id = nil,
103
+ name = nil,
104
+ description = nil,
105
+ default_value = nil)
106
+ @optional = optional
107
+ @type = type
108
+ @constant = constant
109
+ @is_array = is_array
110
+ @is_stream = is_stream
111
+ @is_attribute = is_attribute
112
+ @is_map = is_map
113
+ @attributes = attributes
114
+ @nullable = nullable
115
+ @id = id
116
+ @name = name
117
+ @description = description
118
+ @default_value = default_value
119
+ end
120
+
121
+ # Creates an instance of the object from a hash.
122
+ def self.from_hash(hash)
123
+ return nil unless hash
124
+
125
+ # Extract variables from the hash.
126
+ optional = hash.key?('optional') ? hash['optional'] : nil
127
+ type = hash.key?('type') ? hash['type'] : nil
128
+ constant = hash.key?('constant') ? hash['constant'] : nil
129
+ is_array = hash.key?('isArray') ? hash['isArray'] : nil
130
+ is_stream = hash.key?('isStream') ? hash['isStream'] : nil
131
+ is_attribute = hash.key?('isAttribute') ? hash['isAttribute'] : nil
132
+ is_map = hash.key?('isMap') ? hash['isMap'] : nil
133
+ attributes = Attributes.from_hash(hash['attributes']) if hash['attributes']
134
+ nullable = hash.key?('nullable') ? hash['nullable'] : nil
135
+ id = hash.key?('id') ? hash['id'] : nil
136
+ name = hash.key?('name') ? hash['name'] : nil
137
+ description = hash.key?('description') ? hash['description'] : nil
138
+ default_value = hash.key?('defaultValue') ? hash['defaultValue'] : nil
139
+
140
+ # Create object from extracted values.
141
+ Field.new(optional,
142
+ type,
143
+ constant,
144
+ is_array,
145
+ is_stream,
146
+ is_attribute,
147
+ is_map,
148
+ attributes,
149
+ nullable,
150
+ id,
151
+ name,
152
+ description,
153
+ default_value)
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,48 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # GenerateOnPremPortalViaBuildInputRequestBody Model.
8
+ class GenerateOnPremPortalViaBuildInputRequestBody < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The input file to the Portal Generator. Must contain the build file.
13
+ # @return [Binary]
14
+ attr_accessor :file
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['file'] = 'file'
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(file = nil)
34
+ @file = file
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
+ file = hash.key?('file') ? hash['file'] : nil
43
+
44
+ # Create object from extracted values.
45
+ GenerateOnPremPortalViaBuildInputRequestBody.new(file)
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,61 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # GenerateSDKViaFileRequestBody Model.
8
+ class GenerateSDKViaFileRequestBody < 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 platforms that APIMatic CodeGen can generate SDKs
20
+ # and Docs in.
21
+ # @return [Platforms]
22
+ attr_accessor :template
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['template'] = 'template'
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
+ template = Platforms::CS_NET_STANDARD_LIB)
44
+ @file = file
45
+ @template = template
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
+ template = hash['template'] ||= Platforms::CS_NET_STANDARD_LIB
55
+
56
+ # Create object from extracted values.
57
+ GenerateSDKViaFileRequestBody.new(file,
58
+ template)
59
+ end
60
+ end
61
+ end