late-sdk 0.0.930 → 0.0.932
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 -2
- data/docs/AdCampaignsApi.md +6 -10
- data/docs/AdCreative.md +0 -4
- data/docs/AdCreativesApi.md +1 -1
- data/docs/BoostPostRequest.md +1 -1
- data/docs/ConnectApi.md +140 -0
- data/docs/CreateAdCreative201Response.md +1 -5
- data/docs/CreateAdCreativeRequest.md +2 -2
- data/docs/CreateStandaloneAdRequest.md +2 -2
- data/docs/CreateStandaloneAdRequestCreativesInner.md +0 -2
- data/docs/GetPageWebhookSubscription200Response.md +26 -0
- data/docs/ResyncPageWebhookSubscription200Response.md +28 -0
- data/docs/UpdateAdRequestCreative.md +2 -2
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +4 -7
- data/lib/zernio-sdk/api/ad_creatives_api.rb +2 -2
- data/lib/zernio-sdk/api/connect_api.rb +126 -0
- data/lib/zernio-sdk/models/ad_creative.rb +1 -42
- data/lib/zernio-sdk/models/boost_post_request.rb +1 -1
- data/lib/zernio-sdk/models/create_ad_creative201_response.rb +4 -44
- data/lib/zernio-sdk/models/create_ad_creative_request.rb +3 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +3 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request_creatives_inner.rb +1 -11
- data/lib/zernio-sdk/models/get_page_webhook_subscription200_response.rb +189 -0
- data/lib/zernio-sdk/models/resync_page_webhook_subscription200_response.rb +195 -0
- data/lib/zernio-sdk/models/update_ad_request_creative.rb +4 -3
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +2 -2
- data/openapi.yaml +94 -71
- data/spec/api/ad_campaigns_api_spec.rb +2 -3
- data/spec/api/ad_creatives_api_spec.rb +1 -1
- data/spec/api/connect_api_spec.rb +24 -0
- data/spec/models/ad_creative_spec.rb +0 -12
- data/spec/models/create_ad_creative201_response_spec.rb +0 -12
- data/spec/models/create_standalone_ad_request_creatives_inner_spec.rb +0 -6
- data/spec/models/{meta_promotion_spec.rb → get_page_webhook_subscription200_response_spec.rb} +11 -15
- data/spec/models/resync_page_webhook_subscription200_response_spec.rb +66 -0
- data/zernio-sdk-0.0.932.gem +0 -0
- metadata +10 -10
- data/docs/MetaPromotion.md +0 -26
- data/docs/MetaPromotionStatus.md +0 -15
- data/lib/zernio-sdk/models/meta_promotion.rb +0 -275
- data/lib/zernio-sdk/models/meta_promotion_status.rb +0 -41
- data/spec/models/meta_promotion_status_spec.rb +0 -30
- data/zernio-sdk-0.0.930.gem +0 -0
|
@@ -1364,6 +1364,69 @@ module Zernio
|
|
|
1364
1364
|
return data, status_code, headers
|
|
1365
1365
|
end
|
|
1366
1366
|
|
|
1367
|
+
# Read a Facebook Page's webhook subscription
|
|
1368
|
+
# Returns the webhook fields Zernio's app is subscribed to on the connected Page, read live from Meta. Use it to confirm `leadgen` is present: a Page missing it keeps delivering every other event while lead ads stop arriving, with nothing to indicate it.
|
|
1369
|
+
# @param account_id [String]
|
|
1370
|
+
# @param [Hash] opts the optional parameters
|
|
1371
|
+
# @return [GetPageWebhookSubscription200Response]
|
|
1372
|
+
def get_page_webhook_subscription(account_id, opts = {})
|
|
1373
|
+
data, _status_code, _headers = get_page_webhook_subscription_with_http_info(account_id, opts)
|
|
1374
|
+
data
|
|
1375
|
+
end
|
|
1376
|
+
|
|
1377
|
+
# Read a Facebook Page's webhook subscription
|
|
1378
|
+
# Returns the webhook fields Zernio's app is subscribed to on the connected Page, read live from Meta. Use it to confirm `leadgen` is present: a Page missing it keeps delivering every other event while lead ads stop arriving, with nothing to indicate it.
|
|
1379
|
+
# @param account_id [String]
|
|
1380
|
+
# @param [Hash] opts the optional parameters
|
|
1381
|
+
# @return [Array<(GetPageWebhookSubscription200Response, Integer, Hash)>] GetPageWebhookSubscription200Response data, response status code and response headers
|
|
1382
|
+
def get_page_webhook_subscription_with_http_info(account_id, opts = {})
|
|
1383
|
+
if @api_client.config.debugging
|
|
1384
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.get_page_webhook_subscription ...'
|
|
1385
|
+
end
|
|
1386
|
+
# verify the required parameter 'account_id' is set
|
|
1387
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
1388
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_page_webhook_subscription"
|
|
1389
|
+
end
|
|
1390
|
+
# resource path
|
|
1391
|
+
local_var_path = '/v1/accounts/{accountId}/webhook-subscription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
1392
|
+
|
|
1393
|
+
# query parameters
|
|
1394
|
+
query_params = opts[:query_params] || {}
|
|
1395
|
+
|
|
1396
|
+
# header parameters
|
|
1397
|
+
header_params = opts[:header_params] || {}
|
|
1398
|
+
# HTTP header 'Accept' (if needed)
|
|
1399
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1400
|
+
|
|
1401
|
+
# form parameters
|
|
1402
|
+
form_params = opts[:form_params] || {}
|
|
1403
|
+
|
|
1404
|
+
# http body (model)
|
|
1405
|
+
post_body = opts[:debug_body]
|
|
1406
|
+
|
|
1407
|
+
# return_type
|
|
1408
|
+
return_type = opts[:debug_return_type] || 'GetPageWebhookSubscription200Response'
|
|
1409
|
+
|
|
1410
|
+
# auth_names
|
|
1411
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1412
|
+
|
|
1413
|
+
new_options = opts.merge(
|
|
1414
|
+
:operation => :"ConnectApi.get_page_webhook_subscription",
|
|
1415
|
+
:header_params => header_params,
|
|
1416
|
+
:query_params => query_params,
|
|
1417
|
+
:form_params => form_params,
|
|
1418
|
+
:body => post_body,
|
|
1419
|
+
:auth_names => auth_names,
|
|
1420
|
+
:return_type => return_type
|
|
1421
|
+
)
|
|
1422
|
+
|
|
1423
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1424
|
+
if @api_client.config.debugging
|
|
1425
|
+
@api_client.config.logger.debug "API called: ConnectApi#get_page_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1426
|
+
end
|
|
1427
|
+
return data, status_code, headers
|
|
1428
|
+
end
|
|
1429
|
+
|
|
1367
1430
|
# Get pending OAuth data
|
|
1368
1431
|
# Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. **Scope**: This endpoint is used for LinkedIn organizations, Google Business Profile locations, Slack channels, Snapchat profiles, and Pinterest boards, where the selection list is too large to fit in URL params. The redirect carries a `pendingDataToken` instead of the full payload; the response includes the corresponding selection array (e.g. `boards` for Pinterest). WhatsApp, Facebook and other platforms pass selection state directly via URL query params on the redirect (`profileId`, `tempToken`, `step`), no pending record is created, so this endpoint will return 404 for those flows. Use the platform-specific selection endpoint instead (e.g. `/v1/connect/whatsapp/select-phone-number`). Reading the token does not consume it, so this fetch is repeatable until the token expires 1 hour after issuance. Completing the platform selection deletes the pending record, so the token stops working from then on. No authentication required.
|
|
1369
1432
|
# @param token [String] The pending data token from the OAuth redirect URL (pendingDataToken parameter)
|
|
@@ -2775,6 +2838,69 @@ module Zernio
|
|
|
2775
2838
|
return data, status_code, headers
|
|
2776
2839
|
end
|
|
2777
2840
|
|
|
2841
|
+
# Re-subscribe a Facebook Page to Zernio's webhooks
|
|
2842
|
+
# Re-sends the full field set to Meta and returns the subscription read back afterwards. Meta only honours the field set sent at subscribe time, so a Page connected before a field existed stays without it until this runs. The response reflects what Meta actually granted, not what was requested.
|
|
2843
|
+
# @param account_id [String]
|
|
2844
|
+
# @param [Hash] opts the optional parameters
|
|
2845
|
+
# @return [ResyncPageWebhookSubscription200Response]
|
|
2846
|
+
def resync_page_webhook_subscription(account_id, opts = {})
|
|
2847
|
+
data, _status_code, _headers = resync_page_webhook_subscription_with_http_info(account_id, opts)
|
|
2848
|
+
data
|
|
2849
|
+
end
|
|
2850
|
+
|
|
2851
|
+
# Re-subscribe a Facebook Page to Zernio's webhooks
|
|
2852
|
+
# Re-sends the full field set to Meta and returns the subscription read back afterwards. Meta only honours the field set sent at subscribe time, so a Page connected before a field existed stays without it until this runs. The response reflects what Meta actually granted, not what was requested.
|
|
2853
|
+
# @param account_id [String]
|
|
2854
|
+
# @param [Hash] opts the optional parameters
|
|
2855
|
+
# @return [Array<(ResyncPageWebhookSubscription200Response, Integer, Hash)>] ResyncPageWebhookSubscription200Response data, response status code and response headers
|
|
2856
|
+
def resync_page_webhook_subscription_with_http_info(account_id, opts = {})
|
|
2857
|
+
if @api_client.config.debugging
|
|
2858
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.resync_page_webhook_subscription ...'
|
|
2859
|
+
end
|
|
2860
|
+
# verify the required parameter 'account_id' is set
|
|
2861
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
2862
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.resync_page_webhook_subscription"
|
|
2863
|
+
end
|
|
2864
|
+
# resource path
|
|
2865
|
+
local_var_path = '/v1/accounts/{accountId}/webhook-subscription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
2866
|
+
|
|
2867
|
+
# query parameters
|
|
2868
|
+
query_params = opts[:query_params] || {}
|
|
2869
|
+
|
|
2870
|
+
# header parameters
|
|
2871
|
+
header_params = opts[:header_params] || {}
|
|
2872
|
+
# HTTP header 'Accept' (if needed)
|
|
2873
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
2874
|
+
|
|
2875
|
+
# form parameters
|
|
2876
|
+
form_params = opts[:form_params] || {}
|
|
2877
|
+
|
|
2878
|
+
# http body (model)
|
|
2879
|
+
post_body = opts[:debug_body]
|
|
2880
|
+
|
|
2881
|
+
# return_type
|
|
2882
|
+
return_type = opts[:debug_return_type] || 'ResyncPageWebhookSubscription200Response'
|
|
2883
|
+
|
|
2884
|
+
# auth_names
|
|
2885
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
2886
|
+
|
|
2887
|
+
new_options = opts.merge(
|
|
2888
|
+
:operation => :"ConnectApi.resync_page_webhook_subscription",
|
|
2889
|
+
:header_params => header_params,
|
|
2890
|
+
:query_params => query_params,
|
|
2891
|
+
:form_params => form_params,
|
|
2892
|
+
:body => post_body,
|
|
2893
|
+
:auth_names => auth_names,
|
|
2894
|
+
:return_type => return_type
|
|
2895
|
+
)
|
|
2896
|
+
|
|
2897
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
2898
|
+
if @api_client.config.debugging
|
|
2899
|
+
@api_client.config.logger.debug "API called: ConnectApi#resync_page_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2900
|
+
end
|
|
2901
|
+
return data, status_code, headers
|
|
2902
|
+
end
|
|
2903
|
+
|
|
2778
2904
|
# Select Facebook page
|
|
2779
2905
|
# Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
|
|
2780
2906
|
# @param select_facebook_page_request [SelectFacebookPageRequest]
|
|
@@ -43,11 +43,6 @@ module Zernio
|
|
|
43
43
|
# Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads.
|
|
44
44
|
attr_accessor :video_url
|
|
45
45
|
|
|
46
|
-
# Meta offer read from the live creative on creation or GET /v1/ads/{adId}. Null when metadata is not returned or cannot be read. Requested values are never echoed as applied.
|
|
47
|
-
attr_accessor :promotion
|
|
48
|
-
|
|
49
|
-
attr_accessor :promotion_status
|
|
50
|
-
|
|
51
46
|
# Meta ad creative id backing this ad. Reusable via existingCreativeId on POST /v1/ads/create.
|
|
52
47
|
attr_accessor :creative_id
|
|
53
48
|
|
|
@@ -102,28 +97,6 @@ module Zernio
|
|
|
102
97
|
|
|
103
98
|
attr_accessor :pinterest_description
|
|
104
99
|
|
|
105
|
-
class EnumAttributeValidator
|
|
106
|
-
attr_reader :datatype
|
|
107
|
-
attr_reader :allowable_values
|
|
108
|
-
|
|
109
|
-
def initialize(datatype, allowable_values)
|
|
110
|
-
@allowable_values = allowable_values.map do |value|
|
|
111
|
-
case datatype.to_s
|
|
112
|
-
when /Integer/i
|
|
113
|
-
value.to_i
|
|
114
|
-
when /Float/i
|
|
115
|
-
value.to_f
|
|
116
|
-
else
|
|
117
|
-
value
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
def valid?(value)
|
|
123
|
-
!value || allowable_values.include?(value)
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
|
|
127
100
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
128
101
|
def self.attribute_map
|
|
129
102
|
{
|
|
@@ -136,8 +109,6 @@ module Zernio
|
|
|
136
109
|
:'image_url' => :'imageUrl',
|
|
137
110
|
:'video_id' => :'videoId',
|
|
138
111
|
:'video_url' => :'videoUrl',
|
|
139
|
-
:'promotion' => :'promotion',
|
|
140
|
-
:'promotion_status' => :'promotionStatus',
|
|
141
112
|
:'creative_id' => :'creativeId',
|
|
142
113
|
:'object_type' => :'objectType',
|
|
143
114
|
:'object_story_id' => :'objectStoryId',
|
|
@@ -182,8 +153,6 @@ module Zernio
|
|
|
182
153
|
:'image_url' => :'String',
|
|
183
154
|
:'video_id' => :'String',
|
|
184
155
|
:'video_url' => :'String',
|
|
185
|
-
:'promotion' => :'MetaPromotion',
|
|
186
|
-
:'promotion_status' => :'MetaPromotionStatus',
|
|
187
156
|
:'creative_id' => :'String',
|
|
188
157
|
:'object_type' => :'String',
|
|
189
158
|
:'object_story_id' => :'String',
|
|
@@ -281,14 +250,6 @@ module Zernio
|
|
|
281
250
|
self.video_url = attributes[:'video_url']
|
|
282
251
|
end
|
|
283
252
|
|
|
284
|
-
if attributes.key?(:'promotion')
|
|
285
|
-
self.promotion = attributes[:'promotion']
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
if attributes.key?(:'promotion_status')
|
|
289
|
-
self.promotion_status = attributes[:'promotion_status']
|
|
290
|
-
end
|
|
291
|
-
|
|
292
253
|
if attributes.key?(:'creative_id')
|
|
293
254
|
self.creative_id = attributes[:'creative_id']
|
|
294
255
|
end
|
|
@@ -474,8 +435,6 @@ module Zernio
|
|
|
474
435
|
image_url == o.image_url &&
|
|
475
436
|
video_id == o.video_id &&
|
|
476
437
|
video_url == o.video_url &&
|
|
477
|
-
promotion == o.promotion &&
|
|
478
|
-
promotion_status == o.promotion_status &&
|
|
479
438
|
creative_id == o.creative_id &&
|
|
480
439
|
object_type == o.object_type &&
|
|
481
440
|
object_story_id == o.object_story_id &&
|
|
@@ -506,7 +465,7 @@ module Zernio
|
|
|
506
465
|
# Calculates hash code according to all attributes.
|
|
507
466
|
# @return [Integer] Hash code
|
|
508
467
|
def hash
|
|
509
|
-
[asset_group, asset_group_resource_name, headlines, descriptions, final_urls, thumbnail_url, image_url, video_id, video_url,
|
|
468
|
+
[asset_group, asset_group_resource_name, headlines, descriptions, final_urls, thumbnail_url, image_url, video_id, video_url, creative_id, object_type, object_story_id, effective_object_story_id, page_id, effective_instagram_media_id, instagram_user_id, instagram_permalink_url, media_urls, is_serving, serving_hold_reasons, body, google_headline, google_description, link_url, whatsapp_phone_number, pinterest_image_url, pinterest_title, pinterest_description].hash
|
|
510
469
|
end
|
|
511
470
|
|
|
512
471
|
# Builds the object from hash
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
17
|
class BoostPostRequest < ApiModelBase
|
|
18
|
-
# 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
|
|
18
|
+
# 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 Advantage+ enhancement, not the Ads Manager Promotion setting. The deprecated standard_enhancements bundle is rejected by Meta.
|
|
19
19
|
attr_accessor :creative_features
|
|
20
20
|
|
|
21
21
|
# Zernio post ID (provide this or platformPostId)
|
|
@@ -20,39 +20,11 @@ module Zernio
|
|
|
20
20
|
# Platform creative id, reusable via existingCreativeId.
|
|
21
21
|
attr_accessor :creative_id
|
|
22
22
|
|
|
23
|
-
attr_accessor :promotion
|
|
24
|
-
|
|
25
|
-
attr_accessor :promotion_status
|
|
26
|
-
|
|
27
|
-
class EnumAttributeValidator
|
|
28
|
-
attr_reader :datatype
|
|
29
|
-
attr_reader :allowable_values
|
|
30
|
-
|
|
31
|
-
def initialize(datatype, allowable_values)
|
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
|
33
|
-
case datatype.to_s
|
|
34
|
-
when /Integer/i
|
|
35
|
-
value.to_i
|
|
36
|
-
when /Float/i
|
|
37
|
-
value.to_f
|
|
38
|
-
else
|
|
39
|
-
value
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def valid?(value)
|
|
45
|
-
!value || allowable_values.include?(value)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
24
|
def self.attribute_map
|
|
51
25
|
{
|
|
52
26
|
:'ad_account_id' => :'adAccountId',
|
|
53
|
-
:'creative_id' => :'creativeId'
|
|
54
|
-
:'promotion' => :'promotion',
|
|
55
|
-
:'promotion_status' => :'promotionStatus'
|
|
27
|
+
:'creative_id' => :'creativeId'
|
|
56
28
|
}
|
|
57
29
|
end
|
|
58
30
|
|
|
@@ -70,9 +42,7 @@ module Zernio
|
|
|
70
42
|
def self.openapi_types
|
|
71
43
|
{
|
|
72
44
|
:'ad_account_id' => :'String',
|
|
73
|
-
:'creative_id' => :'String'
|
|
74
|
-
:'promotion' => :'MetaPromotion',
|
|
75
|
-
:'promotion_status' => :'MetaPromotionStatus'
|
|
45
|
+
:'creative_id' => :'String'
|
|
76
46
|
}
|
|
77
47
|
end
|
|
78
48
|
|
|
@@ -105,14 +75,6 @@ module Zernio
|
|
|
105
75
|
if attributes.key?(:'creative_id')
|
|
106
76
|
self.creative_id = attributes[:'creative_id']
|
|
107
77
|
end
|
|
108
|
-
|
|
109
|
-
if attributes.key?(:'promotion')
|
|
110
|
-
self.promotion = attributes[:'promotion']
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
if attributes.key?(:'promotion_status')
|
|
114
|
-
self.promotion_status = attributes[:'promotion_status']
|
|
115
|
-
end
|
|
116
78
|
end
|
|
117
79
|
|
|
118
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -136,9 +98,7 @@ module Zernio
|
|
|
136
98
|
return true if self.equal?(o)
|
|
137
99
|
self.class == o.class &&
|
|
138
100
|
ad_account_id == o.ad_account_id &&
|
|
139
|
-
creative_id == o.creative_id
|
|
140
|
-
promotion == o.promotion &&
|
|
141
|
-
promotion_status == o.promotion_status
|
|
101
|
+
creative_id == o.creative_id
|
|
142
102
|
end
|
|
143
103
|
|
|
144
104
|
# @see the `==` method
|
|
@@ -150,7 +110,7 @@ module Zernio
|
|
|
150
110
|
# Calculates hash code according to all attributes.
|
|
151
111
|
# @return [Integer] Hash code
|
|
152
112
|
def hash
|
|
153
|
-
[ad_account_id, creative_id
|
|
113
|
+
[ad_account_id, creative_id].hash
|
|
154
114
|
end
|
|
155
115
|
|
|
156
116
|
# Builds the object from hash
|
|
@@ -45,9 +45,10 @@ module Zernio
|
|
|
45
45
|
# Appended to every outbound URL (e.g. utm_source=fb).
|
|
46
46
|
attr_accessor :url_tags
|
|
47
47
|
|
|
48
|
+
# Not supported. Meta validates creative_sourcing_spec.promotion_metadata_spec on the create call and then discards it, so a Promotion set through the Marketing API never reaches the creative. Any object is rejected with 400 invalid_field_value. Send null or omit the field, and set the Promotion on the ad in Ads Manager. Verified on 2026-09-11 across Graph v19.0 to v25.0 and every write path.
|
|
48
49
|
attr_accessor :promotion
|
|
49
50
|
|
|
50
|
-
# Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an enhancement
|
|
51
|
+
# Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting.
|
|
51
52
|
attr_accessor :creative_features
|
|
52
53
|
|
|
53
54
|
# 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, and Meta rejects it there.
|
|
@@ -119,7 +120,7 @@ module Zernio
|
|
|
119
120
|
:'image_hash' => :'String',
|
|
120
121
|
:'carousel_cards' => :'Array<CreateAdCreativeRequestCarouselCardsInner>',
|
|
121
122
|
:'url_tags' => :'String',
|
|
122
|
-
:'promotion' => :'
|
|
123
|
+
:'promotion' => :'Null',
|
|
123
124
|
:'creative_features' => :'Hash<String, String>',
|
|
124
125
|
:'multi_advertiser' => :'String'
|
|
125
126
|
}
|
|
@@ -47,9 +47,10 @@ module Zernio
|
|
|
47
47
|
# Meta only. The RESERVED prediction id the R&F ad set runs on (reserving mints a new id, so pass that one). Requires buyingType RESERVED.
|
|
48
48
|
attr_accessor :rf_prediction_id
|
|
49
49
|
|
|
50
|
+
# Not supported. Meta validates creative_sourcing_spec.promotion_metadata_spec on the create call and then discards it, so a Promotion set through the Marketing API never reaches the creative. Any object is rejected with 400 invalid_field_value. Send null or omit the field, and set the Promotion on the ad in Ads Manager. Verified on 2026-09-11 across Graph v19.0 to v25.0 and every write path.
|
|
50
51
|
attr_accessor :promotion
|
|
51
52
|
|
|
52
|
-
# Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an enhancement
|
|
53
|
+
# Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting.
|
|
53
54
|
attr_accessor :creative_features
|
|
54
55
|
|
|
55
56
|
# 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, and Meta rejects it there.
|
|
@@ -468,7 +469,7 @@ module Zernio
|
|
|
468
469
|
:'billing_event' => :'String',
|
|
469
470
|
:'buying_type' => :'String',
|
|
470
471
|
:'rf_prediction_id' => :'String',
|
|
471
|
-
:'promotion' => :'
|
|
472
|
+
:'promotion' => :'Null',
|
|
472
473
|
:'creative_features' => :'Hash<String, String>',
|
|
473
474
|
:'multi_advertiser' => :'String',
|
|
474
475
|
:'validate_only' => :'Boolean',
|
|
@@ -16,9 +16,6 @@ require 'time'
|
|
|
16
16
|
module Zernio
|
|
17
17
|
# Each creative must supply EXACTLY ONE of `imageUrl` (image creative) or `video` (video creative).
|
|
18
18
|
class CreateStandaloneAdRequestCreativesInner < ApiModelBase
|
|
19
|
-
# Overrides the top-level offer for this item. Omit to inherit; null disables the inherited offer.
|
|
20
|
-
attr_accessor :promotion
|
|
21
|
-
|
|
22
19
|
# Replaces the entire top-level creativeFeatures map for this item. Omit to inherit; an empty map clears these defaults.
|
|
23
20
|
attr_accessor :creative_features
|
|
24
21
|
|
|
@@ -66,7 +63,6 @@ module Zernio
|
|
|
66
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
67
64
|
def self.attribute_map
|
|
68
65
|
{
|
|
69
|
-
:'promotion' => :'promotion',
|
|
70
66
|
:'creative_features' => :'creativeFeatures',
|
|
71
67
|
:'name' => :'name',
|
|
72
68
|
:'headline' => :'headline',
|
|
@@ -92,7 +88,6 @@ module Zernio
|
|
|
92
88
|
# Attribute type mapping.
|
|
93
89
|
def self.openapi_types
|
|
94
90
|
{
|
|
95
|
-
:'promotion' => :'MetaPromotion',
|
|
96
91
|
:'creative_features' => :'Hash<String, String>',
|
|
97
92
|
:'name' => :'String',
|
|
98
93
|
:'headline' => :'String',
|
|
@@ -127,10 +122,6 @@ module Zernio
|
|
|
127
122
|
h[k.to_sym] = v
|
|
128
123
|
}
|
|
129
124
|
|
|
130
|
-
if attributes.key?(:'promotion')
|
|
131
|
-
self.promotion = attributes[:'promotion']
|
|
132
|
-
end
|
|
133
|
-
|
|
134
125
|
if attributes.key?(:'creative_features')
|
|
135
126
|
if (value = attributes[:'creative_features']).is_a?(Hash)
|
|
136
127
|
self.creative_features = value
|
|
@@ -307,7 +298,6 @@ module Zernio
|
|
|
307
298
|
def ==(o)
|
|
308
299
|
return true if self.equal?(o)
|
|
309
300
|
self.class == o.class &&
|
|
310
|
-
promotion == o.promotion &&
|
|
311
301
|
creative_features == o.creative_features &&
|
|
312
302
|
name == o.name &&
|
|
313
303
|
headline == o.headline &&
|
|
@@ -328,7 +318,7 @@ module Zernio
|
|
|
328
318
|
# Calculates hash code according to all attributes.
|
|
329
319
|
# @return [Integer] Hash code
|
|
330
320
|
def hash
|
|
331
|
-
[
|
|
321
|
+
[creative_features, name, headline, body, description, image_url, video, link_url, call_to_action].hash
|
|
332
322
|
end
|
|
333
323
|
|
|
334
324
|
# Builds the object from hash
|
|
@@ -0,0 +1,189 @@
|
|
|
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 GetPageWebhookSubscription200Response < ApiModelBase
|
|
18
|
+
attr_accessor :page_id
|
|
19
|
+
|
|
20
|
+
# False when the Page carries no subscription for our app at all.
|
|
21
|
+
attr_accessor :app_subscribed
|
|
22
|
+
|
|
23
|
+
# Whether lead ads submitted on this Page reach Zernio in real time.
|
|
24
|
+
attr_accessor :leadgen
|
|
25
|
+
|
|
26
|
+
attr_accessor :subscribed_fields
|
|
27
|
+
|
|
28
|
+
# Present only when leadgen is missing.
|
|
29
|
+
attr_accessor :warning
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'page_id' => :'pageId',
|
|
35
|
+
:'app_subscribed' => :'appSubscribed',
|
|
36
|
+
:'leadgen' => :'leadgen',
|
|
37
|
+
:'subscribed_fields' => :'subscribedFields',
|
|
38
|
+
:'warning' => :'warning'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'page_id' => :'String',
|
|
56
|
+
:'app_subscribed' => :'Boolean',
|
|
57
|
+
:'leadgen' => :'Boolean',
|
|
58
|
+
:'subscribed_fields' => :'Array<String>',
|
|
59
|
+
:'warning' => :'String'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# List of attributes with nullable: true
|
|
64
|
+
def self.openapi_nullable
|
|
65
|
+
Set.new([
|
|
66
|
+
:'warning'
|
|
67
|
+
])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Initializes the object
|
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
if (!attributes.is_a?(Hash))
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetPageWebhookSubscription200Response` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetPageWebhookSubscription200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'page_id')
|
|
87
|
+
self.page_id = attributes[:'page_id']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'app_subscribed')
|
|
91
|
+
self.app_subscribed = attributes[:'app_subscribed']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'leadgen')
|
|
95
|
+
self.leadgen = attributes[:'leadgen']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'subscribed_fields')
|
|
99
|
+
if (value = attributes[:'subscribed_fields']).is_a?(Array)
|
|
100
|
+
self.subscribed_fields = value
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'warning')
|
|
105
|
+
self.warning = attributes[:'warning']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
true
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Checks equality by comparing each attribute.
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def ==(o)
|
|
127
|
+
return true if self.equal?(o)
|
|
128
|
+
self.class == o.class &&
|
|
129
|
+
page_id == o.page_id &&
|
|
130
|
+
app_subscribed == o.app_subscribed &&
|
|
131
|
+
leadgen == o.leadgen &&
|
|
132
|
+
subscribed_fields == o.subscribed_fields &&
|
|
133
|
+
warning == o.warning
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# @see the `==` method
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def eql?(o)
|
|
139
|
+
self == o
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Calculates hash code according to all attributes.
|
|
143
|
+
# @return [Integer] Hash code
|
|
144
|
+
def hash
|
|
145
|
+
[page_id, app_subscribed, leadgen, subscribed_fields, warning].hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def self.build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
154
|
+
transformed_hash = {}
|
|
155
|
+
openapi_types.each_pair do |key, type|
|
|
156
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = nil
|
|
158
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
162
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
163
|
+
end
|
|
164
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
165
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
new(transformed_hash)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns the object in the form of hash
|
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
|
173
|
+
def to_hash
|
|
174
|
+
hash = {}
|
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
176
|
+
value = self.send(attr)
|
|
177
|
+
if value.nil?
|
|
178
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
179
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
hash[param] = _to_hash(value)
|
|
183
|
+
end
|
|
184
|
+
hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|