late-sdk 0.0.894 → 0.0.896

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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -3
  3. data/docs/AdAccountsApi.md +446 -0
  4. data/docs/AdAnalyticsResponse.md +1 -1
  5. data/docs/AdAnalyticsResponseAnalytics.md +22 -0
  6. data/docs/AdCampaign.md +1 -1
  7. data/docs/AdCampaignBudget.md +11 -3
  8. data/docs/AdCampaignsApi.md +149 -3
  9. data/docs/AdInsightsApi.md +1 -1
  10. data/docs/AdNegativeKeywordList.md +26 -0
  11. data/docs/AdNegativeKeywordListKeyword.md +22 -0
  12. data/docs/BoostPostRequest.md +6 -4
  13. data/docs/CampaignAnalyticsResponseAnalytics.md +3 -1
  14. data/docs/CampaignAnalyticsResponseAnalyticsImpressionShareCache.md +20 -0
  15. data/docs/CampaignAnalyticsResponseAnalyticsSummary.md +96 -0
  16. data/docs/CampaignAnalyticsResponseCampaign.md +2 -0
  17. data/docs/CreateAdNegativeKeywordList201Response.md +24 -0
  18. data/docs/CreateAdNegativeKeywordListRequest.md +26 -0
  19. data/docs/CreateCallAdRequest.md +8 -2
  20. data/docs/CreateMessagingAdRequest.md +8 -2
  21. data/docs/CtwaAdRequestBody.md +8 -2
  22. data/docs/CtwaAdRequestBodyCreativesInner.md +7 -3
  23. data/docs/DeleteAdNegativeKeywordList200Response.md +20 -0
  24. data/docs/GetAdAnalytics202Response.md +1 -1
  25. data/docs/GetAdNegativeKeywordList200Response.md +24 -0
  26. data/docs/GetAdNegativeKeywordList200ResponseList.md +28 -0
  27. data/docs/ListAdNegativeKeywordLists200Response.md +24 -0
  28. data/docs/MediaItem.md +1 -1
  29. data/docs/MessagingAdsApi.md +10 -10
  30. data/docs/ReplaceAdNegativeKeywordListKeywords200Response.md +22 -0
  31. data/docs/ReplaceAdNegativeKeywordListKeywordsRequest.md +24 -0
  32. data/docs/ReplaceCampaignNegativeKeywordListsRequest.md +20 -0
  33. data/docs/UpdateAdCampaign200Response.md +1 -1
  34. data/docs/UpdateAdCampaignRequest.md +2 -0
  35. data/docs/UpdateAdNegativeKeywordList200Response.md +20 -0
  36. data/docs/UpdateAdNegativeKeywordListRequest.md +24 -0
  37. data/lib/zernio-sdk/api/ad_accounts_api.rb +500 -0
  38. data/lib/zernio-sdk/api/ad_campaigns_api.rb +160 -6
  39. data/lib/zernio-sdk/api/ad_insights_api.rb +2 -2
  40. data/lib/zernio-sdk/api/messaging_ads_api.rb +8 -8
  41. data/lib/zernio-sdk/models/ad_analytics_response.rb +1 -1
  42. data/lib/zernio-sdk/models/ad_analytics_response_analytics.rb +169 -0
  43. data/lib/zernio-sdk/models/ad_campaign.rb +3 -1
  44. data/lib/zernio-sdk/models/ad_campaign_budget.rb +99 -5
  45. data/lib/zernio-sdk/models/ad_negative_keyword_list.rb +209 -0
  46. data/lib/zernio-sdk/models/ad_negative_keyword_list_keyword.rb +222 -0
  47. data/lib/zernio-sdk/models/boost_post_request.rb +38 -7
  48. data/lib/zernio-sdk/models/campaign_analytics_response_analytics.rb +11 -2
  49. data/lib/zernio-sdk/models/campaign_analytics_response_analytics_impression_share_cache.rb +158 -0
  50. data/lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb +550 -0
  51. data/lib/zernio-sdk/models/campaign_analytics_response_campaign.rb +11 -1
  52. data/lib/zernio-sdk/models/create_ad_negative_keyword_list201_response.rb +220 -0
  53. data/lib/zernio-sdk/models/create_ad_negative_keyword_list_request.rb +327 -0
  54. data/lib/zernio-sdk/models/create_call_ad_request.rb +94 -3
  55. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +94 -3
  56. data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +95 -4
  57. data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +67 -21
  58. data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner_video.rb +1 -1
  59. data/lib/zernio-sdk/models/ctwa_ad_request_body_video.rb +1 -1
  60. data/lib/zernio-sdk/models/{ad_campaign_campaign_budget.rb → delete_ad_negative_keyword_list200_response.rb} +35 -48
  61. data/lib/zernio-sdk/models/get_ad_analytics202_response.rb +1 -1
  62. data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response.rb +199 -0
  63. data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response_list.rb +227 -0
  64. data/lib/zernio-sdk/models/list_ad_negative_keyword_lists200_response.rb +201 -0
  65. data/lib/zernio-sdk/models/media_item.rb +1 -0
  66. data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords200_response.rb +189 -0
  67. data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords_request.rb +289 -0
  68. data/lib/zernio-sdk/models/replace_campaign_negative_keyword_lists_request.rb +219 -0
  69. data/lib/zernio-sdk/models/update_ad_campaign200_response.rb +1 -1
  70. data/lib/zernio-sdk/models/update_ad_campaign_request.rb +13 -1
  71. data/lib/zernio-sdk/models/update_ad_campaign_request_budget.rb +1 -1
  72. data/lib/zernio-sdk/models/update_ad_negative_keyword_list200_response.rb +178 -0
  73. data/lib/zernio-sdk/models/update_ad_negative_keyword_list_request.rb +296 -0
  74. data/lib/zernio-sdk/version.rb +1 -1
  75. data/lib/zernio-sdk.rb +16 -1
  76. data/openapi.yaml +981 -43
  77. data/spec/api/ad_accounts_api_spec.rb +82 -0
  78. data/spec/api/ad_campaigns_api_spec.rb +29 -3
  79. data/spec/api/ad_insights_api_spec.rb +1 -1
  80. data/spec/api/messaging_ads_api_spec.rb +4 -4
  81. data/spec/models/ad_analytics_response_analytics_spec.rb +48 -0
  82. data/spec/models/ad_campaign_budget_spec.rb +24 -0
  83. data/spec/models/ad_negative_keyword_list_keyword_spec.rb +52 -0
  84. data/spec/models/ad_negative_keyword_list_spec.rb +60 -0
  85. data/spec/models/boost_post_request_spec.rb +7 -1
  86. data/spec/models/campaign_analytics_response_analytics_impression_share_cache_spec.rb +42 -0
  87. data/spec/models/campaign_analytics_response_analytics_spec.rb +6 -0
  88. data/spec/models/campaign_analytics_response_analytics_summary_spec.rb +270 -0
  89. data/spec/models/campaign_analytics_response_campaign_spec.rb +6 -0
  90. data/spec/models/create_ad_negative_keyword_list201_response_spec.rb +54 -0
  91. data/spec/models/create_ad_negative_keyword_list_request_spec.rb +64 -0
  92. data/spec/models/create_call_ad_request_spec.rb +18 -0
  93. data/spec/models/create_messaging_ad_request_spec.rb +18 -0
  94. data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +12 -0
  95. data/spec/models/ctwa_ad_request_body_spec.rb +18 -0
  96. data/spec/models/delete_ad_negative_keyword_list200_response_spec.rb +42 -0
  97. data/spec/models/get_ad_negative_keyword_list200_response_list_spec.rb +66 -0
  98. data/spec/models/get_ad_negative_keyword_list200_response_spec.rb +54 -0
  99. data/spec/models/list_ad_negative_keyword_lists200_response_spec.rb +54 -0
  100. data/spec/models/replace_ad_negative_keyword_list_keywords200_response_spec.rb +48 -0
  101. data/spec/models/replace_ad_negative_keyword_list_keywords_request_spec.rb +58 -0
  102. data/spec/models/{ad_campaign_campaign_budget_spec.rb → replace_campaign_negative_keyword_lists_request_spec.rb} +12 -12
  103. data/spec/models/update_ad_campaign_request_spec.rb +6 -0
  104. data/spec/models/update_ad_negative_keyword_list200_response_spec.rb +42 -0
  105. data/spec/models/update_ad_negative_keyword_list_request_spec.rb +58 -0
  106. data/zernio-sdk-0.0.896.gem +0 -0
  107. metadata +66 -6
  108. data/docs/AdCampaignCampaignBudget.md +0 -20
  109. data/zernio-sdk-0.0.894.gem +0 -0
