late-sdk 0.0.900 → 0.0.902

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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +60 -6
  3. data/docs/AdAccountsApi.md +657 -19
  4. data/docs/AdCampaignsApi.md +521 -9
  5. data/docs/AdCreative.md +6 -0
  6. data/docs/AddAccountCalloutsRequest.md +3 -3
  7. data/docs/AddAccountSitelinks201Response.md +20 -0
  8. data/docs/AddAccountSitelinks201ResponseSitelinksInner.md +26 -0
  9. data/docs/AddAccountSitelinksRequest.md +22 -0
  10. data/docs/AddAccountStructuredSnippets201Response.md +20 -0
  11. data/docs/AddAccountStructuredSnippets201ResponseStructuredSnippetsInner.md +22 -0
  12. data/docs/AddAccountStructuredSnippetsRequest.md +22 -0
  13. data/docs/AttachAdGroupAssets201Response.md +24 -0
  14. data/docs/AttachCampaignAssetsRequest.md +4 -4
  15. data/docs/CreateStandaloneAdRequest.md +4 -4
  16. data/docs/CreateStandaloneAdRequestAdditionalDescriptionsInner.md +49 -0
  17. data/docs/CreateStandaloneAdRequestAdditionalHeadlinesInner.md +49 -0
  18. data/docs/GetAd200Response.md +5 -1
  19. data/docs/GoogleAssetUpdate.md +26 -0
  20. data/docs/GoogleRsaDescription.md +20 -0
  21. data/docs/GoogleRsaHeadline.md +20 -0
  22. data/docs/{AttachCampaignAssetsRequestSitelinksInner.md → GoogleSitelink.md} +2 -2
  23. data/docs/{AttachCampaignAssetsRequestStructuredSnippetsInner.md → GoogleStructuredSnippet.md} +2 -2
  24. data/docs/ListAccountCallouts200Response.md +2 -2
  25. data/docs/ListAccountCallouts200ResponseCalloutsInner.md +3 -3
  26. data/docs/ListAccountSitelinks200Response.md +24 -0
  27. data/docs/ListAccountSitelinks200ResponseSitelinksInner.md +32 -0
  28. data/docs/ListAccountStructuredSnippets200Response.md +24 -0
  29. data/docs/ListAccountStructuredSnippets200ResponseStructuredSnippetsInner.md +28 -0
  30. data/docs/ListAdGroupAssets200Response.md +28 -0
  31. data/docs/ListAdGroupAssets200ResponseCalloutsInner.md +22 -0
  32. data/docs/ListAdGroupAssets200ResponseSitelinksInner.md +28 -0
  33. data/docs/ListAdGroupAssets200ResponseStructuredSnippetsInner.md +24 -0
  34. data/docs/ListCampaignAssets200Response.md +28 -0
  35. data/docs/ListCampaignAssets200ResponseCalloutsInner.md +22 -0
  36. data/docs/ListCampaignAssets200ResponseSitelinksInner.md +28 -0
  37. data/docs/ListCampaignAssets200ResponseStructuredSnippetsInner.md +24 -0
  38. data/docs/RemoveAccountCalloutRequest.md +3 -3
  39. data/docs/RemoveAdGroupAssetsRequest.md +24 -0
  40. data/docs/RemoveCampaignAssets200Response.md +18 -0
  41. data/docs/RemoveCampaignAssetsRequest.md +24 -0
  42. data/docs/UpdateAccountCallouts200Response.md +20 -0
  43. data/docs/UpdateAccountCalloutsRequest.md +22 -0
  44. data/docs/UpdateAccountCalloutsRequestUpdatesInner.md +20 -0
  45. data/docs/UpdateAccountCalloutsRequestUpdatesInnerCalloutAsset.md +18 -0
  46. data/docs/UpdateAccountSitelinksRequest.md +22 -0
  47. data/docs/UpdateAccountSitelinksRequestUpdatesInner.md +22 -0
  48. data/docs/UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset.md +24 -0
  49. data/docs/UpdateAccountStructuredSnippetsRequest.md +22 -0
  50. data/docs/UpdateAccountStructuredSnippetsRequestUpdatesInner.md +20 -0
  51. data/docs/UpdateAdRequest.md +6 -0
  52. data/docs/UpdateCampaignAssets200Response.md +18 -0
  53. data/docs/UpdateCampaignAssetsRequest.md +22 -0
  54. data/docs/WebhookEventsApi.md +2 -2
  55. data/lib/zernio-sdk/api/ad_accounts_api.rb +656 -16
  56. data/lib/zernio-sdk/api/ad_campaigns_api.rb +586 -10
  57. data/lib/zernio-sdk/api/webhook_events_api.rb +4 -4
  58. data/lib/zernio-sdk/models/ad_creative.rb +112 -1
  59. data/lib/zernio-sdk/models/add_account_callouts_request.rb +34 -3
  60. data/lib/zernio-sdk/models/add_account_sitelinks201_response.rb +158 -0
  61. data/lib/zernio-sdk/models/add_account_sitelinks201_response_sitelinks_inner.rb +267 -0
  62. data/lib/zernio-sdk/models/add_account_sitelinks_request.rb +253 -0
  63. data/lib/zernio-sdk/models/add_account_structured_snippets201_response.rb +158 -0
  64. data/lib/zernio-sdk/models/add_account_structured_snippets201_response_structured_snippets_inner.rb +229 -0
  65. data/lib/zernio-sdk/models/add_account_structured_snippets_request.rb +253 -0
  66. data/lib/zernio-sdk/models/attach_ad_group_assets201_response.rb +180 -0
  67. data/lib/zernio-sdk/models/attach_campaign_assets_request.rb +37 -5
  68. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +4 -4
  69. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_descriptions_inner.rb +104 -0
  70. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_headlines_inner.rb +104 -0
  71. data/lib/zernio-sdk/models/get_ad200_response.rb +25 -4
  72. data/lib/zernio-sdk/models/google_asset_update.rb +234 -0
  73. data/lib/zernio-sdk/models/google_rsa_description.rb +226 -0
  74. data/lib/zernio-sdk/models/google_rsa_headline.rb +226 -0
  75. data/lib/zernio-sdk/models/{attach_campaign_assets_request_sitelinks_inner.rb → google_sitelink.rb} +3 -3
  76. data/lib/zernio-sdk/models/{attach_campaign_assets_request_structured_snippets_inner.rb → google_structured_snippet.rb} +3 -3
  77. data/lib/zernio-sdk/models/list_account_callouts200_response.rb +2 -2
  78. data/lib/zernio-sdk/models/list_account_callouts200_response_callouts_inner.rb +13 -14
  79. data/lib/zernio-sdk/models/list_account_sitelinks200_response.rb +179 -0
  80. data/lib/zernio-sdk/models/list_account_sitelinks200_response_sitelinks_inner.rb +210 -0
  81. data/lib/zernio-sdk/models/list_account_structured_snippets200_response.rb +179 -0
  82. data/lib/zernio-sdk/models/list_account_structured_snippets200_response_structured_snippets_inner.rb +194 -0
  83. data/lib/zernio-sdk/models/list_ad_group_assets200_response.rb +201 -0
  84. data/lib/zernio-sdk/models/list_ad_group_assets200_response_callouts_inner.rb +165 -0
  85. data/lib/zernio-sdk/models/list_ad_group_assets200_response_sitelinks_inner.rb +192 -0
  86. data/lib/zernio-sdk/models/list_ad_group_assets200_response_structured_snippets_inner.rb +176 -0
  87. data/lib/zernio-sdk/models/list_campaign_assets200_response.rb +201 -0
  88. data/lib/zernio-sdk/models/list_campaign_assets200_response_callouts_inner.rb +165 -0
  89. data/lib/zernio-sdk/models/list_campaign_assets200_response_sitelinks_inner.rb +192 -0
  90. data/lib/zernio-sdk/models/list_campaign_assets200_response_structured_snippets_inner.rb +176 -0
  91. data/lib/zernio-sdk/models/remove_account_callout_request.rb +45 -3
  92. data/lib/zernio-sdk/models/remove_ad_group_assets_request.rb +281 -0
  93. data/lib/zernio-sdk/models/remove_campaign_assets200_response.rb +147 -0
  94. data/lib/zernio-sdk/models/remove_campaign_assets_request.rb +281 -0
  95. data/lib/zernio-sdk/models/update_account_callouts200_response.rb +156 -0
  96. data/lib/zernio-sdk/models/update_account_callouts_request.rb +253 -0
  97. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner.rb +186 -0
  98. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner_callout_asset.rb +182 -0
  99. data/lib/zernio-sdk/models/update_account_sitelinks_request.rb +253 -0
  100. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner.rb +216 -0
  101. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner_sitelink_asset.rb +241 -0
  102. data/lib/zernio-sdk/models/update_account_structured_snippets_request.rb +253 -0
  103. data/lib/zernio-sdk/models/update_account_structured_snippets_request_updates_inner.rb +186 -0
  104. data/lib/zernio-sdk/models/update_ad_request.rb +112 -1
  105. data/lib/zernio-sdk/models/update_campaign_assets200_response.rb +147 -0
  106. data/lib/zernio-sdk/models/update_campaign_assets_request.rb +253 -0
  107. data/lib/zernio-sdk/models/webhook_payload_post_platform.rb +1 -1
  108. data/lib/zernio-sdk/version.rb +1 -1
  109. data/lib/zernio-sdk.rb +40 -2
  110. data/openapi.yaml +2027 -329
  111. data/spec/api/ad_accounts_api_spec.rb +118 -8
  112. data/spec/api/ad_campaigns_api_spec.rb +98 -5
  113. data/spec/models/ad_creative_spec.rb +18 -0
  114. data/spec/models/add_account_sitelinks201_response_sitelinks_inner_spec.rb +60 -0
  115. data/spec/models/add_account_sitelinks201_response_spec.rb +42 -0
  116. data/spec/models/add_account_sitelinks_request_spec.rb +48 -0
  117. data/spec/models/add_account_structured_snippets201_response_spec.rb +42 -0
  118. data/spec/models/add_account_structured_snippets201_response_structured_snippets_inner_spec.rb +52 -0
  119. data/spec/models/add_account_structured_snippets_request_spec.rb +48 -0
  120. data/spec/models/attach_ad_group_assets201_response_spec.rb +54 -0
  121. data/spec/models/create_standalone_ad_request_additional_descriptions_inner_spec.rb +32 -0
  122. data/spec/models/create_standalone_ad_request_additional_headlines_inner_spec.rb +32 -0
  123. data/spec/models/get_ad200_response_spec.rb +12 -0
  124. data/spec/models/google_asset_update_spec.rb +60 -0
  125. data/spec/models/google_rsa_description_spec.rb +46 -0
  126. data/spec/models/google_rsa_headline_spec.rb +46 -0
  127. data/spec/models/{attach_campaign_assets_request_sitelinks_inner_spec.rb → google_sitelink_spec.rb} +6 -6
  128. data/spec/models/{attach_campaign_assets_request_structured_snippets_inner_spec.rb → google_structured_snippet_spec.rb} +6 -6
  129. data/spec/models/list_account_callouts200_response_callouts_inner_spec.rb +2 -2
  130. data/spec/models/list_account_sitelinks200_response_sitelinks_inner_spec.rb +78 -0
  131. data/spec/models/list_account_sitelinks200_response_spec.rb +54 -0
  132. data/spec/models/list_account_structured_snippets200_response_spec.rb +54 -0
  133. data/spec/models/list_account_structured_snippets200_response_structured_snippets_inner_spec.rb +66 -0
  134. data/spec/models/list_ad_group_assets200_response_callouts_inner_spec.rb +48 -0
  135. data/spec/models/list_ad_group_assets200_response_sitelinks_inner_spec.rb +66 -0
  136. data/spec/models/list_ad_group_assets200_response_spec.rb +66 -0
  137. data/spec/models/list_ad_group_assets200_response_structured_snippets_inner_spec.rb +54 -0
  138. data/spec/models/list_campaign_assets200_response_callouts_inner_spec.rb +48 -0
  139. data/spec/models/list_campaign_assets200_response_sitelinks_inner_spec.rb +66 -0
  140. data/spec/models/list_campaign_assets200_response_spec.rb +66 -0
  141. data/spec/models/list_campaign_assets200_response_structured_snippets_inner_spec.rb +54 -0
  142. data/spec/models/remove_ad_group_assets_request_spec.rb +54 -0
  143. data/spec/models/remove_campaign_assets200_response_spec.rb +36 -0
  144. data/spec/models/remove_campaign_assets_request_spec.rb +54 -0
  145. data/spec/models/update_account_callouts200_response_spec.rb +42 -0
  146. data/spec/models/update_account_callouts_request_spec.rb +48 -0
  147. data/spec/models/update_account_callouts_request_updates_inner_callout_asset_spec.rb +36 -0
  148. data/spec/models/update_account_callouts_request_updates_inner_spec.rb +42 -0
  149. data/spec/models/update_account_sitelinks_request_spec.rb +48 -0
  150. data/spec/models/update_account_sitelinks_request_updates_inner_sitelink_asset_spec.rb +54 -0
  151. data/spec/models/update_account_sitelinks_request_updates_inner_spec.rb +48 -0
  152. data/spec/models/update_account_structured_snippets_request_spec.rb +48 -0
  153. data/spec/models/update_account_structured_snippets_request_updates_inner_spec.rb +42 -0
  154. data/spec/models/update_ad_request_spec.rb +18 -0
  155. data/spec/models/update_campaign_assets200_response_spec.rb +36 -0
  156. data/spec/models/update_campaign_assets_request_spec.rb +48 -0
  157. data/zernio-sdk-0.0.902.gem +0 -0
  158. metadata +163 -11
  159. data/zernio-sdk-0.0.900.gem +0 -0
