Class OSPolicyAssignment.Builder (2.57.0)

public static final class OSPolicyAssignment.Builder extends GeneratedMessageV3.Builder<OSPolicyAssignment.Builder> implements OSPolicyAssignmentOrBuilder

OS policy assignment is an API resource that is used to apply a set of OS policies to a dynamically targeted group of Compute Engine VM instances.

An OS policy is used to define the desired state configuration for a Compute Engine VM instance through a set of configuration resources that provide capabilities such as installing or removing software packages, or executing a script.

For more information, see OS policy and OS policy assignment.

Protobuf type google.cloud.osconfig.v1.OSPolicyAssignment

Static Methods

getDescriptor()

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

Methods

addAllOsPolicies(Iterable<? extends OSPolicy> values)

public OSPolicyAssignment.Builder addAllOsPolicies(Iterable<? extends OSPolicy> values)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends com.google.cloud.osconfig.v1.OSPolicy>
Returns
Type Description
OSPolicyAssignment.Builder

addOsPolicies(OSPolicy value)

public OSPolicyAssignment.Builder addOsPolicies(OSPolicy value)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OSPolicy
Returns
Type Description
OSPolicyAssignment.Builder

addOsPolicies(OSPolicy.Builder builderForValue)

public OSPolicyAssignment.Builder addOsPolicies(OSPolicy.Builder builderForValue)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue OSPolicy.Builder
Returns
Type Description
OSPolicyAssignment.Builder

addOsPolicies(int index, OSPolicy value)

public OSPolicyAssignment.Builder addOsPolicies(int index, OSPolicy value)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value OSPolicy
Returns
Type Description
OSPolicyAssignment.Builder

addOsPolicies(int index, OSPolicy.Builder builderForValue)

public OSPolicyAssignment.Builder addOsPolicies(int index, OSPolicy.Builder builderForValue)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue OSPolicy.Builder
Returns
Type Description
OSPolicyAssignment.Builder

addOsPoliciesBuilder()

public OSPolicy.Builder addOsPoliciesBuilder()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicy.Builder

addOsPoliciesBuilder(int index)

