{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-campaign-manager/json-schema/google-campaign-manager-dynamic-profile-schema.json",
  "title": "DynamicProfile",
  "description": " *Beta:* This API resource is available only to a very limited number of customers. If you'd like to use this resource, please reach out to your Google sales representative. Contains dynamic profile information.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-campaign-manager-dynamic-profiles-api-openapi.yml#/components/schemas/DynamicProfile",
  "type": "object",
  "properties": {
    "kind": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. Identifies what kind of resource this is. Value: the fixed string \"dfareporting#dynamicProfile\"."
    },
    "description": {
      "type": "string",
      "description": "Optional. Description of this dynamic profile."
    },
    "name": {
      "description": "Required. Identifier. Name of this dynamic profile. This is a required field and must be less than 256 characters long.",
      "type": "string"
    },
    "active": {
      "$ref": "#/$defs/DynamicProfileVersion",
      "description": "Optional. Active version of the dynamic profile."
    },
    "lastModifiedInfo": {
      "$ref": "#/$defs/LastModifiedInfo",
      "description": "Output only. The last modified timestamp of the dynamic profile. This is a read-only field."
    },
    "studioAdvertiserId": {
      "description": "Required. Advertiser ID of this dynamic profile. This is a required field on insertion.",
      "format": "int64",
      "type": "string"
    },
    "draft": {
      "$ref": "#/$defs/DynamicProfileVersion",
      "description": "Optional. Draft version of the dynamic profile."
    },
    "dynamicProfileId": {
      "type": "string",
      "format": "int64",
      "readOnly": true,
      "description": "Output only. Unique ID of this dynamic profile. This is a read-only, auto-generated field."
    },
    "createInfo": {
      "$ref": "#/$defs/LastModifiedInfo",
      "description": "Output only. The creation timestamp of the dynamic profile. This is a read-only field."
    },
    "status": {
      "enum": [
        "STATUS_UNKNOWN",
        "ACTIVE",
        "INACTIVE",
        "DELETED"
      ],
      "description": "Optional. Status of this dynamic profile.",
      "type": "string"
    },
    "archiveStatus": {
      "type": "string",
      "enum": [
        "ARCHIVE_STATUS_UNKNOWN",
        "UNARCHIVED",
        "ARCHIVED"
      ],
      "description": "Optional. Archive status of this dynamic profile."
    }
  },
  "$defs": {
    "CustomRule": {
      "description": "Contains custom rule information.",
      "properties": {
        "name": {
          "description": "Optional. Name of this custom rule.",
          "type": "string"
        },
        "ruleBlocks": {
          "items": {
            "$ref": "#/$defs/RuleBlock"
          },
          "type": "array",
          "description": "Optional. A list of field filter, the custom rule will apply."
        },
        "priority": {
          "type": "integer",
          "description": "Optional. Priority of the custom rule.",
          "format": "int32"
        }
      },
      "type": "object"
    },
    "CustomValueField": {
      "description": "Contains custom value field information.",
      "properties": {
        "fieldId": {
          "type": "integer",
          "description": "Optional. Field ID in the element.",
          "format": "int32"
        },
        "requestKey": {
          "type": "string",
          "description": "Optional. Custom key used to match for auto filtering."
        }
      },
      "type": "object"
    },
    "DependentFieldValue": {
      "properties": {
        "elementId": {
          "format": "int64",
          "type": "string",
          "description": "Optional. The ID of the element that value's field will match against."
        },
        "fieldId": {
          "description": "Optional. The field id of the dependent field.",
          "format": "int32",
          "type": "integer"
        },
        "dynamicFeedId": {
          "type": "string",
          "format": "int64",
          "description": "Optional. The ID of the dynamic feed that value's field will match against."
        }
      },
      "type": "object",
      "description": "Contains dependent field value information."
    },
    "DynamicProfileFeedSettings": {
      "description": "Contains dynamic profile specific settings for an associated dynamic feed.",
      "properties": {
        "dynamicFeedId": {
          "format": "int64",
          "type": "string",
          "description": "Optional. Dynamic feed ID associated with dynamic profile version."
        },
        "quantity": {
          "format": "int32",
          "type": "integer",
          "description": "Optional. The number of this dynamic feed rows needed by the dynamic profile, default value is 1. Acceptable values are between 1 to 99, inclusive."
        },
        "dynamicRules": {
          "$ref": "#/$defs/DynamicRules",
          "description": "Optional. Dynamic rules for row selection for the given dynamic feed in the given dynamic profile."
        }
      },
      "type": "object"
    },
    "DynamicProfileVersion": {
      "properties": {
        "versionId": {
          "format": "int64",
          "type": "string",
          "description": "Output only. Version ID of this dynamic profile version. This is a read-only, auto-generated field. -1 for draft version, 0+ for published versions.",
          "readOnly": true
        },
        "dynamicProfileFeedSettings": {
          "description": "Optional. Associated dynamic feeds and their settings (including dynamic rules) for this dynamic profile version.",
          "items": {
            "$ref": "#/$defs/DynamicProfileFeedSettings"
          },
          "type": "array"
        }
      },
      "description": "Contains dynamic profile version information.",
      "type": "object"
    },
    "DynamicRules": {
      "properties": {
        "customValueFields": {
          "description": "Optional. Mapping between field ID and custom key that are used to match for auto filtering.",
          "items": {
            "$ref": "#/$defs/CustomValueField"
          },
          "type": "array"
        },
        "weightFieldId": {
          "format": "int32",
          "description": "Optional. The field ID for the feed that will be used for weighted rotation, only applicable when rotation type is WEIGHTED.",
          "type": "integer"
        },
        "customRules": {
          "items": {
            "$ref": "#/$defs/CustomRule"
          },
          "type": "array",
          "description": "Optional. The custom rules of the dynamic feed, only applicable when rule type is CUSTOM."
        },
        "ruleType": {
          "description": "Optional. The type of the rule, the default value is OPEN.",
          "enum": [
            "RULE_SET_TYPE_UNKNOWN",
            "OPEN",
            "AUTO",
            "CUSTOM",
            "PROXIMITY_TARGETING"
          ],
          "type": "string"
        },
        "proximityFilter": {
          "$ref": "#/$defs/ProximityFilter",
          "description": "Optional. The proximity targeting rules of the dynamic feed, only applicable when rule type is PROXIMITY_TARGETING."
        },
        "rotationType": {
          "type": "string",
          "enum": [
            "ROTATION_TYPE_UNKNOWN",
            "RANDOM",
            "OPTIMIZED",
            "WEIGHTED"
          ],
          "description": "Optional. The rotation type to select from eligible rows. Rotation type only apply when the filtering rule results in more than one eligible rows."
        },
        "autoTargetedFieldIds": {
          "description": "Optional. List of field IDs in this element that should be auto-targeted. Applicable when rule type is AUTO.",
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "remarketingValueAttributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RemarketingValueAttribute"
          },
          "description": "Optional. The link between an element field ID and a list of user attribute IDs."
        }
      },
      "description": "Contains dynamic rules information.",
      "type": "object"
    },
    "FieldFilter": {
      "description": "Contains field filter information.",
      "type": "object",
      "properties": {
        "requestValue": {
          "$ref": "#/$defs/RequestValue",
          "description": "Optional. The request value, only applicable when rhs_value_type is REQUEST."
        },
        "fieldId": {
          "description": "Optional. The field ID on the left hand side of the expression.",
          "type": "integer",
          "format": "int32"
        },
        "matchType": {
          "enum": [
            "LHS_MATCH_TYPE_UNKNOWN",
            "EQUALS_OR_UNRESTRICTED",
            "EQUALS",
            "UNRESTRICTED",
            "NOT_EQUALS"
          ],
          "type": "string",
          "description": "Optional. Left hand side of the expression match type."
        },
        "valueType": {
          "enum": [
            "RHS_VALUE_TYPE_UNKNOWN",
            "STRING",
            "REQUEST",
            "BOOL",
            "DEPENDENT"
          ],
          "type": "string",
          "description": "Optional. Right hand side of the expression."
        },
        "stringValue": {
          "type": "string",
          "description": "Optional. The string value, only applicable when rhs_value_type is STRING."
        },
        "dependentFieldValue": {
          "$ref": "#/$defs/DependentFieldValue",
          "description": "Optional. The dependent values, only applicable when rhs_value_type is DEPENDENT."
        },
        "boolValue": {
          "type": "boolean",
          "description": "Optional. The boolean values, only applicable when rhs_value_type is BOOL."
        }
      }
    },
    "LastModifiedInfo": {
      "description": "Modification timestamp.",
      "properties": {
        "time": {
          "type": "string",
          "description": "Timestamp of the last change in milliseconds since epoch.",
          "format": "int64"
        }
      },
      "type": "object"
    },
    "ProximityFilter": {
      "description": "Contains proximity filter information.",
      "properties": {
        "fieldId": {
          "format": "int32",
          "description": "Optional. Field ID in the element.",
          "type": "integer"
        },
        "radiusUnitType": {
          "type": "string",
          "enum": [
            "RADIUS_UNIT_TYPE_UNKNOWN",
            "KILOMETERS",
            "MILES"
          ],
          "description": "Optional. The units of the radius value"
        },
        "radiusValue": {
          "description": "Optional. Radius length in units defined by radius_units.",
          "format": "int32",
          "type": "integer"
        },
        "radiusBucketType": {
          "description": "Optional. The radius bucket type of the proximity filter",
          "type": "string",
          "enum": [
            "RADIUS_BUCKET_TYPE_UNKNOWN",
            "SMALL",
            "MEDIUM",
            "LARGE",
            "MULTI_REGIONAL",
            "NATIONAL"
          ]
        }
      },
      "type": "object"
    },
    "RemarketingValueAttribute": {
      "description": "Contains remarketing value attribute information.",
      "properties": {
        "fieldId": {
          "description": "Optional. Field ID in the element.",
          "type": "integer",
          "format": "int32"
        },
        "userAttributeIds": {
          "description": "Optional. Remarketing user attribute IDs for auto filtering.",
          "items": {
            "type": "string",
            "format": "int64"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "RequestValue": {
      "type": "object",
      "description": "Contains request value information.",
      "properties": {
        "excludeFromUserAttributeIds": {
          "type": "array",
          "description": "Optional. User attribute IDs in the request that should be excluded. Used only when the field type is REMARKETING_VALUE or USER_ATTRIBUTE_ID.",
          "items": {
            "type": "string",
            "format": "int64"
          }
        },
        "key": {
          "description": "Optional. Custom key in the request. Used only when the field type is CUSTOM_VALUE.",
          "type": "string"
        },
        "userAttributeIds": {
          "type": "array",
          "description": "Optional. User attribute IDs in the request. Used only when the field type is REMARKETING_VALUE or USER_ATTRIBUTE_ID.",
          "items": {
            "format": "int64",
            "type": "string"
          }
        }
      }
    },
    "RuleBlock": {
      "properties": {
        "fieldFilter": {
          "items": {
            "$ref": "#/$defs/FieldFilter"
          },
          "type": "array",
          "description": "Optional. A list of non-auto field filters"
        }
      },
      "type": "object",
      "description": "Contains a list of field filters that the given custom rule will apply."
    }
  }
}