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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/docs/AdAccountsApi.md +364 -0
  4. data/docs/AdCampaignsApi.md +1 -1
  5. data/docs/BoostPostRequest.md +3 -1
  6. data/docs/CreateStandaloneAdRequest.md +4 -0
  7. data/docs/CreateValueRuleSet201Response.md +20 -0
  8. data/docs/CreateValueRuleSetRequest.md +24 -0
  9. data/docs/DeleteValueRuleSet200Response.md +20 -0
  10. data/docs/GetValueRuleSet200Response.md +18 -0
  11. data/docs/ListValueRuleSets200Response.md +22 -0
  12. data/docs/ListValueRuleSets200ResponsePaging.md +18 -0
  13. data/docs/UpdateAdSetRequest.md +4 -0
  14. data/docs/UpdateValueRuleSet200Response.md +24 -0
  15. data/docs/UpdateValueRuleSetRequest.md +22 -0
  16. data/docs/ValueRule.md +28 -0
  17. data/docs/ValueRuleCriterion.md +26 -0
  18. data/docs/ValueRuleSet.md +22 -0
  19. data/lib/zernio-sdk/api/ad_accounts_api.rb +367 -0
  20. data/lib/zernio-sdk/api/ad_campaigns_api.rb +2 -2
  21. data/lib/zernio-sdk/models/boost_post_request.rb +14 -4
  22. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +42 -1
  23. data/lib/zernio-sdk/models/create_value_rule_set201_response.rb +158 -0
  24. data/lib/zernio-sdk/models/create_value_rule_set_request.rb +283 -0
  25. data/lib/zernio-sdk/models/delete_value_rule_set200_response.rb +156 -0
  26. data/lib/zernio-sdk/models/get_value_rule_set200_response.rb +147 -0
  27. data/lib/zernio-sdk/models/list_value_rule_sets200_response.rb +167 -0
  28. data/lib/zernio-sdk/models/list_value_rule_sets200_response_paging.rb +149 -0
  29. data/lib/zernio-sdk/models/update_ad_set_request.rb +42 -1
  30. data/lib/zernio-sdk/models/update_value_rule_set200_response.rb +176 -0
  31. data/lib/zernio-sdk/models/update_value_rule_set_request.rb +257 -0
  32. data/lib/zernio-sdk/models/value_rule.rb +346 -0
  33. data/lib/zernio-sdk/models/value_rule_criterion.rb +305 -0
  34. data/lib/zernio-sdk/models/value_rule_set.rb +221 -0
  35. data/lib/zernio-sdk/version.rb +1 -1
  36. data/lib/zernio-sdk.rb +11 -0
  37. data/openapi.yaml +406 -3
  38. data/spec/api/ad_accounts_api_spec.rb +66 -0
  39. data/spec/api/ad_campaigns_api_spec.rb +1 -1
  40. data/spec/models/boost_post_request_spec.rb +6 -0
  41. data/spec/models/create_standalone_ad_request_spec.rb +12 -0
  42. data/spec/models/create_value_rule_set201_response_spec.rb +42 -0
  43. data/spec/models/create_value_rule_set_request_spec.rb +54 -0
  44. data/spec/models/delete_value_rule_set200_response_spec.rb +42 -0
  45. data/spec/models/get_value_rule_set200_response_spec.rb +36 -0
  46. data/spec/models/list_value_rule_sets200_response_paging_spec.rb +36 -0
  47. data/spec/models/list_value_rule_sets200_response_spec.rb +48 -0
  48. data/spec/models/update_ad_set_request_spec.rb +12 -0
  49. data/spec/models/update_value_rule_set200_response_spec.rb +54 -0
  50. data/spec/models/update_value_rule_set_request_spec.rb +48 -0
  51. data/spec/models/value_rule_criterion_spec.rb +68 -0
  52. data/spec/models/value_rule_set_spec.rb +48 -0
  53. data/spec/models/value_rule_spec.rb +70 -0
  54. data/zernio-sdk-0.0.660.gem +0 -0
  55. metadata +46 -2
  56. data/zernio-sdk-0.0.658.gem +0 -0
data/openapi.yaml CHANGED
@@ -6681,6 +6681,101 @@ components:
6681
6681
  agency apps without full BC asset read scope) — distinct from `0`,
6682
6682
  which would imply the BC genuinely has no advertisers.
6683
6683
  example: 23