@@ -0,0 +1,253 @@
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 UpdateAccountStructuredSnippetsRequest < ApiModelBase
18
+ # Zernio Google Ads connection id.
19
+ attr_accessor :account_id
20
+
21
+ # Google customer id without dashes. Required when the connection has multiple customers.
22
+ attr_accessor :customer_id
23
+
24
+ attr_accessor :updates
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'account_id' => :'accountId',
30
+ :'customer_id' => :'customerId',
31
+ :'updates' => :'updates'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'account_id' => :'String',
49
+ :'customer_id' => :'String',
50
+ :'updates' => :'Array<UpdateAccountStructuredSnippetsRequestUpdatesInner>'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateAccountStructuredSnippetsRequest` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateAccountStructuredSnippetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'account_id')
77
+ self.account_id = attributes[:'account_id']
78
+ else
79
+ self.account_id = nil
80
+ end
81
+
82
+ if attributes.key?(:'customer_id')
83
+ self.customer_id = attributes[:'customer_id']
84
+ end
85
+
86
+ if attributes.key?(:'updates')
87
+ if (value = attributes[:'updates']).is_a?(Array)
88
+ self.updates = value
89
+ end
90
+ else
91
+ self.updates = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @account_id.nil?
101
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
102
+ end
103
+
104
+ pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
105
+ if @account_id !~ pattern
106
+ invalid_properties.push("invalid value for \"account_id\", must conform to the pattern #{pattern}.")
107
+ end
108
+
109
+ pattern = Regexp.new(/^\d+$/)
110
+ if !@customer_id.nil? && @customer_id !~ pattern
111
+ invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
112
+ end
113
+
114
+ if @updates.nil?
115
+ invalid_properties.push('invalid value for "updates", updates cannot be nil.')
116
+ end
117
+
118
+ if @updates.length > 20
119
+ invalid_properties.push('invalid value for "updates", number of items must be less than or equal to 20.')
120
+ end
121
+
122
+ if @updates.length < 1
123
+ invalid_properties.push('invalid value for "updates", number of items must be greater than or equal to 1.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ return false if @account_id.nil?
134
+ return false if @account_id !~ Regexp.new(/^[a-fA-F0-9]{24}$/)
135
+ return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
136
+ return false if @updates.nil?
137
+ return false if @updates.length > 20
138
+ return false if @updates.length < 1
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] account_id Value to be assigned
144
+ def account_id=(account_id)
145
+ if account_id.nil?
146
+ fail ArgumentError, 'account_id cannot be nil'
147
+ end
148
+
149
+ pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
150
+ if account_id !~ pattern
151
+ fail ArgumentError, "invalid value for \"account_id\", must conform to the pattern #{pattern}."
152
+ end
153
+
154
+ @account_id = account_id
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] customer_id Value to be assigned
159
+ def customer_id=(customer_id)
160
+ if customer_id.nil?
161
+ fail ArgumentError, 'customer_id cannot be nil'
162
+ end
163
+
164
+ pattern = Regexp.new(/^\d+$/)
165
+ if customer_id !~ pattern
166
+ fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
167
+ end
168
+
169
+ @customer_id = customer_id
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] updates Value to be assigned
174
+ def updates=(updates)
175
+ if updates.nil?
176
+ fail ArgumentError, 'updates cannot be nil'
177
+ end
178
+
179
+ if updates.length > 20
180
+ fail ArgumentError, 'invalid value for "updates", number of items must be less than or equal to 20.'
181
+ end
182
+
183
+ if updates.length < 1
184
+ fail ArgumentError, 'invalid value for "updates", number of items must be greater than or equal to 1.'
185
+ end
186
+
187
+ @updates = updates
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ account_id == o.account_id &&
196
+ customer_id == o.customer_id &&
197
+ updates == o.updates
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [account_id, customer_id, updates].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ transformed_hash = {}
219
+ openapi_types.each_pair do |key, type|
220
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = nil
222
+ elsif type =~ /\AArray<(.*)>/i
223
+ # check to ensure the input is an array given that the attribute
224
+ # is documented as an array but the input is not
225
+ if attributes[attribute_map[key]].is_a?(Array)
226
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
227
+ end
228
+ elsif !attributes[attribute_map[key]].nil?
229
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
230
+ end
231
+ end
232
+ new(transformed_hash)
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ if value.nil?
242
+ is_nullable = self.class.openapi_nullable.include?(attr)
243
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
244
+ end
245
+
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ end
252
+
253
+ end
@@ -0,0 +1,186 @@
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
+ # Provide at least one field belonging to this asset type.
18
+ class UpdateAccountStructuredSnippetsRequestUpdatesInner < ApiModelBase
19
+ # Asset resource name returned by a list operation. Must belong to the selected customer.
20
+ attr_accessor :asset_resource_name
21
+
22
+ attr_accessor :structured_snippet_asset
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'asset_resource_name' => :'assetResourceName',
28
+ :'structured_snippet_asset' => :'structuredSnippetAsset'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'asset_resource_name' => :'String',
46
+ :'structured_snippet_asset' => :'GoogleStructuredSnippet'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateAccountStructuredSnippetsRequestUpdatesInner` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateAccountStructuredSnippetsRequestUpdatesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'asset_resource_name')
73
+ self.asset_resource_name = attributes[:'asset_resource_name']
74
+ else
75
+ self.asset_resource_name = nil
76
+ end
77
+
78
+ if attributes.key?(:'structured_snippet_asset')
79
+ self.structured_snippet_asset = attributes[:'structured_snippet_asset']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @asset_resource_name.nil?
89
+ invalid_properties.push('invalid value for "asset_resource_name", asset_resource_name cannot be nil.')
90
+ end
91
+
92
+ pattern = Regexp.new(/^customers\/\d+\/assets\/\d+$/)
93
+ if @asset_resource_name !~ pattern
94
+ invalid_properties.push("invalid value for \"asset_resource_name\", must conform to the pattern #{pattern}.")
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ return false if @asset_resource_name.nil?
105
+ return false if @asset_resource_name !~ Regexp.new(/^customers\/\d+\/assets\/\d+$/)
106
+ true
107
+ end
108
+
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] asset_resource_name Value to be assigned
111
+ def asset_resource_name=(asset_resource_name)
112
+ if asset_resource_name.nil?
113
+ fail ArgumentError, 'asset_resource_name cannot be nil'
114
+ end
115
+
116
+ pattern = Regexp.new(/^customers\/\d+\/assets\/\d+$/)
117
+ if asset_resource_name !~ pattern
118
+ fail ArgumentError, "invalid value for \"asset_resource_name\", must conform to the pattern #{pattern}."
119
+ end
120
+
121
+ @asset_resource_name = asset_resource_name
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ asset_resource_name == o.asset_resource_name &&
130
+ structured_snippet_asset == o.structured_snippet_asset
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [asset_resource_name, structured_snippet_asset].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ if value.nil?
175
+ is_nullable = self.class.openapi_nullable.include?(attr)
176
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
177
+ end
178
+
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -15,6 +15,15 @@ require 'time'
15
15
 
