late-sdk 0.0.714 → 0.0.716

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -10
  3. data/docs/AdAnalyticsResponse.md +22 -0
  4. data/docs/{GetAdAnalytics200ResponseAd.md → AdAnalyticsResponseAd.md} +2 -4
  5. data/docs/AdCampaignsApi.md +12 -12
  6. data/docs/AdDailyMetrics.md +14 -0
  7. data/docs/AdEngagementCounts.md +1 -1
  8. data/docs/AdInsightsApi.md +8 -8
  9. data/docs/AdMetrics.md +14 -0
  10. data/docs/AdTreeResponse.md +22 -0
  11. data/docs/AdsListResponse.md +22 -0
  12. data/docs/AdsTimelineResponse.md +20 -0
  13. data/docs/{GetAdsTimeline200ResponseRowsInner.md → AdsTimelineResponseRowsInner.md} +2 -2
  14. data/docs/CampaignAnalyticsResponse.md +22 -0
  15. data/docs/{GetCampaignAnalytics200ResponseAnalytics.md → CampaignAnalyticsResponseAnalytics.md} +3 -3
  16. data/docs/{GetCampaignAnalytics200ResponseAnalyticsDailyInner.md → CampaignAnalyticsResponseAnalyticsDailyInner.md} +16 -2
  17. data/docs/{GetCampaignAnalytics200ResponseCampaign.md → CampaignAnalyticsResponseCampaign.md} +2 -2
  18. data/docs/GetAdAnalytics202Response.md +22 -0
  19. data/docs/GetAdTree202Response.md +22 -0
  20. data/docs/GetAdsTimeline202Response.md +20 -0
  21. data/docs/GetCampaignAnalytics202Response.md +22 -0
  22. data/docs/ListAds202Response.md +22 -0
  23. data/lib/zernio-sdk/api/ad_campaigns_api.rb +9 -9
  24. data/lib/zernio-sdk/api/ad_insights_api.rb +6 -6
  25. data/lib/zernio-sdk/models/{get_ad_analytics200_response.rb → ad_analytics_response.rb} +15 -15
  26. data/lib/zernio-sdk/models/{get_ad_analytics200_response_ad.rb → ad_analytics_response_ad.rb} +4 -47
  27. data/lib/zernio-sdk/models/ad_daily_metrics.rb +73 -1
  28. data/lib/zernio-sdk/models/ad_engagement_counts.rb +1 -1
  29. data/lib/zernio-sdk/models/ad_metrics.rb +73 -1
  30. data/lib/zernio-sdk/models/{get_ad_tree200_response.rb → ad_tree_response.rb} +17 -17
  31. data/lib/zernio-sdk/models/{list_ads200_response.rb → ads_list_response.rb} +17 -17
  32. data/lib/zernio-sdk/models/{get_ads_timeline200_response.rb → ads_timeline_response.rb} +17 -17
  33. data/lib/zernio-sdk/models/{get_ads_timeline200_response_rows_inner.rb → ads_timeline_response_rows_inner.rb} +3 -3
  34. data/lib/zernio-sdk/models/{get_campaign_analytics200_response.rb → campaign_analytics_response.rb} +15 -15
  35. data/lib/zernio-sdk/models/{get_campaign_analytics200_response_analytics.rb → campaign_analytics_response_analytics.rb} +4 -4
  36. data/lib/zernio-sdk/models/{get_campaign_analytics200_response_analytics_daily_inner.rb → campaign_analytics_response_analytics_daily_inner.rb} +76 -4
  37. data/lib/zernio-sdk/models/{get_campaign_analytics200_response_campaign.rb → campaign_analytics_response_campaign.rb} +3 -3
  38. data/lib/zernio-sdk/models/get_ad_analytics202_response.rb +213 -0
  39. data/lib/zernio-sdk/models/get_ad_tree202_response.rb +215 -0
  40. data/lib/zernio-sdk/models/get_ads_timeline202_response.rb +206 -0
  41. data/lib/zernio-sdk/models/get_campaign_analytics202_response.rb +213 -0
  42. data/lib/zernio-sdk/models/list_ads202_response.rb +215 -0
  43. data/lib/zernio-sdk/version.rb +1 -1
  44. data/lib/zernio-sdk.rb +15 -10
  45. data/openapi.yaml +205 -123
  46. data/spec/api/ad_campaigns_api_spec.rb +3 -3
  47. data/spec/api/ad_insights_api_spec.rb +2 -2
  48. data/spec/models/{get_campaign_analytics200_response_campaign_spec.rb → ad_analytics_response_ad_spec.rb} +6 -6
  49. data/spec/models/{get_ad_analytics200_response_spec.rb → ad_analytics_response_spec.rb} +8 -8
  50. data/spec/models/ad_daily_metrics_spec.rb +42 -0
  51. data/spec/models/ad_metrics_spec.rb +42 -0
  52. data/spec/models/{get_ad_tree200_response_spec.rb → ad_tree_response_spec.rb} +8 -8
  53. data/spec/models/{list_ads200_response_spec.rb → ads_list_response_spec.rb} +8 -8
  54. data/spec/models/{get_ads_timeline200_response_rows_inner_spec.rb → ads_timeline_response_rows_inner_spec.rb} +6 -6
  55. data/spec/models/{get_ads_timeline200_response_spec.rb → ads_timeline_response_spec.rb} +8 -8
  56. data/spec/models/{get_campaign_analytics200_response_analytics_daily_inner_spec.rb → campaign_analytics_response_analytics_daily_inner_spec.rb} +48 -6
  57. data/spec/models/{get_campaign_analytics200_response_analytics_spec.rb → campaign_analytics_response_analytics_spec.rb} +6 -6
  58. data/spec/models/{get_ad_analytics200_response_ad_spec.rb → campaign_analytics_response_campaign_spec.rb} +6 -16
  59. data/spec/models/{get_campaign_analytics200_response_spec.rb → campaign_analytics_response_spec.rb} +8 -8
  60. data/spec/models/get_ad_analytics202_response_spec.rb +52 -0
  61. data/spec/models/get_ad_tree202_response_spec.rb +52 -0
  62. data/spec/models/get_ads_timeline202_response_spec.rb +46 -0
  63. data/spec/models/get_campaign_analytics202_response_spec.rb +52 -0
  64. data/spec/models/list_ads202_response_spec.rb +52 -0
  65. data/zernio-sdk-0.0.716.gem +0 -0
  66. metadata +1654 -1634
  67. data/docs/GetAdAnalytics200Response.md +0 -22
  68. data/docs/GetAdTree200Response.md +0 -22
  69. data/docs/GetAdsTimeline200Response.md +0 -20
  70. data/docs/GetCampaignAnalytics200Response.md +0 -22
  71. data/docs/ListAds200Response.md +0 -22
  72. data/zernio-sdk-0.0.714.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
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 GetAdAnalytics202Response < ApiModelBase
18
+ attr_accessor :backfill_pending
19
+
20
+ attr_accessor :ad
21
+
22
+ attr_accessor :analytics
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'backfill_pending' => :'backfillPending',
50
+ :'ad' => :'ad',
51
+ :'analytics' => :'analytics'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'backfill_pending' => :'Boolean',
69
+ :'ad' => :'AdAnalyticsResponseAd',
70
+ :'analytics' => :'CampaignAnalyticsResponseAnalytics'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # List of class defined in allOf (OpenAPI v3)
81
+ def self.openapi_all_of
82
+ [
83
+ :'AdAnalyticsResponse'
84
+ ]
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdAnalytics202Response` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ acceptable_attribute_map = self.class.acceptable_attribute_map
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!acceptable_attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdAnalytics202Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'backfill_pending')
104
+ self.backfill_pending = attributes[:'backfill_pending']
105
+ else
106
+ self.backfill_pending = nil
107
+ end
108
+
109
+ if attributes.key?(:'ad')
110
+ self.ad = attributes[:'ad']
111
+ end
112
+
113
+ if attributes.key?(:'analytics')
114
+ self.analytics = attributes[:'analytics']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @backfill_pending.nil?
124
+ invalid_properties.push('invalid value for "backfill_pending", backfill_pending cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @backfill_pending.nil?
135
+ backfill_pending_validator = EnumAttributeValidator.new('Boolean', ["true"])
136
+ return false unless backfill_pending_validator.valid?(@backfill_pending)
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method checking allowed values (enum).
141
+ # @param [Object] backfill_pending Object to be assigned
142
+ def backfill_pending=(backfill_pending)
143
+ validator = EnumAttributeValidator.new('Boolean', ["true"])
144
+ unless validator.valid?(backfill_pending)
145
+ fail ArgumentError, "invalid value for \"backfill_pending\", must be one of #{validator.allowable_values}."
146
+ end
147
+ @backfill_pending = backfill_pending
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ backfill_pending == o.backfill_pending &&
156
+ ad == o.ad &&
157
+ analytics == o.analytics
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
+ [backfill_pending, ad, analytics].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,215 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 GetAdTree202Response < ApiModelBase
18
+ attr_accessor :campaigns
19
+
20
+ attr_accessor :pagination
21
+
22
+ attr_accessor :backfill_pending
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'campaigns' => :'campaigns',
50
+ :'pagination' => :'pagination',
51
+ :'backfill_pending' => :'backfillPending'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'campaigns' => :'Array<AdTreeCampaign>',
69
+ :'pagination' => :'Pagination',
70
+ :'backfill_pending' => :'Boolean'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # List of class defined in allOf (OpenAPI v3)
81
+ def self.openapi_all_of
82
+ [
83
+ :'AdTreeResponse'
84
+ ]
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdTree202Response` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ acceptable_attribute_map = self.class.acceptable_attribute_map
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!acceptable_attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdTree202Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'campaigns')
104
+ if (value = attributes[:'campaigns']).is_a?(Array)
105
+ self.campaigns = value
106
+ end
107
+ end
108
+
109
+ if attributes.key?(:'pagination')
110
+ self.pagination = attributes[:'pagination']
111
+ end
112
+
113
+ if attributes.key?(:'backfill_pending')
114
+ self.backfill_pending = attributes[:'backfill_pending']
115
+ else
116
+ self.backfill_pending = nil
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ if @backfill_pending.nil?
126
+ invalid_properties.push('invalid value for "backfill_pending", backfill_pending cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @backfill_pending.nil?
137
+ backfill_pending_validator = EnumAttributeValidator.new('Boolean', ["true"])
138
+ return false unless backfill_pending_validator.valid?(@backfill_pending)
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] backfill_pending Object to be assigned
144
+ def backfill_pending=(backfill_pending)
145
+ validator = EnumAttributeValidator.new('Boolean', ["true"])
146
+ unless validator.valid?(backfill_pending)
147
+ fail ArgumentError, "invalid value for \"backfill_pending\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @backfill_pending = backfill_pending
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ campaigns == o.campaigns &&
158
+ pagination == o.pagination &&
159
+ backfill_pending == o.backfill_pending
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [campaigns, pagination, backfill_pending].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 GetAdsTimeline202Response < ApiModelBase
18
+ attr_accessor :backfill_pending
19
+
20
+ attr_accessor :rows
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'backfill_pending' => :'backfillPending',
48
+ :'rows' => :'rows'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'backfill_pending' => :'Boolean',
66
+ :'rows' => :'Array<AdsTimelineResponseRowsInner>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # List of class defined in allOf (OpenAPI v3)
77
+ def self.openapi_all_of
78
+ [
79
+ :'AdsTimelineResponse'
80
+ ]
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdsTimeline202Response` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdsTimeline202Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'backfill_pending')
100
+ self.backfill_pending = attributes[:'backfill_pending']
101
+ else
102
+ self.backfill_pending = nil
103
+ end
104
+
105
+ if attributes.key?(:'rows')
106
+ if (value = attributes[:'rows']).is_a?(Array)
107
+ self.rows = value
108
+ end
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @backfill_pending.nil?
118
+ invalid_properties.push('invalid value for "backfill_pending", backfill_pending cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
+ return false if @backfill_pending.nil?
129
+ backfill_pending_validator = EnumAttributeValidator.new('Boolean', ["true"])
130
+ return false unless backfill_pending_validator.valid?(@backfill_pending)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] backfill_pending Object to be assigned
136
+ def backfill_pending=(backfill_pending)
137
+ validator = EnumAttributeValidator.new('Boolean', ["true"])
138
+ unless validator.valid?(backfill_pending)
139
+ fail ArgumentError, "invalid value for \"backfill_pending\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @backfill_pending = backfill_pending
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ backfill_pending == o.backfill_pending &&
150
+ rows == o.rows
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [backfill_pending, rows].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end