late-sdk 0.0.950 → 0.0.952

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/docs/AdCampaignsApi.md +155 -1
  4. data/docs/AdKeyword.md +3 -1
  5. data/docs/AdKeywordQuality.md +24 -0
  6. data/docs/AdScheduleWindow.md +32 -0
  7. data/docs/BoostPostRequest.md +2 -0
  8. data/docs/BoostPostRequestPromotedObject.md +20 -0
  9. data/docs/GetCampaignAdSchedule200Response.md +28 -0
  10. data/docs/GetCampaignAdSchedule200ResponsePerformance.md +22 -0
  11. data/docs/GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.md +26 -0
  12. data/docs/GetCampaignAdSchedule200ResponsePerformanceByHourInner.md +26 -0
  13. data/docs/UpdateCampaignAdSchedule200Response.md +22 -0
  14. data/docs/UpdateCampaignAdScheduleRequest.md +18 -0
  15. data/docs/UpdateCampaignAdScheduleRequestScheduleInner.md +28 -0
  16. data/lib/zernio-sdk/api/ad_campaigns_api.rb +166 -2
  17. data/lib/zernio-sdk/models/ad_keyword.rb +11 -2
  18. data/lib/zernio-sdk/models/ad_keyword_quality.rb +241 -0
  19. data/lib/zernio-sdk/models/ad_schedule_window.rb +329 -0
  20. data/lib/zernio-sdk/models/boost_post_request.rb +10 -1
  21. data/lib/zernio-sdk/models/boost_post_request_promoted_object.rb +159 -0
  22. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response.rb +197 -0
  23. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance.rb +174 -0
  24. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb +218 -0
  25. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_hour_inner.rb +212 -0
  26. data/lib/zernio-sdk/models/update_campaign_ad_schedule200_response.rb +167 -0
  27. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request.rb +176 -0
  28. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request_schedule_inner.rb +362 -0
  29. data/lib/zernio-sdk/version.rb +1 -1
  30. data/lib/zernio-sdk.rb +10 -0
  31. data/openapi.yaml +230 -7
  32. data/spec/api/ad_campaigns_api_spec.rb +31 -1
  33. data/spec/models/ad_keyword_quality_spec.rb +66 -0
  34. data/spec/models/ad_keyword_spec.rb +6 -0
  35. data/spec/models/ad_schedule_window_spec.rb +90 -0
  36. data/spec/models/boost_post_request_promoted_object_spec.rb +42 -0
  37. data/spec/models/boost_post_request_spec.rb +6 -0
  38. data/spec/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner_spec.rb +64 -0
  39. data/spec/models/get_campaign_ad_schedule200_response_performance_by_hour_inner_spec.rb +60 -0
  40. data/spec/models/get_campaign_ad_schedule200_response_performance_spec.rb +48 -0
  41. data/spec/models/get_campaign_ad_schedule200_response_spec.rb +66 -0
  42. data/spec/models/update_campaign_ad_schedule200_response_spec.rb +48 -0
  43. data/spec/models/update_campaign_ad_schedule_request_schedule_inner_spec.rb +78 -0
  44. data/spec/models/update_campaign_ad_schedule_request_spec.rb +36 -0
  45. data/zernio-sdk-0.0.952.gem +0 -0
  46. metadata +43 -3
  47. data/zernio-sdk-0.0.950.gem +0 -0
