late-sdk 0.0.705 → 0.0.706
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 +9 -0
- data/docs/AdAccountsApi.md +214 -0
- data/docs/CreateAdCreativeRequest.md +3 -1
- data/docs/CreateCustomConversionRequest.md +26 -0
- data/docs/CreateHighDemandPeriod201Response.md +20 -0
- data/docs/CreateHighDemandPeriodRequest.md +34 -0
- data/docs/CreateStandaloneAdRequest.md +2 -0
- data/docs/CustomConversion.md +28 -0
- data/docs/CustomConversionResult.md +24 -0
- data/docs/ListCustomConversions200Response.md +20 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +212 -0
- data/lib/zernio-sdk/models/create_ad_creative_request.rb +26 -4
- data/lib/zernio-sdk/models/create_custom_conversion_request.rb +282 -0
- data/lib/zernio-sdk/models/create_high_demand_period201_response.rb +158 -0
- data/lib/zernio-sdk/models/create_high_demand_period_request.rb +347 -0
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +23 -1
- data/lib/zernio-sdk/models/custom_conversion.rb +198 -0
- data/lib/zernio-sdk/models/custom_conversion_result.rb +176 -0
- data/lib/zernio-sdk/models/list_custom_conversions200_response.rb +158 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +6 -0
- data/openapi.yaml +151 -0
- data/spec/api/ad_accounts_api_spec.rb +38 -0
- data/spec/models/create_ad_creative_request_spec.rb +10 -0
- data/spec/models/create_custom_conversion_request_spec.rb +60 -0
- data/spec/models/create_high_demand_period201_response_spec.rb +42 -0
- data/spec/models/create_high_demand_period_request_spec.rb +92 -0
- data/spec/models/create_standalone_ad_request_spec.rb +10 -0
- data/spec/models/custom_conversion_result_spec.rb +54 -0
- data/spec/models/custom_conversion_spec.rb +66 -0
- data/spec/models/list_custom_conversions200_response_spec.rb +42 -0
- data/zernio-sdk-0.0.706.gem +0 -0
- metadata +26 -2
- data/zernio-sdk-0.0.705.gem +0 -0
|
@@ -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 CreateHighDemandPeriod201Response < ApiModelBase
|
|
18
|
+
# The campaign / ad set the schedule was attached to.
|
|
19
|
+
attr_accessor :object_id
|
|
20
|
+
|
|
21
|
+
# Meta budget schedule id.
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'object_id' => :'objectId',
|
|
28
|
+
:'id' => :'id'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'object_id' => :'String',
|
|
46
|
+
:'id' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
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::CreateHighDemandPeriod201Response` 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::CreateHighDemandPeriod201Response`. 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?(:'object_id')
|
|
73
|
+
self.object_id = attributes[:'object_id']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'id')
|
|
77
|
+
self.id = attributes[:'id']
|
|
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
|
+
object_id == o.object_id &&
|
|
102
|
+
id == o.id
|
|
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
|
+
[object_id, id].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,347 @@
|
|
|
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 CreateHighDemandPeriodRequest < ApiModelBase
|
|
18
|
+
# Zernio SocialAccount id used to resolve the Meta token.
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# Platform campaign id. Exactly one of campaignId / adSetId.
|
|
22
|
+
attr_accessor :campaign_id
|
|
23
|
+
|
|
24
|
+
# Platform ad set id. Exactly one of campaignId / adSetId.
|
|
25
|
+
attr_accessor :ad_set_id
|
|
26
|
+
|
|
27
|
+
# With ABSOLUTE, a budget in the ad account's currency in WHOLE units (50 = $50.00). With MULTIPLIER, a factor of the existing budget (2 = double it) and NOT a currency amount.
|
|
28
|
+
attr_accessor :budget_value
|
|
29
|
+
|
|
30
|
+
attr_accessor :budget_value_type
|
|
31
|
+
|
|
32
|
+
# Unix seconds, on a 15-minute boundary (:00, :15, :30, :45).
|
|
33
|
+
attr_accessor :time_start
|
|
34
|
+
|
|
35
|
+
# Unix seconds, on a 15-minute boundary and after timeStart.
|
|
36
|
+
attr_accessor :time_end
|
|
37
|
+
|
|
38
|
+
attr_accessor :recurrence_type
|
|
39
|
+
|
|
40
|
+
# Ad account currency, for the ABSOLUTE minor-unit conversion. Ignored for MULTIPLIER.
|
|
41
|
+
attr_accessor :currency
|
|
42
|
+
|
|
43
|
+
class EnumAttributeValidator
|
|
44
|
+
attr_reader :datatype
|
|
45
|
+
attr_reader :allowable_values
|
|
46
|
+
|
|
47
|
+
def initialize(datatype, allowable_values)
|
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
|
49
|
+
case datatype.to_s
|
|
50
|
+
when /Integer/i
|
|
51
|
+
value.to_i
|
|
52
|
+
when /Float/i
|
|
53
|
+
value.to_f
|
|
54
|
+
else
|
|
55
|
+
value
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def valid?(value)
|
|
61
|
+
!value || allowable_values.include?(value)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
66
|
+
def self.attribute_map
|
|
67
|
+
{
|
|
68
|
+
:'account_id' => :'accountId',
|
|
69
|
+
:'campaign_id' => :'campaignId',
|
|
70
|
+
:'ad_set_id' => :'adSetId',
|
|
71
|
+
:'budget_value' => :'budgetValue',
|
|
72
|
+
:'budget_value_type' => :'budgetValueType',
|
|
73
|
+
:'time_start' => :'timeStart',
|
|
74
|
+
:'time_end' => :'timeEnd',
|
|
75
|
+
:'recurrence_type' => :'recurrenceType',
|
|
76
|
+
:'currency' => :'currency'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns attribute mapping this model knows about
|
|
81
|
+
def self.acceptable_attribute_map
|
|
82
|
+
attribute_map
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns all the JSON keys this model knows about
|
|
86
|
+
def self.acceptable_attributes
|
|
87
|
+
acceptable_attribute_map.values
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Attribute type mapping.
|
|
91
|
+
def self.openapi_types
|
|
92
|
+
{
|
|
93
|
+
:'account_id' => :'String',
|
|
94
|
+
:'campaign_id' => :'String',
|
|
95
|
+
:'ad_set_id' => :'String',
|
|
96
|
+
:'budget_value' => :'Float',
|
|
97
|
+
:'budget_value_type' => :'String',
|
|
98
|
+
:'time_start' => :'Integer',
|
|
99
|
+
:'time_end' => :'Integer',
|
|
100
|
+
:'recurrence_type' => :'String',
|
|
101
|
+
:'currency' => :'String'
|
|
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::CreateHighDemandPeriodRequest` 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::CreateHighDemandPeriodRequest`. 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?(:'account_id')
|
|
128
|
+
self.account_id = attributes[:'account_id']
|
|
129
|
+
else
|
|
130
|
+
self.account_id = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'campaign_id')
|
|
134
|
+
self.campaign_id = attributes[:'campaign_id']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'ad_set_id')
|
|
138
|
+
self.ad_set_id = attributes[:'ad_set_id']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'budget_value')
|
|
142
|
+
self.budget_value = attributes[:'budget_value']
|
|
143
|
+
else
|
|
144
|
+
self.budget_value = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'budget_value_type')
|
|
148
|
+
self.budget_value_type = attributes[:'budget_value_type']
|
|
149
|
+
else
|
|
150
|
+
self.budget_value_type = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'time_start')
|
|
154
|
+
self.time_start = attributes[:'time_start']
|
|
155
|
+
else
|
|
156
|
+
self.time_start = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'time_end')
|
|
160
|
+
self.time_end = attributes[:'time_end']
|
|
161
|
+
else
|
|
162
|
+
self.time_end = nil
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'recurrence_type')
|
|
166
|
+
self.recurrence_type = attributes[:'recurrence_type']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'currency')
|
|
170
|
+
self.currency = attributes[:'currency']
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
175
|
+
# @return Array for valid properties with the reasons
|
|
176
|
+
def list_invalid_properties
|
|
177
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
178
|
+
invalid_properties = Array.new
|
|
179
|
+
if @account_id.nil?
|
|
180
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if @budget_value.nil?
|
|
184
|
+
invalid_properties.push('invalid value for "budget_value", budget_value cannot be nil.')
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if @budget_value_type.nil?
|
|
188
|
+
invalid_properties.push('invalid value for "budget_value_type", budget_value_type cannot be nil.')
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if @time_start.nil?
|
|
192
|
+
invalid_properties.push('invalid value for "time_start", time_start cannot be nil.')
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if @time_end.nil?
|
|
196
|
+
invalid_properties.push('invalid value for "time_end", time_end cannot be nil.')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
invalid_properties
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Check to see if the all the properties in the model are valid
|
|
203
|
+
# @return true if the model is valid
|
|
204
|
+
def valid?
|
|
205
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
206
|
+
return false if @account_id.nil?
|
|
207
|
+
return false if @budget_value.nil?
|
|
208
|
+
return false if @budget_value_type.nil?
|
|
209
|
+
budget_value_type_validator = EnumAttributeValidator.new('String', ["ABSOLUTE", "MULTIPLIER"])
|
|
210
|
+
return false unless budget_value_type_validator.valid?(@budget_value_type)
|
|
211
|
+
return false if @time_start.nil?
|
|
212
|
+
return false if @time_end.nil?
|
|
213
|
+
recurrence_type_validator = EnumAttributeValidator.new('String', ["ONE_TIME", "WEEKLY", "MONTHLY"])
|
|
214
|
+
return false unless recurrence_type_validator.valid?(@recurrence_type)
|
|
215
|
+
true
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] account_id Value to be assigned
|
|
220
|
+
def account_id=(account_id)
|
|
221
|
+
if account_id.nil?
|
|
222
|
+
fail ArgumentError, 'account_id cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@account_id = account_id
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] budget_value Value to be assigned
|
|
230
|
+
def budget_value=(budget_value)
|
|
231
|
+
if budget_value.nil?
|
|
232
|
+
fail ArgumentError, 'budget_value cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@budget_value = budget_value
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
239
|
+
# @param [Object] budget_value_type Object to be assigned
|
|
240
|
+
def budget_value_type=(budget_value_type)
|
|
241
|
+
validator = EnumAttributeValidator.new('String', ["ABSOLUTE", "MULTIPLIER"])
|
|
242
|
+
unless validator.valid?(budget_value_type)
|
|
243
|
+
fail ArgumentError, "invalid value for \"budget_value_type\", must be one of #{validator.allowable_values}."
|
|
244
|
+
end
|
|
245
|
+
@budget_value_type = budget_value_type
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] time_start Value to be assigned
|
|
250
|
+
def time_start=(time_start)
|
|
251
|
+
if time_start.nil?
|
|
252
|
+
fail ArgumentError, 'time_start cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@time_start = time_start
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] time_end Value to be assigned
|
|
260
|
+
def time_end=(time_end)
|
|
261
|
+
if time_end.nil?
|
|
262
|
+
fail ArgumentError, 'time_end cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@time_end = time_end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
269
|
+
# @param [Object] recurrence_type Object to be assigned
|
|
270
|
+
def recurrence_type=(recurrence_type)
|
|
271
|
+
validator = EnumAttributeValidator.new('String', ["ONE_TIME", "WEEKLY", "MONTHLY"])
|
|
272
|
+
unless validator.valid?(recurrence_type)
|
|
273
|
+
fail ArgumentError, "invalid value for \"recurrence_type\", must be one of #{validator.allowable_values}."
|
|
274
|
+
end
|
|
275
|
+
@recurrence_type = recurrence_type
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Checks equality by comparing each attribute.
|
|
279
|
+
# @param [Object] Object to be compared
|
|
280
|
+
def ==(o)
|
|
281
|
+
return true if self.equal?(o)
|
|
282
|
+
self.class == o.class &&
|
|
283
|
+
account_id == o.account_id &&
|
|
284
|
+
campaign_id == o.campaign_id &&
|
|
285
|
+
ad_set_id == o.ad_set_id &&
|
|
286
|
+
budget_value == o.budget_value &&
|
|
287
|
+
budget_value_type == o.budget_value_type &&
|
|
288
|
+
time_start == o.time_start &&
|
|
289
|
+
time_end == o.time_end &&
|
|
290
|
+
recurrence_type == o.recurrence_type &&
|
|
291
|
+
currency == o.currency
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# @see the `==` method
|
|
295
|
+
# @param [Object] Object to be compared
|
|
296
|
+
def eql?(o)
|
|
297
|
+
self == o
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Calculates hash code according to all attributes.
|
|
301
|
+
# @return [Integer] Hash code
|
|
302
|
+
def hash
|
|
303
|
+
[account_id, campaign_id, ad_set_id, budget_value, budget_value_type, time_start, time_end, recurrence_type, currency].hash
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Builds the object from hash
|
|
307
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
308
|
+
# @return [Object] Returns the model itself
|
|
309
|
+
def self.build_from_hash(attributes)
|
|
310
|
+
return nil unless attributes.is_a?(Hash)
|
|
311
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
312
|
+
transformed_hash = {}
|
|
313
|
+
openapi_types.each_pair do |key, type|
|
|
314
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
315
|
+
transformed_hash["#{key}"] = nil
|
|
316
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
317
|
+
# check to ensure the input is an array given that the attribute
|
|
318
|
+
# is documented as an array but the input is not
|
|
319
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
320
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
321
|
+
end
|
|
322
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
323
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
new(transformed_hash)
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Returns the object in the form of hash
|
|
330
|
+
# @return [Hash] Returns the object in the form of hash
|
|
331
|
+
def to_hash
|
|
332
|
+
hash = {}
|
|
333
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
334
|
+
value = self.send(attr)
|
|
335
|
+
if value.nil?
|
|
336
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
337
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
hash[param] = _to_hash(value)
|
|
341
|
+
end
|
|
342
|
+
hash
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
end
|
|
@@ -50,6 +50,9 @@ module Zernio
|
|
|
50
50
|
# Meta only. Advantage+ creative enhancements: a partial map of Meta creative feature keys (snake_case, e.g. enhance_cta, image_brightness_and_contrast, text_optimizations) to enroll status, forwarded as degrees_of_freedom_spec.creative_features_spec. Meta validates the keys; unspecified features default to OPT_OUT. The legacy standard_enhancements bundle is deprecated by Meta and rejected.
|
|
51
51
|
attr_accessor :creative_features
|
|
52
52
|
|
|
53
|
+
# Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key — Meta rejects it there.
|
|
54
|
+
attr_accessor :multi_advertiser
|
|
55
|
+
|
|
53
56
|
# Meta only, single standalone shape only (no creatives[], adSetId, or RESERVED). Dry-run: each node runs Meta's execution_options validate_only and NOTHING is created or persisted. Children need real parents, so a fresh tree validates the campaign + creative (the ad set needs its campaign to exist — pass existingCampaignId to validate it too; the ad itself is never validatable pre-create). A Meta validation failure returns the 400 verbatim; success returns 200 with per-node results instead of an ad.
|
|
54
57
|
attr_accessor :validate_only
|
|
55
58
|
|
|
@@ -281,6 +284,7 @@ module Zernio
|
|
|
281
284
|
:'buying_type' => :'buyingType',
|
|
282
285
|
:'rf_prediction_id' => :'rfPredictionId',
|
|
283
286
|
:'creative_features' => :'creativeFeatures',
|
|
287
|
+
:'multi_advertiser' => :'multiAdvertiser',
|
|
284
288
|
:'validate_only' => :'validateOnly',
|
|
285
289
|
:'budget_amount' => :'budgetAmount',
|
|
286
290
|
:'budget_type' => :'budgetType',
|
|
@@ -378,6 +382,7 @@ module Zernio
|
|
|
378
382
|
:'buying_type' => :'String',
|
|
379
383
|
:'rf_prediction_id' => :'String',
|
|
380
384
|
:'creative_features' => :'Hash<String, String>',
|
|
385
|
+
:'multi_advertiser' => :'String',
|
|
381
386
|
:'validate_only' => :'Boolean',
|
|
382
387
|
:'budget_amount' => :'Float',
|
|
383
388
|
:'budget_type' => :'String',
|
|
@@ -531,6 +536,10 @@ module Zernio
|
|
|
531
536
|
end
|
|
532
537
|
end
|
|
533
538
|
|
|
539
|
+
if attributes.key?(:'multi_advertiser')
|
|
540
|
+
self.multi_advertiser = attributes[:'multi_advertiser']
|
|
541
|
+
end
|
|
542
|
+
|
|
534
543
|
if attributes.key?(:'validate_only')
|
|
535
544
|
self.validate_only = attributes[:'validate_only']
|
|
536
545
|
end
|
|
@@ -968,6 +977,8 @@ module Zernio
|
|
|
968
977
|
return false unless goal_validator.valid?(@goal)
|
|
969
978
|
buying_type_validator = EnumAttributeValidator.new('String', ["AUCTION", "RESERVED"])
|
|
970
979
|
return false unless buying_type_validator.valid?(@buying_type)
|
|
980
|
+
multi_advertiser_validator = EnumAttributeValidator.new('String', ["OPT_IN", "OPT_OUT"])
|
|
981
|
+
return false unless multi_advertiser_validator.valid?(@multi_advertiser)
|
|
971
982
|
budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
|
|
972
983
|
return false unless budget_type_validator.valid?(@budget_type)
|
|
973
984
|
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
|
|
@@ -1102,6 +1113,16 @@ module Zernio
|
|
|
1102
1113
|
@buying_type = buying_type
|
|
1103
1114
|
end
|
|
1104
1115
|
|
|
1116
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
1117
|
+
# @param [Object] multi_advertiser Object to be assigned
|
|
1118
|
+
def multi_advertiser=(multi_advertiser)
|
|
1119
|
+
validator = EnumAttributeValidator.new('String', ["OPT_IN", "OPT_OUT"])
|
|
1120
|
+
unless validator.valid?(multi_advertiser)
|
|
1121
|
+
fail ArgumentError, "invalid value for \"multi_advertiser\", must be one of #{validator.allowable_values}."
|
|
1122
|
+
end
|
|
1123
|
+
@multi_advertiser = multi_advertiser
|
|
1124
|
+
end
|
|
1125
|
+
|
|
1105
1126
|
# Custom attribute writer method checking allowed values (enum).
|
|
1106
1127
|
# @param [Object] budget_type Object to be assigned
|
|
1107
1128
|
def budget_type=(budget_type)
|
|
@@ -1399,6 +1420,7 @@ module Zernio
|
|
|
1399
1420
|
buying_type == o.buying_type &&
|
|
1400
1421
|
rf_prediction_id == o.rf_prediction_id &&
|
|
1401
1422
|
creative_features == o.creative_features &&
|
|
1423
|
+
multi_advertiser == o.multi_advertiser &&
|
|
1402
1424
|
validate_only == o.validate_only &&
|
|
1403
1425
|
budget_amount == o.budget_amount &&
|
|
1404
1426
|
budget_type == o.budget_type &&
|
|
@@ -1478,7 +1500,7 @@ module Zernio
|
|
|
1478
1500
|
# Calculates hash code according to all attributes.
|
|
1479
1501
|
# @return [Integer] Hash code
|
|
1480
1502
|
def hash
|
|
1481
|
-
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
|
|
1503
|
+
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
|
|
1482
1504
|
end
|
|
1483
1505
|
|
|
1484
1506
|
# Builds the object from hash
|