6684
+ ValueRuleCriterion:
6685
+ type: object
6686
+ additionalProperties: false
6687
+ required: [criteriaType, operator, criteriaValues, criteriaValueTypes]
6688
+ description: |
6689
+ One matching condition inside a value rule. `criteriaValues` and `criteriaValueTypes`
6690
+ are POSITIONALLY paired: same length, same order.
6691
+ properties:
6692
+ id:
6693
+ type: string
6694
+ description: |
6695
+ Platform criterion id. Echo it on `PUT` to KEEP this criterion, omit it to CREATE a
6696
+ new one. A criterion left out of the array entirely is DELETED.
6697
+ criteriaType:
6698
+ type: string
6699
+ enum: [AGE, GENDER, OS_TYPE, DEVICE_PLATFORM, LOCATION, PLACEMENT, OMNI_CHANNEL, AUDIENCE_LABEL]
6700
+ description: |
6701
+ The dimension being matched. `OMNI_CHANNEL` (conversion location: APP, INSTANT_FORM,
6702
+ PHONE_CALL, WEBSITE) is accepted even though Meta's own enum table omits it.
6703
+ operator:
6704
+ type: string
6705
+ enum: [CONTAINS]
6706
+ description: "Required on every criterion. `CONTAINS` is currently the only value Meta supports."
6707
+ criteriaValues:
6708
+ type: array
6709
+ minItems: 1
6710
+ items: { type: string }
6711
+ description: |
6712
+ The values to match. `AGE` takes ranges such as `18-24`, `18+` or a custom `18-26`;
6713
+ a range whose upper bound is 65 is NOT allowed (use `18+` instead of `18-65`).
6714
+ `LOCATION` takes Targeting-Search keys: a two-letter country code for
6715
+ `LOCATION_COUNTRY`, a numeric key for region / city / comScore market.
6716
+ `AUDIENCE_LABEL` takes labels such as `HIGH_VALUE`, which are applied to a Custom
6717
+ Audience in Ads Manager: there is no API to provision them, so they are passed
6718
+ through unvalidated.
6719
+ criteriaValueTypes:
6720
+ type: array
6721
+ minItems: 1
6722
+ items: { type: string }
6723
+ description: |
6724
+ One entry per `criteriaValues` entry, in the same order. The literal `"NONE"` for
6725
+ every criteriaType except `LOCATION`, which uses `LOCATION_COUNTRY`,
6726
+ `LOCATION_REGION`, `LOCATION_CITY` or `LOCATION_COMSCORE_MARKET` and MAY mix them
6727
+ within one criterion. `LOCATION_DMA` was replaced by `LOCATION_COMSCORE_MARKET` on
6728
+ 2026-06-22 and is rejected by this API.
6729
+ ValueRule:
6730
+ type: object
6731
+ additionalProperties: false
6732
+ required: [name, adjustSign, adjustValue, criteria]
6733
+ description: |
6734
+ One bid-adjustment rule. Rules are evaluated in ARRAY ORDER and only the first matching
6735
+ rule adjusts the bid for an overlapping audience, so the order is semantic.
6736
+ properties:
6737
+ id:
6738
+ type: string
6739
+ description: |
6740
+ Platform rule id. Echo it on `PUT` to KEEP this rule, omit it to CREATE a new one.
6741
+ A rule left out of the array entirely is DELETED.
6742
+ name: { type: string, minLength: 1, maxLength: 255 }
6743
+ adjustSign:
6744
+ type: string
6745
+ enum: [INCREASE, DECREASE]
6746
+ description: "Direction of the adjustment. There is no signed value field."
6747
+ adjustValue:
6748
+ type: integer
6749
+ minimum: 1
6750
+ maximum: 1000
6751
+ description: |
6752
+ Unsigned percentage magnitude. `INCREASE` accepts 1-1000, `DECREASE` accepts 1-90.
6753
+ 0 is out of range on both.
6754
+ status:
6755
+ type: string
6756
+ description: |
6757
+ Meta returns `ACTIVE` here but documents no enum for the field. Treat it as a
6758
+ passthrough: echo whatever the `GET` returned, and do not synthesize values.
6759
+ criteria:
6760
+ type: array
6761
+ minItems: 1
6762
+ maxItems: 4
6763
+ items: { $ref: '#/components/schemas/ValueRuleCriterion' }
6764
+ description: "All criteria on a rule must match for the rule to fire."
6765
+ ValueRuleSet:
6766
+ type: object
6767
+ additionalProperties: false
6768
+ required: [id, name, rules]
6769
+ description: |
6770
+ A named set of bid-adjustment rules on an ad account. Attach it to an ad set with
6771
+ `valueRuleSetId`. Limits: 6 sets per ad account, 10 rules per set, 4 criteria per rule.
6772
+ properties:
6773
+ id: { type: string, description: "Platform value rule set id." }
6774
+ name: { type: string }
6775
+ rules:
6776
+ type: array
6777
+ items: { $ref: '#/components/schemas/ValueRule' }
6778
+ description: "Evaluated in order; the first matching rule wins."
6684
6779
  BidStrategy:
6685
6780
  type: string
6686
6781
  enum: [LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS]
@@ -35821,9 +35916,25 @@ paths:
35821
35916
  summary: Update an ad set
35822
35917
  description: |
35823
35918
  Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped
35824
- pause/resume, bid-strategy edits, and Meta-only post-launch delivery
35825
- settings via `platformSpecificData`. At least one updatable field
35826
- is required.
35919
+ pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and
35920
+ Meta-only post-launch delivery settings via `platformSpecificData`. At
35921
+ least one updatable field is required.
35922
+
35923
+ Value rule sets (Meta only, see `/v1/ads/value-rule-sets`):
35924
+ - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's
35925
+ presence, so `valueRulesApplied: true` is optional. Sending a different id
35926
+ replaces the previous association; there is no separate replace call.
35927
+ - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`.
35928
+ - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400
35929
+ `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set
35930
+ whenever `value_rule_set_id` is present, even with `value_rules_applied` false,
35931
+ so echoing stored state while asking to detach would silently keep the bid
35932
+ adjustments live.
35933
+ - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta
35934
+ rejects the rest server-side.
35935
+ - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta
35936
+ does not document `value_rules_applied` as a readable ad-set field, so the
35937
+ boolean cannot be read back.
35827
35938
 
35828
35939
  Bid strategy compatibility (per Meta's spec):
35829
35940
  - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`.
@@ -35881,6 +35992,21 @@ paths:
35881
35992
  Minimum ROAS as a decimal multiplier (2.0 = 2.0x). Required when bidStrategy is
35882
35993
  LOWEST_COST_WITH_MIN_ROAS. Sent to Meta as `bid_constraints.roas_average_floor` × 10000.
35883
35994
  Not supported on OpenAI (422).
35995
+ valueRuleSetId:
35996
+ type: string
35997
+ pattern: '^\d+$'
35998
+ description: |
35999
+ Meta only (other platforms return 501). Value rule set to attach to this ad
36000
+ set, from `/v1/ads/value-rule-sets`. Sending a different id replaces the
36001
+ current association. To DETACH, send `valueRulesApplied: false` and omit
36002
+ this field.
36003
+ valueRulesApplied:
36004
+ type: boolean
36005
+ description: |
36006
+ Meta only (other platforms return 501). `false` DETACHES the ad set's value
36007
+ rule set and must be sent WITHOUT `valueRuleSetId`; the combination returns
36008
+ 400. `true` is optional when attaching, since attachment is driven by
36009
+ `valueRuleSetId`, and requires it to be present.
35884
36010
  platformSpecificData:
35885
36011
  type: object
35886
36012
  description: |
@@ -37570,6 +37696,247 @@ paths:
37570
37696
  '401': { $ref: '#/components/responses/Unauthorized' }
37571
37697
  '501': { description: Only supported on Meta (facebook/instagram) }
37572
37698
 
37699
+ /v1/ads/value-rule-sets:
37700
+ get:
37701
+ operationId: listValueRuleSets
37702
+ tags: ["Ad Accounts"]
37703
+ x-platforms: ["meta"]
37704
+ summary: List value rule sets
37705
+ description: |-
37706
+ Lists the ad account's value rule sets (Meta's `/act_X/value_rule_set`). A value rule
37707
+ set adjusts the auction bid up or down for audience segments you value differently;
37708
+ attach one to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or
37709
+ `PUT /v1/ads/ad-sets/{adSetId}`.
37710
+
37711
+ Rows are returned in the same camelCase shape the `PUT` body takes, ids included, so a
37712
+ set round-trips 1:1: **the update is a full replace, not a patch**, so you GET, mutate
37713
+ and send the whole thing back.
37714
+
37715
+ Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule.
37716
+
37717
+ **Rule order is semantic.** Rules are evaluated in array order and only the FIRST
37718
+ matching rule adjusts the bid for an overlapping audience. The order you send is the
37719
+ order that is stored and returned.
37720
+
37721
+ Eligibility: value rule sets apply only to ad sets on the `LOWEST_COST_WITHOUT_CAP`
37722
+ (auto-bid) or `COST_CAP` bid strategies. Meta rejects the rest server-side.
37723
+ security:
37724
+ - bearerAuth: []
37725
+ parameters:
37726
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
37727
+ - { name: adAccountId, in: query, required: true, schema: { type: string }, description: "Meta ad account id (act_<n>)." }
37728
+ - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 }, description: Rows per page }
37729
+ - { name: after, in: query, schema: { type: string }, description: "Cursor from paging.after of the previous page. Meta does not document paging on this edge; `after` comes back null when it omits cursors." }
37730
+ responses:
37731
+ '200':
37732
+ description: Value rule sets
37733
+ content:
37734
+ application/json:
37735
+ schema:
37736
+ type: object
37737
+ properties:
37738
+ adAccountId: { type: string }
37739
+ data:
37740
+ type: array
37741
+ items: { $ref: '#/components/schemas/ValueRuleSet' }
37742
+ paging:
37743
+ type: object
37744
+ properties:
37745
+ after: { type: [string, "null"], description: "Cursor for the next page; null when exhausted or when Meta omits paging." }
37746
+ '400': { description: "Invalid input, or Meta rejected the query. Meta answers a bad rule-set id with GraphMethodException code 100 / subcode 33, which is indistinguishable between not-found, no-permission, and account-not-enabled." }
37747
+ '401': { $ref: '#/components/responses/Unauthorized' }
37748
+ '501': { description: Only supported on Meta (facebook/instagram) }
37749
+
37750
+ post:
37751
+ operationId: createValueRuleSet
37752
+ tags: ["Ad Accounts"]
37753
+ x-platforms: ["meta"]
37754
+ summary: Create a value rule set
37755
+ description: |-
37756
+ Creates a value rule set on the ad account (Meta's `POST /act_X/value_rule_set`).
37757
+ Attach the returned id to an ad set with `valueRuleSetId` on `POST /v1/ads/create` or
37758
+ `PUT /v1/ads/ad-sets/{adSetId}`.
37759
+
37760
+ **Rule order is semantic**: rules are evaluated in array order and only the first
37761
+ matching rule adjusts the bid for an overlapping audience.
37762
+
37763
+ `adjustValue` is an unsigned magnitude in percent; the direction lives in `adjustSign`.
37764
+ `INCREASE` accepts 1-1000, `DECREASE` accepts 1-90. There is no signed field and 0 is
37765
+ out of range.
37766
+
37767
+ `criteriaValueTypes` is positionally paired with `criteriaValues` (same length, same
37768
+ order). Every type is the literal `"NONE"` except on `LOCATION`, which uses
37769
+ `LOCATION_COUNTRY` / `LOCATION_REGION` / `LOCATION_CITY` / `LOCATION_COMSCORE_MARKET`
37770
+ and may mix them within one criterion. Location values are Targeting-Search keys: a
37771
+ two-letter country code for `LOCATION_COUNTRY`, a numeric key for the rest.
37772
+
37773
+ `LOCATION_DMA` was replaced by `LOCATION_COMSCORE_MARKET` on 2026-06-22 and rules using
37774
+ DMAs are no longer active, so this API rejects it.
37775
+
37776
+ `AUDIENCE_LABEL` values (e.g. `HIGH_VALUE`) are applied to a Custom Audience in Ads
37777
+ Manager. There is no API to provision them, so label strings are passed through
37778
+ unvalidated and a typo produces a rule that never fires.
37779
+
37780
+ Ads Manager turns a rule set read-only (this API stays editable) when a rule uses more
37781
+ than 2 criteria, a custom age range, or the placements `FB_MARKETPLACE`, `FB_SEARCH`,
37782
+ `FB_VIDEO` or `IG_EXPLORE`.
37783
+
37784
+ Limits: 6 rule sets per ad account, 10 rules per set, 4 criteria per rule. The
37785
+ per-account cap is enforced by Meta, not here.
37786
+ security:
37787
+ - bearerAuth: []
37788
+ requestBody:
37789
+ required: true
37790
+ content:
37791
+ application/json:
37792
+ schema:
37793
+ type: object
37794
+ required: [accountId, adAccountId, name, rules]
37795
+ properties:
37796
+ accountId: { type: string, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
37797
+ adAccountId: { type: string, description: "Meta ad account id (act_<n>)." }
37798
+ name: { type: string, minLength: 1, maxLength: 255 }
37799
+ rules:
37800
+ type: array
37801
+ minItems: 1
37802
+ maxItems: 10
37803
+ description: "Evaluated in order; the first matching rule wins."
37804
+ items: { $ref: '#/components/schemas/ValueRule' }
37805
+ responses:
37806
+ '201':
37807
+ description: Value rule set created
37808
+ content:
37809
+ application/json:
37810
+ schema:
37811
+ type: object
37812
+ properties:
37813
+ adAccountId: { type: string }
37814
+ valueRuleSetId: { type: [string, "null"], description: "The new rule set id. Meta does not document the create response body, so this is null on the (unobserved) case where it omits the id." }
37815
+ '400': { description: "Invalid input, or Meta rejected the create (per-account rule-set cap, ineligible criteria, or an account that is not enabled for value rules)" }
37816
+ '401': { $ref: '#/components/responses/Unauthorized' }
37817
+ '501': { description: Only supported on Meta (facebook/instagram) }
37818
+
37819
+ /v1/ads/value-rule-sets/{valueRuleSetId}:
37820
+ get:
37821
+ operationId: getValueRuleSet
37822
+ tags: ["Ad Accounts"]
37823
+ x-platforms: ["meta"]
37824
+ summary: Read a value rule set
37825
+ description: |-
37826
+ Reads one value rule set including every nested rule id and criterion id. This is step
37827
+ one of any edit: `PUT` is a full replace, so you need the ids before you can keep the
37828
+ objects you are not changing.
37829
+
37830
+ Meta's own read returns `GENDER` values lowercase (`"male"`) while writes require
37831
+ `"MALE"`. Values are passed through untouched, so never case-compare a stored rule
37832
+ against a fetched one.
37833
+ security:
37834
+ - bearerAuth: []
37835
+ parameters:
37836
+ - { name: valueRuleSetId, in: path, required: true, schema: { type: string }, description: "Platform value rule set id." }
37837
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
37838
+ responses:
37839
+ '200':
37840
+ description: Value rule set
37841
+ content:
37842
+ application/json:
37843
+ schema:
37844
+ type: object
37845
+ properties:
37846
+ valueRuleSet: { $ref: '#/components/schemas/ValueRuleSet' }
37847
+ '400': { description: "Invalid input, or Meta rejected the read. A bad id comes back as GraphMethodException code 100 / subcode 33, which cannot be told apart from a permission problem." }
37848
+ '401': { $ref: '#/components/responses/Unauthorized' }
37849
+ '501': { description: Only supported on Meta (facebook/instagram) }
37850
+
37851
+ put:
37852
+ operationId: updateValueRuleSet
37853
+ tags: ["Ad Accounts"]
37854
+ x-platforms: ["meta"]
37855
+ summary: Replace a value rule set
37856
+ description: |-
37857
+ **THIS IS A FULL REPLACE, NOT A PATCH.** Meta's update is declarative: the body you
37858
+ send becomes the rule set.
37859
+
37860
+ - `GET /v1/ads/value-rule-sets/{valueRuleSetId}` FIRST.
37861
+ - Keep a rule or criterion by echoing its `id`.
37862
+ - Create one by including the object WITHOUT an `id`.
37863
+ - Delete one by OMITTING it from the array. There is no warning and no undo.
37864
+
37865
+ `name` and `rules` are both required for exactly this reason: a partial body would
37866
+ silently destroy every rule left out.
37867
+
37868
+ **Rule order is semantic**: the array order you send is the evaluation order, and only
37869
+ the first matching rule adjusts the bid for an overlapping audience.
37870
+
37871
+ Existing rule sets created elsewhere may contain `LOCATION_DMA` criteria. Those went
37872
+ inert on 2026-06-22 and are rejected here; migrate them to `LOCATION_COMSCORE_MARKET`.
37873
+ security:
37874
+ - bearerAuth: []
37875
+ parameters:
37876
+ - { name: valueRuleSetId, in: path, required: true, schema: { type: string }, description: "Platform value rule set id." }
37877
+ requestBody:
37878
+ required: true
37879
+ content:
37880
+ application/json:
37881
+ schema:
37882
+ type: object
37883
+ required: [accountId, name, rules]
37884
+ properties:
37885
+ accountId: { type: string, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
37886
+ name: { type: string, minLength: 1, maxLength: 255, description: "Required: the update replaces the whole set." }
37887
+ rules:
37888
+ type: array
37889
+ minItems: 1
37890
+ maxItems: 10
37891
+ description: "The COMPLETE rule list. Omitting a rule deletes it on Meta."
37892
+ items: { $ref: '#/components/schemas/ValueRule' }
37893
+ responses:
37894
+ '200':
37895
+ description: Value rule set replaced
37896
+ content:
37897
+ application/json:
37898
+ schema:
37899
+ type: object
37900
+ properties:
37901
+ valueRuleSetId: { type: string }
37902
+ name: { type: string }
37903
+ rules:
37904
+ type: array
37905
+ items: { $ref: '#/components/schemas/ValueRule' }
37906
+ message: { type: string }
37907
+ '400': { description: "Invalid input, or Meta rejected the update" }
37908
+ '401': { $ref: '#/components/responses/Unauthorized' }
37909
+ '501': { description: Only supported on Meta (facebook/instagram) }
37910
+
37911
+ delete:
37912
+ operationId: deleteValueRuleSet
37913
+ tags: ["Ad Accounts"]
37914
+ x-platforms: ["meta"]
37915
+ summary: Delete a value rule set
37916
+ description: |-
37917
+ Deletes the rule set (Meta's `POST /{value-rule-set-id}/delete_rule_set`, a custom
37918
+ action edge rather than an HTTP DELETE on its side). Ad sets pointing at it are not
37919
+ modified here; detach them first with `valueRulesApplied: false` on
37920
+ `PUT /v1/ads/ad-sets/{adSetId}`.
37921
+ security:
37922
+ - bearerAuth: []
37923
+ parameters:
37924
+ - { name: valueRuleSetId, in: path, required: true, schema: { type: string }, description: "Platform value rule set id." }
37925
+ - { name: accountId, in: query, required: true, schema: { type: string }, description: "Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token." }
37926
+ responses:
37927
+ '200':
37928
+ description: Value rule set deleted
37929
+ content:
37930
+ application/json:
37931
+ schema:
37932
+ type: object
37933
+ properties:
37934
+ valueRuleSetId: { type: string }
37935
+ message: { type: string }
37936
+ '400': { description: "Invalid input, or Meta rejected the delete. A bad id comes back as GraphMethodException code 100 / subcode 33, which reads like a permission error rather than a 404." }
37937
+ '401': { $ref: '#/components/responses/Unauthorized' }
37938
+ '501': { description: Only supported on Meta (facebook/instagram) }
37939
+
37573
37940
  /v1/ads/accounts/finance:
37574
37941
  get:
37575
37942
  operationId: getAdAccountFinance
@@ -38032,6 +38399,17 @@ paths:
38032
38399
  (for example, an agency paying for a client's ads). Same rules as
38033
38400
  `dsaBeneficiary`: required for EU targeting unless the ad account has
38034
38401
  a default payor.
38402
+ optimizationGoal:
38403
+ type: string
38404
+ description: |
38405
+ Meta only. Explicit ad-set `optimization_goal` override. When omitted,
38406
+ defaults to the value derived from `goal`. The value must be compatible
38407
+ with the objective Meta derives from `goal`, not with the objective used
38408
+ by `POST /v1/ads/create` for the same `goal` name: boost maps `goal:
38409
+ "engagement"` to objective `OUTCOME_AWARENESS`, which accepts
38410
+ `REACH`, `IMPRESSIONS`, `AD_RECALL_LIFT`, or THRUPLAY-class values, and
38411
+ rejects `POST_ENGAGEMENT` (that value is only valid under
38412
+ `OUTCOME_ENGAGEMENT`, which create uses for the same goal name).
38035
38413
  responses:
38036
38414
  '201':
38037
38415
  description: Ad created
@@ -38718,6 +39096,31 @@ paths:
38718
39096
  Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when
38719
39097
  `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`. Sent to Meta as
38720
39098
  `bid_constraints.roas_average_floor` × 10000.
39099
+ valueRuleSetId:
39100
+ type: string
39101
+ pattern: '^\d+$'
39102
+ description: |
39103
+ Meta only (facebook, instagram; other platforms return 400). Value rule set
39104
+ to attach to the new ad set, from `/v1/ads/value-rule-sets`. Attachment is
39105
+ driven by this id, so `valueRulesApplied` is optional alongside it.
39106
+
39107
+ Rejected with 400 in `adSetId` attach mode: that shape inherits the existing
39108
+ ad set's attachment, so the field would be silently ignored. Use
39109
+ `PUT /v1/ads/ad-sets/{adSetId}` there instead.
39110
+
39111
+ Ignored (stripped before the ad-set create) when `buyingType` is `RESERVED`:
39112
+ value rules only apply to auction ad sets on `LOWEST_COST_WITHOUT_CAP` or
39113
+ `COST_CAP`, and a Reach & Frequency reservation has no auction bid strategy.
39114
+
39115
+ Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`; the
39116
+ attachment is not mirrored onto Zernio's ad documents.
39117
+ valueRulesApplied:
39118
+ type: boolean
39119
+ description: |
39120
+ Meta only (facebook, instagram; other platforms return 400). Optional when
39121
+ attaching, and requires `valueRuleSetId`. `false` is REJECTED here with 400:
39122
+ a newly created ad set has nothing to detach, so detaching lives on
39123
+ `PUT /v1/ads/ad-sets/{adSetId}`.
38721
39124
  platformSpecificData:
38722
39125
  description: |
38723
39126
  Platform-specific options. The platform is derived from `accountId`;
@@ -32,6 +32,31 @@ describe 'AdAccountsApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for create_value_rule_set
36
+ # Create a value rule set
37
+ # Creates a value rule set on the ad account (Meta&#39;s &#x60;POST /act_X/value_rule_set&#x60;). Attach the returned id to an ad set with &#x60;valueRuleSetId&#x60; on &#x60;POST /v1/ads/create&#x60; or &#x60;PUT /v1/ads/ad-sets/{adSetId}&#x60;. **Rule order is semantic**: rules are evaluated in array order and only the first matching rule adjusts the bid for an overlapping audience. &#x60;adjustValue&#x60; is an unsigned magnitude in percent; the direction lives in &#x60;adjustSign&#x60;. &#x60;INCREASE&#x60; accepts 1-1000, &#x60;DECREASE&#x60; accepts 1-90. There is no signed field and 0 is out of range. &#x60;criteriaValueTypes&#x60; is positionally paired with &#x60;criteriaValues&#x60; (same length, same order). Every type is the literal &#x60;\&quot;NONE\&quot;&#x60; except on &#x60;LOCATION&#x60;, which uses &#x60;LOCATION_COUNTRY&#x60; / &#x60;LOCATION_REGION&#x60; / &#x60;LOCATION_CITY&#x60; / &#x60;LOCATION_COMSCORE_MARKET&#x60; and may mix them within one criterion. Location values are Targeting-Search keys: a two-letter country code for &#x60;LOCATION_COUNTRY&#x60;, a numeric key for the rest. &#x60;LOCATION_DMA&#x60; was replaced by &#x60;LOCATION_COMSCORE_MARKET&#x60; on 2026-06-22 and rules using DMAs are no longer active, so this API rejects it. &#x60;AUDIENCE_LABEL&#x60; values (e.g. &#x60;HIGH_VALUE&#x60;) 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 &#x60;FB_MARKETPLACE&#x60;, &#x60;FB_SEARCH&#x60;, &#x60;FB_VIDEO&#x60; or &#x60;IG_EXPLORE&#x60;. 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.
38
+ # @param create_value_rule_set_request
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [CreateValueRuleSet201Response]
41
+ describe 'create_value_rule_set test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
44
+ end
45
+ end
46
+
47
+ # unit tests for delete_value_rule_set
48
+ # Delete a value rule set
49
+ # Deletes the rule set (Meta&#39;s &#x60;POST /{value-rule-set-id}/delete_rule_set&#x60;, 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 &#x60;valueRulesApplied: false&#x60; on &#x60;PUT /v1/ads/ad-sets/{adSetId}&#x60;.
50
+ # @param value_rule_set_id Platform value rule set id.
51
+ # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
52
+ # @param [Hash] opts the optional parameters
53
+ # @return [DeleteValueRuleSet200Response]
54
+ describe 'delete_value_rule_set test' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
35
60
  # unit tests for get_ad_account_finance
36
61
  # Ad account finances
37
62
  # Finances of one Meta ad account: prepaid &#x60;balance&#x60;, lifetime &#x60;amountSpent&#x60;, account &#x60;spendCap&#x60; (null &#x3D; no cap) and the &#x60;fundingSource&#x60;. Money values are converted from Meta&#39;s minor units to whole units of &#x60;currency&#x60;.
@@ -104,6 +129,19 @@ describe 'AdAccountsApi' do
104
129
  end
105
130
  end
106
131
 
132
+ # unit tests for get_value_rule_set
133
+ # Read a value rule set
134
+ # Reads one value rule set including every nested rule id and criterion id. This is step one of any edit: &#x60;PUT&#x60; is a full replace, so you need the ids before you can keep the objects you are not changing. Meta&#39;s own read returns &#x60;GENDER&#x60; values lowercase (&#x60;\&quot;male\&quot;&#x60;) while writes require &#x60;\&quot;MALE\&quot;&#x60;. Values are passed through untouched, so never case-compare a stored rule against a fetched one.
135
+ # @param value_rule_set_id Platform value rule set id.
136
+ # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
137
+ # @param [Hash] opts the optional parameters
138
+ # @return [GetValueRuleSet200Response]
139
+ describe 'get_value_rule_set test' do
140
+ it 'should work' do
141
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
142
+ end
143
+ end
144
+
107
145
  # unit tests for list_ad_accounts
108
146
  # List ad accounts
109
147
  # 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&#39;s &#x60;/advertiser/info/&#x60; endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time &#x60;advertiser_ids&#x60; list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry. For Google Ads: responds &#x60;429&#x60; when Google&#39;s API quota is temporarily exhausted (instead of an empty list). Retry after a delay.
@@ -191,6 +229,21 @@ describe 'AdAccountsApi' do
191
229
  end
192
230
  end
193
231
 
232
+ # unit tests for list_value_rule_sets
233
+ # List value rule sets
234
+ # Lists the ad account&#39;s value rule sets (Meta&#39;s &#x60;/act_X/value_rule_set&#x60;). A value rule set adjusts the auction bid up or down for audience segments you value differently; attach one to an ad set with &#x60;valueRuleSetId&#x60; on &#x60;POST /v1/ads/create&#x60; or &#x60;PUT /v1/ads/ad-sets/{adSetId}&#x60;. Rows are returned in the same camelCase shape the &#x60;PUT&#x60; 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 &#x60;LOWEST_COST_WITHOUT_CAP&#x60; (auto-bid) or &#x60;COST_CAP&#x60; bid strategies. Meta rejects the rest server-side.
235
+ # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
236
+ # @param ad_account_id Meta ad account id (act_&lt;n&gt;).
237
+ # @param [Hash] opts the optional parameters
238
+ # @option opts [Integer] :limit Rows per page
239
+ # @option opts [String] :after Cursor from paging.after of the previous page. Meta does not document paging on this edge; &#x60;after&#x60; comes back null when it omits cursors.
240
+ # @return [ListValueRuleSets200Response]
241
+ describe 'list_value_rule_sets test' do
242
+ it 'should work' do
243
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
244
+ end
245
+ end
246
+
194
247
  # unit tests for update_ad_account
195
248
  # Update ad account settings
196
249
  # 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 &#x60;/v1/ads/create&#x60;, &#x60;/v1/ads/boost&#x60; and &#x60;/v1/ads/ctwa&#x60; on that ad account can omit &#x60;dsaBeneficiary&#x60;/&#x60;dsaPayor&#x60;: 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 &#x60;GET /v1/ads/dsa-recommendations&#x60; to offer suggestions in your UI. If &#x60;defaultDsaPayor&#x60; 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 &#x60;GET /v1/ads/dsa-defaults&#x60;. Currently supported for Meta accounts only; other platforms return 400.
@@ -203,4 +256,17 @@ describe 'AdAccountsApi' do
203
256
  end
204
257
  end
205
258
 
259
+ # unit tests for update_value_rule_set
260
+ # Replace a value rule set
261
+ # **THIS IS A FULL REPLACE, NOT A PATCH.** Meta&#39;s update is declarative: the body you send becomes the rule set. - &#x60;GET /v1/ads/value-rule-sets/{valueRuleSetId}&#x60; FIRST. - Keep a rule or criterion by echoing its &#x60;id&#x60;. - Create one by including the object WITHOUT an &#x60;id&#x60;. - Delete one by OMITTING it from the array. There is no warning and no undo. &#x60;name&#x60; and &#x60;rules&#x60; 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 &#x60;LOCATION_DMA&#x60; criteria. Those went inert on 2026-06-22 and are rejected here; migrate them to &#x60;LOCATION_COMSCORE_MARKET&#x60;.
262
+ # @param value_rule_set_id Platform value rule set id.
263
+ # @param update_value_rule_set_request
264
+ # @param [Hash] opts the optional parameters
265
+ # @return [UpdateValueRuleSet200Response]
266
+ describe 'update_value_rule_set test' do
267
+ it 'should work' do
268
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
269
+ end
270
+ end
271
+
206
272
  end
@@ -329,7 +329,7 @@ describe 'AdCampaignsApi' do
329
329
 
330
330
  # unit tests for update_ad_set
331
331
  # Update an ad set
332
- # 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 &#x60;platformSpecificData&#x60;. At least one updatable field is required. Bid strategy compatibility (per Meta&#39;s spec): - &#x60;LOWEST_COST_WITHOUT_CAP&#x60;: no &#x60;bidAmount&#x60;, no &#x60;roasAverageFloor&#x60;. - &#x60;LOWEST_COST_WITH_BID_CAP&#x60; / &#x60;COST_CAP&#x60;: &#x60;bidAmount&#x60; REQUIRED (whole currency units). - &#x60;LOWEST_COST_WITH_MIN_ROAS&#x60;: &#x60;roasAverageFloor&#x60; REQUIRED (decimal multiplier, e.g. 2.0 &#x3D; 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn&#39;t allow) surface as 400s from Meta. When updating &#x60;budget&#x60; 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.
332
+ # 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 &#x60;platformSpecificData&#x60;. At least one updatable field is required. Value rule sets (Meta only, see &#x60;/v1/ads/value-rule-sets&#x60;): - ATTACH or REPLACE: send &#x60;valueRuleSetId&#x60;. Attachment is driven by the id&#39;s presence, so &#x60;valueRulesApplied: true&#x60; is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send &#x60;valueRulesApplied: false&#x60; and OMIT &#x60;valueRuleSetId&#x60;. - Sending &#x60;valueRulesApplied: false&#x60; TOGETHER with &#x60;valueRuleSetId&#x60; returns 400 &#x60;mutually_exclusive_fields&#x60;. This is deliberate: Meta attaches the rule set whenever &#x60;value_rule_set_id&#x60; is present, even with &#x60;value_rules_applied&#x60; false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on &#x60;LOWEST_COST_WITHOUT_CAP&#x60; or &#x60;COST_CAP&#x60;. Meta rejects the rest server-side. - Read back with &#x60;GET /v1/ads/ad-sets/{adSetId}?fields&#x3D;value_rule_set_id&#x60;. Meta does not document &#x60;value_rules_applied&#x60; as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta&#39;s spec): - &#x60;LOWEST_COST_WITHOUT_CAP&#x60;: no &#x60;bidAmount&#x60;, no &#x60;roasAverageFloor&#x60;. - &#x60;LOWEST_COST_WITH_BID_CAP&#x60; / &#x60;COST_CAP&#x60;: &#x60;bidAmount&#x60; REQUIRED (whole currency units). - &#x60;LOWEST_COST_WITH_MIN_ROAS&#x60;: &#x60;roasAverageFloor&#x60; REQUIRED (decimal multiplier, e.g. 2.0 &#x3D; 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn&#39;t allow) surface as 400s from Meta. When updating &#x60;budget&#x60; 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.
333
333
  # @param ad_set_id Platform ad set ID
334
334
  # @param update_ad_set_request
335
335
  # @param [Hash] opts the optional parameters
@@ -173,4 +173,10 @@ describe Zernio::BoostPostRequest do
173
173
  end
174
174
  end
175
175
 
176
+ describe 'test attribute "optimization_goal"' do
177
+ it 'should work' do
178
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
179
+ end
180
+ end
181
+
176
182
  end
@@ -513,6 +513,18 @@ describe Zernio::CreateStandaloneAdRequest do
513
513
  end
514
514
  end
515
515
 
516
+ describe 'test attribute "value_rule_set_id"' do
517
+ it 'should work' do
518
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
519
+ end
520
+ end
521
+
522
+ describe 'test attribute "value_rules_applied"' do
523
+ it 'should work' do
524
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
525
+ end
526
+ end
527
+
516
528
  describe 'test attribute "platform_specific_data"' do
517
529
  it 'should work' do
518
530
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,42 @@
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::CreateValueRuleSet201Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::CreateValueRuleSet201Response do
21
+ #let(:instance) { Zernio::CreateValueRuleSet201Response.new }
22
+
23
+ describe 'test an instance of CreateValueRuleSet201Response' do
24
+ it 'should create an instance of CreateValueRuleSet201Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::CreateValueRuleSet201Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "ad_account_id"' 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 "value_rule_set_id"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ end