Class ContentPolicy (3.103.0)

public final class ContentPolicy extends GeneratedMessage implements ContentPolicyOrBuilder

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

Protobuf type google.privacy.dlp.v2.ContentPolicy

Static Fields

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DEFAULT_ACTION_FIELD_NUMBER

public static final int DEFAULT_ACTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

ERRORS_FIELD_NUMBER

public static final int ERRORS_FIELD_NUMBER
Field Value
Type Description
int

FAILED_TO_SCAN_SUPPORTED_FILE_TYPE_FIELD_NUMBER

public static final int FAILED_TO_SCAN_SUPPORTED_FILE_TYPE_FIELD_NUMBER
Field Value
Type Description
int

INPUT_TOO_LARGE_FIELD_NUMBER

public static final int INPUT_TOO_LARGE_FIELD_NUMBER
Field Value
Type Description
int

INSPECT_CONFIG_FIELD_NUMBER

public static final int INSPECT_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

LOGGING_CONFIGS_FIELD_NUMBER

public static final int LOGGING_CONFIGS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

RULES_FIELD_NUMBER

public static final int RULES_FIELD_NUMBER
Field Value
Type Description
int

UNSUPPORTED_FILE_TYPE_FIELD_NUMBER

public static final int UNSUPPORTED_FILE_TYPE_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ContentPolicy getDefaultInstance()
Returns
Type Description
ContentPolicy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ContentPolicy.Builder newBuilder()
Returns
Type Description
ContentPolicy.Builder

newBuilder(ContentPolicy prototype)

public static ContentPolicy.Builder newBuilder(ContentPolicy prototype)
Parameter
Name Description
prototype ContentPolicy
Returns
Type Description
ContentPolicy.Builder

parseDelimitedFrom(InputStream input)

public static ContentPolicy parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ContentPolicy parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ContentPolicy parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ContentPolicy parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ContentPolicy parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ContentPolicy parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ContentPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ContentPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ContentPolicy> parser()
Returns
Type Description
Parser<ContentPolicy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCreateTime()

public Timestamp getCreateTime()

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

.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

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

.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultAction()

public ContentPolicy.PolicyAction getDefaultAction()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction default_action = 11;

Returns
Type Description
ContentPolicy.PolicyAction

The defaultAction.

getDefaultActionOrBuilder()

public ContentPolicy.PolicyActionOrBuilder getDefaultActionOrBuilder()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction default_action = 11;

Returns
Type Description
ContentPolicy.PolicyActionOrBuilder

getDefaultInstanceForType()

public ContentPolicy getDefaultInstanceForType()
Returns
Type Description
ContentPolicy

getDisplayName()

public String getDisplayName()

Optional. Display name (max 63 chars)

string display_name = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Optional. Display name (max 63 chars)

string display_name = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for displayName.

getErrors(int index)

public Error getErrors(int index)

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.

repeated .google.privacy.dlp.v2.Error errors = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Error

getErrorsCount()

public int getErrorsCount()

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.

repeated .google.privacy.dlp.v2.Error errors = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getErrorsList()

public List<Error> getErrorsList()

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.

repeated .google.privacy.dlp.v2.Error errors = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Error>

getErrorsOrBuilder(int index)

public ErrorOrBuilder getErrorsOrBuilder(int index)

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.

repeated .google.privacy.dlp.v2.Error errors = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ErrorOrBuilder

getErrorsOrBuilderList()

public List<? extends ErrorOrBuilder> getErrorsOrBuilderList()

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.

repeated .google.privacy.dlp.v2.Error errors = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.privacy.dlp.v2.ErrorOrBuilder>

getFailedToScanSupportedFileType()

public ContentPolicy.PolicyAction getFailedToScanSupportedFileType()

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.

.google.privacy.dlp.v2.ContentPolicy.PolicyAction failed_to_scan_supported_file_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyAction

The failedToScanSupportedFileType.

getFailedToScanSupportedFileTypeOrBuilder()

public ContentPolicy.PolicyActionOrBuilder getFailedToScanSupportedFileTypeOrBuilder()

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.

.google.privacy.dlp.v2.ContentPolicy.PolicyAction failed_to_scan_supported_file_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyActionOrBuilder

getInputTooLarge()

public ContentPolicy.PolicyAction getInputTooLarge()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction input_too_large = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyAction

The inputTooLarge.

getInputTooLargeOrBuilder()

public ContentPolicy.PolicyActionOrBuilder getInputTooLargeOrBuilder()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction input_too_large = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyActionOrBuilder

getInspectConfig()

public InspectConfig getInspectConfig()

Optional. InspectConfig to use to produce findings.

.google.privacy.dlp.v2.InspectConfig inspect_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
InspectConfig

