late-sdk 0.0.528 → 0.0.530

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -9
  3. data/docs/AdsApi.md +301 -11
  4. data/docs/CreateAdInsightsReportRequest.md +8 -0
  5. data/docs/CreateCallAdRequest.md +80 -0
  6. data/docs/CreateMessagingAdRequest.md +78 -0
  7. data/docs/CreateStandaloneAdRequest.md +2 -0
  8. data/docs/CreateStandaloneAdRequestCarouselCardsInner.md +26 -0
  9. data/docs/{CreateCtwaAdRequest.md → CtwaAdRequestBody.md} +10 -10
  10. data/docs/{CreateCtwaAdRequestCitiesInner.md → CtwaAdRequestBodyCitiesInner.md} +2 -2
  11. data/docs/{CreateCtwaAdRequestCreativesInner.md → CtwaAdRequestBodyCreativesInner.md} +3 -3
  12. data/docs/{CreateCtwaAdRequestCreativesInnerVideo.md → CtwaAdRequestBodyCreativesInnerVideo.md} +2 -2
  13. data/docs/{CreateCtwaAdRequestPlacements.md → CtwaAdRequestBodyPlacements.md} +2 -2
  14. data/docs/{CreateCtwaAdRequestRegionsInner.md → CtwaAdRequestBodyRegionsInner.md} +2 -2
  15. data/docs/{CreateCtwaAdRequestVideo.md → CtwaAdRequestBodyVideo.md} +2 -2
  16. data/docs/{CreateCtwaAdRequestZipsInner.md → CtwaAdRequestBodyZipsInner.md} +2 -2
  17. data/docs/GenerateAdPreviews200Response.md +18 -0
  18. data/docs/GenerateAdPreviews200ResponsePreviewsInner.md +20 -0
  19. data/docs/GenerateAdPreviewsRequest.md +26 -0
  20. data/docs/GetAdPreviews200Response.md +20 -0
  21. data/lib/zernio-sdk/api/ads_api.rb +295 -13
  22. data/lib/zernio-sdk/models/create_ad_insights_report_request.rb +43 -1
  23. data/lib/zernio-sdk/models/create_call_ad_request.rb +869 -0
  24. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +844 -0
  25. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +41 -1
  26. data/lib/zernio-sdk/models/create_standalone_ad_request_carousel_cards_inner.rb +243 -0
  27. data/lib/zernio-sdk/models/{create_ctwa_ad_request.rb → ctwa_ad_request_body.rb} +12 -12
  28. data/lib/zernio-sdk/models/{create_ctwa_ad_request_cities_inner.rb → ctwa_ad_request_body_cities_inner.rb} +3 -3
  29. data/lib/zernio-sdk/models/{create_ctwa_ad_request_creatives_inner.rb → ctwa_ad_request_body_creatives_inner.rb} +4 -4
  30. data/lib/zernio-sdk/models/{create_ctwa_ad_request_creatives_inner_video.rb → ctwa_ad_request_body_creatives_inner_video.rb} +3 -3
  31. data/lib/zernio-sdk/models/{create_ctwa_ad_request_placements.rb → ctwa_ad_request_body_placements.rb} +3 -3
  32. data/lib/zernio-sdk/models/{create_ctwa_ad_request_regions_inner.rb → ctwa_ad_request_body_regions_inner.rb} +3 -3
  33. data/lib/zernio-sdk/models/{create_ctwa_ad_request_video.rb → ctwa_ad_request_body_video.rb} +3 -3
  34. data/lib/zernio-sdk/models/{create_ctwa_ad_request_zips_inner.rb → ctwa_ad_request_body_zips_inner.rb} +3 -3
  35. data/lib/zernio-sdk/models/generate_ad_previews200_response.rb +149 -0
  36. data/lib/zernio-sdk/models/generate_ad_previews200_response_previews_inner.rb +158 -0
  37. data/lib/zernio-sdk/models/generate_ad_previews_request.rb +254 -0
  38. data/lib/zernio-sdk/models/get_ad_previews200_response.rb +158 -0
  39. data/lib/zernio-sdk/version.rb +1 -1
  40. data/lib/zernio-sdk.rb +15 -8
  41. data/openapi.yaml +516 -320
  42. data/spec/api/ads_api_spec.rb +56 -3
  43. data/spec/models/create_ad_insights_report_request_spec.rb +24 -0
  44. data/spec/models/create_call_ad_request_spec.rb +238 -0
  45. data/spec/models/create_messaging_ad_request_spec.rb +236 -0
  46. data/spec/models/create_standalone_ad_request_carousel_cards_inner_spec.rb +60 -0
  47. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  48. data/spec/models/{create_ctwa_ad_request_cities_inner_spec.rb → ctwa_ad_request_body_cities_inner_spec.rb} +6 -6
  49. data/spec/models/{create_ctwa_ad_request_creatives_inner_spec.rb → ctwa_ad_request_body_creatives_inner_spec.rb} +6 -6
  50. data/spec/models/{create_ctwa_ad_request_creatives_inner_video_spec.rb → ctwa_ad_request_body_creatives_inner_video_spec.rb} +6 -6
  51. data/spec/models/{create_ctwa_ad_request_placements_spec.rb → ctwa_ad_request_body_placements_spec.rb} +6 -6
  52. data/spec/models/{create_ctwa_ad_request_regions_inner_spec.rb → ctwa_ad_request_body_regions_inner_spec.rb} +6 -6
  53. data/spec/models/{create_ctwa_ad_request_spec.rb → ctwa_ad_request_body_spec.rb} +6 -6
  54. data/spec/models/{create_ctwa_ad_request_video_spec.rb → ctwa_ad_request_body_video_spec.rb} +6 -6
  55. data/spec/models/{create_ctwa_ad_request_zips_inner_spec.rb → ctwa_ad_request_body_zips_inner_spec.rb} +6 -6
  56. data/spec/models/generate_ad_previews200_response_previews_inner_spec.rb +42 -0
  57. data/spec/models/generate_ad_previews200_response_spec.rb +36 -0
  58. data/spec/models/generate_ad_previews_request_spec.rb +60 -0
  59. data/spec/models/get_ad_previews200_response_spec.rb +42 -0
  60. data/zernio-sdk-0.0.530.gem +0 -0
  61. metadata +62 -34
  62. data/zernio-sdk-0.0.528.gem +0 -0
