late-sdk 0.0.897 → 0.0.899
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/docs/AdCampaignsApi.md +11 -7
- data/docs/AdCreative.md +4 -0
- data/docs/AdCreativesApi.md +2 -2
- data/docs/BoostPostRequest.md +2 -0
- data/docs/CreateAdCreative201Response.md +5 -1
- data/docs/CreateAdCreativeRequest.md +4 -2
- data/docs/CreateCallAdRequest.md +2 -0
- data/docs/CreateMessagingAdRequest.md +2 -0
- data/docs/CreateStandaloneAdRequest.md +5 -3
- data/docs/CreateStandaloneAdRequestCreativesInner.md +4 -0
- data/docs/CreateStandaloneAdRequestPromotedObject.md +2 -2
- data/docs/CtwaAdRequestBody.md +2 -0
- data/docs/CtwaAdRequestBodyCreativesInner.md +2 -0
- data/docs/MetaPromotion.md +26 -0
- data/docs/MetaPromotionStatus.md +15 -0
- data/docs/UpdateAdRequestCreative.md +4 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +9 -6
- data/lib/zernio-sdk/api/ad_creatives_api.rb +4 -4
- data/lib/zernio-sdk/models/ad_creative.rb +42 -1
- data/lib/zernio-sdk/models/boost_post_request.rb +13 -1
- data/lib/zernio-sdk/models/create_ad_creative201_response.rb +44 -4
- data/lib/zernio-sdk/models/create_ad_creative_request.rb +11 -2
- data/lib/zernio-sdk/models/create_call_ad_request.rb +13 -1
- data/lib/zernio-sdk/models/create_messaging_ad_request.rb +13 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +12 -3
- data/lib/zernio-sdk/models/create_standalone_ad_request_creatives_inner.rb +23 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request_dynamic_creative.rb +1 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request_promoted_object.rb +2 -2
- data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +13 -1
- data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +35 -1
- data/lib/zernio-sdk/models/meta_promotion.rb +275 -0
- data/lib/zernio-sdk/models/meta_promotion_status.rb +41 -0
- data/lib/zernio-sdk/models/update_ad_request_creative.rb +45 -2
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +2 -0
- data/openapi.yaml +132 -13
- data/spec/api/ad_campaigns_api_spec.rb +4 -3
- data/spec/api/ad_creatives_api_spec.rb +2 -2
- data/spec/models/ad_creative_spec.rb +12 -0
- data/spec/models/boost_post_request_spec.rb +10 -0
- data/spec/models/create_ad_creative201_response_spec.rb +12 -0
- data/spec/models/create_ad_creative_request_spec.rb +6 -0
- data/spec/models/create_call_ad_request_spec.rb +10 -0
- data/spec/models/create_messaging_ad_request_spec.rb +10 -0
- data/spec/models/create_standalone_ad_request_creatives_inner_spec.rb +16 -0
- data/spec/models/create_standalone_ad_request_spec.rb +6 -0
- data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +10 -0
- data/spec/models/ctwa_ad_request_body_spec.rb +10 -0
- data/spec/models/meta_promotion_spec.rb +64 -0
- data/spec/models/meta_promotion_status_spec.rb +30 -0
- data/spec/models/update_ad_request_creative_spec.rb +16 -0
- data/zernio-sdk-0.0.899.gem +0 -0
- metadata +10 -2
- data/zernio-sdk-0.0.897.gem +0 -0
|
@@ -22,6 +22,9 @@ module Zernio
|
|
|
22
22
|
# Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with existingPostId and fresh creative fields.
|
|
23
23
|
attr_accessor :object_story_id
|
|
24
24
|
|
|
25
|
+
# Replaces the top-level creativeFeatures map for this item. Omit to inherit; an empty object clears inherited enrollment choices.
|
|
26
|
+
attr_accessor :creative_features
|
|
27
|
+
|
|
25
28
|
attr_accessor :headline
|
|
26
29
|
|
|
27
30
|
# Primary text shown above the image / video.
|
|
@@ -34,11 +37,34 @@ module Zernio
|
|
|
34
37
|
|
|
35
38
|
attr_accessor :welcome_message
|
|
36
39
|
|
|
40
|
+
class EnumAttributeValidator
|
|
41
|
+
attr_reader :datatype
|
|
42
|
+
attr_reader :allowable_values
|
|
43
|
+
|
|
44
|
+
def initialize(datatype, allowable_values)
|
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
|
46
|
+
case datatype.to_s
|
|
47
|
+
when /Integer/i
|
|
48
|
+
value.to_i
|
|
49
|
+
when /Float/i
|
|
50
|
+
value.to_f
|
|
51
|
+
else
|
|
52
|
+
value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def valid?(value)
|
|
58
|
+
!value || allowable_values.include?(value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
37
62
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
63
|
def self.attribute_map
|
|
39
64
|
{
|
|
40
65
|
:'existing_post_id' => :'existingPostId',
|
|
41
66
|
:'object_story_id' => :'objectStoryId',
|
|
67
|
+
:'creative_features' => :'creativeFeatures',
|
|
42
68
|
:'headline' => :'headline',
|
|
43
69
|
:'body' => :'body',
|
|
44
70
|
:'image_url' => :'imageUrl',
|
|
@@ -62,6 +88,7 @@ module Zernio
|
|
|
62
88
|
{
|
|
63
89
|
:'existing_post_id' => :'String',
|
|
64
90
|
:'object_story_id' => :'String',
|
|
91
|
+
:'creative_features' => :'Hash<String, String>',
|
|
65
92
|
:'headline' => :'String',
|
|
66
93
|
:'body' => :'String',
|
|
67
94
|
:'image_url' => :'String',
|
|
@@ -100,6 +127,12 @@ module Zernio
|
|
|
100
127
|
self.object_story_id = attributes[:'object_story_id']
|
|
101
128
|
end
|
|
102
129
|
|
|
130
|
+
if attributes.key?(:'creative_features')
|
|
131
|
+
if (value = attributes[:'creative_features']).is_a?(Hash)
|
|
132
|
+
self.creative_features = value
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
103
136
|
if attributes.key?(:'headline')
|
|
104
137
|
self.headline = attributes[:'headline']
|
|
105
138
|
end
|
|
@@ -230,6 +263,7 @@ module Zernio
|
|
|
230
263
|
self.class == o.class &&
|
|
231
264
|
existing_post_id == o.existing_post_id &&
|
|
232
265
|
object_story_id == o.object_story_id &&
|
|
266
|
+
creative_features == o.creative_features &&
|
|
233
267
|
headline == o.headline &&
|
|
234
268
|
body == o.body &&
|
|
235
269
|
image_url == o.image_url &&
|
|
@@ -246,7 +280,7 @@ module Zernio
|
|
|
246
280
|
# Calculates hash code according to all attributes.
|
|
247
281
|
# @return [Integer] Hash code
|
|
248
282
|
def hash
|
|
249
|
-
[existing_post_id, object_story_id, headline, body, image_url, video, welcome_message].hash
|
|
283
|
+
[existing_post_id, object_story_id, creative_features, headline, body, image_url, video, welcome_message].hash
|
|
250
284
|
end
|
|
251
285
|
|
|
252
286
|
# Builds the object from hash
|
|
@@ -0,0 +1,275 @@
|
|
|
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
|
+
# Meta explicit Promotion offer. Maps to creative_sourcing_spec.promotion_metadata_spec with promotion_source ADVERTISER_INPUT. Dates become Unix seconds. Send null to omit an explicit offer on a new creative or remove it when rebuilding. Creation success alone does not confirm application: inspect promotionStatus in the response.
|
|
18
|
+
class MetaPromotion < ApiModelBase
|
|
19
|
+
# Promotion type accepted by Meta. PERCENTAGE_OFF values cannot exceed 100.
|
|
20
|
+
attr_accessor :type
|
|
21
|
+
|
|
22
|
+
# Nonnegative promotion value passed to Meta unchanged. AMOUNT_OFF units are not confirmed, including major versus minor currency units. For PERCENTAGE_OFF this is the percentage discount, at most 100.
|
|
23
|
+
attr_accessor :value
|
|
24
|
+
|
|
25
|
+
# Optional promotion code.
|
|
26
|
+
attr_accessor :code
|
|
27
|
+
|
|
28
|
+
# Optional ISO 8601 start timestamp with a timezone offset or Z.
|
|
29
|
+
attr_accessor :start_date
|
|
30
|
+
|
|
31
|
+
# Optional ISO 8601 end timestamp with a timezone offset or Z. Must be after startDate when both are set.
|
|
32
|
+
attr_accessor :end_date
|
|
33
|
+
|
|
34
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
57
|
+
def self.attribute_map
|
|
58
|
+
{
|
|
59
|
+
:'type' => :'type',
|
|
60
|
+
:'value' => :'value',
|
|
61
|
+
:'code' => :'code',
|
|
62
|
+
:'start_date' => :'startDate',
|
|
63
|
+
:'end_date' => :'endDate'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns attribute mapping this model knows about
|
|
68
|
+
def self.acceptable_attribute_map
|
|
69
|
+
attribute_map
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns all the JSON keys this model knows about
|
|
73
|
+
def self.acceptable_attributes
|
|
74
|
+
acceptable_attribute_map.values
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.openapi_types
|
|
79
|
+
{
|
|
80
|
+
:'type' => :'String',
|
|
81
|
+
:'value' => :'Float',
|
|
82
|
+
:'code' => :'String',
|
|
83
|
+
:'start_date' => :'Time',
|
|
84
|
+
:'end_date' => :'Time'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List of attributes with nullable: true
|
|
89
|
+
def self.openapi_nullable
|
|
90
|
+
Set.new([
|
|
91
|
+
])
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Initializes the object
|
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
96
|
+
def initialize(attributes = {})
|
|
97
|
+
if (!attributes.is_a?(Hash))
|
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaPromotion` initialize method"
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MetaPromotion`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
106
|
+
end
|
|
107
|
+
h[k.to_sym] = v
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'type')
|
|
111
|
+
self.type = attributes[:'type']
|
|
112
|
+
else
|
|
113
|
+
self.type = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'value')
|
|
117
|
+
self.value = attributes[:'value']
|
|
118
|
+
else
|
|
119
|
+
self.value = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'code')
|
|
123
|
+
self.code = attributes[:'code']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'start_date')
|
|
127
|
+
self.start_date = attributes[:'start_date']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'end_date')
|
|
131
|
+
self.end_date = attributes[:'end_date']
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
136
|
+
# @return Array for valid properties with the reasons
|
|
137
|
+
def list_invalid_properties
|
|
138
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
139
|
+
invalid_properties = Array.new
|
|
140
|
+
if @type.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @value.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "value", value cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if @value < 0
|
|
149
|
+
invalid_properties.push('invalid value for "value", must be greater than or equal to 0.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if !@code.nil? && @code.to_s.length < 1
|
|
153
|
+
invalid_properties.push('invalid value for "code", the character length must be greater than or equal to 1.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
invalid_properties
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Check to see if the all the properties in the model are valid
|
|
160
|
+
# @return true if the model is valid
|
|
161
|
+
def valid?
|
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
return false if @type.nil?
|
|
164
|
+
type_validator = EnumAttributeValidator.new('String', ["AMOUNT_OFF", "FREE_RETURN", "FREE_SHIPPING", "PERCENTAGE_OFF", "PROMO_CODE"])
|
|
165
|
+
return false unless type_validator.valid?(@type)
|
|
166
|
+
return false if @value.nil?
|
|
167
|
+
return false if @value < 0
|
|
168
|
+
return false if !@code.nil? && @code.to_s.length < 1
|
|
169
|
+
true
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
173
|
+
# @param [Object] type Object to be assigned
|
|
174
|
+
def type=(type)
|
|
175
|
+
validator = EnumAttributeValidator.new('String', ["AMOUNT_OFF", "FREE_RETURN", "FREE_SHIPPING", "PERCENTAGE_OFF", "PROMO_CODE"])
|
|
176
|
+
unless validator.valid?(type)
|
|
177
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
178
|
+
end
|
|
179
|
+
@type = type
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] value Value to be assigned
|
|
184
|
+
def value=(value)
|
|
185
|
+
if value.nil?
|
|
186
|
+
fail ArgumentError, 'value cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if value < 0
|
|
190
|
+
fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@value = value
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] code Value to be assigned
|
|
198
|
+
def code=(code)
|
|
199
|
+
if code.nil?
|
|
200
|
+
fail ArgumentError, 'code cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if code.to_s.length < 1
|
|
204
|
+
fail ArgumentError, 'invalid value for "code", the character length must be greater than or equal to 1.'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
@code = code
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Checks equality by comparing each attribute.
|
|
211
|
+
# @param [Object] Object to be compared
|
|
212
|
+
def ==(o)
|
|
213
|
+
return true if self.equal?(o)
|
|
214
|
+
self.class == o.class &&
|
|
215
|
+
type == o.type &&
|
|
216
|
+
value == o.value &&
|
|
217
|
+
code == o.code &&
|
|
218
|
+
start_date == o.start_date &&
|
|
219
|
+
end_date == o.end_date
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# @see the `==` method
|
|
223
|
+
# @param [Object] Object to be compared
|
|
224
|
+
def eql?(o)
|
|
225
|
+
self == o
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Calculates hash code according to all attributes.
|
|
229
|
+
# @return [Integer] Hash code
|
|
230
|
+
def hash
|
|
231
|
+
[type, value, code, start_date, end_date].hash
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Builds the object from hash
|
|
235
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
236
|
+
# @return [Object] Returns the model itself
|
|
237
|
+
def self.build_from_hash(attributes)
|
|
238
|
+
return nil unless attributes.is_a?(Hash)
|
|
239
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
240
|
+
transformed_hash = {}
|
|
241
|
+
openapi_types.each_pair do |key, type|
|
|
242
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
243
|
+
transformed_hash["#{key}"] = nil
|
|
244
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
245
|
+
# check to ensure the input is an array given that the attribute
|
|
246
|
+
# is documented as an array but the input is not
|
|
247
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
248
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
249
|
+
end
|
|
250
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
251
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
new(transformed_hash)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Returns the object in the form of hash
|
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
|
259
|
+
def to_hash
|
|
260
|
+
hash = {}
|
|
261
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
262
|
+
value = self.send(attr)
|
|
263
|
+
if value.nil?
|
|
264
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
265
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
hash[param] = _to_hash(value)
|
|
269
|
+
end
|
|
270
|
+
hash
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 MetaPromotionStatus
|
|
18
|
+
APPLIED = "applied".freeze
|
|
19
|
+
NOT_RETURNED = "not_returned".freeze
|
|
20
|
+
UNAVAILABLE = "unavailable".freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [APPLIED, NOT_RETURNED, UNAVAILABLE].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the enum from string
|
|
34
|
+
# @param [String] The enum value in the form of the string
|
|
35
|
+
# @return [String] The enum value
|
|
36
|
+
def build_from_hash(value)
|
|
37
|
+
return value if MetaPromotionStatus.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #MetaPromotionStatus"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -14,8 +14,13 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Replace or patch the ad's creative. Meta, TikTok, and LinkedIn. - **Meta**: patch-style. Pass any subset: fields you omit are preserved from the live creative, including media (`image_hash`/`video_id` are reused, no re-upload) and `url_tags`. Sending the full set (`headline`, `body`, `callToAction`, `linkUrl`, `imageUrl`) rebuilds the creative from scratch instead. Partial patching reads the live `object_story_spec`, which Meta strips on SHARE / page-post / dark / asset_feed creatives. Those return 422 asking for the full set. A `videoUrl`/`videoId` on an image creative is a type change and also needs the full set. `existingCreativeId` repoints the ad at a creative from GET /v1/ads/creatives and ignores every other field. Meta creatives are immutable, so any change creates a new creative and repoints the ad; the old creative is retained on the ad account for historical reporting. - **TikTok**: patch-style. Pass any subset; `headline` is ignored (TikTok creatives have no headline slot). `body` becomes the in-feed `ad_text`; `linkUrl` becomes `landing_page_url`; `videoUrl` triggers a fresh upload. `description`, `videoId` and `existingCreativeId` are Meta-only and return 400. - **LinkedIn**: requires new media (image via `imageUrl` or video via `videoUrl`); a text-only creative update returns 400. Uploads the media, creates a new inline media creative on the same campaign, and pauses the old creative (best-effort). The old creative is retained for historical reporting. `videoId` and `existingCreativeId` are Meta-only and return 400.
|
|
17
|
+
# Replace or patch the ad's creative. Meta, TikTok, and LinkedIn. - **Meta**: patch-style. Pass any subset: fields you omit are preserved from the live creative, including media (`image_hash`/`video_id` are reused, no re-upload) and `url_tags`. Sending the full set (`headline`, `body`, `callToAction`, `linkUrl`, `imageUrl`) rebuilds the creative from scratch instead. Partial patching reads the live `object_story_spec`, which Meta strips on SHARE / page-post / dark / asset_feed creatives. Those return 422 asking for the full set. A `videoUrl`/`videoId` on an image creative is a type change and also needs the full set. `existingCreativeId` repoints the ad at a creative from GET /v1/ads/creatives and ignores every other field. Meta creatives are immutable, so any change creates a new creative and repoints the ad; the old creative is retained on the ad account for historical reporting. `promotion` and `creativeFeatures` are Meta-only. Omitted settings are preserved from the live creative, including full rebuilds. Send `promotion: null` to remove the explicit offer from the replacement. A supplied creativeFeatures map overrides individual existing keys. - **TikTok**: patch-style. Pass any subset; `headline` is ignored (TikTok creatives have no headline slot). `body` becomes the in-feed `ad_text`; `linkUrl` becomes `landing_page_url`; `videoUrl` triggers a fresh upload. `description`, `videoId` and `existingCreativeId` are Meta-only and return 400. - **LinkedIn**: requires new media (image via `imageUrl` or video via `videoUrl`); a text-only creative update returns 400. Uploads the media, creates a new inline media creative on the same campaign, and pauses the old creative (best-effort). The old creative is retained for historical reporting. `videoId` and `existingCreativeId` are Meta-only and return 400.
|
|
18
18
|
class UpdateAdRequestCreative < ApiModelBase
|
|
19
|
+
attr_accessor :promotion
|
|
20
|
+
|
|
21
|
+
# Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an enhancement; use the separate promotion field for an explicit offer. The deprecated standard_enhancements bundle is rejected by Meta.
|
|
22
|
+
attr_accessor :creative_features
|
|
23
|
+
|
|
19
24
|
# Meta and LinkedIn (TikTok has no headline slot)
|
|
20
25
|
attr_accessor :headline
|
|
21
26
|
|
|
@@ -38,9 +43,33 @@ module Zernio
|
|
|
38
43
|
# Meta only. Repoint the ad at an existing library creative (from GET /v1/ads/creatives); all other creative fields are ignored.
|
|
39
44
|
attr_accessor :existing_creative_id
|
|
40
45
|
|
|
46
|
+
class EnumAttributeValidator
|
|
47
|
+
attr_reader :datatype
|
|
48
|
+
attr_reader :allowable_values
|
|
49
|
+
|
|
50
|
+
def initialize(datatype, allowable_values)
|
|
51
|
+
@allowable_values = allowable_values.map do |value|
|
|
52
|
+
case datatype.to_s
|
|
53
|
+
when /Integer/i
|
|
54
|
+
value.to_i
|
|
55
|
+
when /Float/i
|
|
56
|
+
value.to_f
|
|
57
|
+
else
|
|
58
|
+
value
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def valid?(value)
|
|
64
|
+
!value || allowable_values.include?(value)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
41
68
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
69
|
def self.attribute_map
|
|
43
70
|
{
|
|
71
|
+
:'promotion' => :'promotion',
|
|
72
|
+
:'creative_features' => :'creativeFeatures',
|
|
44
73
|
:'headline' => :'headline',
|
|
45
74
|
:'body' => :'body',
|
|
46
75
|
:'description' => :'description',
|
|
@@ -66,6 +95,8 @@ module Zernio
|
|
|
66
95
|
# Attribute type mapping.
|
|
67
96
|
def self.openapi_types
|
|
68
97
|
{
|
|
98
|
+
:'promotion' => :'MetaPromotion',
|
|
99
|
+
:'creative_features' => :'Hash<String, String>',
|
|
69
100
|
:'headline' => :'String',
|
|
70
101
|
:'body' => :'String',
|
|
71
102
|
:'description' => :'String',
|
|
@@ -100,6 +131,16 @@ module Zernio
|
|
|
100
131
|
h[k.to_sym] = v
|
|
101
132
|
}
|
|
102
133
|
|
|
134
|
+
if attributes.key?(:'promotion')
|
|
135
|
+
self.promotion = attributes[:'promotion']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'creative_features')
|
|
139
|
+
if (value = attributes[:'creative_features']).is_a?(Hash)
|
|
140
|
+
self.creative_features = value
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
103
144
|
if attributes.key?(:'headline')
|
|
104
145
|
self.headline = attributes[:'headline']
|
|
105
146
|
end
|
|
@@ -176,6 +217,8 @@ module Zernio
|
|
|
176
217
|
def ==(o)
|
|
177
218
|
return true if self.equal?(o)
|
|
178
219
|
self.class == o.class &&
|
|
220
|
+
promotion == o.promotion &&
|
|
221
|
+
creative_features == o.creative_features &&
|
|
179
222
|
headline == o.headline &&
|
|
180
223
|
body == o.body &&
|
|
181
224
|
description == o.description &&
|
|
@@ -196,7 +239,7 @@ module Zernio
|
|
|
196
239
|
# Calculates hash code according to all attributes.
|
|
197
240
|
# @return [Integer] Hash code
|
|
198
241
|
def hash
|
|
199
|
-
[headline, body, description, call_to_action, link_url, image_url, video_url, video_id, existing_creative_id].hash
|
|
242
|
+
[promotion, creative_features, headline, body, description, call_to_action, link_url, image_url, video_url, video_id, existing_creative_id].hash
|
|
200
243
|
end
|
|
201
244
|
|
|
202
245
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1200,6 +1200,8 @@ require 'zernio-sdk/models/media_upload_response'
|
|
|
1200
1200
|
require 'zernio-sdk/models/meta_ads_platform_data'
|
|
1201
1201
|
require 'zernio-sdk/models/meta_lead_form_platform_data'
|
|
1202
1202
|
require 'zernio-sdk/models/meta_lead_form_platform_data_context_card'
|
|
1203
|
+
require 'zernio-sdk/models/meta_promotion'
|
|
1204
|
+
require 'zernio-sdk/models/meta_promotion_status'
|
|
1203
1205
|
require 'zernio-sdk/models/money'
|
|
1204
1206
|
require 'zernio-sdk/models/money_amount'
|
|
1205
1207
|
require 'zernio-sdk/models/move_account_to_profile200_response'
|