Class SecurityPosture.Builder (2.54.0)

public static final class SecurityPosture.Builder extends GeneratedMessageV3.Builder<SecurityPosture.Builder> implements SecurityPostureOrBuilder

Represents a posture that is deployed on Google Cloud by the Security Command Center Posture Management service. A posture contains one or more policy sets. A policy set is a group of policies that enforce a set of security rules on Google Cloud.

Protobuf type google.cloud.securitycenter.v1.SecurityPosture

Static Methods

getDescriptor()

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

Methods

addAllPolicyDriftDetails(Iterable<? extends SecurityPosture.PolicyDriftDetails> values)

public SecurityPosture.Builder addAllPolicyDriftDetails(Iterable<? extends SecurityPosture.PolicyDriftDetails> values)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
values Iterable<? extends com.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails>
Returns
Type Description
SecurityPosture.Builder

addPolicyDriftDetails(SecurityPosture.PolicyDriftDetails value)

public SecurityPosture.Builder addPolicyDriftDetails(SecurityPosture.PolicyDriftDetails value)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
value SecurityPosture.PolicyDriftDetails
Returns
Type Description
SecurityPosture.Builder

addPolicyDriftDetails(SecurityPosture.PolicyDriftDetails.Builder builderForValue)

public SecurityPosture.Builder addPolicyDriftDetails(SecurityPosture.PolicyDriftDetails.Builder builderForValue)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
builderForValue SecurityPosture.PolicyDriftDetails.Builder
Returns
Type Description
SecurityPosture.Builder

addPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails value)

public SecurityPosture.Builder addPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails value)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
Name Description
index int
value SecurityPosture.PolicyDriftDetails
Returns
Type Description
SecurityPosture.Builder

addPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails.Builder builderForValue)

public SecurityPosture.Builder addPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails.Builder builderForValue)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
Name Description
index int
builderForValue SecurityPosture.PolicyDriftDetails.Builder
Returns
Type Description
SecurityPosture.Builder

addPolicyDriftDetailsBuilder()

public SecurityPosture.PolicyDriftDetails.Builder addPolicyDriftDetailsBuilder()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
SecurityPosture.PolicyDriftDetails.Builder

addPolicyDriftDetailsBuilder(int index)

public SecurityPosture.PolicyDriftDetails.Builder addPolicyDriftDetailsBuilder(int index)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
index int
Returns
Type Description
SecurityPosture.PolicyDriftDetails.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SecurityPosture.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SecurityPosture.Builder
Overrides

build()

public SecurityPosture build()
Returns
Type Description
SecurityPosture

buildPartial()

public SecurityPosture buildPartial()
Returns
Type Description
SecurityPosture

clear()

public SecurityPosture.Builder clear()
Returns
Type Description
SecurityPosture.Builder
Overrides

clearChangedPolicy()

public SecurityPosture.Builder clearChangedPolicy()

The name of the updated policy, for example, projects/{project_id}/policies/{constraint_name}.

string changed_policy = 5;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SecurityPosture.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SecurityPosture.Builder
Overrides

clearName()

public SecurityPosture.Builder clearName()

Name of the posture, for example, CIS-Posture.

string name = 1;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SecurityPosture.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SecurityPosture.Builder
Overrides

clearPolicy()

public SecurityPosture.Builder clearPolicy()

The ID of the updated policy, for example, compute-policy-1.

string policy = 7;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearPolicyDriftDetails()

public SecurityPosture.Builder clearPolicyDriftDetails()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
SecurityPosture.Builder

clearPolicySet()

public SecurityPosture.Builder clearPolicySet()

The name of the updated policyset, for example, cis-policyset.

string policy_set = 6;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearPostureDeployment()

public SecurityPosture.Builder clearPostureDeployment()

The name of the posture deployment, for example, organizations/{org_id}/posturedeployments/{posture_deployment_id}.

string posture_deployment = 4;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearPostureDeploymentResource()

public SecurityPosture.Builder clearPostureDeploymentResource()

The project, folder, or organization on which the posture is deployed, for example, projects/{project_number}.

string posture_deployment_resource = 3;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clearRevisionId()

public SecurityPosture.Builder clearRevisionId()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

clone()

public SecurityPosture.Builder clone()
Returns
Type Description
SecurityPosture.Builder
Overrides

getChangedPolicy()

public String getChangedPolicy()

The name of the updated policy, for example, projects/{project_id}/policies/{constraint_name}.

