Class OSPolicy.Resource.Builder (2.15.0)

public static final class OSPolicy.Resource.Builder extends GeneratedMessageV3.Builder<OSPolicy.Resource.Builder> implements OSPolicy.ResourceOrBuilder

An OS policy resource is used to define the desired state configuration and provides a specific functionality like installing/removing packages, executing a script etc. The system ensures that resources are always in their desired state by taking necessary actions if they have drifted from their desired state.

Protobuf type google.cloud.osconfig.v1.OSPolicy.Resource

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public OSPolicy.Resource build()
Returns
TypeDescription
OSPolicy.Resource

buildPartial()

public OSPolicy.Resource buildPartial()
Returns
TypeDescription
OSPolicy.Resource

clear()

public OSPolicy.Resource.Builder clear()
Returns
TypeDescription
OSPolicy.Resource.Builder
Overrides

clearExec()

public OSPolicy.Resource.Builder clearExec()

Exec resource

.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource exec = 4;

Returns
TypeDescription
OSPolicy.Resource.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearFile()

public OSPolicy.Resource.Builder clearFile()

File resource

.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource file = 5;

Returns
TypeDescription
OSPolicy.Resource.Builder

clearId()

public OSPolicy.Resource.Builder clearId()

Required. The id of the resource with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the OS policy.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicy.Resource.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPkg()

public OSPolicy.Resource.Builder clearPkg()

Package resource

.google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource pkg = 2;

Returns
TypeDescription
OSPolicy.Resource.Builder

clearRepository()

public OSPolicy.Resource.Builder clearRepository()

Package repository resource

.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource repository = 3;

Returns
TypeDescription
OSPolicy.Resource.Builder

clearResourceType()

public OSPolicy.Resource.Builder clearResourceType()
Returns
TypeDescription
OSPolicy.Resource.Builder

clone()

public OSPolicy.Resource.Builder clone()
Returns
TypeDescription
OSPolicy.Resource.Builder
Overrides

getDefaultInstanceForType()

public OSPolicy.Resource getDefaultInstanceForType()
Returns
TypeDescription
OSPolicy.Resource

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getExec()

public OSPolicy.Resource.ExecResource getExec()

Exec resource

.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource exec = 4;

Returns
TypeDescription
OSPolicy.Resource.ExecResource

The exec.

getExecBuilder()

public OSPolicy.Resource.ExecResource.Builder getExecBuilder()

Exec resource

.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource exec = 4;

Returns
TypeDescription
OSPolicy.Resource.ExecResource.Builder

getExecOrBuilder()

public OSPolicy.Resource.ExecResourceOrBuilder getExecOrBuilder()

Exec resource

.google.cloud.osconfig.v1.OSPolicy.Resource.ExecResource exec = 4;

Returns
TypeDescription
OSPolicy.Resource.ExecResourceOrBuilder

getFile()

public OSPolicy.Resource.FileResource getFile()

File resource

.google.cloud.osconfig.v1.OSPolicy.Resource.FileResource file = 5;

Returns
TypeDescription
OSPolicy.Resource.FileResource

The file.

getFileBuilder()

public OSPolicy.Resource.FileResource.Builder getFileBuilder()