late-sdk 0.0.722 → 0.0.724
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 +4 -0
- data/docs/AdCreativesApi.md +80 -0
- data/docs/CreateInboxConversation404Response.md +20 -0
- data/docs/CreateInboxConversation429Response.md +20 -0
- data/docs/ListAdVideos200Response.md +22 -0
- data/docs/UploadedOrDerivedAudience.md +3 -1
- data/lib/zernio-sdk/api/ad_creatives_api.rb +88 -0
- data/lib/zernio-sdk/models/create_inbox_conversation404_response.rb +190 -0
- data/lib/zernio-sdk/models/create_inbox_conversation429_response.rb +190 -0
- data/lib/zernio-sdk/models/create_standalone_ad_request_video.rb +1 -1
- data/lib/zernio-sdk/models/list_ad_videos200_response.rb +167 -0
- data/lib/zernio-sdk/models/uploaded_or_derived_audience.rb +12 -2
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +95 -5
- data/spec/api/ad_creatives_api_spec.rb +16 -0
- data/spec/models/create_inbox_conversation404_response_spec.rb +46 -0
- data/spec/models/create_inbox_conversation429_response_spec.rb +46 -0
- data/spec/models/list_ad_videos200_response_spec.rb +48 -0
- data/spec/models/uploaded_or_derived_audience_spec.rb +6 -0
- data/zernio-sdk-0.0.724.gem +0 -0
- metadata +14 -2
- data/zernio-sdk-0.0.722.gem +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
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 CreateInboxConversation429Response < ApiModelBase
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
attr_accessor :code
|
|
21
|
+
|
|
22
|
+
class EnumAttributeValidator
|
|
23
|
+
attr_reader :datatype
|
|
24
|
+
attr_reader :allowable_values
|
|
25
|
+
|
|
26
|
+
def initialize(datatype, allowable_values)
|
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
|
28
|
+
case datatype.to_s
|
|
29
|
+
when /Integer/i
|
|
30
|
+
value.to_i
|
|
31
|
+
when /Float/i
|
|
32
|
+
value.to_f
|
|
33
|
+
else
|
|
34
|
+
value
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def valid?(value)
|
|
40
|
+
!value || allowable_values.include?(value)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
45
|
+
def self.attribute_map
|
|
46
|
+
{
|
|
47
|
+
:'error' => :'error',
|
|
48
|
+
:'code' => :'code'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'error' => :'String',
|
|
66
|
+
:'code' => :'String'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateInboxConversation429Response` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateInboxConversation429Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'error')
|
|
93
|
+
self.error = attributes[:'error']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'code')
|
|
97
|
+
self.code = attributes[:'code']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
code_validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
114
|
+
return false unless code_validator.valid?(@code)
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
119
|
+
# @param [Object] code Object to be assigned
|
|
120
|
+
def code=(code)
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
122
|
+
unless validator.valid?(code)
|
|
123
|
+
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
124
|
+
end
|
|
125
|
+
@code = code
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
error == o.error &&
|
|
134
|
+
code == o.code
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[error, code].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Meta (facebook, instagram) and LinkedIn.
|
|
17
|
+
# Meta (facebook, instagram) and LinkedIn. Creates a single VIDEO ad. Mutually exclusive with `imageUrl`. Supply `url` to upload a file, or `id` to reuse a video already on the ad account (list them with GET /v1/ads/videos). Works on the single-ad and attach (`adSetId`) shapes; for Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB.
|
|
18
18
|
class CreateStandaloneAdRequestVideo < ApiModelBase
|
|
19
19
|
# Public URL of the video. Meta: uploaded via chunked transfer on /act_X/advideos, then the request blocks on Meta's transcoding until status.video_status === 'ready'. LinkedIn: uploaded via the Videos API (multipart), then the request blocks until LinkedIn finishes transcoding (status AVAILABLE) — short clips take ~10-30s. Provide either `url` or `id`.
|
|
20
20
|
attr_accessor :url
|
|
@@ -0,0 +1,167 @@
|
|
|
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 ListAdVideos200Response < ApiModelBase
|
|
18
|
+
attr_accessor :ad_account_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :data
|
|
21
|
+
|
|
22
|
+
attr_accessor :paging
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'ad_account_id' => :'adAccountId',
|
|
28
|
+
:'data' => :'data',
|
|
29
|
+
:'paging' => :'paging'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'ad_account_id' => :'String',
|
|
47
|
+
:'data' => :'Array<Object>',
|
|
48
|
+
:'paging' => :'GetAdsActivityLog200ResponsePaging'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListAdVideos200Response` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListAdVideos200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'ad_account_id')
|
|
75
|
+
self.ad_account_id = attributes[:'ad_account_id']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'data')
|
|
79
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
80
|
+
self.data = value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'paging')
|
|
85
|
+
self.paging = attributes[:'paging']
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
90
|
+
# @return Array for valid properties with the reasons
|
|
91
|
+
def list_invalid_properties
|
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
93
|
+
invalid_properties = Array.new
|
|
94
|
+
invalid_properties
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Check to see if the all the properties in the model are valid
|
|
98
|
+
# @return true if the model is valid
|
|
99
|
+
def valid?
|
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
101
|
+
true
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
ad_account_id == o.ad_account_id &&
|
|
110
|
+
data == o.data &&
|
|
111
|
+
paging == o.paging
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# @see the `==` method
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def eql?(o)
|
|
117
|
+
self == o
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Calculates hash code according to all attributes.
|
|
121
|
+
# @return [Integer] Hash code
|
|
122
|
+
def hash
|
|
123
|
+
[ad_account_id, data, paging].hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Builds the object from hash
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
# @return [Object] Returns the model itself
|
|
129
|
+
def self.build_from_hash(attributes)
|
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
+
transformed_hash = {}
|
|
133
|
+
openapi_types.each_pair do |key, type|
|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = nil
|
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
137
|
+
# check to ensure the input is an array given that the attribute
|
|
138
|
+
# is documented as an array but the input is not
|
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
|
+
end
|
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
new(transformed_hash)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Returns the object in the form of hash
|
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
|
151
|
+
def to_hash
|
|
152
|
+
hash = {}
|
|
153
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
154
|
+
value = self.send(attr)
|
|
155
|
+
if value.nil?
|
|
156
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
157
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|
|
@@ -69,7 +69,10 @@ module Zernio
|
|
|
69
69
|
# Required for lookalike audiences
|
|
70
70
|
attr_accessor :ratio
|
|
71
71
|
|
|
72
|
-
#
|
|
72
|
+
# website only. Narrows the audience from all visitors to visitors of URLs containing this substring. Ignored when `rule` is supplied.
|
|
73
|
+
attr_accessor :url_contains
|
|
74
|
+
|
|
75
|
+
# Optional raw Meta rule, replacing the one we build. Omit it for all visitors of `pixelId`, or use `urlContains` for the common page-match case. For `website` this is Meta's Flexible Audience Rule and is VALIDATED before we call Meta: every entry in `inclusions.rules` (and `exclusions.rules`) must carry `event_sources`, `retention_seconds` AND `filter`. Meta rejects a rule missing any of the three with code 100 / subcode 1713098 (\"Invalid rule JSON format\"), so a bad shape is a 400 here instead. The pre-2018 flat shapes (`{url: ...}`, `{event: ...}`) are not accepted by Meta at all (subcode 1870029). Example, visitors of /checkout in the last 30 days: `{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"<pixelId>\",\"type\":\"pixel\"}],\"retention_seconds\":2592000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"url\",\"operator\":\"i_contains\",\"value\":\"/checkout\"}]}}]}}` Note Meta DERIVES `retention_days` from `retention_seconds` and stores `event_sources[].id` as a number, so a rule read back will not be byte-identical to the one you sent. For `meta_engagement` the rule is forwarded verbatim and NOT validated: that type has two dialects (the `video` source uses a legacy flat array), so no single schema covers both.
|
|
73
76
|
attr_accessor :rule
|
|
74
77
|
|
|
75
78
|
# Data source declaration for GDPR compliance (customer_list only)
|
|
@@ -119,6 +122,7 @@ module Zernio
|
|
|
119
122
|
:'source_audience_id' => :'sourceAudienceId',
|
|
120
123
|
:'country' => :'country',
|
|
121
124
|
:'ratio' => :'ratio',
|
|
125
|
+
:'url_contains' => :'urlContains',
|
|
122
126
|
:'rule' => :'rule',
|
|
123
127
|
:'customer_file_source' => :'customerFileSource'
|
|
124
128
|
}
|
|
@@ -156,6 +160,7 @@ module Zernio
|
|
|
156
160
|
:'source_audience_id' => :'String',
|
|
157
161
|
:'country' => :'String',
|
|
158
162
|
:'ratio' => :'Float',
|
|
163
|
+
:'url_contains' => :'String',
|
|
159
164
|
:'rule' => :'Object',
|
|
160
165
|
:'customer_file_source' => :'String'
|
|
161
166
|
}
|
|
@@ -273,6 +278,10 @@ module Zernio
|
|
|
273
278
|
self.ratio = attributes[:'ratio']
|
|
274
279
|
end
|
|
275
280
|
|
|
281
|
+
if attributes.key?(:'url_contains')
|
|
282
|
+
self.url_contains = attributes[:'url_contains']
|
|
283
|
+
end
|
|
284
|
+
|
|
276
285
|
if attributes.key?(:'rule')
|
|
277
286
|
self.rule = attributes[:'rule']
|
|
278
287
|
end
|
|
@@ -568,6 +577,7 @@ module Zernio
|
|
|
568
577
|
source_audience_id == o.source_audience_id &&
|
|
569
578
|
country == o.country &&
|
|
570
579
|
ratio == o.ratio &&
|
|
580
|
+
url_contains == o.url_contains &&
|
|
571
581
|
rule == o.rule &&
|
|
572
582
|
customer_file_source == o.customer_file_source
|
|
573
583
|
end
|
|
@@ -581,7 +591,7 @@ module Zernio
|
|
|
581
591
|
# Calculates hash code according to all attributes.
|
|
582
592
|
# @return [Integer] Hash code
|
|
583
593
|
def hash
|
|
584
|
-
[account_id, ad_account_id, name, description, type, match_rules, source_type, trigger, lookback_days, engagement_sources, companies, pixel_id, retention_days, engagement_source, source_id, event, source_audience_id, country, ratio, rule, customer_file_source].hash
|
|
594
|
+
[account_id, ad_account_id, name, description, type, match_rules, source_type, trigger, lookback_days, engagement_sources, companies, pixel_id, retention_days, engagement_source, source_id, event, source_audience_id, country, ratio, url_contains, rule, customer_file_source].hash
|
|
585
595
|
end
|
|
586
596
|
|
|
587
597
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -246,7 +246,9 @@ require 'zernio-sdk/models/create_high_demand_period_request'
|
|
|
246
246
|
require 'zernio-sdk/models/create_inbox_conversation201_response'
|
|
247
247
|
require 'zernio-sdk/models/create_inbox_conversation201_response_data'
|
|
248
248
|
require 'zernio-sdk/models/create_inbox_conversation400_response'
|
|
249
|
+
require 'zernio-sdk/models/create_inbox_conversation404_response'
|
|
249
250
|
require 'zernio-sdk/models/create_inbox_conversation422_response'
|
|
251
|
+
require 'zernio-sdk/models/create_inbox_conversation429_response'
|
|
250
252
|
require 'zernio-sdk/models/create_inbox_conversation_request'
|
|
251
253
|
require 'zernio-sdk/models/create_inbox_conversation_request_header_media'
|
|
252
254
|
require 'zernio-sdk/models/create_invite_token201_response'
|
|
@@ -876,6 +878,7 @@ require 'zernio-sdk/models/list_ad_keywords200_response'
|
|
|
876
878
|
require 'zernio-sdk/models/list_ad_keywords200_response_keywords_inner'
|
|
877
879
|
require 'zernio-sdk/models/list_ad_labels200_response'
|
|
878
880
|
require 'zernio-sdk/models/list_ad_studies200_response'
|
|
881
|
+
require 'zernio-sdk/models/list_ad_videos200_response'
|
|
879
882
|
require 'zernio-sdk/models/list_ads202_response'
|
|
880
883
|
require 'zernio-sdk/models/list_ads_business_centers200_response'
|
|
881
884
|
require 'zernio-sdk/models/list_api_keys200_response'
|
data/openapi.yaml
CHANGED
|
@@ -25335,9 +25335,16 @@ paths:
|
|
|
25335
25335
|
'403':
|
|
25336
25336
|
description: Inbox addon required or profile limit reached
|
|
25337
25337
|
'404':
|
|
25338
|
-
description: Account or recipient user not found
|
|
25338
|
+
description: 'Account or recipient user not found (Reddit: PARTICIPANT_NOT_FOUND when the u/username does not exist)'
|
|
25339
|
+
content:
|
|
25340
|
+
application/json:
|
|
25341
|
+
schema:
|
|
25342
|
+
type: object
|
|
25343
|
+
properties:
|
|
25344
|
+
error: { type: string }
|
|
25345
|
+
code: { type: string, enum: [account_not_found, PARTICIPANT_NOT_FOUND] }
|
|
25339
25346
|
'422':
|
|
25340
|
-
description: Recipient does not accept DMs from this account
|
|
25347
|
+
description: 'Recipient does not accept DMs from this account (X/Twitter), or does not accept private messages from you (Reddit)'
|
|
25341
25348
|
content:
|
|
25342
25349
|
application/json:
|
|
25343
25350
|
schema:
|
|
@@ -25346,7 +25353,14 @@ paths:
|
|
|
25346
25353
|
error: { type: string }
|
|
25347
25354
|
code: { type: string, enum: [DM_NOT_ALLOWED] }
|
|
25348
25355
|
'429':
|
|
25349
|
-
description: X API rate limit exceeded
|
|
25356
|
+
description: 'X API rate limit exceeded, or Reddit rate limit reached for this account'
|
|
25357
|
+
content:
|
|
25358
|
+
application/json:
|
|
25359
|
+
schema:
|
|
25360
|
+
type: object
|
|
25361
|
+
properties:
|
|
25362
|
+
error: { type: string }
|
|
25363
|
+
code: { type: string, enum: [rate_limited] }
|
|
25350
25364
|
/v1/inbox/conversations/search:
|
|
25351
25365
|
get:
|
|
25352
25366
|
x-resource-group: "messages"
|
|
@@ -41992,7 +42006,7 @@ paths:
|
|
|
41992
42006
|
square: { type: string, format: uri, description: "Square 1:1 marketing image URL (e.g. 1080x1080). Required for Google Display." }
|
|
41993
42007
|
video:
|
|
41994
42008
|
type: object
|
|
41995
|
-
description: "Meta (facebook, instagram) and LinkedIn.
|
|
42009
|
+
description: "Meta (facebook, instagram) and LinkedIn. Creates a single VIDEO ad. Mutually exclusive with `imageUrl`. Supply `url` to upload a file, or `id` to reuse a video already on the ad account (list them with GET /v1/ads/videos). Works on the single-ad and attach (`adSetId`) shapes; for Meta multi-creative, set `video` per entry inside `creatives[]` instead. For LinkedIn the video is uploaded to LinkedIn under the authoring Company Page (see `organizationId`) and the campaign format is set to SINGLE_VIDEO; LinkedIn ignores `thumbnailUrl` (it auto-generates the poster frame) — supply MP4 H.264/AAC, 3s-30min, 75KB-500MB."
|
|
41996
42010
|
properties:
|
|
41997
42011
|
url: { type: string, format: uri, description: "Public URL of the video. Meta: uploaded via chunked transfer on /act_X/advideos, then the request blocks on Meta's transcoding until status.video_status === 'ready'. LinkedIn: uploaded via the Videos API (multipart), then the request blocks until LinkedIn finishes transcoding (status AVAILABLE) — short clips take ~10-30s. Provide either `url` or `id`."}
|
|
41998
42012
|
id: { type: string, description: "Meta only. Reuse a video ALREADY uploaded to this ad account instead of re-uploading the file: pass the `videoId` returned by a previous create. Wins over `url`, so N ads that differ only in copy share one upload (`existingCreativeId` only covers the identical-copy case). Provide either `url` or `id`."}
|
|
@@ -43265,6 +43279,53 @@ paths:
|
|
|
43265
43279
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
43266
43280
|
'501': { description: Only supported on Meta (facebook/instagram) }
|
|
43267
43281
|
|
|
43282
|
+
/v1/ads/videos:
|
|
43283
|
+
get:
|
|
43284
|
+
x-resource-group: "ads"
|
|
43285
|
+
operationId: listAdVideos
|
|
43286
|
+
tags: ["Ad Creatives"]
|
|
43287
|
+
x-platforms: ["meta"]
|
|
43288
|
+
summary: Ad video library
|
|
43289
|
+
description: |-
|
|
43290
|
+
Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim.
|
|
43291
|
+
The default projection covers id, title, status, poster frames and length; `fields` is a
|
|
43292
|
+
raw-passthrough override. Any `id` here is reusable as `video.id` on the create
|
|
43293
|
+
endpoints, so N ads that differ only in copy share one upload.
|
|
43294
|
+
|
|
43295
|
+
This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another
|
|
43296
|
+
tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads.
|
|
43297
|
+
|
|
43298
|
+
Meta transcodes asynchronously, so a row is only usable once `status.video_status`
|
|
43299
|
+
reads `ready`. There is no upload operation here: upload by URL inline via `video.url`
|
|
43300
|
+
on POST /v1/ads/create.
|
|
43301
|
+
security:
|
|
43302
|
+
- bearerAuth: []
|
|
43303
|
+
parameters:
|
|
43304
|
+
- { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
|
|
43305
|
+
- { name: adAccountId, in: query, required: true, schema: { type: string }, description: "Meta ad account id (act_<n>)." }
|
|
43306
|
+
- { name: fields, in: query, schema: { type: string }, description: "Comma-separated Graph field override (supports nested {} projections)." }
|
|
43307
|
+
- { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 }, description: Rows per page }
|
|
43308
|
+
- { name: after, in: query, schema: { type: string }, description: "Cursor from paging.after of the previous page." }
|
|
43309
|
+
responses:
|
|
43310
|
+
'200':
|
|
43311
|
+
description: Ad videos (raw Meta shape)
|
|
43312
|
+
content:
|
|
43313
|
+
application/json:
|
|
43314
|
+
schema:
|
|
43315
|
+
type: object
|
|
43316
|
+
properties:
|
|
43317
|
+
adAccountId: { type: string }
|
|
43318
|
+
data:
|
|
43319
|
+
type: array
|
|
43320
|
+
items: { type: object, description: "Raw Meta ad video row (id, title, status, picture, thumbnails, length)." }
|
|
43321
|
+
paging:
|
|
43322
|
+
type: object
|
|
43323
|
+
properties:
|
|
43324
|
+
after: { type: [string, "null"], description: "Cursor for the next page; null when exhausted." }
|
|
43325
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
43326
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
43327
|
+
'501': { description: Only supported on Meta (facebook/instagram) }
|
|
43328
|
+
|
|
43268
43329
|
/v1/ads/interests:
|
|
43269
43330
|
get:
|
|
43270
43331
|
x-resource-group: "ads"
|
|
@@ -43836,7 +43897,36 @@ paths:
|
|
|
43836
43897
|
sourceAudienceId: { type: string, description: Required for lookalike audiences }
|
|
43837
43898
|
country: { type: string, description: "2-letter code, required for lookalike audiences" }
|
|
43838
43899
|
ratio: { type: number, minimum: 0.01, maximum: 0.20, description: Required for lookalike audiences }
|
|
43839
|
-
|
|
43900
|
+
urlContains:
|
|
43901
|
+
type: string
|
|
43902
|
+
description: |
|
|
43903
|
+
website only. Narrows the audience from all visitors to visitors of
|
|
43904
|
+
URLs containing this substring. Ignored when `rule` is supplied.
|
|
43905
|
+
rule:
|
|
43906
|
+
type: object
|
|
43907
|
+
description: |
|
|
43908
|
+
Optional raw Meta rule, replacing the one we build. Omit it for all
|
|
43909
|
+
visitors of `pixelId`, or use `urlContains` for the common page-match
|
|
43910
|
+
case.
|
|
43911
|
+
|
|
43912
|
+
For `website` this is Meta's Flexible Audience Rule and is VALIDATED
|
|
43913
|
+
before we call Meta: every entry in `inclusions.rules` (and
|
|
43914
|
+
`exclusions.rules`) must carry `event_sources`, `retention_seconds`
|
|
43915
|
+
AND `filter`. Meta rejects a rule missing any of the three with code
|
|
43916
|
+
100 / subcode 1713098 ("Invalid rule JSON format"), so a bad shape is
|
|
43917
|
+
a 400 here instead. The pre-2018 flat shapes (`{url: ...}`,
|
|
43918
|
+
`{event: ...}`) are not accepted by Meta at all (subcode 1870029).
|
|
43919
|
+
|
|
43920
|
+
Example, visitors of /checkout in the last 30 days:
|
|
43921
|
+
`{"inclusions":{"operator":"or","rules":[{"event_sources":[{"id":"<pixelId>","type":"pixel"}],"retention_seconds":2592000,"filter":{"operator":"and","filters":[{"field":"url","operator":"i_contains","value":"/checkout"}]}}]}}`
|
|
43922
|
+
|
|
43923
|
+
Note Meta DERIVES `retention_days` from `retention_seconds` and
|
|
43924
|
+
stores `event_sources[].id` as a number, so a rule read back will
|
|
43925
|
+
not be byte-identical to the one you sent.
|
|
43926
|
+
|
|
43927
|
+
For `meta_engagement` the rule is forwarded verbatim and NOT
|
|
43928
|
+
validated: that type has two dialects (the `video` source uses a
|
|
43929
|
+
legacy flat array), so no single schema covers both.
|
|
43840
43930
|
customerFileSource: { type: string, description: "Data source declaration for GDPR compliance (customer_list only)" }
|
|
43841
43931
|
- type: object
|
|
43842
43932
|
title: SavedTargetingAudience
|
|
@@ -154,6 +154,22 @@ describe 'AdCreativesApi' do
|
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
+
# unit tests for list_ad_videos
|
|
158
|
+
# Ad video library
|
|
159
|
+
# Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. There is no upload operation here: upload by URL inline via `video.url` on POST /v1/ads/create.
|
|
160
|
+
# @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
161
|
+
# @param ad_account_id Meta ad account id (act_<n>).
|
|
162
|
+
# @param [Hash] opts the optional parameters
|
|
163
|
+
# @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
|
|
164
|
+
# @option opts [Integer] :limit Rows per page
|
|
165
|
+
# @option opts [String] :after Cursor from paging.after of the previous page.
|
|
166
|
+
# @return [ListAdVideos200Response]
|
|
167
|
+
describe 'list_ad_videos test' do
|
|
168
|
+
it 'should work' do
|
|
169
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
157
173
|
# unit tests for update_ad_creative
|
|
158
174
|
# Rename a creative
|
|
159
175
|
# Renames a creative. Creatives are immutable on Meta beyond `name` — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/{adId} with `creative`).
|
|
@@ -0,0 +1,46 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::CreateInboxConversation404Response
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::CreateInboxConversation404Response do
|
|
21
|
+
#let(:instance) { Zernio::CreateInboxConversation404Response.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CreateInboxConversation404Response' do
|
|
24
|
+
it 'should create an instance of CreateInboxConversation404Response' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::CreateInboxConversation404Response)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "error"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "code"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["account_not_found", "PARTICIPANT_NOT_FOUND"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.code = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|