late-sdk 0.0.1486 → 0.0.1487

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/docs/AdAccountsApi.md +144 -0
  4. data/docs/GetAdAccountBilling200Response.md +30 -0
  5. data/docs/GetAdAccountBilling200ResponseAccountBudgetsInner.md +28 -0
  6. data/docs/GetAdAccountBilling200ResponseBillingSetupsInner.md +26 -0
  7. data/docs/GetAdAccountBilling200ResponsePaymentsAccountsInner.md +26 -0
  8. data/docs/GetAdAccountBilling200ResponsePendingBudgetProposalsInner.md +20 -0
  9. data/docs/SetUpAdAccountBilling200Response.md +30 -0
  10. data/docs/SetUpAdAccountBilling201Response.md +32 -0
  11. data/docs/SetUpAdAccountBillingRequest.md +30 -0
  12. data/lib/zernio-sdk/api/ad_accounts_api.rb +135 -0
  13. data/lib/zernio-sdk/models/get_ad_account_billing200_response.rb +213 -0
  14. data/lib/zernio-sdk/models/get_ad_account_billing200_response_account_budgets_inner.rb +232 -0
  15. data/lib/zernio-sdk/models/get_ad_account_billing200_response_billing_setups_inner.rb +222 -0
  16. data/lib/zernio-sdk/models/get_ad_account_billing200_response_payments_accounts_inner.rb +189 -0
  17. data/lib/zernio-sdk/models/get_ad_account_billing200_response_pending_budget_proposals_inner.rb +157 -0
  18. data/lib/zernio-sdk/models/set_up_ad_account_billing200_response.rb +205 -0
  19. data/lib/zernio-sdk/models/set_up_ad_account_billing201_response.rb +213 -0
  20. data/lib/zernio-sdk/models/set_up_ad_account_billing_request.rb +350 -0
  21. data/lib/zernio-sdk/version.rb +1 -1
  22. data/lib/zernio-sdk.rb +8 -0
  23. data/openapi.yaml +1 -1
  24. data/spec/api/ad_accounts_api_spec.rb +25 -0
  25. data/spec/models/get_ad_account_billing200_response_account_budgets_inner_spec.rb +70 -0
  26. data/spec/models/get_ad_account_billing200_response_billing_setups_inner_spec.rb +64 -0
  27. data/spec/models/get_ad_account_billing200_response_payments_accounts_inner_spec.rb +60 -0
  28. data/spec/models/get_ad_account_billing200_response_pending_budget_proposals_inner_spec.rb +42 -0
  29. data/spec/models/get_ad_account_billing200_response_spec.rb +72 -0
  30. data/spec/models/set_up_ad_account_billing200_response_spec.rb +72 -0
  31. data/spec/models/set_up_ad_account_billing201_response_spec.rb +78 -0
  32. data/spec/models/set_up_ad_account_billing_request_spec.rb +72 -0
  33. data/zernio-sdk-0.0.1487.gem +0 -0
  34. metadata +34 -2
  35. data/zernio-sdk-0.0.1486.gem +0 -0