@@ -14,14 +14,20 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Each entry must also include exactly one of `imageUrl` or `video`.
17
+ # Supply headline, body, and image/video, or exactly one existing post reference. References cannot be combined with fresh creative fields.
18
18
  class CtwaAdRequestBodyCreativesInner < ApiModelBase
19
+ # Messaging and CTWA only. Platform post or reel ID, resolved like boost platformPostId. Facebook IDs become object_story_id; Instagram IDs become source_instagram_media_id using the connected Instagram identity. Mutually exclusive with objectStoryId and fresh creative fields.
20
+ attr_accessor :existing_post_id
21
+
22
+ # Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with existingPostId and fresh creative fields.
23
+ attr_accessor :object_story_id
24
+
19
25
  attr_accessor :headline
20
26
 
21
27
  # Primary text shown above the image / video.
22
28
  attr_accessor :body
23
29
 
24
- # Image asset. Mutually exclusive with this entry's `video`. Required if `video` is not supplied.
30
+ # Image asset. Mutually exclusive with this entry's `video`. Required if neither `video` nor an existing post reference is supplied.
25
31
  attr_accessor :image_url
26
32
 
27
33
  attr_accessor :video
@@ -31,6 +37,8 @@ module Zernio
31
37
  # Attribute mapping from ruby-style variable name to JSON key.