public OSPolicy.Builder addOsPoliciesBuilder(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public OSPolicyAssignment build()
Returns
Type Description
OSPolicyAssignment

buildPartial()

public OSPolicyAssignment buildPartial()
Returns
Type Description
OSPolicyAssignment

clear()

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

clearBaseline()

public OSPolicyAssignment.Builder clearBaseline()

Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision.

For a given OS policy assignment, there is only one revision with a value of true for this field.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearDeleted()

public OSPolicyAssignment.Builder clearDeleted()

Output only. Indicates that this revision deletes the OS policy assignment.

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearDescription()

public OSPolicyAssignment.Builder clearDescription()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearEtag()

public OSPolicyAssignment.Builder clearEtag()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearInstanceFilter()

public OSPolicyAssignment.Builder clearInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Builder

clearName()

public OSPolicyAssignment.Builder clearName()

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOsPolicies()

public OSPolicyAssignment.Builder clearOsPolicies()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Builder

clearReconciling()

public OSPolicyAssignment.Builder clearReconciling()

Output only. Indicates that reconciliation is in progress for the revision. This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearRevisionCreateTime()

public OSPolicyAssignment.Builder clearRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

clearRevisionId()

public OSPolicyAssignment.Builder clearRevisionId()

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearRollout()

public OSPolicyAssignment.Builder clearRollout()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Builder

clearRolloutState()

public OSPolicyAssignment.Builder clearRolloutState()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clearUid()

public OSPolicyAssignment.Builder clearUid()

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

clone()

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

getBaseline()

public boolean getBaseline()

Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision.

For a given OS policy assignment, there is only one revision with a value of true for this field.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The baseline.

getDefaultInstanceForType()

public OSPolicyAssignment getDefaultInstanceForType()
Returns
Type Description
OSPolicyAssignment

getDeleted()

public boolean getDeleted()

Output only. Indicates that this revision deletes the OS policy assignment.

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The deleted.

getDescription()

public String getDescription()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

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

getEtag()

public String getEtag()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
Type Description
ByteString

The bytes for etag.

getInstanceFilter()

public OSPolicyAssignment.InstanceFilter getInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.InstanceFilter

The instanceFilter.

getInstanceFilterBuilder()

public OSPolicyAssignment.InstanceFilter.Builder getInstanceFilterBuilder()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.InstanceFilter.Builder

getInstanceFilterOrBuilder()

public OSPolicyAssignment.InstanceFilterOrBuilder getInstanceFilterOrBuilder()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.InstanceFilterOrBuilder

getName()

public String getName()

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOsPolicies(int index)

public OSPolicy getOsPolicies(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy

getOsPoliciesBuilder(int index)

public OSPolicy.Builder getOsPoliciesBuilder(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy.Builder

getOsPoliciesBuilderList()

public List<OSPolicy.Builder> getOsPoliciesBuilderList()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Builder>

getOsPoliciesCount()

public int getOsPoliciesCount()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getOsPoliciesList()

public List<OSPolicy> getOsPoliciesList()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<OSPolicy>

getOsPoliciesOrBuilder(int index)

public OSPolicyOrBuilder getOsPoliciesOrBuilder(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicyOrBuilder

getOsPoliciesOrBuilderList()

public List<? extends OSPolicyOrBuilder> getOsPoliciesOrBuilderList()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.osconfig.v1.OSPolicyOrBuilder>

getReconciling()

public boolean getReconciling()

Output only. Indicates that reconciliation is in progress for the revision. This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The reconciling.

getRevisionCreateTime()

public Timestamp getRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The revisionCreateTime.

getRevisionCreateTimeBuilder()

public Timestamp.Builder getRevisionCreateTimeBuilder()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getRevisionCreateTimeOrBuilder()

public TimestampOrBuilder getRevisionCreateTimeOrBuilder()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getRevisionId()

public String getRevisionId()

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The revisionId.

getRevisionIdBytes()

public ByteString getRevisionIdBytes()

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for revisionId.

getRollout()

public OSPolicyAssignment.Rollout getRollout()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Rollout

The rollout.

getRolloutBuilder()

public OSPolicyAssignment.Rollout.Builder getRolloutBuilder()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Rollout.Builder

getRolloutOrBuilder()

public OSPolicyAssignment.RolloutOrBuilder getRolloutOrBuilder()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.RolloutOrBuilder

getRolloutState()

public OSPolicyAssignment.RolloutState getRolloutState()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.RolloutState

The rolloutState.

getRolloutStateValue()

public int getRolloutStateValue()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for rolloutState.

getUid()

public String getUid()

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The uid.

getUidBytes()

public ByteString getUidBytes()

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for uid.

hasInstanceFilter()

public boolean hasInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the instanceFilter field is set.

hasRevisionCreateTime()

public boolean hasRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the revisionCreateTime field is set.

hasRollout()

public boolean hasRollout()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the rollout field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(OSPolicyAssignment other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeInstanceFilter(OSPolicyAssignment.InstanceFilter value)

public OSPolicyAssignment.Builder mergeInstanceFilter(OSPolicyAssignment.InstanceFilter value)

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OSPolicyAssignment.InstanceFilter
Returns
Type Description
OSPolicyAssignment.Builder

mergeRevisionCreateTime(Timestamp value)

public OSPolicyAssignment.Builder mergeRevisionCreateTime(Timestamp value)

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
OSPolicyAssignment.Builder

mergeRollout(OSPolicyAssignment.Rollout value)

public OSPolicyAssignment.Builder mergeRollout(OSPolicyAssignment.Rollout value)

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OSPolicyAssignment.Rollout
Returns
Type Description
OSPolicyAssignment.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeOsPolicies(int index)

public OSPolicyAssignment.Builder removeOsPolicies(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicyAssignment.Builder

setBaseline(boolean value)

public OSPolicyAssignment.Builder setBaseline(boolean value)

Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision.

For a given OS policy assignment, there is only one revision with a value of true for this field.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value boolean

The baseline to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setDeleted(boolean value)

public OSPolicyAssignment.Builder setDeleted(boolean value)

Output only. Indicates that this revision deletes the OS policy assignment.

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value boolean

The deleted to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setDescription(String value)

public OSPolicyAssignment.Builder setDescription(String value)

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Parameter
Name Description
value String

The description to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public OSPolicyAssignment.Builder setDescriptionBytes(ByteString value)

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setEtag(String value)

public OSPolicyAssignment.Builder setEtag(String value)

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Parameter
Name Description
value String

The etag to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public OSPolicyAssignment.Builder setEtagBytes(ByteString value)

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Parameter
Name Description
value ByteString

The bytes for etag to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setInstanceFilter(OSPolicyAssignment.InstanceFilter value)

public OSPolicyAssignment.Builder setInstanceFilter(OSPolicyAssignment.InstanceFilter value)

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OSPolicyAssignment.InstanceFilter
Returns
Type Description
OSPolicyAssignment.Builder

setInstanceFilter(OSPolicyAssignment.InstanceFilter.Builder builderForValue)

public OSPolicyAssignment.Builder setInstanceFilter(OSPolicyAssignment.InstanceFilter.Builder builderForValue)

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue OSPolicyAssignment.InstanceFilter.Builder
Returns
Type Description
OSPolicyAssignment.Builder

setName(String value)

public OSPolicyAssignment.Builder setName(String value)

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setNameBytes(ByteString value)

public OSPolicyAssignment.Builder setNameBytes(ByteString value)

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setOsPolicies(int index, OSPolicy value)

public OSPolicyAssignment.Builder setOsPolicies(int index, OSPolicy value)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value OSPolicy
Returns
Type Description
OSPolicyAssignment.Builder

setOsPolicies(int index, OSPolicy.Builder builderForValue)

public OSPolicyAssignment.Builder setOsPolicies(int index, OSPolicy.Builder builderForValue)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue OSPolicy.Builder
Returns
Type Description
OSPolicyAssignment.Builder

setReconciling(boolean value)

public OSPolicyAssignment.Builder setReconciling(boolean value)

Output only. Indicates that reconciliation is in progress for the revision. This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value boolean

The reconciling to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

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

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

setRevisionCreateTime(Timestamp value)

public OSPolicyAssignment.Builder setRevisionCreateTime(Timestamp value)

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
OSPolicyAssignment.Builder

setRevisionCreateTime(Timestamp.Builder builderForValue)

public OSPolicyAssignment.Builder setRevisionCreateTime(Timestamp.Builder builderForValue)

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
OSPolicyAssignment.Builder

setRevisionId(String value)

public OSPolicyAssignment.Builder setRevisionId(String value)

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The revisionId to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setRevisionIdBytes(ByteString value)

public OSPolicyAssignment.Builder setRevisionIdBytes(ByteString value)

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for revisionId to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setRollout(OSPolicyAssignment.Rollout value)

public OSPolicyAssignment.Builder setRollout(OSPolicyAssignment.Rollout value)

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OSPolicyAssignment.Rollout
Returns
Type Description
OSPolicyAssignment.Builder

setRollout(OSPolicyAssignment.Rollout.Builder builderForValue)

public OSPolicyAssignment.Builder setRollout(OSPolicyAssignment.Rollout.Builder builderForValue)

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue OSPolicyAssignment.Rollout.Builder
Returns
Type Description
OSPolicyAssignment.Builder

setRolloutState(OSPolicyAssignment.RolloutState value)

public OSPolicyAssignment.Builder setRolloutState(OSPolicyAssignment.RolloutState value)

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value OSPolicyAssignment.RolloutState

The rolloutState to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setRolloutStateValue(int value)

public OSPolicyAssignment.Builder setRolloutStateValue(int value)

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The enum numeric value on the wire for rolloutState to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setUid(String value)

public OSPolicyAssignment.Builder setUid(String value)

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The uid to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setUidBytes(ByteString value)

public OSPolicyAssignment.Builder setUidBytes(ByteString value)

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for uid to set.

Returns
Type Description
OSPolicyAssignment.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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