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,48 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # ParamterFormatDetails Model.
8
+ class ParamterFormatDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Specify Parameter Format
13
+ # @return [String]
14
+ attr_accessor :param_format
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['param_format'] = 'ParamFormat'
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(param_format = nil)
34
+ @param_format = param_format
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
+ param_format = hash.key?('ParamFormat') ? hash['ParamFormat'] : nil
43
+
44
+ # Create object from extracted values.
45
+ ParamterFormatDetails.new(param_format)
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,39 @@
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 platforms that APIMatic CodeGen can generate SDKs and
8
+ # Docs in.
9
+ class Platforms
10
+ PLATFORMS = [
11
+ # .NET Standard Library
12
+ CS_NET_STANDARD_LIB = 'CS_NET_STANDARD_LIB'.freeze,
13
+
14
+ # JAVA
15
+ JAVA_ECLIPSE_JRE_LIB = 'JAVA_ECLIPSE_JRE_LIB'.freeze,
16
+
17
+ # PHP
18
+ PHP_GENERIC_LIB_V2 = 'PHP_GENERIC_LIB'.freeze,
19
+
20
+ # Python
21
+ PYTHON_GENERIC_LIB = 'PYTHON_GENERIC_LIB'.freeze,
22
+
23
+ # Ruby
24
+ RUBY_GENERIC_LIB = 'RUBY_GENERIC_LIB'.freeze,
25
+
26
+ # Typescript
27
+ TS_GENERIC_LIB = 'TS_GENERIC_LIB'.freeze,
28
+
29
+ # Go
30
+ GO_GENERIC_LIB = 'GO_GENERIC_LIB'.freeze
31
+ ].freeze
32
+
33
+ def self.validate(value)
34
+ return false if value.nil?
35
+
36
+ PLATFORMS.include?(value)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,49 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # PlatformsTemplate Model.
8
+ class PlatformsTemplate < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The structure contains platforms that APIMatic CodeGen can generate SDKs
13
+ # and Docs in.
14
+ # @return [Platforms]
15
+ attr_accessor :template
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['template'] = 'template'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(template = Platforms::CS_NET_STANDARD_LIB)
35
+ @template = template
36
+ end
37
+
38
+ # Creates an instance of the object from a hash.
39
+ def self.from_hash(hash)
40
+ return nil unless hash
41
+
42
+ # Extract variables from the hash.
43
+ template = hash['template'] ||= Platforms::CS_NET_STANDARD_LIB
44
+
45
+ # Create object from extracted values.
46
+ PlatformsTemplate.new(template)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,69 @@
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
@@ -0,0 +1,105 @@
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
@@ -0,0 +1,70 @@
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
@@ -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
+ # 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
@@ -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
+ # This structure puts together the URL of the file to be transformed, along
8
+ # with the desired export format.
9
+ class TransformViaUrlRequest < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The URL for the API specification file.<br><br>**Note:** This URL should
14
+ # be publicly accessible.
15
+ # @return [String]
16
+ attr_accessor :url
17
+
18
+ # The structure contains API specification formats that Transformer can
19
+ # convert to.
20
+ # @return [ExportFormats]
21
+ attr_accessor :export_format
22
+
23
+ # A mapping from model property names to API property names.
24
+ def self.names
25
+ @_hash = {} if @_hash.nil?
26
+ @_hash['url'] = 'url'
27
+ @_hash['export_format'] = 'export_format'
28
+ @_hash
29
+ end
30
+
31
+ # An array for optional fields
32
+ def self.optionals
33
+ []
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(url = nil,
42
+ export_format = nil)
43
+ @url = url
44
+ @export_format = export_format
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ url = hash.key?('url') ? hash['url'] : nil
53
+ export_format = hash.key?('export_format') ? hash['export_format'] : nil
54
+
55
+ # Create object from extracted values.
56
+ TransformViaUrlRequest.new(url,
57
+ export_format)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,152 @@
1
+ # apimatic_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ApimaticApi
7
+ # Transformation structure encapsulates all the details of a Transformation.
8
+ class Transformation < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique Transformation Identifier
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # Transformation Date and Time
17
+ # @return [String]
18
+ attr_accessor :transformed_on
19
+
20
+ # Unique User Identifier
21
+ # @return [String]
22
+ attr_accessor :user_id
23
+
24
+ # API Specification file to be transformed
25
+ # @return [String]
26
+ attr_accessor :inputted_file
27
+
28
+ # API Specification file transformed to desired format
29
+ # @return [String]
30
+ attr_accessor :generated_file
31
+
32
+ # Desired Specification format
33
+ # @return [String]
34
+ attr_accessor :export_format
35
+
36
+ # Source of Transformation
37
+ # @return [String]
38
+ attr_accessor :transformation_source
39
+
40
+ # Via File or URL
41
+ # @return [String]
42
+ attr_accessor :transformation_input
43
+
44
+ # CodeGen Engine Version
45
+ # @return [String]
46
+ attr_accessor :code_gen_version
47
+
48
+ # Successful Transformation Flag
49
+ # @return [TrueClass | FalseClass]
50
+ attr_accessor :success
51
+
52
+ # Successful Transformation Flag
53
+ # @return [ApiValidationSummary]
54
+ attr_accessor :import_summary
55
+
56
+ # Successful Transformation Flag
57
+ # @return [ApiValidationSummary]
58
+ attr_accessor :api_validation_summary
59
+
60
+ # A mapping from model property names to API property names.
61
+ def self.names
62
+ @_hash = {} if @_hash.nil?
63
+ @_hash['id'] = 'id'
64
+ @_hash['transformed_on'] = 'transformedOn'
65
+ @_hash['user_id'] = 'userId'
66
+ @_hash['inputted_file'] = 'inputtedFile'
67
+ @_hash['generated_file'] = 'generatedFile'
68
+ @_hash['export_format'] = 'exportFormat'
69
+ @_hash['transformation_source'] = 'transformationSource'
70
+ @_hash['transformation_input'] = 'transformationInput'
71
+ @_hash['code_gen_version'] = 'codeGenVersion'
72
+ @_hash['success'] = 'success'
73
+ @_hash['import_summary'] = 'importSummary'
74
+ @_hash['api_validation_summary'] = 'apiValidationSummary'
75
+ @_hash
76
+ end
77
+
78
+ # An array for optional fields
79
+ def self.optionals
80
+ []
81
+ end
82
+
83
+ # An array for nullable fields
84
+ def self.nullables
85
+ []
86
+ end
87
+
88
+ def initialize(id = nil,
89
+ transformed_on = nil,
90
+ user_id = nil,
91
+ inputted_file = nil,
92
+ generated_file = nil,
93
+ export_format = nil,
94
+ transformation_source = nil,
95
+ transformation_input = nil,
96
+ code_gen_version = nil,
97
+ success = nil,
98
+ import_summary = nil,
99
+ api_validation_summary = nil)
100
+ @id = id
101
+ @transformed_on = transformed_on
102
+ @user_id = user_id
103
+ @inputted_file = inputted_file
104
+ @generated_file = generated_file
105
+ @export_format = export_format
106
+ @transformation_source = transformation_source
107
+ @transformation_input = transformation_input
108
+ @code_gen_version = code_gen_version
109
+ @success = success
110
+ @import_summary = import_summary
111
+ @api_validation_summary = api_validation_summary
112
+ end
113
+
114
+ # Creates an instance of the object from a hash.
115
+ def self.from_hash(hash)
116
+ return nil unless hash
117
+
118
+ # Extract variables from the hash.
119
+ id = hash.key?('id') ? hash['id'] : nil
120
+ transformed_on = hash.key?('transformedOn') ? hash['transformedOn'] : nil
121
+ user_id = hash.key?('userId') ? hash['userId'] : nil
122
+ inputted_file = hash.key?('inputtedFile') ? hash['inputtedFile'] : nil
123
+ generated_file = hash.key?('generatedFile') ? hash['generatedFile'] : nil
124
+ export_format = hash.key?('exportFormat') ? hash['exportFormat'] : nil
125
+ transformation_source =
126
+ hash.key?('transformationSource') ? hash['transformationSource'] : nil
127
+ transformation_input =
128
+ hash.key?('transformationInput') ? hash['transformationInput'] : nil
129
+ code_gen_version =
130
+ hash.key?('codeGenVersion') ? hash['codeGenVersion'] : nil
131
+ success = hash.key?('success') ? hash['success'] : nil
132
+ import_summary = ApiValidationSummary.from_hash(hash['importSummary']) if
133
+ hash['importSummary']
134
+ api_validation_summary = ApiValidationSummary.from_hash(hash['apiValidationSummary']) if
135
+ hash['apiValidationSummary']
136
+
137
+ # Create object from extracted values.
138
+ Transformation.new(id,
139
+ transformed_on,
140
+ user_id,
141
+ inputted_file,
142
+ generated_file,
143
+ export_format,
144
+ transformation_source,
145
+ transformation_input,
146
+ code_gen_version,
147
+ success,
148
+ import_summary,
149
+ api_validation_summary)
150
+ end
151
+ end
152
+ end