32
38
  def self.attribute_map
33
39
  {
40
+ :'existing_post_id' => :'existingPostId',
41
+ :'object_story_id' => :'objectStoryId',
34
42
  :'headline' => :'headline',
35
43
  :'body' => :'body',
36
44
  :'image_url' => :'imageUrl',
@@ -52,6 +60,8 @@ module Zernio
52
60
  # Attribute type mapping.
53
61
  def self.openapi_types
54
62
  {
63
+ :'existing_post_id' => :'String',
64
+ :'object_story_id' => :'String',
55
65
  :'headline' => :'String',
56
66
  :'body' => :'String',
57
67
  :'image_url' => :'String',
@@ -82,16 +92,20 @@ module Zernio
82
92
  h[k.to_sym] = v
83
93
  }
84
94
 
95
+ if attributes.key?(:'existing_post_id')
96
+ self.existing_post_id = attributes[:'existing_post_id']
97
+ end
98
+
99
+ if attributes.key?(:'object_story_id')
100
+ self.object_story_id = attributes[:'object_story_id']
101
+ end
102
+
85
103
  if attributes.key?(:'headline')
86
104
  self.headline = attributes[:'headline']
87
- else
88
- self.headline = nil
89
105
  end
90
106
 
91
107
  if attributes.key?(:'body')
92
108
  self.body = attributes[:'body']
93
- else
94
- self.body = nil
95
109
  end
96
110
 
97
111
  if attributes.key?(:'image_url')
@@ -112,23 +126,24 @@ module Zernio
112
126
  def list_invalid_properties
113
127
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
128
  invalid_properties = Array.new
115
- if @headline.nil?
116
- invalid_properties.push('invalid value for "headline", headline cannot be nil.')
129
+ if !@existing_post_id.nil? && @existing_post_id.to_s.length < 1
130
+ invalid_properties.push('invalid value for "existing_post_id", the character length must be greater than or equal to 1.')
117
131
  end
118
132
 
119
- if @headline.to_s.length > 255
120
- invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
133
+ pattern = Regexp.new(/^\d+_\d+$/)
134
+ if !@object_story_id.nil? && @object_story_id !~ pattern
135
+ invalid_properties.push("invalid value for \"object_story_id\", must conform to the pattern #{pattern}.")
121
136
  end
122
137
 
123
- if @headline.to_s.length < 1
124
- invalid_properties.push('invalid value for "headline", the character length must be greater than or equal to 1.')
138
+ if !@headline.nil? && @headline.to_s.length > 255
139
+ invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
125
140
  end
126
141
 
127
- if @body.nil?
128
- invalid_properties.push('invalid value for "body", body cannot be nil.')
142
+ if !@headline.nil? && @headline.to_s.length < 1
143
+ invalid_properties.push('invalid value for "headline", the character length must be greater than or equal to 1.')
129
144
  end
130
145
 
131
- if @body.to_s.length < 1
146
+ if !@body.nil? && @body.to_s.length < 1
132
147
  invalid_properties.push('invalid value for "body", the character length must be greater than or equal to 1.')
133
148
  end
134
149
 
@@ -139,14 +154,43 @@ module Zernio
139
154
  # @return true if the model is valid
140
155
  def valid?
141
156
  warn '[DEPRECATED] the `valid?` method is obsolete'
142
- return false if @headline.nil?
143
- return false if @headline.to_s.length > 255
144
- return false if @headline.to_s.length < 1
145
- return false if @body.nil?
146
- return false if @body.to_s.length < 1
157
+ return false if !@existing_post_id.nil? && @existing_post_id.to_s.length < 1
158
+ return false if !@object_story_id.nil? && @object_story_id !~ Regexp.new(/^\d+_\d+$/)
159
+ return false if !@headline.nil? && @headline.to_s.length > 255
160
+ return false if !@headline.nil? && @headline.to_s.length < 1
161
+ return false if !@body.nil? && @body.to_s.length < 1
147
162
  true
148
163
  end
149
164
 
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] existing_post_id Value to be assigned
167
+ def existing_post_id=(existing_post_id)
168
+ if existing_post_id.nil?
169
+ fail ArgumentError, 'existing_post_id cannot be nil'
170
+ end
171
+
172
+ if existing_post_id.to_s.length < 1
173
+ fail ArgumentError, 'invalid value for "existing_post_id", the character length must be greater than or equal to 1.'
174
+ end
175
+
176
+ @existing_post_id = existing_post_id
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] object_story_id Value to be assigned
181
+ def object_story_id=(object_story_id)
182
+ if object_story_id.nil?
183
+ fail ArgumentError, 'object_story_id cannot be nil'
184
+ end
185
+
186
+ pattern = Regexp.new(/^\d+_\d+$/)
187
+ if object_story_id !~ pattern
188
+ fail ArgumentError, "invalid value for \"object_story_id\", must conform to the pattern #{pattern}."
189
+ end
190
+
191
+ @object_story_id = object_story_id
192
+ end
193
+
150
194
  # Custom attribute writer method with validation