string changed_policy = 5;

Returns
Type Description
String

The changedPolicy.

getChangedPolicyBytes()

public ByteString getChangedPolicyBytes()

The name of the updated policy, for example, projects/{project_id}/policies/{constraint_name}.

string changed_policy = 5;

Returns
Type Description
ByteString

The bytes for changedPolicy.

getDefaultInstanceForType()

public SecurityPosture getDefaultInstanceForType()
Returns
Type Description
SecurityPosture

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getName()

public String getName()

Name of the posture, for example, CIS-Posture.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the posture, for example, CIS-Posture.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getPolicy()

public String getPolicy()

The ID of the updated policy, for example, compute-policy-1.

string policy = 7;

Returns
Type Description
String

The policy.

getPolicyBytes()

public ByteString getPolicyBytes()

The ID of the updated policy, for example, compute-policy-1.

string policy = 7;

Returns
Type Description
ByteString

The bytes for policy.

getPolicyDriftDetails(int index)

public SecurityPosture.PolicyDriftDetails getPolicyDriftDetails(int index)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
index int
Returns
Type Description
SecurityPosture.PolicyDriftDetails

getPolicyDriftDetailsBuilder(int index)

public SecurityPosture.PolicyDriftDetails.Builder getPolicyDriftDetailsBuilder(int index)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
index int
Returns
Type Description
SecurityPosture.PolicyDriftDetails.Builder

getPolicyDriftDetailsBuilderList()

public List<SecurityPosture.PolicyDriftDetails.Builder> getPolicyDriftDetailsBuilderList()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
List<Builder>

getPolicyDriftDetailsCount()

public int getPolicyDriftDetailsCount()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
int

getPolicyDriftDetailsList()

public List<SecurityPosture.PolicyDriftDetails> getPolicyDriftDetailsList()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
List<PolicyDriftDetails>

getPolicyDriftDetailsOrBuilder(int index)

public SecurityPosture.PolicyDriftDetailsOrBuilder getPolicyDriftDetailsOrBuilder(int index)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
index int
Returns
Type Description
SecurityPosture.PolicyDriftDetailsOrBuilder

getPolicyDriftDetailsOrBuilderList()

public List<? extends SecurityPosture.PolicyDriftDetailsOrBuilder> getPolicyDriftDetailsOrBuilderList()

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
Type Description
List<? extends com.google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetailsOrBuilder>

getPolicySet()

public String getPolicySet()

The name of the updated policyset, for example, cis-policyset.

string policy_set = 6;

Returns
Type Description
String

The policySet.

getPolicySetBytes()

public ByteString getPolicySetBytes()

The name of the updated policyset, for example, cis-policyset.

string policy_set = 6;

Returns
Type Description
ByteString

The bytes for policySet.

getPostureDeployment()

public String getPostureDeployment()

The name of the posture deployment, for example, organizations/{org_id}/posturedeployments/{posture_deployment_id}.

string posture_deployment = 4;

Returns
Type Description
String

The postureDeployment.

getPostureDeploymentBytes()

public ByteString getPostureDeploymentBytes()

The name of the posture deployment, for example, organizations/{org_id}/posturedeployments/{posture_deployment_id}.

string posture_deployment = 4;

Returns
Type Description
ByteString

The bytes for postureDeployment.

getPostureDeploymentResource()

public String getPostureDeploymentResource()

The project, folder, or organization on which the posture is deployed, for example, projects/{project_number}.

string posture_deployment_resource = 3;

Returns
Type Description
String

The postureDeploymentResource.

getPostureDeploymentResourceBytes()

public ByteString getPostureDeploymentResourceBytes()

The project, folder, or organization on which the posture is deployed, for example, projects/{project_number}.

string posture_deployment_resource = 3;

Returns
Type Description
ByteString

The bytes for postureDeploymentResource.

getRevisionId()

public String getRevisionId()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
Type Description
String

The revisionId.

getRevisionIdBytes()

public ByteString getRevisionIdBytes()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
Type Description
ByteString

The bytes for revisionId.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SecurityPosture other)

public SecurityPosture.Builder mergeFrom(SecurityPosture other)
Parameter
Name Description
other SecurityPosture
Returns
Type Description
SecurityPosture.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SecurityPosture.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SecurityPosture.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SecurityPosture.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SecurityPosture.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SecurityPosture.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SecurityPosture.Builder
Overrides

