late-sdk 0.0.658 → 0.0.660
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 +16 -0
- data/docs/AdAccountsApi.md +364 -0
- data/docs/AdCampaignsApi.md +1 -1
- data/docs/BoostPostRequest.md +3 -1
- data/docs/CreateStandaloneAdRequest.md +4 -0
- data/docs/CreateValueRuleSet201Response.md +20 -0
- data/docs/CreateValueRuleSetRequest.md +24 -0
- data/docs/DeleteValueRuleSet200Response.md +20 -0
- data/docs/GetValueRuleSet200Response.md +18 -0
- data/docs/ListValueRuleSets200Response.md +22 -0
- data/docs/ListValueRuleSets200ResponsePaging.md +18 -0
- data/docs/UpdateAdSetRequest.md +4 -0
- data/docs/UpdateValueRuleSet200Response.md +24 -0
- data/docs/UpdateValueRuleSetRequest.md +22 -0
- data/docs/ValueRule.md +28 -0
- data/docs/ValueRuleCriterion.md +26 -0
- data/docs/ValueRuleSet.md +22 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +367 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +2 -2
- data/lib/zernio-sdk/models/boost_post_request.rb +14 -4
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +42 -1
- data/lib/zernio-sdk/models/create_value_rule_set201_response.rb +158 -0
- data/lib/zernio-sdk/models/create_value_rule_set_request.rb +283 -0
- data/lib/zernio-sdk/models/delete_value_rule_set200_response.rb +156 -0
- data/lib/zernio-sdk/models/get_value_rule_set200_response.rb +147 -0
- data/lib/zernio-sdk/models/list_value_rule_sets200_response.rb +167 -0
- data/lib/zernio-sdk/models/list_value_rule_sets200_response_paging.rb +149 -0
- data/lib/zernio-sdk/models/update_ad_set_request.rb +42 -1
- data/lib/zernio-sdk/models/update_value_rule_set200_response.rb +176 -0
- data/lib/zernio-sdk/models/update_value_rule_set_request.rb +257 -0
- data/lib/zernio-sdk/models/value_rule.rb +346 -0
- data/lib/zernio-sdk/models/value_rule_criterion.rb +305 -0
- data/lib/zernio-sdk/models/value_rule_set.rb +221 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +11 -0
- data/openapi.yaml +406 -3
- data/spec/api/ad_accounts_api_spec.rb +66 -0
- data/spec/api/ad_campaigns_api_spec.rb +1 -1
- data/spec/models/boost_post_request_spec.rb +6 -0
- data/spec/models/create_standalone_ad_request_spec.rb +12 -0
- data/spec/models/create_value_rule_set201_response_spec.rb +42 -0
- data/spec/models/create_value_rule_set_request_spec.rb +54 -0
- data/spec/models/delete_value_rule_set200_response_spec.rb +42 -0
- data/spec/models/get_value_rule_set200_response_spec.rb +36 -0
- data/spec/models/list_value_rule_sets200_response_paging_spec.rb +36 -0
- data/spec/models/list_value_rule_sets200_response_spec.rb +48 -0
- data/spec/models/update_ad_set_request_spec.rb +12 -0
- data/spec/models/update_value_rule_set200_response_spec.rb +54 -0
- data/spec/models/update_value_rule_set_request_spec.rb +48 -0
- data/spec/models/value_rule_criterion_spec.rb +68 -0
- data/spec/models/value_rule_set_spec.rb +48 -0
- data/spec/models/value_rule_spec.rb +70 -0
- data/zernio-sdk-0.0.660.gem +0 -0
- metadata +46 -2
- data/zernio-sdk-0.0.658.gem +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Zernio::ListValueRuleSets200ResponsePaging
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **after** | **String** | Cursor for the next page; null when exhausted or when Meta omits paging. | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'zernio-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Zernio::ListValueRuleSets200ResponsePaging.new(
|
|
15
|
+
after: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
data/docs/UpdateAdSetRequest.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
| **bid_strategy** | [**BidStrategy**](BidStrategy.md) | Ad-set-level bid strategy. Overrides the campaign-level default. Supported on Meta (facebook, instagram), TikTok, and OpenAI. On TikTok the Meta-style enum is mapped to bid_type / bid_price / deep_bid_type automatically. On OpenAI, LOWEST_COST_WITH_BID_CAP and COST_CAP both map to the ad group's `bidding_config.max_bid_micros` (one knob covers both); LOWEST_COST_WITH_MIN_ROAS is rejected with 422 (OpenAI has no ROAS-based bidding). Other platforms (linkedin, pinterest, google, twitter) return 501 Not Implemented when bidStrategy is set. | [optional] |
|
|
12
12
|
| **bid_amount** | **Float** | Bid cap in WHOLE currency units (USD: 5 = $5.00; JPY: 100 = ¥100). Required when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. Internally converted to Meta's smallest-denomination integer, or (on OpenAI) to micros (× 1,000,000). | [optional] |
|
|
13
13
|
| **roas_average_floor** | **Float** | Minimum ROAS as a decimal multiplier (2.0 = 2.0x). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. Sent to Meta as `bid_constraints.roas_average_floor` × 10000. Not supported on OpenAI (422). | [optional] |
|
|
14
|
+
| **value_rule_set_id** | **String** | Meta only (other platforms return 501). Value rule set to attach to this ad set, from `/v1/ads/value-rule-sets`. Sending a different id replaces the current association. To DETACH, send `valueRulesApplied: false` and omit this field. | [optional] |
|
|
15
|
+
| **value_rules_applied** | **Boolean** | Meta only (other platforms return 501). `false` DETACHES the ad set's value rule set and must be sent WITHOUT `valueRuleSetId`; the combination returns 400. `true` is optional when attaching, since attachment is driven by `valueRuleSetId`, and requires it to be present. | [optional] |
|
|
14
16
|
| **platform_specific_data** | [**UpdateAdSetRequestPlatformSpecificData**](UpdateAdSetRequestPlatformSpecificData.md) | | [optional] |
|
|
15
17
|
|
|
16
18
|
## Example
|
|
@@ -26,6 +28,8 @@ instance = Zernio::UpdateAdSetRequest.new(
|
|
|
26
28
|
bid_strategy: null,
|
|
27
29
|
bid_amount: null,
|
|
28
30
|
roas_average_floor: null,
|
|
31
|
+
value_rule_set_id: null,
|
|
32
|
+
value_rules_applied: null,
|
|
29
33
|
platform_specific_data: null
|
|
30
34
|
)
|
|
31
35
|
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::UpdateValueRuleSet200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **value_rule_set_id** | **String** | | [optional] |
|
|
8
|
+
| **name** | **String** | | [optional] |
|
|
9
|
+
| **rules** | [**Array<ValueRule>**](ValueRule.md) | | [optional] |
|
|
10
|
+
| **message** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::UpdateValueRuleSet200Response.new(
|
|
18
|
+
value_rule_set_id: null,
|
|
19
|
+
name: null,
|
|
20
|
+
rules: null,
|
|
21
|
+
message: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::UpdateValueRuleSetRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
|
|
8
|
+
| **name** | **String** | Required: the update replaces the whole set. | |
|
|
9
|
+
| **rules** | [**Array<ValueRule>**](ValueRule.md) | The COMPLETE rule list. Omitting a rule deletes it on Meta. | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::UpdateValueRuleSetRequest.new(
|
|
17
|
+
account_id: null,
|
|
18
|
+
name: null,
|
|
19
|
+
rules: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/ValueRule.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Zernio::ValueRule
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Platform rule id. Echo it on `PUT` to KEEP this rule, omit it to CREATE a new one. A rule left out of the array entirely is DELETED. | [optional] |
|
|
8
|
+
| **name** | **String** | | |
|
|
9
|
+
| **adjust_sign** | **String** | Direction of the adjustment. There is no signed value field. | |
|
|
10
|
+
| **adjust_value** | **Integer** | Unsigned percentage magnitude. `INCREASE` accepts 1-1000, `DECREASE` accepts 1-90. 0 is out of range on both. | |
|
|
11
|
+
| **status** | **String** | Meta returns `ACTIVE` here but documents no enum for the field. Treat it as a passthrough: echo whatever the `GET` returned, and do not synthesize values. | [optional] |
|
|
12
|
+
| **criteria** | [**Array<ValueRuleCriterion>**](ValueRuleCriterion.md) | All criteria on a rule must match for the rule to fire. | |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'zernio-sdk'
|
|
18
|
+
|
|
19
|
+
instance = Zernio::ValueRule.new(
|
|
20
|
+
id: null,
|
|
21
|
+
name: null,
|
|
22
|
+
adjust_sign: null,
|
|
23
|
+
adjust_value: null,
|
|
24
|
+
status: null,
|
|
25
|
+
criteria: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zernio::ValueRuleCriterion
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Platform criterion id. Echo it on `PUT` to KEEP this criterion, omit it to CREATE a new one. A criterion left out of the array entirely is DELETED. | [optional] |
|
|
8
|
+
| **criteria_type** | **String** | The dimension being matched. `OMNI_CHANNEL` (conversion location: APP, INSTANT_FORM, PHONE_CALL, WEBSITE) is accepted even though Meta's own enum table omits it. | |
|
|
9
|
+
| **operator** | **String** | Required on every criterion. `CONTAINS` is currently the only value Meta supports. | |
|
|
10
|
+
| **criteria_values** | **Array<String>** | The values to match. `AGE` takes ranges such as `18-24`, `18+` or a custom `18-26`; a range whose upper bound is 65 is NOT allowed (use `18+` instead of `18-65`). `LOCATION` takes Targeting-Search keys: a two-letter country code for `LOCATION_COUNTRY`, a numeric key for region / city / comScore market. `AUDIENCE_LABEL` takes labels such as `HIGH_VALUE`, which are applied to a Custom Audience in Ads Manager: there is no API to provision them, so they are passed through unvalidated. | |
|
|
11
|
+
| **criteria_value_types** | **Array<String>** | One entry per `criteriaValues` entry, in the same order. The literal `\"NONE\"` for every criteriaType except `LOCATION`, which uses `LOCATION_COUNTRY`, `LOCATION_REGION`, `LOCATION_CITY` or `LOCATION_COMSCORE_MARKET` and MAY mix them within one criterion. `LOCATION_DMA` was replaced by `LOCATION_COMSCORE_MARKET` on 2026-06-22 and is rejected by this API. | |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'zernio-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Zernio::ValueRuleCriterion.new(
|
|
19
|
+
id: null,
|
|
20
|
+
criteria_type: null,
|
|
21
|
+
operator: null,
|
|
22
|
+
criteria_values: null,
|
|
23
|
+
criteria_value_types: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::ValueRuleSet
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Platform value rule set id. | |
|
|
8
|
+
| **name** | **String** | | |
|
|
9
|
+
| **rules** | [**Array<ValueRule>**](ValueRule.md) | Evaluated in order; the first matching rule wins. | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::ValueRuleSet.new(
|
|
17
|
+
id: null,
|
|
18
|
+
name: null,
|
|
19
|
+
rules: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -19,6 +19,144 @@ module Zernio
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Create a value rule set
|
|
23
|
+
# Creates a value rule set on the ad account (Meta's `POST /act_X/value_rule_set`). Attach the returned id to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or `PUT /v1/ads/ad-sets/{adSetId}`. **Rule order is semantic**: rules are evaluated in array order and only the first matching rule adjusts the bid for an overlapping audience. `adjustValue` is an unsigned magnitude in percent; the direction lives in `adjustSign`. `INCREASE` accepts 1-1000, `DECREASE` accepts 1-90. There is no signed field and 0 is out of range. `criteriaValueTypes` is positionally paired with `criteriaValues` (same length, same order). Every type is the literal `\"NONE\"` except on `LOCATION`, which uses `LOCATION_COUNTRY` / `LOCATION_REGION` / `LOCATION_CITY` / `LOCATION_COMSCORE_MARKET` and may mix them within one criterion. Location values are Targeting-Search keys: a two-letter country code for `LOCATION_COUNTRY`, a numeric key for the rest. `LOCATION_DMA` was replaced by `LOCATION_COMSCORE_MARKET` on 2026-06-22 and rules using DMAs are no longer active, so this API rejects it. `AUDIENCE_LABEL` values (e.g. `HIGH_VALUE`) are applied to a Custom Audience in Ads Manager. There is no API to provision them, so label strings are passed through unvalidated and a typo produces a rule that never fires. Ads Manager turns a rule set read-only (this API stays editable) when a rule uses more than 2 criteria, a custom age range, or the placements `FB_MARKETPLACE`, `FB_SEARCH`, `FB_VIDEO` or `IG_EXPLORE`. Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule. The per-account cap is enforced by Meta, not here.
|
|
24
|
+
# @param create_value_rule_set_request [CreateValueRuleSetRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [CreateValueRuleSet201Response]
|
|
27
|
+
def create_value_rule_set(create_value_rule_set_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_value_rule_set_with_http_info(create_value_rule_set_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create a value rule set
|
|
33
|
+
# Creates a value rule set on the ad account (Meta's `POST /act_X/value_rule_set`). Attach the returned id to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or `PUT /v1/ads/ad-sets/{adSetId}`. **Rule order is semantic**: rules are evaluated in array order and only the first matching rule adjusts the bid for an overlapping audience. `adjustValue` is an unsigned magnitude in percent; the direction lives in `adjustSign`. `INCREASE` accepts 1-1000, `DECREASE` accepts 1-90. There is no signed field and 0 is out of range. `criteriaValueTypes` is positionally paired with `criteriaValues` (same length, same order). Every type is the literal `\"NONE\"` except on `LOCATION`, which uses `LOCATION_COUNTRY` / `LOCATION_REGION` / `LOCATION_CITY` / `LOCATION_COMSCORE_MARKET` and may mix them within one criterion. Location values are Targeting-Search keys: a two-letter country code for `LOCATION_COUNTRY`, a numeric key for the rest. `LOCATION_DMA` was replaced by `LOCATION_COMSCORE_MARKET` on 2026-06-22 and rules using DMAs are no longer active, so this API rejects it. `AUDIENCE_LABEL` values (e.g. `HIGH_VALUE`) are applied to a Custom Audience in Ads Manager. There is no API to provision them, so label strings are passed through unvalidated and a typo produces a rule that never fires. Ads Manager turns a rule set read-only (this API stays editable) when a rule uses more than 2 criteria, a custom age range, or the placements `FB_MARKETPLACE`, `FB_SEARCH`, `FB_VIDEO` or `IG_EXPLORE`. Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule. The per-account cap is enforced by Meta, not here.
|
|
34
|
+
# @param create_value_rule_set_request [CreateValueRuleSetRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(CreateValueRuleSet201Response, Integer, Hash)>] CreateValueRuleSet201Response data, response status code and response headers
|
|
37
|
+
def create_value_rule_set_with_http_info(create_value_rule_set_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AdAccountsApi.create_value_rule_set ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_value_rule_set_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_value_rule_set_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_value_rule_set_request' when calling AdAccountsApi.create_value_rule_set"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/ads/value-rule-sets'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_value_rule_set_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateValueRuleSet201Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"AdAccountsApi.create_value_rule_set",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: AdAccountsApi#create_value_rule_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Delete a value rule set
|
|
91
|
+
# Deletes the rule set (Meta's `POST /{value-rule-set-id}/delete_rule_set`, a custom action edge rather than an HTTP DELETE on its side). Ad sets pointing at it are not modified here; detach them first with `valueRulesApplied: false` on `PUT /v1/ads/ad-sets/{adSetId}`.
|
|
92
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
93
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @return [DeleteValueRuleSet200Response]
|
|
96
|
+
def delete_value_rule_set(value_rule_set_id, account_id, opts = {})
|
|
97
|
+
data, _status_code, _headers = delete_value_rule_set_with_http_info(value_rule_set_id, account_id, opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Delete a value rule set
|
|
102
|
+
# Deletes the rule set (Meta's `POST /{value-rule-set-id}/delete_rule_set`, a custom action edge rather than an HTTP DELETE on its side). Ad sets pointing at it are not modified here; detach them first with `valueRulesApplied: false` on `PUT /v1/ads/ad-sets/{adSetId}`.
|
|
103
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
104
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
105
|
+
# @param [Hash] opts the optional parameters
|
|
106
|
+
# @return [Array<(DeleteValueRuleSet200Response, Integer, Hash)>] DeleteValueRuleSet200Response data, response status code and response headers
|
|
107
|
+
def delete_value_rule_set_with_http_info(value_rule_set_id, account_id, opts = {})
|
|
108
|
+
if @api_client.config.debugging
|
|
109
|
+
@api_client.config.logger.debug 'Calling API: AdAccountsApi.delete_value_rule_set ...'
|
|
110
|
+
end
|
|
111
|
+
# verify the required parameter 'value_rule_set_id' is set
|
|
112
|
+
if @api_client.config.client_side_validation && value_rule_set_id.nil?
|
|
113
|
+
fail ArgumentError, "Missing the required parameter 'value_rule_set_id' when calling AdAccountsApi.delete_value_rule_set"
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'account_id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdAccountsApi.delete_value_rule_set"
|
|
118
|
+
end
|
|
119
|
+
# resource path
|
|
120
|
+
local_var_path = '/v1/ads/value-rule-sets/{valueRuleSetId}'.sub('{' + 'valueRuleSetId' + '}', CGI.escape(value_rule_set_id.to_s))
|
|
121
|
+
|
|
122
|
+
# query parameters
|
|
123
|
+
query_params = opts[:query_params] || {}
|
|
124
|
+
query_params[:'accountId'] = account_id
|
|
125
|
+
|
|
126
|
+
# header parameters
|
|
127
|
+
header_params = opts[:header_params] || {}
|
|
128
|
+
# HTTP header 'Accept' (if needed)
|
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
130
|
+
|
|
131
|
+
# form parameters
|
|
132
|
+
form_params = opts[:form_params] || {}
|
|
133
|
+
|
|
134
|
+
# http body (model)
|
|
135
|
+
post_body = opts[:debug_body]
|
|
136
|
+
|
|
137
|
+
# return_type
|
|
138
|
+
return_type = opts[:debug_return_type] || 'DeleteValueRuleSet200Response'
|
|
139
|
+
|
|
140
|
+
# auth_names
|
|
141
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
142
|
+
|
|
143
|
+
new_options = opts.merge(
|
|
144
|
+
:operation => :"AdAccountsApi.delete_value_rule_set",
|
|
145
|
+
:header_params => header_params,
|
|
146
|
+
:query_params => query_params,
|
|
147
|
+
:form_params => form_params,
|
|
148
|
+
:body => post_body,
|
|
149
|
+
:auth_names => auth_names,
|
|
150
|
+
:return_type => return_type
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug "API called: AdAccountsApi#delete_value_rule_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
156
|
+
end
|
|
157
|
+
return data, status_code, headers
|
|
158
|
+
end
|
|
159
|
+
|
|
22
160
|
# Ad account finances
|
|
23
161
|
# Finances of one Meta ad account: prepaid `balance`, lifetime `amountSpent`, account `spendCap` (null = no cap) and the `fundingSource`. Money values are converted from Meta's minor units to whole units of `currency`.
|
|
24
162
|
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
@@ -410,6 +548,76 @@ module Zernio
|
|
|
410
548
|
return data, status_code, headers
|
|
411
549
|
end
|
|
412
550
|
|
|
551
|
+
# Read a value rule set
|
|
552
|
+
# Reads one value rule set including every nested rule id and criterion id. This is step one of any edit: `PUT` is a full replace, so you need the ids before you can keep the objects you are not changing. Meta's own read returns `GENDER` values lowercase (`\"male\"`) while writes require `\"MALE\"`. Values are passed through untouched, so never case-compare a stored rule against a fetched one.
|
|
553
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
554
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
555
|
+
# @param [Hash] opts the optional parameters
|
|
556
|
+
# @return [GetValueRuleSet200Response]
|
|
557
|
+
def get_value_rule_set(value_rule_set_id, account_id, opts = {})
|
|
558
|
+
data, _status_code, _headers = get_value_rule_set_with_http_info(value_rule_set_id, account_id, opts)
|
|
559
|
+
data
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
# Read a value rule set
|
|
563
|
+
# Reads one value rule set including every nested rule id and criterion id. This is step one of any edit: `PUT` is a full replace, so you need the ids before you can keep the objects you are not changing. Meta's own read returns `GENDER` values lowercase (`\"male\"`) while writes require `\"MALE\"`. Values are passed through untouched, so never case-compare a stored rule against a fetched one.
|
|
564
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
565
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
566
|
+
# @param [Hash] opts the optional parameters
|
|
567
|
+
# @return [Array<(GetValueRuleSet200Response, Integer, Hash)>] GetValueRuleSet200Response data, response status code and response headers
|
|
568
|
+
def get_value_rule_set_with_http_info(value_rule_set_id, account_id, opts = {})
|
|
569
|
+
if @api_client.config.debugging
|
|
570
|
+
@api_client.config.logger.debug 'Calling API: AdAccountsApi.get_value_rule_set ...'
|
|
571
|
+
end
|
|
572
|
+
# verify the required parameter 'value_rule_set_id' is set
|
|
573
|
+
if @api_client.config.client_side_validation && value_rule_set_id.nil?
|
|
574
|
+
fail ArgumentError, "Missing the required parameter 'value_rule_set_id' when calling AdAccountsApi.get_value_rule_set"
|
|
575
|
+
end
|
|
576
|
+
# verify the required parameter 'account_id' is set
|
|
577
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
578
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdAccountsApi.get_value_rule_set"
|
|
579
|
+
end
|
|
580
|
+
# resource path
|
|
581
|
+
local_var_path = '/v1/ads/value-rule-sets/{valueRuleSetId}'.sub('{' + 'valueRuleSetId' + '}', CGI.escape(value_rule_set_id.to_s))
|
|
582
|
+
|
|
583
|
+
# query parameters
|
|
584
|
+
query_params = opts[:query_params] || {}
|
|
585
|
+
query_params[:'accountId'] = account_id
|
|
586
|
+
|
|
587
|
+
# header parameters
|
|
588
|
+
header_params = opts[:header_params] || {}
|
|
589
|
+
# HTTP header 'Accept' (if needed)
|
|
590
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
591
|
+
|
|
592
|
+
# form parameters
|
|
593
|
+
form_params = opts[:form_params] || {}
|
|
594
|
+
|
|
595
|
+
# http body (model)
|
|
596
|
+
post_body = opts[:debug_body]
|
|
597
|
+
|
|
598
|
+
# return_type
|
|
599
|
+
return_type = opts[:debug_return_type] || 'GetValueRuleSet200Response'
|
|
600
|
+
|
|
601
|
+
# auth_names
|
|
602
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
603
|
+
|
|
604
|
+
new_options = opts.merge(
|
|
605
|
+
:operation => :"AdAccountsApi.get_value_rule_set",
|
|
606
|
+
:header_params => header_params,
|
|
607
|
+
:query_params => query_params,
|
|
608
|
+
:form_params => form_params,
|
|
609
|
+
:body => post_body,
|
|
610
|
+
:auth_names => auth_names,
|
|
611
|
+
:return_type => return_type
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
615
|
+
if @api_client.config.debugging
|
|
616
|
+
@api_client.config.logger.debug "API called: AdAccountsApi#get_value_rule_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
617
|
+
end
|
|
618
|
+
return data, status_code, headers
|
|
619
|
+
end
|
|
620
|
+
|
|
413
621
|
# List ad accounts
|
|
414
622
|
# Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok's `/advertiser/info/` endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time `advertiser_ids` list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry. For Google Ads: responds `429` when Google's API quota is temporarily exhausted (instead of an empty list). Retry after a delay.
|
|
415
623
|
# @param account_id [String] Social account ID
|
|
@@ -887,6 +1095,91 @@ module Zernio
|
|
|
887
1095
|
return data, status_code, headers
|
|
888
1096
|
end
|
|
889
1097
|
|
|
1098
|
+
# List value rule sets
|
|
1099
|
+
# Lists the ad account's value rule sets (Meta's `/act_X/value_rule_set`). A value rule set adjusts the auction bid up or down for audience segments you value differently; attach one to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or `PUT /v1/ads/ad-sets/{adSetId}`. Rows are returned in the same camelCase shape the `PUT` body takes, ids included, so a set round-trips 1:1: **the update is a full replace, not a patch**, so you GET, mutate and send the whole thing back. Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule. **Rule order is semantic.** Rules are evaluated in array order and only the FIRST matching rule adjusts the bid for an overlapping audience. The order you send is the order that is stored and returned. Eligibility: value rule sets apply only to ad sets on the `LOWEST_COST_WITHOUT_CAP` (auto-bid) or `COST_CAP` bid strategies. Meta rejects the rest server-side.
|
|
1100
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
1101
|
+
# @param ad_account_id [String] Meta ad account id (act_<n>).
|
|
1102
|
+
# @param [Hash] opts the optional parameters
|
|
1103
|
+
# @option opts [Integer] :limit Rows per page (default to 25)
|
|
1104
|
+
# @option opts [String] :after Cursor from paging.after of the previous page. Meta does not document paging on this edge; `after` comes back null when it omits cursors.
|
|
1105
|
+
# @return [ListValueRuleSets200Response]
|
|
1106
|
+
def list_value_rule_sets(account_id, ad_account_id, opts = {})
|
|
1107
|
+
data, _status_code, _headers = list_value_rule_sets_with_http_info(account_id, ad_account_id, opts)
|
|
1108
|
+
data
|
|
1109
|
+
end
|
|
1110
|
+
|
|
1111
|
+
# List value rule sets
|
|
1112
|
+
# Lists the ad account's value rule sets (Meta's `/act_X/value_rule_set`). A value rule set adjusts the auction bid up or down for audience segments you value differently; attach one to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or `PUT /v1/ads/ad-sets/{adSetId}`. Rows are returned in the same camelCase shape the `PUT` body takes, ids included, so a set round-trips 1:1: **the update is a full replace, not a patch**, so you GET, mutate and send the whole thing back. Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule. **Rule order is semantic.** Rules are evaluated in array order and only the FIRST matching rule adjusts the bid for an overlapping audience. The order you send is the order that is stored and returned. Eligibility: value rule sets apply only to ad sets on the `LOWEST_COST_WITHOUT_CAP` (auto-bid) or `COST_CAP` bid strategies. Meta rejects the rest server-side.
|
|
1113
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
1114
|
+
# @param ad_account_id [String] Meta ad account id (act_<n>).
|
|
1115
|
+
# @param [Hash] opts the optional parameters
|
|
1116
|
+
# @option opts [Integer] :limit Rows per page (default to 25)
|
|
1117
|
+
# @option opts [String] :after Cursor from paging.after of the previous page. Meta does not document paging on this edge; `after` comes back null when it omits cursors.
|
|
1118
|
+
# @return [Array<(ListValueRuleSets200Response, Integer, Hash)>] ListValueRuleSets200Response data, response status code and response headers
|
|
1119
|
+
def list_value_rule_sets_with_http_info(account_id, ad_account_id, opts = {})
|
|
1120
|
+
if @api_client.config.debugging
|
|
1121
|
+
@api_client.config.logger.debug 'Calling API: AdAccountsApi.list_value_rule_sets ...'
|
|
1122
|
+
end
|
|
1123
|
+
# verify the required parameter 'account_id' is set
|
|
1124
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
1125
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdAccountsApi.list_value_rule_sets"
|
|
1126
|
+
end
|
|
1127
|
+
# verify the required parameter 'ad_account_id' is set
|
|
1128
|
+
if @api_client.config.client_side_validation && ad_account_id.nil?
|
|
1129
|
+
fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdAccountsApi.list_value_rule_sets"
|
|
1130
|
+
end
|
|
1131
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1132
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdAccountsApi.list_value_rule_sets, must be smaller than or equal to 100.'
|
|
1133
|
+
end
|
|
1134
|
+
|
|
1135
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1136
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdAccountsApi.list_value_rule_sets, must be greater than or equal to 1.'
|
|
1137
|
+
end
|
|
1138
|
+
|
|
1139
|
+
# resource path
|
|
1140
|
+
local_var_path = '/v1/ads/value-rule-sets'
|
|
1141
|
+
|
|
1142
|
+
# query parameters
|
|
1143
|
+
query_params = opts[:query_params] || {}
|
|
1144
|
+
query_params[:'accountId'] = account_id
|
|
1145
|
+
query_params[:'adAccountId'] = ad_account_id
|
|
1146
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1147
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1148
|
+
|
|
1149
|
+
# header parameters
|
|
1150
|
+
header_params = opts[:header_params] || {}
|
|
1151
|
+
# HTTP header 'Accept' (if needed)
|
|
1152
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1153
|
+
|
|
1154
|
+
# form parameters
|
|
1155
|
+
form_params = opts[:form_params] || {}
|
|
1156
|
+
|
|
1157
|
+
# http body (model)
|
|
1158
|
+
post_body = opts[:debug_body]
|
|
1159
|
+
|
|
1160
|
+
# return_type
|
|
1161
|
+
return_type = opts[:debug_return_type] || 'ListValueRuleSets200Response'
|
|
1162
|
+
|
|
1163
|
+
# auth_names
|
|
1164
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1165
|
+
|
|
1166
|
+
new_options = opts.merge(
|
|
1167
|
+
:operation => :"AdAccountsApi.list_value_rule_sets",
|
|
1168
|
+
:header_params => header_params,
|
|
1169
|
+
:query_params => query_params,
|
|
1170
|
+
:form_params => form_params,
|
|
1171
|
+
:body => post_body,
|
|
1172
|
+
:auth_names => auth_names,
|
|
1173
|
+
:return_type => return_type
|
|
1174
|
+
)
|
|
1175
|
+
|
|
1176
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1177
|
+
if @api_client.config.debugging
|
|
1178
|
+
@api_client.config.logger.debug "API called: AdAccountsApi#list_value_rule_sets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1179
|
+
end
|
|
1180
|
+
return data, status_code, headers
|
|
1181
|
+
end
|
|
1182
|
+
|
|
890
1183
|
# Update ad account settings
|
|
891
1184
|
# Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26). Set them once and every EU-targeted call to `/v1/ads/create`, `/v1/ads/boost` and `/v1/ads/ctwa` on that ad account can omit `dsaBeneficiary`/`dsaPayor`: Meta applies the defaults automatically. The values are written to the ad account on Meta, the same setting Ads Manager edits. Nothing is stored in Zernio, and defaults already set in Ads Manager work identically. Zernio never guesses these values for you. Beneficiary and payor are legal disclosures shown to EU users, so you must provide the entity names explicitly. Use `GET /v1/ads/dsa-recommendations` to offer suggestions in your UI. If `defaultDsaPayor` is omitted, the beneficiary is also set as the payor, which covers the common case where the same entity benefits from and pays for the ads. Read the current values back with `GET /v1/ads/dsa-defaults`. Currently supported for Meta accounts only; other platforms return 400.
|
|
892
1185
|
# @param update_ad_account_request [UpdateAdAccountRequest]
|
|
@@ -954,5 +1247,79 @@ module Zernio
|
|
|
954
1247
|
end
|
|
955
1248
|
return data, status_code, headers
|
|
956
1249
|
end
|
|
1250
|
+
|
|
1251
|
+
# Replace a value rule set
|
|
1252
|
+
# **THIS IS A FULL REPLACE, NOT A PATCH.** Meta's update is declarative: the body you send becomes the rule set. - `GET /v1/ads/value-rule-sets/{valueRuleSetId}` FIRST. - Keep a rule or criterion by echoing its `id`. - Create one by including the object WITHOUT an `id`. - Delete one by OMITTING it from the array. There is no warning and no undo. `name` and `rules` are both required for exactly this reason: a partial body would silently destroy every rule left out. **Rule order is semantic**: the array order you send is the evaluation order, and only the first matching rule adjusts the bid for an overlapping audience. Existing rule sets created elsewhere may contain `LOCATION_DMA` criteria. Those went inert on 2026-06-22 and are rejected here; migrate them to `LOCATION_COMSCORE_MARKET`.
|
|
1253
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
1254
|
+
# @param update_value_rule_set_request [UpdateValueRuleSetRequest]
|
|
1255
|
+
# @param [Hash] opts the optional parameters
|
|
1256
|
+
# @return [UpdateValueRuleSet200Response]
|
|
1257
|
+
def update_value_rule_set(value_rule_set_id, update_value_rule_set_request, opts = {})
|
|
1258
|
+
data, _status_code, _headers = update_value_rule_set_with_http_info(value_rule_set_id, update_value_rule_set_request, opts)
|
|
1259
|
+
data
|
|
1260
|
+
end
|
|
1261
|
+
|
|
1262
|
+
# Replace a value rule set
|
|
1263
|
+
# **THIS IS A FULL REPLACE, NOT A PATCH.** Meta's update is declarative: the body you send becomes the rule set. - `GET /v1/ads/value-rule-sets/{valueRuleSetId}` FIRST. - Keep a rule or criterion by echoing its `id`. - Create one by including the object WITHOUT an `id`. - Delete one by OMITTING it from the array. There is no warning and no undo. `name` and `rules` are both required for exactly this reason: a partial body would silently destroy every rule left out. **Rule order is semantic**: the array order you send is the evaluation order, and only the first matching rule adjusts the bid for an overlapping audience. Existing rule sets created elsewhere may contain `LOCATION_DMA` criteria. Those went inert on 2026-06-22 and are rejected here; migrate them to `LOCATION_COMSCORE_MARKET`.
|
|
1264
|
+
# @param value_rule_set_id [String] Platform value rule set id.
|
|
1265
|
+
# @param update_value_rule_set_request [UpdateValueRuleSetRequest]
|
|
1266
|
+
# @param [Hash] opts the optional parameters
|
|
1267
|
+
# @return [Array<(UpdateValueRuleSet200Response, Integer, Hash)>] UpdateValueRuleSet200Response data, response status code and response headers
|
|
1268
|
+
def update_value_rule_set_with_http_info(value_rule_set_id, update_value_rule_set_request, opts = {})
|
|
1269
|
+
if @api_client.config.debugging
|
|
1270
|
+
@api_client.config.logger.debug 'Calling API: AdAccountsApi.update_value_rule_set ...'
|
|
1271
|
+
end
|
|
1272
|
+
# verify the required parameter 'value_rule_set_id' is set
|
|
1273
|
+
if @api_client.config.client_side_validation && value_rule_set_id.nil?
|
|
1274
|
+
fail ArgumentError, "Missing the required parameter 'value_rule_set_id' when calling AdAccountsApi.update_value_rule_set"
|
|
1275
|
+
end
|
|
1276
|
+
# verify the required parameter 'update_value_rule_set_request' is set
|
|
1277
|
+
if @api_client.config.client_side_validation && update_value_rule_set_request.nil?
|
|
1278
|
+
fail ArgumentError, "Missing the required parameter 'update_value_rule_set_request' when calling AdAccountsApi.update_value_rule_set"
|
|
1279
|
+
end
|
|
1280
|
+
# resource path
|
|
1281
|
+
local_var_path = '/v1/ads/value-rule-sets/{valueRuleSetId}'.sub('{' + 'valueRuleSetId' + '}', CGI.escape(value_rule_set_id.to_s))
|
|
1282
|
+
|
|
1283
|
+
# query parameters
|
|
1284
|
+
query_params = opts[:query_params] || {}
|
|
1285
|
+
|
|
1286
|
+
# header parameters
|
|
1287
|
+
header_params = opts[:header_params] || {}
|
|
1288
|
+
# HTTP header 'Accept' (if needed)
|
|
1289
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1290
|
+
# HTTP header 'Content-Type'
|
|
1291
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1292
|
+
if !content_type.nil?
|
|
1293
|
+
header_params['Content-Type'] = content_type
|
|
1294
|
+
end
|
|
1295
|
+
|
|
1296
|
+
# form parameters
|
|
1297
|
+
form_params = opts[:form_params] || {}
|
|
1298
|
+
|
|
1299
|
+
# http body (model)
|
|
1300
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_value_rule_set_request)
|
|
1301
|
+
|
|
1302
|
+
# return_type
|
|
1303
|
+
return_type = opts[:debug_return_type] || 'UpdateValueRuleSet200Response'
|
|
1304
|
+
|
|
1305
|
+
# auth_names
|
|
1306
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1307
|
+
|
|
1308
|
+
new_options = opts.merge(
|
|
1309
|
+
:operation => :"AdAccountsApi.update_value_rule_set",
|
|
1310
|
+
:header_params => header_params,
|
|
1311
|
+
:query_params => query_params,
|
|
1312
|
+
:form_params => form_params,
|
|
1313
|
+
:body => post_body,
|
|
1314
|
+
:auth_names => auth_names,
|
|
1315
|
+
:return_type => return_type
|
|
1316
|
+
)
|
|
1317
|
+
|
|
1318
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
1319
|
+
if @api_client.config.debugging
|
|
1320
|
+
@api_client.config.logger.debug "API called: AdAccountsApi#update_value_rule_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1321
|
+
end
|
|
1322
|
+
return data, status_code, headers
|
|
1323
|
+
end
|
|
957
1324
|
end
|
|
958
1325
|
end
|
|
@@ -1603,7 +1603,7 @@ module Zernio
|
|
|
1603
1603
|
end
|
|
1604
1604
|
|
|
1605
1605
|
# Update an ad set
|
|
1606
|
-
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1606
|
+
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Value rule sets (Meta only, see `/v1/ads/value-rule-sets`): - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's presence, so `valueRulesApplied: true` is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`. - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400 `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set whenever `value_rule_set_id` is present, even with `value_rules_applied` false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta rejects the rest server-side. - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta does not document `value_rules_applied` as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1607
1607
|
# @param ad_set_id [String] Platform ad set ID
|
|
1608
1608
|
# @param update_ad_set_request [UpdateAdSetRequest]
|
|
1609
1609
|
# @param [Hash] opts the optional parameters
|
|
@@ -1614,7 +1614,7 @@ module Zernio
|
|
|
1614
1614
|
end
|
|
1615
1615
|
|
|
1616
1616
|
# Update an ad set
|
|
1617
|
-
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1617
|
+
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Value rule sets (Meta only, see `/v1/ads/value-rule-sets`): - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's presence, so `valueRulesApplied: true` is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`. - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400 `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set whenever `value_rule_set_id` is present, even with `value_rules_applied` false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta rejects the rest server-side. - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta does not document `value_rules_applied` as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1618
1618
|
# @param ad_set_id [String] Platform ad set ID
|
|
1619
1619
|
# @param update_ad_set_request [UpdateAdSetRequest]
|
|
1620
1620
|
# @param [Hash] opts the optional parameters
|