151
195
  # @param [Object] headline Value to be assigned
152
196
  def headline=(headline)
@@ -184,6 +228,8 @@ module Zernio
184
228
  def ==(o)
185
229
  return true if self.equal?(o)
186
230
  self.class == o.class &&
231
+ existing_post_id == o.existing_post_id &&
232
+ object_story_id == o.object_story_id &&
187
233
  headline == o.headline &&
188
234
  body == o.body &&
189
235
  image_url == o.image_url &&
@@ -200,7 +246,7 @@ module Zernio
200
246
  # Calculates hash code according to all attributes.
201
247
  # @return [Integer] Hash code
202
248
  def hash
203
- [headline, body, image_url, video, welcome_message].hash
249
+ [existing_post_id, object_story_id, headline, body, image_url, video, welcome_message].hash
204
250
  end
205
251
 
206
252
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Video creative. Mutually exclusive with this entry's `imageUrl`. Required if `imageUrl` is not supplied.
17
+ # Video creative. Mutually exclusive with this entry's `imageUrl`. Required if neither `imageUrl` nor an existing post reference is supplied.
18
18
  class CtwaAdRequestBodyCreativesInnerVideo < ApiModelBase
19
19
  # Public URL of the video to upload. Provide either `url` or `id`.
20
20
  attr_accessor :url
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Video creative for single-creative shape. Mutually exclusive with `imageUrl` and with `creatives[]`. Required on the single-creative shape if `imageUrl` is not supplied.
17
+ # Video creative for single-creative shape. Mutually exclusive with `imageUrl` and with `creatives[]`. Required on the single-creative shape if neither `imageUrl` nor an existing post reference is supplied.
18
18
  class CtwaAdRequestBodyVideo < ApiModelBase