removePolicyDriftDetails(int index)

public SecurityPosture.Builder removePolicyDriftDetails(int index)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
Name Description
index int
Returns
Type Description
SecurityPosture.Builder

setChangedPolicy(String value)

public SecurityPosture.Builder setChangedPolicy(String value)

The name of the updated policy, for example, projects/{project_id}/policies/{constraint_name}.

string changed_policy = 5;

Parameter
Name Description
value String

The changedPolicy to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setChangedPolicyBytes(ByteString value)

public SecurityPosture.Builder setChangedPolicyBytes(ByteString value)

The name of the updated policy, for example, projects/{project_id}/policies/{constraint_name}.

string changed_policy = 5;

Parameter
Name Description
value ByteString

The bytes for changedPolicy to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SecurityPosture.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SecurityPosture.Builder
Overrides

setName(String value)

public SecurityPosture.Builder setName(String value)

Name of the posture, for example, CIS-Posture.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setNameBytes(ByteString value)

public SecurityPosture.Builder setNameBytes(ByteString value)

Name of the posture, for example, CIS-Posture.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPolicy(String value)

public SecurityPosture.Builder setPolicy(String value)

The ID of the updated policy, for example, compute-policy-1.

string policy = 7;

Parameter
Name Description
value String

The policy to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPolicyBytes(ByteString value)

public SecurityPosture.Builder setPolicyBytes(ByteString value)

The ID of the updated policy, for example, compute-policy-1.

string policy = 7;

Parameter
Name Description
value ByteString

The bytes for policy to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails value)

public SecurityPosture.Builder setPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails value)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
Name Description
index int
value SecurityPosture.PolicyDriftDetails
Returns
Type Description
SecurityPosture.Builder

setPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails.Builder builderForValue)

public SecurityPosture.Builder setPolicyDriftDetails(int index, SecurityPosture.PolicyDriftDetails.Builder builderForValue)

The details about a change in an updated policy that violates the deployed posture.

repeated .google.cloud.securitycenter.v1.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
Name Description
index int
builderForValue SecurityPosture.PolicyDriftDetails.Builder
Returns
Type Description
SecurityPosture.Builder

setPolicySet(String value)

public SecurityPosture.Builder setPolicySet(String value)

The name of the updated policyset, for example, cis-policyset.

string policy_set = 6;

Parameter
Name Description
value String

The policySet to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPolicySetBytes(ByteString value)

public SecurityPosture.Builder setPolicySetBytes(ByteString value)

The name of the updated policyset, for example, cis-policyset.

string policy_set = 6;

Parameter
Name Description
value ByteString

The bytes for policySet to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPostureDeployment(String value)

public SecurityPosture.Builder setPostureDeployment(String value)

The name of the posture deployment, for example, organizations/{org_id}/posturedeployments/{posture_deployment_id}.

string posture_deployment = 4;

Parameter
Name Description
value String

The postureDeployment to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPostureDeploymentBytes(ByteString value)

public SecurityPosture.Builder setPostureDeploymentBytes(ByteString value)

The name of the posture deployment, for example, organizations/{org_id}/posturedeployments/{posture_deployment_id}.

string posture_deployment = 4;

Parameter
Name Description
value ByteString

The bytes for postureDeployment to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPostureDeploymentResource(String value)

public SecurityPosture.Builder setPostureDeploymentResource(String value)

The project, folder, or organization on which the posture is deployed, for example, projects/{project_number}.

string posture_deployment_resource = 3;

Parameter
Name Description
value String

The postureDeploymentResource to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setPostureDeploymentResourceBytes(ByteString value)

public SecurityPosture.Builder setPostureDeploymentResourceBytes(ByteString value)

The project, folder, or organization on which the posture is deployed, for example, projects/{project_number}.

string posture_deployment_resource = 3;

Parameter
Name Description
value ByteString

The bytes for postureDeploymentResource to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public SecurityPosture.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SecurityPosture.Builder
Overrides

setRevisionId(String value)

public SecurityPosture.Builder setRevisionId(String value)

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Parameter
Name Description
value String

The revisionId to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setRevisionIdBytes(ByteString value)

public SecurityPosture.Builder setRevisionIdBytes(ByteString value)

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Parameter
Name Description
value ByteString

The bytes for revisionId to set.

Returns
Type Description
SecurityPosture.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final SecurityPosture.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SecurityPosture.Builder
Overrides