@@ -0,0 +1,213 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
5
+
6
+ The version of the OpenAPI document: 1.324.0
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetAdAccountBilling200Response < ApiModelBase
18
+ attr_accessor :customer_id
19
+
20
+ attr_accessor :payments_accounts
21
+
22
+ attr_accessor :billing_setups
23
+
24
+ attr_accessor :account_budgets
25
+
26
+ # New account budgets proposed but not yet approved by Google. A setup with one is not reused by the POST.
27
+ attr_accessor :pending_budget_proposals
28
+
29
+ # When this data was fetched from Google. Null when the cache is unavailable.
30
+ attr_accessor :cached_at
31
+
32
+ # True when Google's quota was exhausted and this is the last successful fetch.
33
+ attr_accessor :stale
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'customer_id' => :'customerId',
39
+ :'payments_accounts' => :'paymentsAccounts',
40
+ :'billing_setups' => :'billingSetups',
41
+ :'account_budgets' => :'accountBudgets',
42
+ :'pending_budget_proposals' => :'pendingBudgetProposals',
43
+ :'cached_at' => :'cachedAt',
44
+ :'stale' => :'stale'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'customer_id' => :'String',
62
+ :'payments_accounts' => :'Array<GetAdAccountBilling200ResponsePaymentsAccountsInner>',
63
+ :'billing_setups' => :'Array<GetAdAccountBilling200ResponseBillingSetupsInner>',
64
+ :'account_budgets' => :'Array<GetAdAccountBilling200ResponseAccountBudgetsInner>',
65
+ :'pending_budget_proposals' => :'Array<GetAdAccountBilling200ResponsePendingBudgetProposalsInner>',
66
+ :'cached_at' => :'Time',
67
+ :'stale' => :'Boolean'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'cached_at',
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdAccountBilling200Response` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdAccountBilling200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'customer_id')
95
+ self.customer_id = attributes[:'customer_id']
96
+ end
97
+
98
+ if attributes.key?(:'payments_accounts')
99
+ if (value = attributes[:'payments_accounts']).is_a?(Array)
100
+ self.payments_accounts = value
101
+ end
102
+ end
103
+
104
+ if attributes.key?(:'billing_setups')
105
+ if (value = attributes[:'billing_setups']).is_a?(Array)
106
+ self.billing_setups = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'account_budgets')
111
+ if (value = attributes[:'account_budgets']).is_a?(Array)
112
+ self.account_budgets = value
113
+ end
114
+ end
115
+
116
+ if attributes.key?(:'pending_budget_proposals')
117
+ if (value = attributes[:'pending_budget_proposals']).is_a?(Array)
118
+ self.pending_budget_proposals = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'cached_at')
123
+ self.cached_at = attributes[:'cached_at']
124
+ end
125
+
126
+ if attributes.key?(:'stale')
127
+ self.stale = attributes[:'stale']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
135
+ invalid_properties = Array.new
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ true
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ customer_id == o.customer_id &&
152
+ payments_accounts == o.payments_accounts &&
153
+ billing_setups == o.billing_setups &&
154
+ account_budgets == o.account_budgets &&
155
+ pending_budget_proposals == o.pending_budget_proposals &&
156
+ cached_at == o.cached_at &&
157
+ stale == o.stale
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [customer_id, payments_accounts, billing_setups, account_budgets, pending_budget_proposals, cached_at, stale].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ end
212
+
213
+ end
@@ -0,0 +1,232 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
5
+
6
+ The version of the OpenAPI document: 1.324.0
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetAdAccountBilling200ResponseAccountBudgetsInner < ApiModelBase
18
+ attr_accessor :account_budget_id
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :billing_setup_id
23
+
24
+ attr_accessor :approved_spending_limit_micros
25
+
26
+ # INFINITE for an unlimited budget.
27
+ attr_accessor :approved_spending_limit_type
28
+
29
+ # Account budget proposal still waiting for Google's review.
30
+ attr_accessor :pending_proposal_id
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'account_budget_id' => :'accountBudgetId',
58
+ :'status' => :'status',
59
+ :'billing_setup_id' => :'billingSetupId',
60
+ :'approved_spending_limit_micros' => :'approvedSpendingLimitMicros',
61
+ :'approved_spending_limit_type' => :'approvedSpendingLimitType',
62
+ :'pending_proposal_id' => :'pendingProposalId'
63
+ }
64
+ end
65
+
66
+ # Returns attribute mapping this model knows about
67
+ def self.acceptable_attribute_map
68
+ attribute_map
69
+ end
70
+
71
+ # Returns all the JSON keys this model knows about
72
+ def self.acceptable_attributes
73
+ acceptable_attribute_map.values
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'account_budget_id' => :'String',
80
+ :'status' => :'String',
81
+ :'billing_setup_id' => :'String',
82
+ :'approved_spending_limit_micros' => :'String',
83
+ :'approved_spending_limit_type' => :'String',
84
+ :'pending_proposal_id' => :'String'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ :'billing_setup_id',
92
+ :'approved_spending_limit_micros',
93
+ :'approved_spending_limit_type',
94
+ :'pending_proposal_id'
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdAccountBilling200ResponseAccountBudgetsInner` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdAccountBilling200ResponseAccountBudgetsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'account_budget_id')
115
+ self.account_budget_id = attributes[:'account_budget_id']
116
+ end
117
+
118
+ if attributes.key?(:'status')
119
+ self.status = attributes[:'status']
120
+ end
121
+
122
+ if attributes.key?(:'billing_setup_id')
123
+ self.billing_setup_id = attributes[:'billing_setup_id']
124
+ end
125
+
126
+ if attributes.key?(:'approved_spending_limit_micros')
127
+ self.approved_spending_limit_micros = attributes[:'approved_spending_limit_micros']
128
+ end
129
+
130
+ if attributes.key?(:'approved_spending_limit_type')
131
+ self.approved_spending_limit_type = attributes[:'approved_spending_limit_type']
132
+ end
133
+
134
+ if attributes.key?(:'pending_proposal_id')
135
+ self.pending_proposal_id = attributes[:'pending_proposal_id']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
+ invalid_properties = Array.new
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "CANCELLED", "UNKNOWN"])
152
+ return false unless status_validator.valid?(@status)
153
+ true
154
+ end
155
+
156
+ # Custom attribute writer method checking allowed values (enum).
157
+ # @param [Object] status Object to be assigned
158
+ def status=(status)
159
+ validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "CANCELLED", "UNKNOWN"])
160
+ unless validator.valid?(status)
161
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
162
+ end
163
+ @status = status
164
+ end
165
+
166
+ # Checks equality by comparing each attribute.
167
+ # @param [Object] Object to be compared
168
+ def ==(o)
169
+ return true if self.equal?(o)
170
+ self.class == o.class &&
171
+ account_budget_id == o.account_budget_id &&
172
+ status == o.status &&
173
+ billing_setup_id == o.billing_setup_id &&
174
+ approved_spending_limit_micros == o.approved_spending_limit_micros &&
175
+ approved_spending_limit_type == o.approved_spending_limit_type &&
176
+ pending_proposal_id == o.pending_proposal_id
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Integer] Hash code
187
+ def hash
188
+ [account_budget_id, status, billing_setup_id, approved_spending_limit_micros, approved_spending_limit_type, pending_proposal_id].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def self.build_from_hash(attributes)
195
+ return nil unless attributes.is_a?(Hash)
196
+ attributes = attributes.transform_keys(&:to_sym)
197
+ transformed_hash = {}
198
+ openapi_types.each_pair do |key, type|
199
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
200
+ transformed_hash["#{key}"] = nil
201
+ elsif type =~ /\AArray<(.*)>/i
202
+ # check to ensure the input is an array given that the attribute
203
+ # is documented as an array but the input is not
204
+ if attributes[attribute_map[key]].is_a?(Array)
205
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
206
+ end
207
+ elsif !attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
209
+ end
210
+ end
211
+ new(transformed_hash)
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
5
+
6
+ The version of the OpenAPI document: 1.324.0
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetAdAccountBilling200ResponseBillingSetupsInner < ApiModelBase
18
+ attr_accessor :billing_setup_id
19
+
20
+ # APPROVED_HELD means approved but waiting for its first account budget to be approved.
21
+ attr_accessor :status
22
+
23
+ attr_accessor :payments_account_id
24
+
25
+ # In the account time zone, as Google returns it.
26
+ attr_accessor :start_date_time
27
+
28
+ attr_accessor :end_date_time
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'billing_setup_id' => :'billingSetupId',
56
+ :'status' => :'status',
57
+ :'payments_account_id' => :'paymentsAccountId',
58
+ :'start_date_time' => :'startDateTime',
59
+ :'end_date_time' => :'endDateTime'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'billing_setup_id' => :'String',
77
+ :'status' => :'String',
78
+ :'payments_account_id' => :'String',
79
+ :'start_date_time' => :'String',
80
+ :'end_date_time' => :'String'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'payments_account_id',
88
+ :'start_date_time',
89
+ :'end_date_time'
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdAccountBilling200ResponseBillingSetupsInner` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!acceptable_attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdAccountBilling200ResponseBillingSetupsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'billing_setup_id')
110
+ self.billing_setup_id = attributes[:'billing_setup_id']
111
+ end
112
+
113
+ if attributes.key?(:'status')
114
+ self.status = attributes[:'status']
115
+ end
116
+
117
+ if attributes.key?(:'payments_account_id')
118
+ self.payments_account_id = attributes[:'payments_account_id']
119
+ end
120
+
121
+ if attributes.key?(:'start_date_time')
122
+ self.start_date_time = attributes[:'start_date_time']
123
+ end
124
+
125
+ if attributes.key?(:'end_date_time')
126
+ self.end_date_time = attributes[:'end_date_time']
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED_HELD", "APPROVED", "CANCELLED", "UNKNOWN"])
143
+ return false unless status_validator.valid?(@status)
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method checking allowed values (enum).
148
+ # @param [Object] status Object to be assigned
149
+ def status=(status)
150
+ validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED_HELD", "APPROVED", "CANCELLED", "UNKNOWN"])
151
+ unless validator.valid?(status)
152
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
153
+ end
154
+ @status = status
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ billing_setup_id == o.billing_setup_id &&
163
+ status == o.status &&
164
+ payments_account_id == o.payments_account_id &&
165
+ start_date_time == o.start_date_time &&
166
+ end_date_time == o.end_date_time
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [billing_setup_id, status, payments_account_id, start_date_time, end_date_time].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ attributes = attributes.transform_keys(&:to_sym)
187
+ transformed_hash = {}
188
+ openapi_types.each_pair do |key, type|
189
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = nil
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[attribute_map[key]].is_a?(Array)
195
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
+ end
197
+ elsif !attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
+ end
200
+ end
201
+ new(transformed_hash)
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ end
221
+
222
+ end