/** * @example * { * account_id: "biz_xxxxxxxxxxxxxx", * adjustment_type: "fixed", * events: [{ * event_name: "purchase" * }], * targets: [{ * platform: "tiktok", * scope: "business" * }] * } */ export interface CreateAdConversionValueRulesRequest { /** Business that owns the rule. */ account_id: string; adjustment_type: CreateAdConversionValueRulesRequest.AdjustmentType; /** Events adjusted on every selected target. Every platform must support every selected event. */ events: CreateAdConversionValueRulesRequest.Events.Item[]; fixed_value?: CreateAdConversionValueRulesRequest.FixedValue | null; metadata?: Record; /** Signed percent change from negative 100 to 10000. The sent value cannot go below zero. */ percentage_change?: number | null; /** Exact IDs of active rules whose overlapping selections will be replaced. Other selections keep their values; remaining selections may split into separate rules. Broader rules remain as fallbacks for other items. Rules left with no selections are paused. Stale or incomplete conflict selections fail. */ replace_rule_ids?: string[]; /** Initial rule status. Defaults to active. */ status?: CreateAdConversionValueRulesRequest.Status; /** Targets sharing one scope. Every selected event applies to every target. At most 500 target and event combinations. */ targets: CreateAdConversionValueRulesRequest.Targets.Item[]; } export declare namespace CreateAdConversionValueRulesRequest { const AdjustmentType: { readonly Fixed: "fixed"; readonly Percentage: "percentage"; }; type AdjustmentType = (typeof AdjustmentType)[keyof typeof AdjustmentType]; type Events = Events.Item[]; namespace Events { interface Item { /** Exact custom event name. Required for custom events; `null` for standard events. Google does not support named custom events. */ custom_name?: (string | null) | undefined; event_name: Item.EventName; } namespace Item { const EventName: { readonly Purchase: "purchase"; readonly Subscribe: "subscribe"; readonly StartTrial: "start_trial"; readonly Lead: "lead"; readonly CompleteRegistration: "complete_registration"; readonly SubmitApplication: "submit_application"; readonly Schedule: "schedule"; readonly Contact: "contact"; readonly ViewContent: "view_content"; readonly AddToCart: "add_to_cart"; readonly Custom: "custom"; }; type EventName = (typeof EventName)[keyof typeof EventName]; } } interface FixedValue { /** Decimal amount with at most 2 decimal places. Fixed values must be greater than 0 and at most 99999999.99. */ amount: string; currency: string; } /** Initial rule status. Defaults to active. */ const Status: { readonly Active: "active"; readonly Paused: "paused"; }; type Status = (typeof Status)[keyof typeof Status]; type Targets = Targets.Item[]; namespace Targets { interface Item { platform: Item.Platform; /** Campaign, ad group, or ad ID. Null for a business target. */ resource_id?: (string | null) | undefined; scope: Item.Scope; } namespace Item { const Platform: { readonly Tiktok: "tiktok"; readonly Meta: "meta"; readonly Google: "google"; }; type Platform = (typeof Platform)[keyof typeof Platform]; const Scope: { readonly Business: "business"; readonly Campaign: "campaign"; readonly AdGroup: "ad_group"; readonly Ad: "ad"; }; type Scope = (typeof Scope)[keyof typeof Scope]; } } }