late-sdk 0.0.900 → 0.0.901

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 (156) 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/lib/zernio-sdk/api/ad_accounts_api.rb +656 -16
  55. data/lib/zernio-sdk/api/ad_campaigns_api.rb +586 -10
  56. data/lib/zernio-sdk/models/ad_creative.rb +112 -1
  57. data/lib/zernio-sdk/models/add_account_callouts_request.rb +34 -3
  58. data/lib/zernio-sdk/models/add_account_sitelinks201_response.rb +158 -0
  59. data/lib/zernio-sdk/models/add_account_sitelinks201_response_sitelinks_inner.rb +267 -0
  60. data/lib/zernio-sdk/models/add_account_sitelinks_request.rb +253 -0
  61. data/lib/zernio-sdk/models/add_account_structured_snippets201_response.rb +158 -0
  62. data/lib/zernio-sdk/models/add_account_structured_snippets201_response_structured_snippets_inner.rb +229 -0
  63. data/lib/zernio-sdk/models/add_account_structured_snippets_request.rb +253 -0
  64. data/lib/zernio-sdk/models/attach_ad_group_assets201_response.rb +180 -0
  65. data/lib/zernio-sdk/models/attach_campaign_assets_request.rb +37 -5
  66. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +4 -4
  67. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_descriptions_inner.rb +104 -0
  68. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_headlines_inner.rb +104 -0
  69. data/lib/zernio-sdk/models/get_ad200_response.rb +25 -4
  70. data/lib/zernio-sdk/models/google_asset_update.rb +234 -0
  71. data/lib/zernio-sdk/models/google_rsa_description.rb +226 -0
  72. data/lib/zernio-sdk/models/google_rsa_headline.rb +226 -0
  73. data/lib/zernio-sdk/models/{attach_campaign_assets_request_sitelinks_inner.rb → google_sitelink.rb} +3 -3
  74. data/lib/zernio-sdk/models/{attach_campaign_assets_request_structured_snippets_inner.rb → google_structured_snippet.rb} +3 -3
  75. data/lib/zernio-sdk/models/list_account_callouts200_response.rb +2 -2
  76. data/lib/zernio-sdk/models/list_account_callouts200_response_callouts_inner.rb +13 -14
  77. data/lib/zernio-sdk/models/list_account_sitelinks200_response.rb +179 -0
  78. data/lib/zernio-sdk/models/list_account_sitelinks200_response_sitelinks_inner.rb +210 -0
  79. data/lib/zernio-sdk/models/list_account_structured_snippets200_response.rb +179 -0
  80. data/lib/zernio-sdk/models/list_account_structured_snippets200_response_structured_snippets_inner.rb +194 -0
  81. data/lib/zernio-sdk/models/list_ad_group_assets200_response.rb +201 -0
  82. data/lib/zernio-sdk/models/list_ad_group_assets200_response_callouts_inner.rb +165 -0
  83. data/lib/zernio-sdk/models/list_ad_group_assets200_response_sitelinks_inner.rb +192 -0
  84. data/lib/zernio-sdk/models/list_ad_group_assets200_response_structured_snippets_inner.rb +176 -0
  85. data/lib/zernio-sdk/models/list_campaign_assets200_response.rb +201 -0
  86. data/lib/zernio-sdk/models/list_campaign_assets200_response_callouts_inner.rb +165 -0
  87. data/lib/zernio-sdk/models/list_campaign_assets200_response_sitelinks_inner.rb +192 -0
  88. data/lib/zernio-sdk/models/list_campaign_assets200_response_structured_snippets_inner.rb +176 -0
  89. data/lib/zernio-sdk/models/remove_account_callout_request.rb +45 -3
  90. data/lib/zernio-sdk/models/remove_ad_group_assets_request.rb +281 -0
  91. data/lib/zernio-sdk/models/remove_campaign_assets200_response.rb +147 -0
  92. data/lib/zernio-sdk/models/remove_campaign_assets_request.rb +281 -0
  93. data/lib/zernio-sdk/models/update_account_callouts200_response.rb +156 -0
  94. data/lib/zernio-sdk/models/update_account_callouts_request.rb +253 -0
  95. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner.rb +186 -0
  96. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner_callout_asset.rb +182 -0
  97. data/lib/zernio-sdk/models/update_account_sitelinks_request.rb +253 -0
  98. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner.rb +216 -0
  99. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner_sitelink_asset.rb +241 -0
  100. data/lib/zernio-sdk/models/update_account_structured_snippets_request.rb +253 -0
  101. data/lib/zernio-sdk/models/update_account_structured_snippets_request_updates_inner.rb +186 -0
  102. data/lib/zernio-sdk/models/update_ad_request.rb +112 -1
  103. data/lib/zernio-sdk/models/update_campaign_assets200_response.rb +147 -0
  104. data/lib/zernio-sdk/models/update_campaign_assets_request.rb +253 -0
  105. data/lib/zernio-sdk/version.rb +1 -1
  106. data/lib/zernio-sdk.rb +40 -2
  107. data/openapi.yaml +2010 -320
  108. data/spec/api/ad_accounts_api_spec.rb +118 -8
  109. data/spec/api/ad_campaigns_api_spec.rb +98 -5
  110. data/spec/models/ad_creative_spec.rb +18 -0
  111. data/spec/models/add_account_sitelinks201_response_sitelinks_inner_spec.rb +60 -0
  112. data/spec/models/add_account_sitelinks201_response_spec.rb +42 -0
  113. data/spec/models/add_account_sitelinks_request_spec.rb +48 -0
  114. data/spec/models/add_account_structured_snippets201_response_spec.rb +42 -0
  115. data/spec/models/add_account_structured_snippets201_response_structured_snippets_inner_spec.rb +52 -0
  116. data/spec/models/add_account_structured_snippets_request_spec.rb +48 -0
  117. data/spec/models/attach_ad_group_assets201_response_spec.rb +54 -0
  118. data/spec/models/create_standalone_ad_request_additional_descriptions_inner_spec.rb +32 -0
  119. data/spec/models/create_standalone_ad_request_additional_headlines_inner_spec.rb +32 -0
  120. data/spec/models/get_ad200_response_spec.rb +12 -0
  121. data/spec/models/google_asset_update_spec.rb +60 -0
  122. data/spec/models/google_rsa_description_spec.rb +46 -0
  123. data/spec/models/google_rsa_headline_spec.rb +46 -0
  124. data/spec/models/{attach_campaign_assets_request_sitelinks_inner_spec.rb → google_sitelink_spec.rb} +6 -6
  125. data/spec/models/{attach_campaign_assets_request_structured_snippets_inner_spec.rb → google_structured_snippet_spec.rb} +6 -6
  126. data/spec/models/list_account_callouts200_response_callouts_inner_spec.rb +2 -2
  127. data/spec/models/list_account_sitelinks200_response_sitelinks_inner_spec.rb +78 -0
  128. data/spec/models/list_account_sitelinks200_response_spec.rb +54 -0
  129. data/spec/models/list_account_structured_snippets200_response_spec.rb +54 -0
  130. data/spec/models/list_account_structured_snippets200_response_structured_snippets_inner_spec.rb +66 -0
  131. data/spec/models/list_ad_group_assets200_response_callouts_inner_spec.rb +48 -0
  132. data/spec/models/list_ad_group_assets200_response_sitelinks_inner_spec.rb +66 -0
  133. data/spec/models/list_ad_group_assets200_response_spec.rb +66 -0
  134. data/spec/models/list_ad_group_assets200_response_structured_snippets_inner_spec.rb +54 -0
  135. data/spec/models/list_campaign_assets200_response_callouts_inner_spec.rb +48 -0
  136. data/spec/models/list_campaign_assets200_response_sitelinks_inner_spec.rb +66 -0
  137. data/spec/models/list_campaign_assets200_response_spec.rb +66 -0
  138. data/spec/models/list_campaign_assets200_response_structured_snippets_inner_spec.rb +54 -0
  139. data/spec/models/remove_ad_group_assets_request_spec.rb +54 -0
  140. data/spec/models/remove_campaign_assets200_response_spec.rb +36 -0
  141. data/spec/models/remove_campaign_assets_request_spec.rb +54 -0
  142. data/spec/models/update_account_callouts200_response_spec.rb +42 -0
  143. data/spec/models/update_account_callouts_request_spec.rb +48 -0
  144. data/spec/models/update_account_callouts_request_updates_inner_callout_asset_spec.rb +36 -0
  145. data/spec/models/update_account_callouts_request_updates_inner_spec.rb +42 -0
  146. data/spec/models/update_account_sitelinks_request_spec.rb +48 -0
  147. data/spec/models/update_account_sitelinks_request_updates_inner_sitelink_asset_spec.rb +54 -0
  148. data/spec/models/update_account_sitelinks_request_updates_inner_spec.rb +48 -0
  149. data/spec/models/update_account_structured_snippets_request_spec.rb +48 -0
  150. data/spec/models/update_account_structured_snippets_request_updates_inner_spec.rb +42 -0
  151. data/spec/models/update_ad_request_spec.rb +18 -0
  152. data/spec/models/update_campaign_assets200_response_spec.rb +36 -0
  153. data/spec/models/update_campaign_assets_request_spec.rb +48 -0
  154. data/zernio-sdk-0.0.901.gem +0 -0
  155. metadata +162 -10
  156. 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 AddAccountSitelinksRequest < 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 :sitelinks
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
+ :'sitelinks' => :'sitelinks'
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
+ :'sitelinks' => :'Array<GoogleSitelink>'
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::AddAccountSitelinksRequest` 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::AddAccountSitelinksRequest`. 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?(:'sitelinks')
87
+ if (value = attributes[:'sitelinks']).is_a?(Array)
88
+ self.sitelinks = value
89
+ end
90
+ else
91
+ self.sitelinks = 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 @sitelinks.nil?
115
+ invalid_properties.push('invalid value for "sitelinks", sitelinks cannot be nil.')
116
+ end
117
+
118
+ if @sitelinks.length > 20
119
+ invalid_properties.push('invalid value for "sitelinks", number of items must be less than or equal to 20.')
120
+ end
121
+
122
+ if @sitelinks.length < 1
123
+ invalid_properties.push('invalid value for "sitelinks", 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 @sitelinks.nil?
137
+ return false if @sitelinks.length > 20
138
+ return false if @sitelinks.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] sitelinks Value to be assigned
174
+ def sitelinks=(sitelinks)
175
+ if sitelinks.nil?
176
+ fail ArgumentError, 'sitelinks cannot be nil'
177
+ end
178
+
179
+ if sitelinks.length > 20
180
+ fail ArgumentError, 'invalid value for "sitelinks", number of items must be less than or equal to 20.'
181
+ end
182
+
183
+ if sitelinks.length < 1
184
+ fail ArgumentError, 'invalid value for "sitelinks", number of items must be greater than or equal to 1.'
185
+ end
186
+
187
+ @sitelinks = sitelinks
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
+ sitelinks == o.sitelinks
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, sitelinks].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,158 @@
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 AddAccountStructuredSnippets201Response < ApiModelBase
18
+ attr_accessor :customer_id
19
+
20
+ attr_accessor :structured_snippets
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'customer_id' => :'customerId',
26
+ :'structured_snippets' => :'structuredSnippets'
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
+ :'customer_id' => :'String',
44
+ :'structured_snippets' => :'Array<AddAccountStructuredSnippets201ResponseStructuredSnippetsInner>'
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::AddAccountStructuredSnippets201Response` 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::AddAccountStructuredSnippets201Response`. 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?(:'customer_id')
71
+ self.customer_id = attributes[:'customer_id']
72
+ end
73
+
74
+ if attributes.key?(:'structured_snippets')
75
+ if (value = attributes[:'structured_snippets']).is_a?(Array)
76
+ self.structured_snippets = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ customer_id == o.customer_id &&
102
+ structured_snippets == o.structured_snippets
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [customer_id, structured_snippets].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end
@@ -0,0 +1,229 @@
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 AddAccountStructuredSnippets201ResponseStructuredSnippetsInner < ApiModelBase
18
+ attr_accessor :asset_id
19
+
20
+ attr_accessor :header
21
+
22
+ attr_accessor :values
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'asset_id' => :'assetId',
50
+ :'header' => :'header',
51
+ :'values' => :'values'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'asset_id' => :'String',
69
+ :'header' => :'String',
70
+ :'values' => :'Array<String>'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AddAccountStructuredSnippets201ResponseStructuredSnippetsInner` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AddAccountStructuredSnippets201ResponseStructuredSnippetsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'asset_id')
97
+ self.asset_id = attributes[:'asset_id']
98
+ end
99
+
100
+ if attributes.key?(:'header')
101
+ self.header = attributes[:'header']
102
+ end
103
+
104
+ if attributes.key?(:'values')
105
+ if (value = attributes[:'values']).is_a?(Array)
106
+ self.values = value
107
+ end
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if !@values.nil? && @values.length > 10
117
+ invalid_properties.push('invalid value for "values", number of items must be less than or equal to 10.')
118
+ end
119
+
120
+ if !@values.nil? && @values.length < 3
121
+ invalid_properties.push('invalid value for "values", number of items must be greater than or equal to 3.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ header_validator = EnumAttributeValidator.new('String', ["Amenities", "Brands", "Courses", "Degree programs", "Destinations", "Featured hotels", "Insurance coverage", "Models", "Neighborhoods", "Service catalog", "Shows", "Styles", "Types"])
132
+ return false unless header_validator.valid?(@header)
133
+ return false if !@values.nil? && @values.length > 10
134
+ return false if !@values.nil? && @values.length < 3
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method checking allowed values (enum).
139
+ # @param [Object] header Object to be assigned
140
+ def header=(header)
141
+ validator = EnumAttributeValidator.new('String', ["Amenities", "Brands", "Courses", "Degree programs", "Destinations", "Featured hotels", "Insurance coverage", "Models", "Neighborhoods", "Service catalog", "Shows", "Styles", "Types"])
142
+ unless validator.valid?(header)
143
+ fail ArgumentError, "invalid value for \"header\", must be one of #{validator.allowable_values}."
144
+ end
145
+ @header = header
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] values Value to be assigned
150
+ def values=(values)
151
+ if values.nil?
152
+ fail ArgumentError, 'values cannot be nil'
153
+ end
154
+
155
+ if values.length > 10
156
+ fail ArgumentError, 'invalid value for "values", number of items must be less than or equal to 10.'
157
+ end
158
+
159
+ if values.length < 3
160
+ fail ArgumentError, 'invalid value for "values", number of items must be greater than or equal to 3.'
161
+ end
162
+
163
+ @values = values
164
+ end
165
+
166
+ # Checks equality by comparing each attribute.
167
+ # @param [Object] Object to be compared
168
+ def ==(o)
169
+ return true if self.equal?(o)
170
+ self.class == o.class &&
171
+ asset_id == o.asset_id &&
172
+ header == o.header &&
173
+ values == o.values
174
+ end
175
+
176
+ # @see the `==` method
177
+ # @param [Object] Object to be compared
178
+ def eql?(o)
179
+ self == o
180
+ end
181
+
182
+ # Calculates hash code according to all attributes.
183
+ # @return [Integer] Hash code
184
+ def hash
185
+ [asset_id, header, values].hash
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def self.build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ attributes = attributes.transform_keys(&:to_sym)
194
+ transformed_hash = {}
195
+ openapi_types.each_pair do |key, type|
196
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = nil
198
+ elsif type =~ /\AArray<(.*)>/i
199
+ # check to ensure the input is an array given that the attribute
200
+ # is documented as an array but the input is not
201
+ if attributes[attribute_map[key]].is_a?(Array)
202
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
203
+ end
204
+ elsif !attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
206
+ end
207
+ end
208
+ new(transformed_hash)
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ if value.nil?
218
+ is_nullable = self.class.openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ end
228
+
229
+ end