16
16
  module Zernio
17
17
  class UpdateAdRequest < ApiModelBase
18
+ # Google RSA only. Replaces the complete headline list. No padding or truncation on update.
19
+ attr_accessor :headlines
20
+
21
+ # Google RSA only. Replaces the complete description list. No padding or truncation on update.
22
+ attr_accessor :descriptions
23
+
24
+ # Google RSA only. Replaces final URLs. Omitted lists stay unchanged.
25
+ attr_accessor :final_urls
26
+
18
27
  attr_accessor :status
19
28
 
20
29
  attr_accessor :budget
@@ -51,6 +60,9 @@ module Zernio
51
60
  # Attribute mapping from ruby-style variable name to JSON key.
52
61
  def self.attribute_map
53
62
  {
63
+ :'headlines' => :'headlines',
64
+ :'descriptions' => :'descriptions',
65
+ :'final_urls' => :'finalUrls',
54
66
  :'status' => :'status',
55
67
  :'budget' => :'budget',
56
68
  :'targeting' => :'targeting',
@@ -72,6 +84,9 @@ module Zernio
72
84
  # Attribute type mapping.
73
85
  def self.openapi_types
74
86
  {
87
+ :'headlines' => :'Array<GoogleRsaHeadline>',
88
+ :'descriptions' => :'Array<GoogleRsaDescription>',
89
+ :'final_urls' => :'Array<String>',
75
90
  :'status' => :'String',
76
91
  :'budget' => :'UpdateAdRequestBudget',
77
92
  :'targeting' => :'UpdateAdRequestTargeting',
@@ -102,6 +117,24 @@ module Zernio
102
117
  h[k.to_sym] = v
103
118
  }
104
119
 
120
+ if attributes.key?(:'headlines')
121
+ if (value = attributes[:'headlines']).is_a?(Array)
122
+ self.headlines = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'descriptions')
127
+ if (value = attributes[:'descriptions']).is_a?(Array)
128
+ self.descriptions = value
129
+ end
130
+ end
131
+
132
+ if attributes.key?(:'final_urls')
133
+ if (value = attributes[:'final_urls']).is_a?(Array)
134
+ self.final_urls = value
135
+ end
136
+ end
137
+
105
138
  if attributes.key?(:'status')
106
139
  self.status = attributes[:'status']
107
140
  end
@@ -128,6 +161,26 @@ module Zernio
128
161
  def list_invalid_properties
129
162
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
163
  invalid_properties = Array.new
164
+ if !@headlines.nil? && @headlines.length > 15
165
+ invalid_properties.push('invalid value for "headlines", number of items must be less than or equal to 15.')
166
+ end
167
+
168
+ if !@headlines.nil? && @headlines.length < 3
169
+ invalid_properties.push('invalid value for "headlines", number of items must be greater than or equal to 3.')
170
+ end
171
+
172
+ if !@descriptions.nil? && @descriptions.length > 4
173
+ invalid_properties.push('invalid value for "descriptions", number of items must be less than or equal to 4.')
174
+ end
175
+
176
+ if !@descriptions.nil? && @descriptions.length < 2
177
+ invalid_properties.push('invalid value for "descriptions", number of items must be greater than or equal to 2.')
178
+ end
179
+
180
+ if !@final_urls.nil? && @final_urls.length < 1
181
+ invalid_properties.push('invalid value for "final_urls", number of items must be greater than or equal to 1.')
182
+ end
183
+
131
184
  if !@name.nil? && @name.to_s.length > 255
132
185
  invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
133
186
  end
@@ -139,12 +192,67 @@ module Zernio
139
192
  # @return true if the model is valid
