chainlink-apimatic-sdk 0.0.1 → 0.0.2

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -60
  3. data/bin/console +4 -4
  4. data/lib/ccip_directory_and_configuration_rest_api_v1/api_helper.rb +10 -0
  5. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/apis/base_api.rb +5 -5
  6. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/chains_api.rb +69 -0
  7. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/lanes_api.rb +75 -0
  8. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/tokens_api.rb +51 -0
  9. data/lib/ccip_directory_and_configuration_rest_api_v1/client.rb +72 -0
  10. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/configuration.rb +27 -41
  11. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/exceptions/api_exception.rb +4 -4
  12. data/lib/ccip_directory_and_configuration_rest_api_v1/exceptions/error_response_exception.rb +57 -0
  13. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/api_response.rb +4 -4
  14. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_call_back.rb +10 -0
  15. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_method_enum.rb +10 -0
  16. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_request.rb +10 -0
  17. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_response.rb +10 -0
  18. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/proxy_settings.rb +4 -4
  19. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/configuration/api_logging_configuration.rb +4 -4
  20. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/sdk_logger.rb +4 -4
  21. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/models/base_model.rb +4 -4
  22. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_api_response.rb +99 -0
  23. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_config_error.rb +100 -0
  24. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_details.rb +272 -0
  25. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_family.rb +64 -0
  26. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_info.rb +135 -0
  27. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb +144 -0
  28. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_type.rb +64 -0
  29. data/lib/ccip_directory_and_configuration_rest_api_v1/models/data.rb +171 -0
  30. data/lib/ccip_directory_and_configuration_rest_api_v1/models/enrich_fee_tokens.rb +36 -0
  31. data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment.rb +36 -0
  32. data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment3.rb +36 -0
  33. data/lib/ccip_directory_and_configuration_rest_api_v1/models/family.rb +64 -0
  34. data/lib/ccip_directory_and_configuration_rest_api_v1/models/fee_token_enriched.rb +130 -0
  35. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_api_response.rb +102 -0
  36. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_config_error.rb +102 -0
  37. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_details.rb +116 -0
  38. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb +119 -0
  39. data/lib/ccip_directory_and_configuration_rest_api_v1/models/off_ramp.rb +82 -0
  40. data/lib/ccip_directory_and_configuration_rest_api_v1/models/on_ramp.rb +95 -0
  41. data/lib/ccip_directory_and_configuration_rest_api_v1/models/output_key.rb +40 -0
  42. data/lib/ccip_directory_and_configuration_rest_api_v1/models/pool_type.rb +44 -0
  43. data/lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb +46 -0
  44. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_api_response.rb +101 -0
  45. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_data.rb +190 -0
  46. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_info.rb +159 -0
  47. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_config_error.rb +91 -0
  48. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_details.rb +99 -0
  49. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_metadata.rb +119 -0
  50. data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/date_time_helper.rb +11 -0
  51. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/utilities/file_wrapper.rb +4 -4
  52. data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/union_type_lookup.rb +61 -0
  53. data/lib/ccip_directory_and_configuration_rest_api_v1.rb +112 -0
  54. metadata +51 -36
  55. data/lib/swagger_petstore_open_api30/api_helper.rb +0 -10
  56. data/lib/swagger_petstore_open_api30/apis/pet_api.rb +0 -287
  57. data/lib/swagger_petstore_open_api30/apis/store_api.rb +0 -131
  58. data/lib/swagger_petstore_open_api30/apis/user_api.rb +0 -233
  59. data/lib/swagger_petstore_open_api30/client.rb +0 -94
  60. data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +0 -64
  61. data/lib/swagger_petstore_open_api30/http/auth/api_key.rb +0 -52
  62. data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +0 -112
  63. data/lib/swagger_petstore_open_api30/http/http_call_back.rb +0 -10
  64. data/lib/swagger_petstore_open_api30/http/http_method_enum.rb +0 -10
  65. data/lib/swagger_petstore_open_api30/http/http_request.rb +0 -10
  66. data/lib/swagger_petstore_open_api30/http/http_response.rb +0 -10
  67. data/lib/swagger_petstore_open_api30/models/api_response.rb +0 -118
  68. data/lib/swagger_petstore_open_api30/models/category.rb +0 -105
  69. data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +0 -62
  70. data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +0 -36
  71. data/lib/swagger_petstore_open_api30/models/oauth_token.rb +0 -125
  72. data/lib/swagger_petstore_open_api30/models/order.rb +0 -167
  73. data/lib/swagger_petstore_open_api30/models/order_status.rb +0 -40
  74. data/lib/swagger_petstore_open_api30/models/pet.rb +0 -168
  75. data/lib/swagger_petstore_open_api30/models/pet_status.rb +0 -40
  76. data/lib/swagger_petstore_open_api30/models/tag.rb +0 -105
  77. data/lib/swagger_petstore_open_api30/models/user.rb +0 -182
  78. data/lib/swagger_petstore_open_api30/utilities/date_time_helper.rb +0 -11
  79. data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +0 -12
  80. data/lib/swagger_petstore_open_api30.rb +0 -62