19
19
  # Public URL of the video to upload. Provide either `url` or `id`.
20
20
  attr_accessor :url
@@ -14,39 +14,17 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Campaign-level budget (CBO). Null for ABO campaigns.
18
- class AdCampaignCampaignBudget < ApiModelBase
19
- attr_accessor :amount
20
-
21
- attr_accessor :type
22
-
23
- class EnumAttributeValidator
24
- attr_reader :datatype
25
- attr_reader :allowable_values
26
-
27
- def initialize(datatype, allowable_values)
28
- @allowable_values = allowable_values.map do |value|
29
- case datatype.to_s
30
- when /Integer/i
31
- value.to_i
32
- when /Float/i
33
- value.to_f
34
- else
35
- value
36
- end
37
- end
38
- end
17
+ class DeleteAdNegativeKeywordList200Response < ApiModelBase
18
+ attr_accessor :removed
39
19
 
40
- def valid?(value)
41
- !value || allowable_values.include?(value)
42
- end
43
- end
20
+ # Resolved Google Ads customer id.
21
+ attr_accessor :customer_id
44
22
 
45
23
  # Attribute mapping from ruby-style variable name to JSON key.
46
24
  def self.attribute_map
47
25
  {
48
- :'amount' => :'amount',
49
- :'type' => :'type'
26
+ :'removed' => :'removed',
27
+ :'customer_id' => :'customerId'
50
28
  }
51
29
  end
52
30
 
@@ -63,8 +41,8 @@ module Zernio
63
41
  # Attribute type mapping.
64
42
  def self.openapi_types
65
43
  {
66
- :'amount' => :'Float',
67
- :'type' => :'String'
44
+ :'removed' => :'Boolean',
45
+ :'customer_id' => :'String'
68
46
  }
69
47
  end
70
48
 
@@ -78,24 +56,24 @@ module Zernio
78
56
  # @param [Hash] attributes Model attributes in the form of hash
79
57
  def initialize(attributes = {})
80
58
  if (!attributes.is_a?(Hash))
81
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdCampaignCampaignBudget` initialize method"
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::DeleteAdNegativeKeywordList200Response` initialize method"
82
60
  end
83
61
 
84
62
  # check to see if the attribute exists and convert string to symbol for hash key
85
63
  acceptable_attribute_map = self.class.acceptable_attribute_map
86
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
87
65
  if (!acceptable_attribute_map.key?(k.to_sym))
88
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdCampaignCampaignBudget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::DeleteAdNegativeKeywordList200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
67
  end
90
68
  h[k.to_sym] = v
91
69
  }
92
70
 
93
- if attributes.key?(:'amount')
94
- self.amount = attributes[:'amount']
71
+ if attributes.key?(:'removed')
72
+ self.removed = attributes[:'removed']
95
73
  end
96
74
 
97
- if attributes.key?(:'type')
98
- self.type = attributes[:'type']
75
+ if attributes.key?(:'customer_id')
76
+ self.customer_id = attributes[:'customer_id']
99
77
  end
100
78
  end
101
79
 
@@ -104,6 +82,11 @@ module Zernio
104
82
  def list_invalid_properties
105
83
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
84
  invalid_properties = Array.new
85
+ pattern = Regexp.new(/^\d+$/)
86
+ if !@customer_id.nil? && @customer_id !~ pattern
87
+ invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
88
+ end
89
+
107
90
  invalid_properties
108
91
  end
109
92
 
@@ -111,19 +94,23 @@ module Zernio
111
94
  # @return true if the model is valid
112
95
  def valid?