@@ -0,0 +1,149 @@
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 GenerateAdPreviews200Response < ApiModelBase
18
+ attr_accessor :previews
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'previews' => :'previews'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'previews' => :'Array<GenerateAdPreviews200ResponsePreviewsInner>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GenerateAdPreviews200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GenerateAdPreviews200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'previews')
67
+ if (value = attributes[:'previews']).is_a?(Array)
68
+ self.previews = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ previews == o.previews
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [previews].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ 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
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 GenerateAdPreviews200ResponsePreviewsInner < ApiModelBase
18
+ attr_accessor :format
19
+
20
+ # Meta's <iframe> snippet; null when Meta returned no preview for the format.
21
+ attr_accessor :html
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'format' => :'format',
27
+ :'html' => :'html'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'format' => :'String',
45
+ :'html' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'html'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GenerateAdPreviews200ResponsePreviewsInner` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GenerateAdPreviews200ResponsePreviewsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'format')
73
+ self.format = attributes[:'format']
74
+ end
75
+
76
+ if attributes.key?(:'html')
77
+ self.html = attributes[:'html']
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
+ format == o.format &&
102
+ html == o.html
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
+ [format, html].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,254 @@
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 GenerateAdPreviewsRequest < ApiModelBase
18
+ # Zernio SocialAccount id used to resolve the Meta token.
19
+ attr_accessor :account_id
20
+
21
+ # Meta ad account id (act_<n>).
22
+ attr_accessor :ad_account_id
23
+
24
+ # Meta ad_format values, one preview per format. Defaults to [DESKTOP_FEED_STANDARD].
25
+ attr_accessor :formats
26
+
27
+ # Preview an existing ad-account creative by id. Mutually exclusive with creativeSpec.
28
+ attr_accessor :existing_creative_id
29
+
30
+ # Raw Meta creative spec forwarded verbatim to /generatepreviews. Mutually exclusive with existingCreativeId.
31
+ attr_accessor :creative_spec
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'account_id' => :'accountId',
37
+ :'ad_account_id' => :'adAccountId',
38
+ :'formats' => :'formats',
39
+ :'existing_creative_id' => :'existingCreativeId',
40
+ :'creative_spec' => :'creativeSpec'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'account_id' => :'String',
58
+ :'ad_account_id' => :'String',
59
+ :'formats' => :'Array<String>',
60
+ :'existing_creative_id' => :'String',
61
+ :'creative_spec' => :'Hash<String, Object>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GenerateAdPreviewsRequest` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GenerateAdPreviewsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'account_id')
88
+ self.account_id = attributes[:'account_id']
89
+ else
90
+ self.account_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'ad_account_id')
94
+ self.ad_account_id = attributes[:'ad_account_id']
95
+ else
96
+ self.ad_account_id = nil
97
+ end
98
+
99
+ if attributes.key?(:'formats')
100
+ if (value = attributes[:'formats']).is_a?(Array)
101
+ self.formats = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'existing_creative_id')
106
+ self.existing_creative_id = attributes[:'existing_creative_id']
107
+ end
108
+
109
+ if attributes.key?(:'creative_spec')
110
+ if (value = attributes[:'creative_spec']).is_a?(Hash)
111
+ self.creative_spec = value
112
+ end
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @account_id.nil?
122
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
123
+ end
124
+
125
+ if @ad_account_id.nil?
126
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
127
+ end
128
+
129
+ if !@formats.nil? && @formats.length > 10
130
+ invalid_properties.push('invalid value for "formats", number of items must be less than or equal to 10.')
131
+ end
132
+
133
+ if !@formats.nil? && @formats.length < 1
134
+ invalid_properties.push('invalid value for "formats", number of items must be greater than or equal to 1.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
+ return false if @account_id.nil?
145
+ return false if @ad_account_id.nil?
146
+ return false if !@formats.nil? && @formats.length > 10
147
+ return false if !@formats.nil? && @formats.length < 1
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] account_id Value to be assigned
153
+ def account_id=(account_id)
154
+ if account_id.nil?
155
+ fail ArgumentError, 'account_id cannot be nil'
156
+ end
157
+
158
+ @account_id = account_id
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] ad_account_id Value to be assigned
163
+ def ad_account_id=(ad_account_id)
164
+ if ad_account_id.nil?
165
+ fail ArgumentError, 'ad_account_id cannot be nil'
166
+ end
167
+
168
+ @ad_account_id = ad_account_id
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] formats Value to be assigned
173
+ def formats=(formats)
174
+ if formats.nil?
175
+ fail ArgumentError, 'formats cannot be nil'
176
+ end
177
+
178
+ if formats.length > 10
179
+ fail ArgumentError, 'invalid value for "formats", number of items must be less than or equal to 10.'
180
+ end
181
+
182
+ if formats.length < 1
183
+ fail ArgumentError, 'invalid value for "formats", number of items must be greater than or equal to 1.'
184
+ end
185
+
186
+ @formats = formats
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ account_id == o.account_id &&
195
+ ad_account_id == o.ad_account_id &&
196
+ formats == o.formats &&
197
+ existing_creative_id == o.existing_creative_id &&
198
+ creative_spec == o.creative_spec
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Integer] Hash code
209
+ def hash
210
+ [account_id, ad_account_id, formats, existing_creative_id, creative_spec].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def self.build_from_hash(attributes)
217
+ return nil unless attributes.is_a?(Hash)
218
+ attributes = attributes.transform_keys(&:to_sym)
219
+ transformed_hash = {}
220
+ openapi_types.each_pair do |key, type|
221
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = nil
223
+ elsif type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[attribute_map[key]].is_a?(Array)
227
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
228
+ end
229
+ elsif !attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
231
+ end
232
+ end
233
+ new(transformed_hash)
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end