late-sdk 0.0.856 → 0.0.857

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -2
  3. data/docs/AdCampaignsApi.md +364 -6
  4. data/docs/{ListAdKeywords200ResponseKeywordsInner.md → AdKeyword.md} +7 -3
  5. data/docs/AdKeywordMetrics.md +30 -0
  6. data/docs/AddAdKeywords201Response.md +18 -0
  7. data/docs/AddAdKeywordsRequest.md +24 -0
  8. data/docs/AddAdKeywordsRequestKeywordsInner.md +20 -0
  9. data/docs/AddAdKeywordsRequestKeywordsInnerAnyOf.md +20 -0
  10. data/docs/CreateStandaloneAdRequest.md +4 -2
  11. data/docs/KeywordEntry.md +49 -0
  12. data/docs/ListAdKeywords200Response.md +1 -1
  13. data/docs/ListCampaignNegativeKeywords200Response.md +18 -0
  14. data/docs/ListCampaignNegativeKeywords200ResponseKeywordsInner.md +22 -0
  15. data/docs/RemoveAdKeyword200Response.md +20 -0
  16. data/docs/ReplaceCampaignNegativeKeywords200Response.md +22 -0
  17. data/docs/ReplaceCampaignNegativeKeywordsRequest.md +20 -0
  18. data/docs/UpdateAdKeyword200Response.md +18 -0
  19. data/docs/{UpdateAdStatusRequest.md → UpdateAdKeywordRequest.md} +2 -2
  20. data/lib/zernio-sdk/api/ad_campaigns_api.rb +358 -9
  21. data/lib/zernio-sdk/models/{list_ad_keywords200_response_keywords_inner.rb → ad_keyword.rb} +28 -8
  22. data/lib/zernio-sdk/models/ad_keyword_metrics.rb +207 -0
  23. data/lib/zernio-sdk/models/add_ad_keywords201_response.rb +149 -0
  24. data/lib/zernio-sdk/models/add_ad_keywords_request.rb +250 -0
  25. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner.rb +103 -0
  26. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner_any_of.rb +225 -0
  27. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +55 -5
  28. data/lib/zernio-sdk/models/keyword_entry.rb +105 -0
  29. data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +1 -1
  30. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response.rb +149 -0
  31. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response_keywords_inner.rb +199 -0
  32. data/lib/zernio-sdk/models/remove_ad_keyword200_response.rb +157 -0
  33. data/lib/zernio-sdk/models/replace_campaign_negative_keywords200_response.rb +170 -0
  34. data/lib/zernio-sdk/models/replace_campaign_negative_keywords_request.rb +219 -0
  35. data/lib/zernio-sdk/models/update_ad_keyword200_response.rb +147 -0
  36. data/lib/zernio-sdk/models/{update_ad_status_request.rb → update_ad_keyword_request.rb} +3 -3
  37. data/lib/zernio-sdk/version.rb +1 -1
  38. data/lib/zernio-sdk.rb +14 -2
  39. data/openapi.yaml +257 -21
  40. data/spec/api/ad_campaigns_api_spec.rb +64 -1
  41. data/spec/models/ad_keyword_metrics_spec.rb +72 -0
  42. data/spec/models/{list_ad_keywords200_response_keywords_inner_spec.rb → ad_keyword_spec.rb} +18 -6
  43. data/spec/models/add_ad_keywords201_response_spec.rb +36 -0
  44. data/spec/models/add_ad_keywords_request_keywords_inner_any_of_spec.rb +46 -0
  45. data/spec/models/add_ad_keywords_request_keywords_inner_spec.rb +21 -0
  46. data/spec/models/add_ad_keywords_request_spec.rb +54 -0
  47. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  48. data/spec/models/keyword_entry_spec.rb +32 -0
  49. data/spec/models/list_campaign_negative_keywords200_response_keywords_inner_spec.rb +52 -0
  50. data/spec/models/list_campaign_negative_keywords200_response_spec.rb +36 -0
  51. data/spec/models/remove_ad_keyword200_response_spec.rb +42 -0
  52. data/spec/models/replace_campaign_negative_keywords200_response_spec.rb +48 -0
  53. data/spec/models/replace_campaign_negative_keywords_request_spec.rb +46 -0
  54. data/spec/models/update_ad_keyword200_response_spec.rb +36 -0
  55. data/spec/models/{update_ad_status_request_spec.rb → update_ad_keyword_request_spec.rb} +6 -6
  56. data/zernio-sdk-0.0.857.gem +0 -0
  57. metadata +58 -10
  58. data/zernio-sdk-0.0.856.gem +0 -0