The inspectConfig.

getInspectConfigOrBuilder()

public InspectConfigOrBuilder getInspectConfigOrBuilder()

Optional. InspectConfig to use to produce findings.

.google.privacy.dlp.v2.InspectConfig inspect_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
InspectConfigOrBuilder

getLoggingConfigs(int index)

public ContentPolicy.LoggingConfig getLoggingConfigs(int index)

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

repeated .google.privacy.dlp.v2.ContentPolicy.LoggingConfig logging_configs = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ContentPolicy.LoggingConfig

getLoggingConfigsCount()

public int getLoggingConfigsCount()

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

repeated .google.privacy.dlp.v2.ContentPolicy.LoggingConfig logging_configs = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getLoggingConfigsList()

public List<ContentPolicy.LoggingConfig> getLoggingConfigsList()

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

repeated .google.privacy.dlp.v2.ContentPolicy.LoggingConfig logging_configs = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<LoggingConfig>

getLoggingConfigsOrBuilder(int index)

public ContentPolicy.LoggingConfigOrBuilder getLoggingConfigsOrBuilder(int index)

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

repeated .google.privacy.dlp.v2.ContentPolicy.LoggingConfig logging_configs = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ContentPolicy.LoggingConfigOrBuilder

getLoggingConfigsOrBuilderList()

public List<? extends ContentPolicy.LoggingConfigOrBuilder> getLoggingConfigsOrBuilderList()

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

repeated .google.privacy.dlp.v2.ContentPolicy.LoggingConfig logging_configs = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.privacy.dlp.v2.ContentPolicy.LoggingConfigOrBuilder>

getName()

public String getName()

Output only. Resource name of the policy.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. Resource name of the policy.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<ContentPolicy> getParserForType()
Returns
Type Description
Parser<ContentPolicy>
Overrides

getRules(int index)

public ContentPolicy.PolicyRule getRules(int index)

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

repeated .google.privacy.dlp.v2.ContentPolicy.PolicyRule rules = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
ContentPolicy.PolicyRule

getRulesCount()

public int getRulesCount()

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

repeated .google.privacy.dlp.v2.ContentPolicy.PolicyRule rules = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getRulesList()

public List<ContentPolicy.PolicyRule> getRulesList()

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

repeated .google.privacy.dlp.v2.ContentPolicy.PolicyRule rules = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<PolicyRule>

getRulesOrBuilder(int index)

public ContentPolicy.PolicyRuleOrBuilder getRulesOrBuilder(int index)

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

repeated .google.privacy.dlp.v2.ContentPolicy.PolicyRule rules = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
ContentPolicy.PolicyRuleOrBuilder

getRulesOrBuilderList()

public List<? extends ContentPolicy.PolicyRuleOrBuilder> getRulesOrBuilderList()

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

repeated .google.privacy.dlp.v2.ContentPolicy.PolicyRule rules = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.privacy.dlp.v2.ContentPolicy.PolicyRuleOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUnsupportedFileType()

public ContentPolicy.PolicyAction getUnsupportedFileType()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction unsupported_file_type = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyAction

The unsupportedFileType.

getUnsupportedFileTypeOrBuilder()

public ContentPolicy.PolicyActionOrBuilder getUnsupportedFileTypeOrBuilder()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction unsupported_file_type = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentPolicy.PolicyActionOrBuilder

getUpdateTime()

public Timestamp getUpdateTime()

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

.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

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

.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

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

.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasDefaultAction()

public boolean hasDefaultAction()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction default_action = 11;

Returns
Type Description
boolean

Whether the defaultAction field is set.

hasFailedToScanSupportedFileType()

public boolean hasFailedToScanSupportedFileType()

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.

.google.privacy.dlp.v2.ContentPolicy.PolicyAction failed_to_scan_supported_file_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the failedToScanSupportedFileType field is set.

hasInputTooLarge()

public boolean hasInputTooLarge()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction input_too_large = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the inputTooLarge field is set.

hasInspectConfig()

public boolean hasInspectConfig()

Optional. InspectConfig to use to produce findings.

.google.privacy.dlp.v2.InspectConfig inspect_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the inspectConfig field is set.

hasUnsupportedFileType()

public boolean hasUnsupportedFileType()

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

.google.privacy.dlp.v2.ContentPolicy.PolicyAction unsupported_file_type = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the unsupportedFileType field is set.

hasUpdateTime()

public boolean hasUpdateTime()

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

.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ContentPolicy.Builder newBuilderForType()
Returns
Type Description
ContentPolicy.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected ContentPolicy.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ContentPolicy.Builder
Overrides

toBuilder()

public ContentPolicy.Builder toBuilder()
Returns
Type Description
ContentPolicy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException