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,281 @@
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 RemoveCampaignAssetsRequest < 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 :asset_resource_names
25
+
26
+ attr_accessor :campaign_asset_resource_names
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'account_id' => :'accountId',
32
+ :'customer_id' => :'customerId',
33
+ :'asset_resource_names' => :'assetResourceNames',
34
+ :'campaign_asset_resource_names' => :'campaignAssetResourceNames'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'account_id' => :'String',
52
+ :'customer_id' => :'String',
53
+ :'asset_resource_names' => :'Array<String>',
54
+ :'campaign_asset_resource_names' => :'Array<String>'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::RemoveCampaignAssetsRequest` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::RemoveCampaignAssetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'account_id')
81
+ self.account_id = attributes[:'account_id']
82
+ else
83
+ self.account_id = nil
84
+ end
85
+
86
+ if attributes.key?(:'customer_id')
87
+ self.customer_id = attributes[:'customer_id']
88
+ end
89
+
90
+ if attributes.key?(:'asset_resource_names')
91
+ if (value = attributes[:'asset_resource_names']).is_a?(Array)
92
+ self.asset_resource_names = value
93
+ end
94
+ else
95
+ self.asset_resource_names = nil
96
+ end
97
+
98
+ if attributes.key?(:'campaign_asset_resource_names')
99
+ if (value = attributes[:'campaign_asset_resource_names']).is_a?(Array)
100
+ self.campaign_asset_resource_names = value
101
+ end
102
+ else
103
+ self.campaign_asset_resource_names = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @account_id.nil?
113
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
114
+ end
115
+
116
+ pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
117
+ if @account_id !~ pattern
118
+ invalid_properties.push("invalid value for \"account_id\", must conform to the pattern #{pattern}.")
119
+ end
120
+
121
+ pattern = Regexp.new(/^\d+$/)
122
+ if !@customer_id.nil? && @customer_id !~ pattern
123
+ invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
124
+ end
125
+
126
+ if @asset_resource_names.nil?
127
+ invalid_properties.push('invalid value for "asset_resource_names", asset_resource_names cannot be nil.')
128
+ end
129
+
130
+ if @asset_resource_names.length < 1
131
+ invalid_properties.push('invalid value for "asset_resource_names", number of items must be greater than or equal to 1.')
132
+ end
133
+
134
+ if @campaign_asset_resource_names.nil?
135
+ invalid_properties.push('invalid value for "campaign_asset_resource_names", campaign_asset_resource_names cannot be nil.')
136
+ end
137
+
138
+ if @campaign_asset_resource_names.length < 1
139
+ invalid_properties.push('invalid value for "campaign_asset_resource_names", number of items must be greater than or equal to 1.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ warn '[DEPRECATED] the `valid?` method is obsolete'
149
+ return false if @account_id.nil?
150
+ return false if @account_id !~ Regexp.new(/^[a-fA-F0-9]{24}$/)
151
+ return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
152
+ return false if @asset_resource_names.nil?
153
+ return false if @asset_resource_names.length < 1
154
+ return false if @campaign_asset_resource_names.nil?
155
+ return false if @campaign_asset_resource_names.length < 1
156
+ true
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] account_id Value to be assigned
161
+ def account_id=(account_id)
162
+ if account_id.nil?
163
+ fail ArgumentError, 'account_id cannot be nil'
164
+ end
165
+
166
+ pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
167
+ if account_id !~ pattern
168
+ fail ArgumentError, "invalid value for \"account_id\", must conform to the pattern #{pattern}."
169
+ end
170
+
171
+ @account_id = account_id
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] customer_id Value to be assigned
176
+ def customer_id=(customer_id)
177
+ if customer_id.nil?
178
+ fail ArgumentError, 'customer_id cannot be nil'
179
+ end
180
+
181
+ pattern = Regexp.new(/^\d+$/)
182
+ if customer_id !~ pattern
183
+ fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
184
+ end
185
+
186
+ @customer_id = customer_id
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] asset_resource_names Value to be assigned
191
+ def asset_resource_names=(asset_resource_names)
192
+ if asset_resource_names.nil?
193
+ fail ArgumentError, 'asset_resource_names cannot be nil'
194
+ end
195
+
196
+ if asset_resource_names.length < 1
197
+ fail ArgumentError, 'invalid value for "asset_resource_names", number of items must be greater than or equal to 1.'
198
+ end
199
+
200
+ @asset_resource_names = asset_resource_names
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] campaign_asset_resource_names Value to be assigned
205
+ def campaign_asset_resource_names=(campaign_asset_resource_names)
206
+ if campaign_asset_resource_names.nil?
207
+ fail ArgumentError, 'campaign_asset_resource_names cannot be nil'
208
+ end
209
+
210
+ if campaign_asset_resource_names.length < 1
211
+ fail ArgumentError, 'invalid value for "campaign_asset_resource_names", number of items must be greater than or equal to 1.'
212
+ end
213
+
214
+ @campaign_asset_resource_names = campaign_asset_resource_names
215
+ end
216
+
217
+ # Checks equality by comparing each attribute.
218
+ # @param [Object] Object to be compared
219
+ def ==(o)
220
+ return true if self.equal?(o)
221
+ self.class == o.class &&
222
+ account_id == o.account_id &&
223
+ customer_id == o.customer_id &&
224
+ asset_resource_names == o.asset_resource_names &&
225
+ campaign_asset_resource_names == o.campaign_asset_resource_names
226
+ end
227
+
228
+ # @see the `==` method
229
+ # @param [Object] Object to be compared
230
+ def eql?(o)
231
+ self == o
232
+ end
233
+
234
+ # Calculates hash code according to all attributes.
235
+ # @return [Integer] Hash code
236
+ def hash
237
+ [account_id, customer_id, asset_resource_names, campaign_asset_resource_names].hash
238
+ end
239
+
240
+ # Builds the object from hash
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ # @return [Object] Returns the model itself
243
+ def self.build_from_hash(attributes)
244
+ return nil unless attributes.is_a?(Hash)
245
+ attributes = attributes.transform_keys(&:to_sym)
246
+ transformed_hash = {}
247
+ openapi_types.each_pair do |key, type|
248
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = nil
250
+ elsif type =~ /\AArray<(.*)>/i
251
+ # check to ensure the input is an array given that the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[attribute_map[key]].is_a?(Array)
254
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
255
+ end
256
+ elsif !attributes[attribute_map[key]].nil?
257
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
258
+ end
259
+ end
260
+ new(transformed_hash)
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,156 @@
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 UpdateAccountCallouts200Response < ApiModelBase
18
+ attr_accessor :updated
19
+
20
+ attr_accessor :customer_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'updated' => :'updated',
26
+ :'customer_id' => :'customerId'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'updated' => :'Integer',
44
+ :'customer_id' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateAccountCallouts200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateAccountCallouts200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'updated')
71
+ self.updated = attributes[:'updated']
72
+ end
73
+
74
+ if attributes.key?(:'customer_id')
75
+ self.customer_id = attributes[:'customer_id']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ updated == o.updated &&
100
+ customer_id == o.customer_id
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [updated, customer_id].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -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 UpdateAccountCalloutsRequest < 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<UpdateAccountCalloutsRequestUpdatesInner>'
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::UpdateAccountCalloutsRequest` 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::UpdateAccountCalloutsRequest`. 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