@@ -0,0 +1,207 @@
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
+ # Trailing 30-day window. Null on rows synced before the metrics columns existed (re-synced on the keyword's next weekly sweep).
18
+ class AdKeywordMetrics < ApiModelBase
19
+ attr_accessor :window_days
20
+
21
+ attr_accessor :clicks
22
+
23
+ attr_accessor :impressions
24
+
25
+ # Account currency, not USD-normalized
26
+ attr_accessor :cost
27
+
28
+ attr_accessor :conversions
29
+
30
+ # Account currency
31
+ attr_accessor :first_page_cpc
32
+
33
+ # Account currency
34
+ attr_accessor :first_position_cpc
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'window_days' => :'windowDays',
40
+ :'clicks' => :'clicks',
41
+ :'impressions' => :'impressions',
42
+ :'cost' => :'cost',
43
+ :'conversions' => :'conversions',
44
+ :'first_page_cpc' => :'firstPageCpc',
45
+ :'first_position_cpc' => :'firstPositionCpc'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'window_days' => :'Integer',
63
+ :'clicks' => :'Integer',
64
+ :'impressions' => :'Integer',
65
+ :'cost' => :'Float',
66
+ :'conversions' => :'Float',
67
+ :'first_page_cpc' => :'Float',
68
+ :'first_position_cpc' => :'Float'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ :'first_page_cpc',
76
+ :'first_position_cpc'
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdKeywordMetrics` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdKeywordMetrics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'window_days')
97
+ self.window_days = attributes[:'window_days']
98
+ end
99
+
100
+ if attributes.key?(:'clicks')
101
+ self.clicks = attributes[:'clicks']
102
+ end
103
+
104
+ if attributes.key?(:'impressions')
105
+ self.impressions = attributes[:'impressions']
106
+ end
107
+
108
+ if attributes.key?(:'cost')
109
+ self.cost = attributes[:'cost']
110
+ end
111
+
112
+ if attributes.key?(:'conversions')
113
+ self.conversions = attributes[:'conversions']
114
+ end
115
+
116
+ if attributes.key?(:'first_page_cpc')
117
+ self.first_page_cpc = attributes[:'first_page_cpc']
118
+ end
119
+
120
+ if attributes.key?(:'first_position_cpc')
121
+ self.first_position_cpc = attributes[:'first_position_cpc']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ true
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ window_days == o.window_days &&
146
+ clicks == o.clicks &&
147
+ impressions == o.impressions &&
148
+ cost == o.cost &&
149
+ conversions == o.conversions &&
150
+ first_page_cpc == o.first_page_cpc &&
151
+ first_position_cpc == o.first_position_cpc
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ def hash
163
+ [window_days, clicks, impressions, cost, conversions, first_page_cpc, first_position_cpc].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def self.build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ transformed_hash = {}
173
+ openapi_types.each_pair do |key, type|
174
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = nil
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[attribute_map[key]].is_a?(Array)
180
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
+ end
182
+ elsif !attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
+ end
185
+ end
186
+ new(transformed_hash)
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ end
206
+
207
+ end
@@ -0,0 +1,149 @@
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 AddAdKeywords201Response < ApiModelBase
18
+ attr_accessor :keywords
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'keywords' => :'keywords'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'keywords' => :'Array<AdKeyword>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AddAdKeywords201Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AddAdKeywords201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'keywords')
67
+ if (value = attributes[:'keywords']).is_a?(Array)
68
+ self.keywords = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ keywords == o.keywords
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [keywords].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -0,0 +1,250 @@
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 AddAdKeywordsRequest < ApiModelBase
18
+ # Social account ID (Google Ads)
19
+ attr_accessor :account_id
20
+
21
+ # Google ad group ID to add the keywords to
22
+ attr_accessor :ad_set_id
23
+
24
+ attr_accessor :keywords
25
+
26
+ # Add as ad-group-level negatives instead of positive keywords
27
+ attr_accessor :negative
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'account_id' => :'accountId',
33
+ :'ad_set_id' => :'adSetId',
34
+ :'keywords' => :'keywords',
35
+ :'negative' => :'negative'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'account_id' => :'String',
53
+ :'ad_set_id' => :'String',
54
+ :'keywords' => :'Array<AddAdKeywordsRequestKeywordsInner>',
55
+ :'negative' => :'Boolean'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AddAdKeywordsRequest` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AddAdKeywordsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'account_id')
82
+ self.account_id = attributes[:'account_id']
83
+ else
84
+ self.account_id = nil
85
+ end
86
+
87
+ if attributes.key?(:'ad_set_id')
88
+ self.ad_set_id = attributes[:'ad_set_id']
89
+ else
90
+ self.ad_set_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'keywords')
94
+ if (value = attributes[:'keywords']).is_a?(Array)
95
+ self.keywords = value
96
+ end
97
+ else
98
+ self.keywords = nil
99
+ end
100
+
101
+ if attributes.key?(:'negative')
102
+ self.negative = attributes[:'negative']
103
+ else
104
+ self.negative = false
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @account_id.nil?
114
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
115
+ end
116
+
117
+ if @ad_set_id.nil?
118
+ invalid_properties.push('invalid value for "ad_set_id", ad_set_id cannot be nil.')
119
+ end
120
+
121
+ if @keywords.nil?
122
+ invalid_properties.push('invalid value for "keywords", keywords cannot be nil.')
123
+ end
124
+
125
+ if @keywords.length > 1000
126
+ invalid_properties.push('invalid value for "keywords", number of items must be less than or equal to 1000.')
127
+ end
128
+
129
+ if @keywords.length < 1
130
+ invalid_properties.push('invalid value for "keywords", number of items must be greater than or equal to 1.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ return false if @account_id.nil?
141
+ return false if @ad_set_id.nil?
142
+ return false if @keywords.nil?
143
+ return false if @keywords.length > 1000
144
+ return false if @keywords.length < 1
145
+ true
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] account_id Value to be assigned
150
+ def account_id=(account_id)
151
+ if account_id.nil?
152
+ fail ArgumentError, 'account_id cannot be nil'
153
+ end
154
+
155
+ @account_id = account_id
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] ad_set_id Value to be assigned
160
+ def ad_set_id=(ad_set_id)
161
+ if ad_set_id.nil?
162
+ fail ArgumentError, 'ad_set_id cannot be nil'
163
+ end
164
+
165
+ @ad_set_id = ad_set_id
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] keywords Value to be assigned
170
+ def keywords=(keywords)
171
+ if keywords.nil?
172
+ fail ArgumentError, 'keywords cannot be nil'
173
+ end
174
+
175
+ if keywords.length > 1000
176
+ fail ArgumentError, 'invalid value for "keywords", number of items must be less than or equal to 1000.'
177
+ end
178
+
179
+ if keywords.length < 1
180
+ fail ArgumentError, 'invalid value for "keywords", number of items must be greater than or equal to 1.'
181
+ end
182
+
183
+ @keywords = keywords
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ account_id == o.account_id &&
192
+ ad_set_id == o.ad_set_id &&
193
+ keywords == o.keywords &&
194
+ negative == o.negative
195
+ end
196
+
197
+ # @see the `==` method
198
+ # @param [Object] Object to be compared
199
+ def eql?(o)
200
+ self == o
201
+ end
202
+
203
+ # Calculates hash code according to all attributes.
204
+ # @return [Integer] Hash code
205
+ def hash
206
+ [account_id, ad_set_id, keywords, negative].hash
207
+ end
208
+
209
+ # Builds the object from hash
210
+ # @param [Hash] attributes Model attributes in the form of hash
211
+ # @return [Object] Returns the model itself
212
+ def self.build_from_hash(attributes)
213
+ return nil unless attributes.is_a?(Hash)
214
+ attributes = attributes.transform_keys(&:to_sym)
215
+ transformed_hash = {}
216
+ openapi_types.each_pair do |key, type|
217
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = nil
219
+ elsif type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[attribute_map[key]].is_a?(Array)
223
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
224
+ end
225
+ elsif !attributes[attribute_map[key]].nil?
226
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
227
+ end
228
+ end
229
+ new(transformed_hash)
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ end
249
+
250
+ end