@@ -0,0 +1,197 @@
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).
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 GetCampaignAdSchedule200Response < ApiModelBase
18
+ attr_accessor :campaign_id
19
+
20
+ attr_accessor :schedule
21
+
22
+ # True when the campaign carries no ad schedule at all, so it can serve at any time.
23
+ attr_accessor :serves_around_the_clock
24
+
25
+ attr_accessor :cached_at
26
+
27
+ # True when a quota-exhausted read served the last-good copy.
28
+ attr_accessor :stale
29
+
30
+ attr_accessor :performance
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'campaign_id' => :'campaignId',
36
+ :'schedule' => :'schedule',
37
+ :'serves_around_the_clock' => :'servesAroundTheClock',
38
+ :'cached_at' => :'cachedAt',
39
+ :'stale' => :'stale',
40
+ :'performance' => :'performance'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'campaign_id' => :'String',
58
+ :'schedule' => :'Array<AdScheduleWindow>',
59
+ :'serves_around_the_clock' => :'Boolean',
60
+ :'cached_at' => :'Time',
61
+ :'stale' => :'Boolean',
62
+ :'performance' => :'GetCampaignAdSchedule200ResponsePerformance'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'cached_at',
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetCampaignAdSchedule200Response` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetCampaignAdSchedule200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'campaign_id')
90
+ self.campaign_id = attributes[:'campaign_id']
91
+ end
92
+
93
+ if attributes.key?(:'schedule')
94
+ if (value = attributes[:'schedule']).is_a?(Array)
95
+ self.schedule = value
96
+ end
97
+ end
98
+
99
+ if attributes.key?(:'serves_around_the_clock')
100
+ self.serves_around_the_clock = attributes[:'serves_around_the_clock']
101
+ end
102
+
103
+ if attributes.key?(:'cached_at')
104
+ self.cached_at = attributes[:'cached_at']
105
+ end
106
+
107
+ if attributes.key?(:'stale')
108
+ self.stale = attributes[:'stale']
109
+ end
110
+
111
+ if attributes.key?(:'performance')
112
+ self.performance = attributes[:'performance']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
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
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ campaign_id == o.campaign_id &&
137
+ schedule == o.schedule &&
138
+ serves_around_the_clock == o.serves_around_the_clock &&
139
+ cached_at == o.cached_at &&
140
+ stale == o.stale &&
141
+ performance == o.performance
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [campaign_id, schedule, serves_around_the_clock, cached_at, stale, performance].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attributes = attributes.transform_keys(&:to_sym)
162
+ transformed_hash = {}
163
+ openapi_types.each_pair do |key, type|
164
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = nil
166
+ elsif type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[attribute_map[key]].is_a?(Array)
170
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
171
+ end
172
+ elsif !attributes[attribute_map[key]].nil?
173
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
174
+ end
175
+ end
176
+ new(transformed_hash)
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ end
196
+
197
+ end
@@ -0,0 +1,174 @@
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).
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
+ # Only present when includePerformance=true.
18
+ class GetCampaignAdSchedule200ResponsePerformance < ApiModelBase
19
+ # The trailing window used, or null when an explicit fromDate/toDate range was given.
20
+ attr_accessor :window_days
21
+
22
+ # One entry per day that delivered, Monday first.
23
+ attr_accessor :by_day_of_week
24
+
25
+ # One entry per hour that delivered, 0-23 in the account time zone.
26
+ attr_accessor :by_hour
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'window_days' => :'windowDays',
32
+ :'by_day_of_week' => :'byDayOfWeek',
33
+ :'by_hour' => :'byHour'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'window_days' => :'Integer',
51
+ :'by_day_of_week' => :'Array<GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner>',
52
+ :'by_hour' => :'Array<GetCampaignAdSchedule200ResponsePerformanceByHourInner>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'window_days',
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetCampaignAdSchedule200ResponsePerformance` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetCampaignAdSchedule200ResponsePerformance`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'window_days')
80
+ self.window_days = attributes[:'window_days']
81
+ end
82
+
83
+ if attributes.key?(:'by_day_of_week')
84
+ if (value = attributes[:'by_day_of_week']).is_a?(Array)
85
+ self.by_day_of_week = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'by_hour')
90
+ if (value = attributes[:'by_hour']).is_a?(Array)
91
+ self.by_hour = value
92
+ end
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ window_days == o.window_days &&
117
+ by_day_of_week == o.by_day_of_week &&
118
+ by_hour == o.by_hour
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [window_days, by_day_of_week, by_hour].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,218 @@
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).
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 GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner < ApiModelBase
18
+ attr_accessor :day_of_week
19
+
20
+ attr_accessor :impressions
21
+
22
+ attr_accessor :clicks
23
+
24
+ # Account currency, not USD-normalized.
25
+ attr_accessor :cost
26
+
27
+ attr_accessor :conversions
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'day_of_week' => :'dayOfWeek',
55
+ :'impressions' => :'impressions',
56
+ :'clicks' => :'clicks',
57
+ :'cost' => :'cost',
58
+ :'conversions' => :'conversions'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'day_of_week' => :'String',
76
+ :'impressions' => :'Integer',
77
+ :'clicks' => :'Integer',
78
+ :'cost' => :'Float',
79
+ :'conversions' => :'Float'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ acceptable_attribute_map = self.class.acceptable_attribute_map
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!acceptable_attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'day_of_week')
106
+ self.day_of_week = attributes[:'day_of_week']
107
+ end
108
+
109
+ if attributes.key?(:'impressions')
110
+ self.impressions = attributes[:'impressions']
111
+ end
112
+
113
+ if attributes.key?(:'clicks')
114
+ self.clicks = attributes[:'clicks']
115
+ end
116
+
117
+ if attributes.key?(:'cost')
118
+ self.cost = attributes[:'cost']
119
+ end
120
+
121
+ if attributes.key?(:'conversions')
122
+ self.conversions = attributes[:'conversions']
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ day_of_week_validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
139
+ return false unless day_of_week_validator.valid?(@day_of_week)
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method checking allowed values (enum).
144
+ # @param [Object] day_of_week Object to be assigned
145
+ def day_of_week=(day_of_week)
146
+ validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
147
+ unless validator.valid?(day_of_week)
148
+ fail ArgumentError, "invalid value for \"day_of_week\", must be one of #{validator.allowable_values}."
149
+ end
150
+ @day_of_week = day_of_week
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ day_of_week == o.day_of_week &&
159
+ impressions == o.impressions &&
160
+ clicks == o.clicks &&
161
+ cost == o.cost &&
162
+ conversions == o.conversions
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [day_of_week, impressions, clicks, cost, conversions].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ end
217
+
218
+ end