140
193
  def valid?
141
194
  warn '[DEPRECATED] the `valid?` method is obsolete'
195
+ return false if !@headlines.nil? && @headlines.length > 15
196
+ return false if !@headlines.nil? && @headlines.length < 3
197
+ return false if !@descriptions.nil? && @descriptions.length > 4
198
+ return false if !@descriptions.nil? && @descriptions.length < 2
199
+ return false if !@final_urls.nil? && @final_urls.length < 1
142
200
  status_validator = EnumAttributeValidator.new('String', ["active", "paused"])
143
201
  return false unless status_validator.valid?(@status)
144
202
  return false if !@name.nil? && @name.to_s.length > 255
145
203
  true
146
204
  end
147
205
 
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] headlines Value to be assigned
208
+ def headlines=(headlines)
209
+ if headlines.nil?
210
+ fail ArgumentError, 'headlines cannot be nil'
211
+ end
212
+
213
+ if headlines.length > 15
214
+ fail ArgumentError, 'invalid value for "headlines", number of items must be less than or equal to 15.'
215
+ end
216
+
217
+ if headlines.length < 3
218
+ fail ArgumentError, 'invalid value for "headlines", number of items must be greater than or equal to 3.'
219
+ end
220
+
221
+ @headlines = headlines
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] descriptions Value to be assigned
226
+ def descriptions=(descriptions)
227
+ if descriptions.nil?
228
+ fail ArgumentError, 'descriptions cannot be nil'
229
+ end
230
+
231
+ if descriptions.length > 4
232
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be less than or equal to 4.'
233
+ end
234
+
235
+ if descriptions.length < 2
236
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be greater than or equal to 2.'
237
+ end
238
+
239
+ @descriptions = descriptions
240
+ end
241
+
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] final_urls Value to be assigned
244
+ def final_urls=(final_urls)
245
+ if final_urls.nil?
246
+ fail ArgumentError, 'final_urls cannot be nil'
247
+ end
248
+
249
+ if final_urls.length < 1
250
+ fail ArgumentError, 'invalid value for "final_urls", number of items must be greater than or equal to 1.'
251
+ end
252
+
253
+ @final_urls = final_urls
254
+ end
255
+
148
256
  # Custom attribute writer method checking allowed values (enum).
149
257
  # @param [Object] status Object to be assigned
150
258
  def status=(status)
@@ -174,6 +282,9 @@ module Zernio
174
282
  def ==(o)
175
283
  return true if self.equal?(o)
176
284
  self.class == o.class &&
285
+ headlines == o.headlines &&
286
+ descriptions == o.descriptions &&
287
+ final_urls == o.final_urls &&
177
288
  status == o.status &&
178
289
  budget == o.budget &&
179
290
  targeting == o.targeting &&
@@ -190,7 +301,7 @@ module Zernio
190
301
  # Calculates hash code according to all attributes.
191
302
  # @return [Integer] Hash code
192
303
  def hash
193
- [status, budget, targeting, creative, name].hash
304
+ [headlines, descriptions, final_urls, status, budget, targeting, creative, name].hash
194
305
  end
195
306
 
196
307
  # Builds the object from hash