REST Resource: projects.locations.contentPolicies

Resource: ContentPolicy

A policy to apply to content based on its inspection findings.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "displayName": string,
  "inspectTemplate": {
    object (InspectTemplate)
  },
  "inspectConfig": {
    object (InspectConfig)
  },
  "rules": [
    {
      object (PolicyRule)
    }
  ],
  "unsupportedFileType": {
    object (PolicyAction)
  },
  "inputTooLarge": {
    object (PolicyAction)
  },
  "failedToScanSupportedFileType": {
    object (PolicyAction)
  },
  "defaultAction": {
    object (PolicyAction)
  },
  "loggingConfigs": [
    {
      object (LoggingConfig)
    }
  ],
  "errors": [
    {
      object (Error)
    }
  ]
}
Fields
name

string

Output only. Resource name of the policy.

createTime

string (Timestamp format)

Output only. The creation timestamp of a contentPolicy; output-only field.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The last update timestamp of a contentPolicy; output-only field.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

displayName

string

Optional. Display name (max 63 chars)

inspectTemplate
(deprecated)

object (InspectTemplate)

Optional. InspectTemplate to use to produce findings. Deprecated: use inspectConfig instead.

inspectConfig

object (InspectConfig)

Optional. InspectConfig to use to produce findings.

rules[]

object (PolicyRule)

Required. Policies to apply, based on the findings returned by inspection. The first rule to match applies.

unsupportedFileType

object (PolicyAction)

Optional. Action to take if the content is an unsupported file type.

inputTooLarge

object (PolicyAction)

Optional. Action to take if the content is a supported file type but is too large to be scanned.

failedToScanSupportedFileType

object (PolicyAction)

Optional. Action to take if the content is a supported file type and size but fails to be scanned, for example because the file is encrypted or corrupted.

defaultAction

object (PolicyAction)

Action to take if the content is scanned and no rules match. Defaults to returning an ALLOW verdict if not set.

loggingConfigs[]

object (LoggingConfig)

Optional. Log the actions taken by the content policy to external systems.

errors[]

object (Error)

Output only. A stream of errors encountered when the policy was applied. Output only field. Will return the last 100 errors. Whenever the policy is modified this list will be cleared.

PolicyRule

A single policy rule. The first rule to match from the list above controls the result.

JSON representation
{
  "conditions": [
    {
      object (PolicyCondition)
    }
  ],
  "action": {
    object (PolicyAction)
  },

  // Union field deprecated_action can be only one of the following:
  "returnVerdict": enum (ContentPolicyVerdict)
  // End of list of possible types for union field deprecated_action.
}
Fields
conditions[]

object (PolicyCondition)

Optional. Conditions that must match for this rule to apply. All conditions must match (AND). For OR conditions, use multiple rules.

action

object (PolicyAction)

Required. Action to take if this rule applies.

Union field deprecated_action. Action to take if this rule applies. Deprecated: Use action instead. deprecated_action can be only one of the following:
returnVerdict
(deprecated)

enum (ContentPolicyVerdict)

If set, the verdict will be returned to the user. Deprecated: Use action instead.

PolicyCondition

A condition that must match for this rule to apply.

JSON representation
{

  // Union field condition can be only one of the following:
  "infoTypeCondition": {
    object (InfoTypeCondition)
  }
  // End of list of possible types for union field condition.
}
Fields
Union field condition. A condition. condition can be only one of the following:
infoTypeCondition

object (InfoTypeCondition)

A condition based on info types.

InfoTypeCondition

A info type based condition.

JSON representation
{

  // Union field info_type_condition can be only one of the following:
  "infoTypes": {
    object (InfoTypes)
  },
  "anyInfoType": {
    object
  }
  // End of list of possible types for union field info_type_condition.
}
Fields
Union field info_type_condition. A condition based on info types. info_type_condition can be only one of the following:
infoTypes

object (InfoTypes)

match any of these info types.

anyInfoType

object

match any info types.

InfoTypes

Info types to match.

JSON representation
{
  "infoTypeNames": [
    string
  ]
}
Fields
infoTypeNames[]

string

Required. A list of info types to match.

ContentPolicyVerdict

Possible results of applying a content policy. This may expand to include additional result types in the future.

Enums
CONTENT_POLICY_VERDICT_UNSPECIFIED Not used.
ALLOW The policy allows the provided content to be used.
BLOCK The policy prevents the provided content from being used. This should result in a blocked file upload, exclusion from training dataset, or other similar block action. (specific action will depend on the caller).

PolicyAction

A possible action to take when applying a content policy.

JSON representation
{

  // Union field action can be only one of the following:
  "returnVerdict": enum (ContentPolicyVerdict)
  // End of list of possible types for union field action.
}
Fields

Union field action.

action can be only one of the following:

returnVerdict

enum (ContentPolicyVerdict)

Optional. If set, the verdict will be returned to the user.

LoggingConfig

A single logging configuration.

JSON representation
{

  // Union field destination can be only one of the following:
  "logToBigQuery": {
    object (LogToBigQuery)
  }
  // End of list of possible types for union field destination.
}
Fields
Union field destination. The destination for the action logs. destination can be only one of the following:
logToBigQuery

object (LogToBigQuery)

Optional. Log the actions taken to a BigQuery table.

LogToBigQuery

Configuration for logging content policy actions to BigQuery.

JSON representation
{
  "projectId": string,
  "datasetId": string,
  "tableId": string
}
Fields
projectId

string

Required. The ID of the project containing the BigQuery table to write to.

datasetId

string

Required. The ID of the dataset containing the BigQuery table to write to.

tableId

string

Required. The ID of the BigQuery table to write to.

Methods

create

Create a ContentPolicy.

delete

Delete a ContentPolicy.

get

Get a ContentPolicy.

list

Lists ContentPolicies in a parent.

patch

Update a ContentPolicy.