113
96
  warn '[DEPRECATED] the `valid?` method is obsolete'
114
- type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
115
- return false unless type_validator.valid?(@type)
97
+ return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
116
98
  true
117
99
  end
118
100
 
119
- # Custom attribute writer method checking allowed values (enum).
120
- # @param [Object] type Object to be assigned
121
- def type=(type)
122
- validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
123
- unless validator.valid?(type)
124
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] customer_id Value to be assigned
103
+ def customer_id=(customer_id)
104
+ if customer_id.nil?
105
+ fail ArgumentError, 'customer_id cannot be nil'
125
106
  end
126
- @type = type
107
+
108
+ pattern = Regexp.new(/^\d+$/)
109
+ if customer_id !~ pattern
110
+ fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
111
+ end
112
+
113
+ @customer_id = customer_id
127
114
  end
128
115
 
129
116
  # Checks equality by comparing each attribute.
@@ -131,8 +118,8 @@ module Zernio
131
118
  def ==(o)
132
119
  return true if self.equal?(o)
133
120
  self.class == o.class &&
134
- amount == o.amount &&
135
- type == o.type
121
+ removed == o.removed &&
122
+ customer_id == o.customer_id
136
123
  end
137
124
 
138
125
  # @see the `==` method
@@ -144,7 +131,7 @@ module Zernio
144
131
  # Calculates hash code according to all attributes.
145
132
  # @return [Integer] Hash code
146
133
  def hash
147
- [amount, type].hash
134
+ [removed, customer_id].hash
148
135
  end
149
136
 
150
137
  # Builds the object from hash
@@ -46,7 +46,7 @@ module Zernio
46
46
  {
47
47
  :'backfill_pending' => :'Boolean',
48
48
  :'ad' => :'AdAnalyticsResponseAd',
49
- :'analytics' => :'CampaignAnalyticsResponseAnalytics'
49
+ :'analytics' => :'AdAnalyticsResponseAnalytics'
50
50
  }
51
51
  end
52
52
 
@@ -0,0 +1,199 @@
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 GetAdNegativeKeywordList200Response < ApiModelBase
18
+ attr_accessor :list
19
+
20
+ # Resolved Google Ads customer id.
21
+ attr_accessor :customer_id
22
+
23
+ # Last successful fetch time, or null without cache storage.
24
+ attr_accessor :cached_at
25
+
26
+ # True when quota exhaustion caused the last successful cached result to be served.
27
+ attr_accessor :stale
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'list' => :'list',
33
+ :'customer_id' => :'customerId',
34
+ :'cached_at' => :'cachedAt',
35
+ :'stale' => :'stale'
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
+ :'list' => :'GetAdNegativeKeywordList200ResponseList',
53
+ :'customer_id' => :'String',
54
+ :'cached_at' => :'Time',
55
+ :'stale' => :'Boolean'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'cached_at',
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdNegativeKeywordList200Response` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdNegativeKeywordList200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'list')
83
+ self.list = attributes[:'list']
84
+ end
85
+
86
+ if attributes.key?(:'customer_id')
87
+ self.customer_id = attributes[:'customer_id']
88
+ end
89
+
90
+ if attributes.key?(:'cached_at')
91
+ self.cached_at = attributes[:'cached_at']
92
+ end
93
+
94
+ if attributes.key?(:'stale')
95
+ self.stale = attributes[:'stale']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ pattern = Regexp.new(/^\d+$/)
105
+ if !@customer_id.nil? && @customer_id !~ pattern
106
+ invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
117
+ true
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] customer_id Value to be assigned
122
+ def customer_id=(customer_id)
123
+ if customer_id.nil?
124
+ fail ArgumentError, 'customer_id cannot be nil'
125
+ end
126
+
127
+ pattern = Regexp.new(/^\d+$/)
128
+ if customer_id !~ pattern
129
+ fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
130
+ end
131
+
132
+ @customer_id = customer_id
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ list == o.list &&
141
+ customer_id == o.customer_id &&
142
+ cached_at == o.cached_at &&
143
+ stale == o.stale
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [list, customer_id, cached_at, stale].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end