@@ -1,10 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # HttpCallBack allows defining callables for pre and post API calls.
8
- class HttpCallBack < CoreLibrary::HttpCallback
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # HTTP Methods Enumeration.
8
- class HttpMethodEnum < CoreLibrary::HttpMethod
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # Represents a single Http Request.
8
- class HttpRequest < CoreLibrary::HttpRequest
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # Http response received.
8
- class HttpResponse < CoreLibrary::HttpResponse
9
- end
10
- end
@@ -1,118 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # ApiResponse Model.
8
- class ApiResponse < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [Integer]
14
- attr_accessor :code
15
-
16
- # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :type
19
-
20
- # TODO: Write general description for this method
21
- # @return [String]
22
- attr_accessor :message
23
-
24
- # A mapping from model property names to API property names.
25
- def self.names
26
- @_hash = {} if @_hash.nil?
27
- @_hash['code'] = 'code'
28
- @_hash['type'] = 'type'
29
- @_hash['message'] = 'message'
30
- @_hash
31
- end
32
-
33
- # An array for optional fields
34
- def self.optionals
35
- %w[
36
- code
37
- type
38
- message
39
- ]
40
- end
41
-
42
- # An array for nullable fields
43
- def self.nullables
44
- []
45
- end
46
-
47
- def initialize(code: SKIP, type: SKIP, message: SKIP,
48
- additional_properties: nil)
49
- # Add additional model properties to the instance
50
- additional_properties = {} if additional_properties.nil?
51
-
52
- @code = code unless code == SKIP
53
- @type = type unless type == SKIP
54
- @message = message unless message == SKIP
55
- @additional_properties = additional_properties
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
- code = hash.key?('code') ? hash['code'] : SKIP
64
- type = hash.key?('type') ? hash['type'] : SKIP
65
- message = hash.key?('message') ? hash['message'] : SKIP
66
-
67
- # Create a new hash for additional properties, removing known properties.
68
- new_hash = hash.reject { |k, _| names.value?(k) }
69
-
70
- additional_properties = APIHelper.get_additional_properties(
71
- new_hash, proc { |value| value }
72
- )
73
-
74
- # Create object from extracted values.
75
- ApiResponse.new(code: code,
76
- type: type,
77
- message: message,
78
- additional_properties: additional_properties)
79
- end
80
-
81
- def self.from_element(root)
82
- code = XmlUtilities.from_element(root, 'code', Integer)
83
- type = XmlUtilities.from_element(root, 'type', String)
84
- message = XmlUtilities.from_element(root, 'message', String)
85
-
86
- new(code: code,
87
- type: type,
88
- message: message,
89
- additional_properties: additional_properties)
90
- end
91
-
92
- def to_xml_element(doc, root_name)
93
- root = doc.create_element(root_name)
94
-
95
- XmlUtilities.add_as_subelement(doc, root, 'code', code)
96
- XmlUtilities.add_as_subelement(doc, root, 'type', type)
97
- XmlUtilities.add_as_subelement(doc, root, 'message', message)
98
- XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
99
- additional_properties)
100
-
101
- root
102
- end
103
-
104
- # Provides a human-readable string representation of the object.
105
- def to_s
106
- class_name = self.class.name.split('::').last
107
- "<#{class_name} code: #{@code}, type: #{@type}, message: #{@message},"\
108
- " additional_properties: #{@additional_properties}>"
109
- end
110
-
111
- # Provides a debugging-friendly string with detailed object information.
112
- def inspect
113
- class_name = self.class.name.split('::').last
114
- "<#{class_name} code: #{@code.inspect}, type: #{@type.inspect}, message:"\
115
- " #{@message.inspect}, additional_properties: #{@additional_properties}>"
116
- end
117
- end
118
- end
@@ -1,105 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # Category Model.
8
- class Category < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [Integer]
14
- attr_accessor :id
15
-
16
- # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :name
19
-
20
- # A mapping from model property names to API property names.
21
- def self.names
22
- @_hash = {} if @_hash.nil?
23
- @_hash['id'] = 'id'
24
- @_hash['name'] = 'name'
25
- @_hash
26
- end
27
-
28
- # An array for optional fields
29
- def self.optionals
30
- %w[
31
- id
32
- name
33
- ]
34
- end
35
-
36
- # An array for nullable fields
37
- def self.nullables
38
- []
39
- end
40
-
41
- def initialize(id: SKIP, name: SKIP, additional_properties: nil)
42
- # Add additional model properties to the instance
43
- additional_properties = {} if additional_properties.nil?
44
-
45
- @id = id unless id == SKIP
46
- @name = name unless name == SKIP
47
- @additional_properties = additional_properties
48
- end
49
-
50
- # Creates an instance of the object from a hash.
51
- def self.from_hash(hash)
52
- return nil unless hash
53
-
54
- # Extract variables from the hash.
55
- id = hash.key?('id') ? hash['id'] : SKIP
56
- name = hash.key?('name') ? hash['name'] : SKIP
57
-
58
- # Create a new hash for additional properties, removing known properties.
59
- new_hash = hash.reject { |k, _| names.value?(k) }
60
-
61
- additional_properties = APIHelper.get_additional_properties(
62
- new_hash, proc { |value| value }
63
- )
64
-
65
- # Create object from extracted values.
66
- Category.new(id: id,
67
- name: name,
68
- additional_properties: additional_properties)
69
- end
70
-
71
- def self.from_element(root)
72
- id = XmlUtilities.from_element(root, 'id', Integer)
73
- name = XmlUtilities.from_element(root, 'name', String)
74
-
75
- new(id: id,
76
- name: name,
77
- additional_properties: additional_properties)
78
- end
79
-
80
- def to_xml_element(doc, root_name)
81
- root = doc.create_element(root_name)
82
-
83
- XmlUtilities.add_as_subelement(doc, root, 'id', id)
84
- XmlUtilities.add_as_subelement(doc, root, 'name', name)
85
- XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
86
- additional_properties)
87
-
88
- root
89
- end
90
-
91
- # Provides a human-readable string representation of the object.
92
- def to_s
93
- class_name = self.class.name.split('::').last
94
- "<#{class_name} id: #{@id}, name: #{@name}, additional_properties:"\
95
- " #{@additional_properties}>"
96
- end
97
-
98
- # Provides a debugging-friendly string with detailed object information.
99
- def inspect
100
- class_name = self.class.name.split('::').last
101
- "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, additional_properties:"\
102
- " #{@additional_properties}>"
103
- end
104
- end
105
- end
@@ -1,62 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # OAuth 2 Authorization error codes
8
- class OauthProviderError
9
- OAUTH_PROVIDER_ERROR = [
10
- # The request is missing a required parameter, includes an unsupported
11
- # parameter value (other than grant type), repeats a parameter, includes
12
- # multiple credentials, utilizes more than one mechanism for
13
- # authenticating the client, or is otherwise malformed.
14
- INVALID_REQUEST = 'invalid_request'.freeze,
15
-
16
- # Client authentication failed (e.g., unknown client, no client
17
- # authentication included, or unsupported authentication method).
18
- INVALID_CLIENT = 'invalid_client'.freeze,
19
-
20
- # The provided authorization grant (e.g., authorization code, resource
21
- # owner credentials) or refresh token is invalid, expired, revoked, does
22
- # not match the redirection URI used in the authorization request, or was
23
- # issued to another client.
24
- INVALID_GRANT = 'invalid_grant'.freeze,
25
-
26
- # The authenticated client is not authorized to use this authorization
27
- # grant type.
28
- UNAUTHORIZED_CLIENT = 'unauthorized_client'.freeze,
29
-
30
- # The authorization grant type is not supported by the authorization
31
- # server.
32
- UNSUPPORTED_GRANT_TYPE = 'unsupported_grant_type'.freeze,
33
-
34
- # The requested scope is invalid, unknown, malformed, or exceeds the scope
35
- # granted by the resource owner.
36
- INVALID_SCOPE = 'invalid_scope'.freeze
37
- ].freeze
38
-
39
- def self.validate(value)
40
- return false if value.nil?
41
-
42
- OAUTH_PROVIDER_ERROR.include?(value)
43
- end
44
-
45
- def self.from_value(value, default_value = INVALID_REQUEST)
46
- return default_value if value.nil?
47
-
48
- str = value.to_s.strip
49
-
50
- case str.downcase
51
- when 'invalid_request' then INVALID_REQUEST
52
- when 'invalid_client' then INVALID_CLIENT
53
- when 'invalid_grant' then INVALID_GRANT
54
- when 'unauthorized_client' then UNAUTHORIZED_CLIENT
55
- when 'unsupported_grant_type' then UNSUPPORTED_GRANT_TYPE
56
- when 'invalid_scope' then INVALID_SCOPE
57
- else
58
- default_value
59
- end
60
- end
61
- end
62
- end
@@ -1,36 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # OAuth 2 scopes supported by the API
8
- class OauthScopePetstoreAuth
9
- OAUTH_SCOPE_PETSTORE_AUTH = [
10
- # modify pets in your account
11
- WRITEPETS = 'write:pets'.freeze,
12
-
13
- # read your pets
14
- READPETS = 'read:pets'.freeze
15
- ].freeze
16
-
17
- def self.validate(value)
18
- return false if value.nil?
19
-
20
- OAUTH_SCOPE_PETSTORE_AUTH.include?(value)
21
- end
22
-
23
- def self.from_value(value, default_value = WRITEPETS)
24
- return default_value if value.nil?
25
-
26
- str = value.to_s.strip
27
-
28
- case str.downcase
29
- when 'writepets' then WRITEPETS
30
- when 'readpets' then READPETS
31
- else
32
- default_value
33
- end
34
- end
35
- end
36
- end
@@ -1,125 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstoreOpenApi30
7
- # OAuth 2 Authorization endpoint response
8
- class OauthToken < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Access token
13
- # @return [String]
14
- attr_accessor :access_token
15
-
16
- # Type of access token
17
- # @return [String]
18
- attr_accessor :token_type
19
-
20
- # Time in seconds before the access token expires
21
- # @return [Integer]
22
- attr_accessor :expires_in
23
-
24
- # List of scopes granted
25
- # This is a space-delimited list of strings.
26
- # @return [String]
27
- attr_accessor :scope
28
-
29
- # Time of token expiry as unix timestamp (UTC)
30
- # @return [Integer]
31
- attr_accessor :expiry
32
-
33
- # Refresh token
34
- # Used to get a new access token when it expires.
35
- # @return [String]
36
- attr_accessor :refresh_token
37
-
38
- # A mapping from model property names to API property names.
39
- def self.names
40
- @_hash = {} if @_hash.nil?
41
- @_hash['access_token'] = 'access_token'
42
- @_hash['token_type'] = 'token_type'
43
- @_hash['expires_in'] = 'expires_in'
44
- @_hash['scope'] = 'scope'
45
- @_hash['expiry'] = 'expiry'
46
- @_hash['refresh_token'] = 'refresh_token'
47
- @_hash
48
- end
49
-
50
- # An array for optional fields
51
- def self.optionals
52
- %w[
53
- expires_in
54
- scope
55
- expiry
56
- refresh_token
57
- ]
58
- end
59
-
60
- # An array for nullable fields
61
- def self.nullables
62
- []
63
- end
64
-
65
- def initialize(access_token:, token_type:, expires_in: SKIP, scope: SKIP,
66
- expiry: SKIP, refresh_token: SKIP)
67
- @access_token = access_token
68
- @token_type = token_type
69
- @expires_in = expires_in unless expires_in == SKIP
70
- @scope = scope unless scope == SKIP
71
- @expiry = expiry unless expiry == SKIP
72
- @refresh_token = refresh_token unless refresh_token == SKIP
73
- end
74
-
75
- # Creates an instance of the object from a hash.
76
- def self.from_hash(hash)
77
- return nil unless hash
78
-
79
- # Extract variables from the hash.
80
- access_token = hash.key?('access_token') ? hash['access_token'] : nil
81
- token_type = hash.key?('token_type') ? hash['token_type'] : nil
82
- expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
83
- scope = hash.key?('scope') ? hash['scope'] : SKIP
84
- expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
85
- refresh_token = hash.key?('refresh_token') ? hash['refresh_token'] : SKIP
86
-
87
- # Create object from extracted values.
88
- OauthToken.new(access_token: access_token,
89
- token_type: token_type,
90
- expires_in: expires_in,
91
- scope: scope,
92
- expiry: expiry,
93
- refresh_token: refresh_token)
94
- end
95
-
96
- def self.from_element(root)
97
- access_token = XmlUtilities.from_element(root, 'access_token', String)
98
- token_type = XmlUtilities.from_element(root, 'token_type', String)
99
- expires_in = XmlUtilities.from_element(root, 'expires_in', Integer)
100
- scope = XmlUtilities.from_element(root, 'scope', String)
101
- expiry = XmlUtilities.from_element(root, 'expiry', Integer)
102
- refresh_token = XmlUtilities.from_element(root, 'refresh_token', String)
103
-
104
- new(access_token: access_token,
105
- token_type: token_type,
106
- expires_in: expires_in,
107
- scope: scope,
108
- expiry: expiry,
109
- refresh_token: refresh_token)
110
- end
111
-
112
- def to_xml_element(doc, root_name)
113
- root = doc.create_element(root_name)
114
-
115
- XmlUtilities.add_as_subelement(doc, root, 'access_token', access_token)
116
- XmlUtilities.add_as_subelement(doc, root, 'token_type', token_type)
117
- XmlUtilities.add_as_subelement(doc, root, 'expires_in', expires_in)
118
- XmlUtilities.add_as_subelement(doc, root, 'scope', scope)
119
- XmlUtilities.add_as_subelement(doc, root, 'expiry', expiry)
120
- XmlUtilities.add_as_subelement(doc, root, 'refresh_token', refresh_token)
121
-
122
- root
123
- end
124
- end
125
- end
@@ -1,167 +0,0 @@
1
- # swagger_petstore_open_api30
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- require 'date'
7
- module SwaggerPetstoreOpenApi30
8
- # Order Model.
9
- class Order < BaseModel
10
- SKIP = Object.new
11
- private_constant :SKIP
12
-
13
- # TODO: Write general description for this method
14
- # @return [Integer]
15
- attr_accessor :id
16
-
17
- # TODO: Write general description for this method
18
- # @return [Integer]
19
- attr_accessor :pet_id
20
-
21
- # TODO: Write general description for this method
22
- # @return [Integer]
23
- attr_accessor :quantity
24
-
25
- # TODO: Write general description for this method
26
- # @return [DateTime]
27
- attr_accessor :ship_date
28
-
29
- # Order Status
30
- # @return [OrderStatus]
31
- attr_accessor :status
32
-
33
- # Order Status
34
- # @return [TrueClass | FalseClass]
35
- attr_accessor :complete
36
-
37
- # A mapping from model property names to API property names.
38
- def self.names
39
- @_hash = {} if @_hash.nil?
40
- @_hash['id'] = 'id'
41
- @_hash['pet_id'] = 'petId'
42
- @_hash['quantity'] = 'quantity'
43
- @_hash['ship_date'] = 'shipDate'
44
- @_hash['status'] = 'status'
45
- @_hash['complete'] = 'complete'
46
- @_hash
47
- end
48
-
49
- # An array for optional fields
50
- def self.optionals
51
- %w[
52
- id
53
- pet_id
54
- quantity
55
- ship_date
56
- status
57
- complete
58
- ]
59
- end
60
-
61
- # An array for nullable fields
62
- def self.nullables
63
- []
64
- end
65
-
66
- def initialize(id: SKIP, pet_id: SKIP, quantity: SKIP, ship_date: SKIP,
67
- status: SKIP, complete: SKIP, additional_properties: nil)
68
- # Add additional model properties to the instance
69
- additional_properties = {} if additional_properties.nil?
70
-
71
- @id = id unless id == SKIP
72
- @pet_id = pet_id unless pet_id == SKIP
73
- @quantity = quantity unless quantity == SKIP
74
- @ship_date = ship_date unless ship_date == SKIP
75
- @status = status unless status == SKIP
76
- @complete = complete unless complete == SKIP
77
- @additional_properties = additional_properties
78
- end
79
-
80
- # Creates an instance of the object from a hash.
81
- def self.from_hash(hash)
82
- return nil unless hash
83
-
84
- # Extract variables from the hash.
85
- id = hash.key?('id') ? hash['id'] : SKIP
86
- pet_id = hash.key?('petId') ? hash['petId'] : SKIP
87
- quantity = hash.key?('quantity') ? hash['quantity'] : SKIP
88
- ship_date = if hash.key?('shipDate')
89
- (DateTimeHelper.from_rfc3339(hash['shipDate']) if hash['shipDate'])
90
- else
91
- SKIP
92
- end
93
- status = hash.key?('status') ? hash['status'] : SKIP
94
- complete = hash.key?('complete') ? hash['complete'] : SKIP
95
-
96
- # Create a new hash for additional properties, removing known properties.
97
- new_hash = hash.reject { |k, _| names.value?(k) }
98
-
99
- additional_properties = APIHelper.get_additional_properties(
100
- new_hash, proc { |value| value }
101
- )
102
-
103
- # Create object from extracted values.
104
- Order.new(id: id,
105
- pet_id: pet_id,
106
- quantity: quantity,
107
- ship_date: ship_date,
108
- status: status,
109
- complete: complete,
110
- additional_properties: additional_properties)
111
- end
112
-
113
- def to_custom_ship_date
114
- DateTimeHelper.to_rfc3339(ship_date)
115
- end
116
-
117
- def self.from_element(root)
118
- id = XmlUtilities.from_element(root, 'id', Integer)
119
- pet_id = XmlUtilities.from_element(root, 'petId', Integer)
120
- quantity = XmlUtilities.from_element(root, 'quantity', Integer)
121
- ship_date = XmlUtilities.from_element(root, 'shipDate', String,
122
- datetime_format: 'rfc3339')
123
- status = XmlUtilities.from_element(root, 'status', String)
124
- complete = XmlUtilities.from_element(root, 'complete', TrueClass)
125
-
126
- new(id: id,
127
- pet_id: pet_id,
128
- quantity: quantity,
129
- ship_date: ship_date,
130
- status: status,
131
- complete: complete,
132
- additional_properties: additional_properties)
133
- end
134
-
135
- def to_xml_element(doc, root_name)
136
- root = doc.create_element(root_name)
137
-
138
- XmlUtilities.add_as_subelement(doc, root, 'id', id)
139
- XmlUtilities.add_as_subelement(doc, root, 'petId', pet_id)
140
- XmlUtilities.add_as_subelement(doc, root, 'quantity', quantity)
141
- XmlUtilities.add_as_subelement(doc, root, 'shipDate', ship_date,
142
- datetime_format: 'rfc3339')
143
- XmlUtilities.add_as_subelement(doc, root, 'status', status)
144
- XmlUtilities.add_as_subelement(doc, root, 'complete', complete)
145
- XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
146
- additional_properties)
147
-
148
- root
149
- end
150
-
151
- # Provides a human-readable string representation of the object.
152
- def to_s
153
- class_name = self.class.name.split('::').last
154
- "<#{class_name} id: #{@id}, pet_id: #{@pet_id}, quantity: #{@quantity}, ship_date:"\
155
- " #{@ship_date}, status: #{@status}, complete: #{@complete}, additional_properties:"\
156
- " #{@additional_properties}>"
157
- end
158
-
159
- # Provides a debugging-friendly string with detailed object information.
160
- def inspect
161
- class_name = self.class.name.split('::').last
162
- "<#{class_name} id: #{@id.inspect}, pet_id: #{@pet_id.inspect}, quantity:"\
163
- " #{@quantity.inspect}, ship_date: #{@ship_date.inspect}, status: #{@status.inspect},"\
164
- " complete: #{@complete.inspect}, additional_properties: #{@additional_properties}>"
165
- end
166
- end
167
- end