Class SecurityPosture.Builder (2.45.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.v2.SecurityPosture

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails>
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
valueSecurityPosture.PolicyDriftDetails
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
builderForValueSecurityPosture.PolicyDriftDetails.Builder
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
NameDescription
indexint
valueSecurityPosture.PolicyDriftDetails
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
NameDescription
indexint
builderForValueSecurityPosture.PolicyDriftDetails.Builder
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
SecurityPosture.PolicyDriftDetails.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SecurityPosture.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SecurityPosture.Builder
Overrides

build()

public SecurityPosture build()
Returns
TypeDescription
SecurityPosture

buildPartial()

public SecurityPosture buildPartial()
Returns
TypeDescription
SecurityPosture

clear()

public SecurityPosture.Builder clear()
Returns
TypeDescription
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
TypeDescription
SecurityPosture.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SecurityPosture.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
SecurityPosture.Builder
Overrides

clearName()

public SecurityPosture.Builder clearName()

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

string name = 1;

Returns
TypeDescription
SecurityPosture.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SecurityPosture.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
SecurityPosture.Builder
Overrides

clearPolicy()

public SecurityPosture.Builder clearPolicy()

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

string policy = 7;

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
TypeDescription
SecurityPosture.Builder

clearPolicySet()

public SecurityPosture.Builder clearPolicySet()

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

string policy_set = 6;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
SecurityPosture.Builder

This builder for chaining.

clearRevisionId()

public SecurityPosture.Builder clearRevisionId()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
TypeDescription
SecurityPosture.Builder

This builder for chaining.

clone()

public SecurityPosture.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for changedPolicy.

getDefaultInstanceForType()

public SecurityPosture getDefaultInstanceForType()
Returns
TypeDescription
SecurityPosture

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getName()

public String getName()

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

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getPolicy()

public String getPolicy()

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

string policy = 7;

Returns
TypeDescription
String

The policy.

getPolicyBytes()

public ByteString getPolicyBytes()

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

string policy = 7;

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
TypeDescription
List<Builder>

getPolicyDriftDetailsCount()

public int getPolicyDriftDetailsCount()

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

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

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Returns
TypeDescription
List<? extends com.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetailsOrBuilder>

getPolicySet()

public String getPolicySet()

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

string policy_set = 6;

Returns
TypeDescription
String

The policySet.

getPolicySetBytes()

public ByteString getPolicySetBytes()

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

string policy_set = 6;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for postureDeploymentResource.

getRevisionId()

public String getRevisionId()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
TypeDescription
String

The revisionId.

getRevisionIdBytes()

public ByteString getRevisionIdBytes()

The version of the posture, for example, c7cfa2a8.

string revision_id = 2;

Returns
TypeDescription
ByteString

The bytes for revisionId.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SecurityPosture other)

public SecurityPosture.Builder mergeFrom(SecurityPosture other)
Parameter
NameDescription
otherSecurityPosture
Returns
TypeDescription
SecurityPosture.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SecurityPosture.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SecurityPosture.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public SecurityPosture.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
SecurityPosture.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SecurityPosture.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
valueString

The changedPolicy to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for changedPolicy to set.

Returns
TypeDescription
SecurityPosture.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SecurityPosture.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SecurityPosture.Builder
Overrides

setName(String value)

public SecurityPosture.Builder setName(String value)

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

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
valueString

The policy to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for policy to set.

Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
NameDescription
indexint
valueSecurityPosture.PolicyDriftDetails
Returns
TypeDescription
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.v2.SecurityPosture.PolicyDriftDetails policy_drift_details = 8;

Parameters
NameDescription
indexint
builderForValueSecurityPosture.PolicyDriftDetails.Builder
Returns
TypeDescription
SecurityPosture.Builder

setPolicySet(String value)

public SecurityPosture.Builder setPolicySet(String value)

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

string policy_set = 6;

Parameter
NameDescription
valueString

The policySet to set.

Returns
TypeDescription
SecurityPosture.Builder

This builder for chaining.

setPolicySetBytes(ByteString value)

public SecurityPosture.Builder setPolicySetBytes(ByteString value)

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

string policy_set = 6;

Parameter
NameDescription
valueByteString

The bytes for policySet to set.

Returns
TypeDescription
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
NameDescription
valueString

The postureDeployment to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for postureDeployment to set.

Returns
TypeDescription
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
NameDescription
valueString

The postureDeploymentResource to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for postureDeploymentResource to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The revisionId to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for revisionId to set.

Returns
TypeDescription
SecurityPosture.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final SecurityPosture.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SecurityPosture.Builder
Overrides