zernio-sdk 0.0.536 → 0.0.537

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -1
  3. data/docs/AdAudiencesApi.md +5 -5
  4. data/docs/AdCampaignsApi.md +142 -0
  5. data/docs/AdsApi.md +715 -33
  6. data/docs/CreateAdCampaign201Response.md +24 -0
  7. data/docs/CreateAdCampaignRequest.md +32 -0
  8. data/docs/CreateAdCreative201Response.md +20 -0
  9. data/docs/CreateAdCreativeRequest.md +38 -0
  10. data/docs/CreateAdCreativeRequestCarouselCardsInner.md +26 -0
  11. data/docs/DeleteAdCreative200Response.md +20 -0
  12. data/docs/DuplicateAd200Response.md +22 -0
  13. data/docs/DuplicateAdRequest.md +28 -0
  14. data/docs/DuplicateAdSet200Response.md +22 -0
  15. data/docs/DuplicateAdSetRequest.md +36 -0
  16. data/docs/GetAdCreative200Response.md +18 -0
  17. data/docs/ListAdCreatives200Response.md +22 -0
  18. data/docs/ListAdImages200Response.md +22 -0
  19. data/docs/ListAdLabels200Response.md +22 -0
  20. data/docs/ListHighDemandPeriods200Response.md +22 -0
  21. data/docs/UpdateAdCreative200Response.md +22 -0
  22. data/docs/UpdateAdCreativeRequest.md +20 -0
  23. data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
  24. data/lib/zernio-sdk/api/ad_campaigns_api.rb +142 -0
  25. data/lib/zernio-sdk/api/ads_api.rb +748 -48
  26. data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +210 -0
  27. data/lib/zernio-sdk/models/create_ad_campaign_request.rb +343 -0
  28. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +157 -0
  29. data/lib/zernio-sdk/models/create_ad_creative_request.rb +390 -0
  30. data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +255 -0
  31. data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +156 -0
  32. data/lib/zernio-sdk/models/duplicate_ad200_response.rb +200 -0
  33. data/lib/zernio-sdk/models/duplicate_ad_request.rb +243 -0
  34. data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +201 -0
  35. data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +302 -0
  36. data/lib/zernio-sdk/models/get_ad_creative200_response.rb +148 -0
  37. data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +167 -0
  38. data/lib/zernio-sdk/models/list_ad_images200_response.rb +167 -0
  39. data/lib/zernio-sdk/models/list_ad_labels200_response.rb +167 -0
  40. data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +168 -0
  41. data/lib/zernio-sdk/models/update_ad_creative200_response.rb +165 -0
  42. data/lib/zernio-sdk/models/update_ad_creative_request.rb +200 -0
  43. data/lib/zernio-sdk/version.rb +1 -1
  44. data/lib/zernio-sdk.rb +17 -0
  45. data/openapi.yaml +445 -7
  46. data/spec/api/ad_audiences_api_spec.rb +2 -2
  47. data/spec/api/ad_campaigns_api_spec.rb +25 -0
  48. data/spec/api/ads_api_spec.rb +128 -0
  49. data/spec/models/create_ad_campaign201_response_spec.rb +58 -0
  50. data/spec/models/create_ad_campaign_request_spec.rb +94 -0
  51. data/spec/models/create_ad_creative201_response_spec.rb +42 -0
  52. data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +60 -0
  53. data/spec/models/create_ad_creative_request_spec.rb +96 -0
  54. data/spec/models/delete_ad_creative200_response_spec.rb +42 -0
  55. data/spec/models/duplicate_ad200_response_spec.rb +52 -0
  56. data/spec/models/duplicate_ad_request_spec.rb +74 -0
  57. data/spec/models/duplicate_ad_set200_response_spec.rb +52 -0
  58. data/spec/models/duplicate_ad_set_request_spec.rb +102 -0
  59. data/spec/models/get_ad_creative200_response_spec.rb +36 -0
  60. data/spec/models/list_ad_creatives200_response_spec.rb +48 -0
  61. data/spec/models/list_ad_images200_response_spec.rb +48 -0
  62. data/spec/models/list_ad_labels200_response_spec.rb +48 -0
  63. data/spec/models/list_high_demand_periods200_response_spec.rb +48 -0
  64. data/spec/models/update_ad_creative200_response_spec.rb +48 -0
  65. data/spec/models/update_ad_creative_request_spec.rb +42 -0
  66. metadata +70 -2
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 DuplicateAdSet200Response < ApiModelBase
18
+ # Platform ID of the new ad set
19
+ attr_accessor :copied_ad_set_id
20
+
21
+ attr_accessor :discovery
22
+
23
+ # Meta's native copy response (includes ad_object_ids for child copies)
24
+ attr_accessor :raw
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'copied_ad_set_id' => :'copiedAdSetId',
52
+ :'discovery' => :'discovery',
53
+ :'raw' => :'raw'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'copied_ad_set_id' => :'String',
71
+ :'discovery' => :'String',
72
+ :'raw' => :'Object'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::DuplicateAdSet200Response` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::DuplicateAdSet200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'copied_ad_set_id')
99
+ self.copied_ad_set_id = attributes[:'copied_ad_set_id']
100
+ end
101
+
102
+ if attributes.key?(:'discovery')
103
+ self.discovery = attributes[:'discovery']
104
+ end
105
+
106
+ if attributes.key?(:'raw')
107
+ self.raw = attributes[:'raw']
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
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ discovery_validator = EnumAttributeValidator.new('String', ["triggered", "skipped", "failed"])
124
+ return false unless discovery_validator.valid?(@discovery)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] discovery Object to be assigned
130
+ def discovery=(discovery)
131
+ validator = EnumAttributeValidator.new('String', ["triggered", "skipped", "failed"])
132
+ unless validator.valid?(discovery)
133
+ fail ArgumentError, "invalid value for \"discovery\", must be one of #{validator.allowable_values}."
134
+ end
135
+ @discovery = discovery
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ copied_ad_set_id == o.copied_ad_set_id &&
144
+ discovery == o.discovery &&
145
+ raw == o.raw
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [copied_ad_set_id, discovery, raw].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,302 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 DuplicateAdSetRequest < ApiModelBase
18
+ attr_accessor :platform
19
+
20
+ # Destination platform campaign id (defaults to the source's campaign)
21
+ attr_accessor :campaign_id
22
+
23
+ # Copy child ads + creatives
24
+ attr_accessor :deep_copy
25
+
26
+ attr_accessor :status_option
27
+
28
+ # Reschedule the copy's start time
29
+ attr_accessor :start_time
30
+
31
+ attr_accessor :end_time
32
+
33
+ attr_accessor :rename_strategy
34
+
35
+ attr_accessor :rename_prefix
36
+
37
+ attr_accessor :rename_suffix
38
+
39
+ attr_accessor :sync_after
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'platform' => :'platform',
67
+ :'campaign_id' => :'campaignId',
68
+ :'deep_copy' => :'deepCopy',
69
+ :'status_option' => :'statusOption',
70
+ :'start_time' => :'startTime',
71
+ :'end_time' => :'endTime',
72
+ :'rename_strategy' => :'renameStrategy',
73
+ :'rename_prefix' => :'renamePrefix',
74
+ :'rename_suffix' => :'renameSuffix',
75
+ :'sync_after' => :'syncAfter'
76
+ }
77
+ end
78
+
79
+ # Returns attribute mapping this model knows about
80
+ def self.acceptable_attribute_map
81
+ attribute_map
82
+ end
83
+
84
+ # Returns all the JSON keys this model knows about
85
+ def self.acceptable_attributes
86
+ acceptable_attribute_map.values
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.openapi_types
91
+ {
92
+ :'platform' => :'String',
93
+ :'campaign_id' => :'String',
94
+ :'deep_copy' => :'Boolean',
95
+ :'status_option' => :'String',
96
+ :'start_time' => :'Time',
97
+ :'end_time' => :'Time',
98
+ :'rename_strategy' => :'String',
99
+ :'rename_prefix' => :'String',
100
+ :'rename_suffix' => :'String',
101
+ :'sync_after' => :'Boolean'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ def self.openapi_nullable
107
+ Set.new([
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::DuplicateAdSetRequest` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ acceptable_attribute_map = self.class.acceptable_attribute_map
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!acceptable_attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::DuplicateAdSetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'platform')
128
+ self.platform = attributes[:'platform']
129
+ else
130
+ self.platform = nil
131
+ end
132
+
133
+ if attributes.key?(:'campaign_id')
134
+ self.campaign_id = attributes[:'campaign_id']
135
+ end
136
+
137
+ if attributes.key?(:'deep_copy')
138
+ self.deep_copy = attributes[:'deep_copy']
139
+ else
140
+ self.deep_copy = true
141
+ end
142
+
143
+ if attributes.key?(:'status_option')
144
+ self.status_option = attributes[:'status_option']
145
+ else
146
+ self.status_option = 'PAUSED'
147
+ end
148
+
149
+ if attributes.key?(:'start_time')
150
+ self.start_time = attributes[:'start_time']
151
+ end
152
+
153
+ if attributes.key?(:'end_time')
154
+ self.end_time = attributes[:'end_time']
155
+ end
156
+
157
+ if attributes.key?(:'rename_strategy')
158
+ self.rename_strategy = attributes[:'rename_strategy']
159
+ end
160
+
161
+ if attributes.key?(:'rename_prefix')
162
+ self.rename_prefix = attributes[:'rename_prefix']
163
+ end
164
+
165
+ if attributes.key?(:'rename_suffix')
166
+ self.rename_suffix = attributes[:'rename_suffix']
167
+ end
168
+
169
+ if attributes.key?(:'sync_after')
170
+ self.sync_after = attributes[:'sync_after']
171
+ else
172
+ self.sync_after = true
173
+ end
174
+ end
175
+
176
+ # Show invalid properties with the reasons. Usually used together with valid?
177
+ # @return Array for valid properties with the reasons
178
+ def list_invalid_properties
179
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
180
+ invalid_properties = Array.new
181
+ if @platform.nil?
182
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
183
+ end
184
+
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
+ return false if @platform.nil?
193
+ platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram"])
194
+ return false unless platform_validator.valid?(@platform)
195
+ status_option_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED", "INHERITED_FROM_SOURCE"])
196
+ return false unless status_option_validator.valid?(@status_option)
197
+ rename_strategy_validator = EnumAttributeValidator.new('String', ["DEEP_RENAME", "ONLY_TOP_LEVEL_RENAME", "NO_RENAME"])
198
+ return false unless rename_strategy_validator.valid?(@rename_strategy)
199
+ true
200
+ end
201
+
202
+ # Custom attribute writer method checking allowed values (enum).
203
+ # @param [Object] platform Object to be assigned
204
+ def platform=(platform)
205
+ validator = EnumAttributeValidator.new('String', ["facebook", "instagram"])
206
+ unless validator.valid?(platform)
207
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
208
+ end
209
+ @platform = platform
210
+ end
211
+
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] status_option Object to be assigned
214
+ def status_option=(status_option)
215
+ validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED", "INHERITED_FROM_SOURCE"])
216
+ unless validator.valid?(status_option)
217
+ fail ArgumentError, "invalid value for \"status_option\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @status_option = status_option
220
+ end
221
+
222
+ # Custom attribute writer method checking allowed values (enum).
223
+ # @param [Object] rename_strategy Object to be assigned
224
+ def rename_strategy=(rename_strategy)
225
+ validator = EnumAttributeValidator.new('String', ["DEEP_RENAME", "ONLY_TOP_LEVEL_RENAME", "NO_RENAME"])
226
+ unless validator.valid?(rename_strategy)
227
+ fail ArgumentError, "invalid value for \"rename_strategy\", must be one of #{validator.allowable_values}."
228
+ end
229
+ @rename_strategy = rename_strategy
230
+ end
231
+
232
+ # Checks equality by comparing each attribute.
233
+ # @param [Object] Object to be compared
234
+ def ==(o)
235
+ return true if self.equal?(o)
236
+ self.class == o.class &&
237
+ platform == o.platform &&
238
+ campaign_id == o.campaign_id &&
239
+ deep_copy == o.deep_copy &&
240
+ status_option == o.status_option &&
241
+ start_time == o.start_time &&
242
+ end_time == o.end_time &&
243
+ rename_strategy == o.rename_strategy &&
244
+ rename_prefix == o.rename_prefix &&
245
+ rename_suffix == o.rename_suffix &&
246
+ sync_after == o.sync_after
247
+ end
248
+
249
+ # @see the `==` method
250
+ # @param [Object] Object to be compared
251
+ def eql?(o)
252
+ self == o
253
+ end
254
+
255
+ # Calculates hash code according to all attributes.
256
+ # @return [Integer] Hash code
257
+ def hash
258
+ [platform, campaign_id, deep_copy, status_option, start_time, end_time, rename_strategy, rename_prefix, rename_suffix, sync_after].hash
259
+ end
260
+
261
+ # Builds the object from hash
262
+ # @param [Hash] attributes Model attributes in the form of hash
263
+ # @return [Object] Returns the model itself
264
+ def self.build_from_hash(attributes)
265
+ return nil unless attributes.is_a?(Hash)
266
+ attributes = attributes.transform_keys(&:to_sym)
267
+ transformed_hash = {}
268
+ openapi_types.each_pair do |key, type|
269
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = nil
271
+ elsif type =~ /\AArray<(.*)>/i
272
+ # check to ensure the input is an array given that the attribute
273
+ # is documented as an array but the input is not
274
+ if attributes[attribute_map[key]].is_a?(Array)
275
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
276
+ end
277
+ elsif !attributes[attribute_map[key]].nil?
278
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
279
+ end
280
+ end
281
+ new(transformed_hash)
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ end
301
+
302
+ end
@@ -0,0 +1,148 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 GetAdCreative200Response < ApiModelBase
18
+ # Raw Meta creative node
19
+ attr_accessor :creative
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'creative' => :'creative'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'creative' => :'Object'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdCreative200Response` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdCreative200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'creative')
68
+ self.creative = attributes[:'creative']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ creative == o.creative
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [creative].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = self.send(attr)
136
+ if value.nil?
137
+ is_nullable = self.class.openapi_nullable.include?(attr)
138
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
+ end
140
+
141
+ hash[param] = _to_hash(value)
142
+ end
143
+ hash
144
+ end
145
+
146
+ end
147
+
148
+ end