Class OSPolicy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder>
com.google.cloud.osconfig.v1alpha.OSPolicy.Builder
All Implemented Interfaces:
OSPolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
OSPolicy

public static final class OSPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder> implements OSPolicyOrBuilder
 An OS policy defines the desired state configuration for a VM.
 
Protobuf type google.cloud.osconfig.v1alpha.OSPolicy
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder>
    • clear

      public OSPolicy.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder>
    • getDefaultInstanceForType

      public OSPolicy getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public OSPolicy build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public OSPolicy buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public OSPolicy.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OSPolicy.Builder>
    • mergeFrom

      public OSPolicy.Builder mergeFrom(OSPolicy other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<OSPolicy.Builder>
    • mergeFrom

      public OSPolicy.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OSPolicy.Builder>
      Throws:
      IOException
    • getId

      public String getId()
       Required. The id of the OS policy 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 assignment.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getId in interface OSPolicyOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Required. The id of the OS policy 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 assignment.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getIdBytes in interface OSPolicyOrBuilder
      Returns:
      The bytes for id.
    • setId

      public OSPolicy.Builder setId(String value)
       Required. The id of the OS policy 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 assignment.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

      public OSPolicy.Builder clearId()
       Required. The id of the OS policy 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 assignment.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setIdBytes

      public OSPolicy.Builder setIdBytes(com.google.protobuf.ByteString value)
       Required. The id of the OS policy 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 assignment.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getDescription

      public String getDescription()
       Policy description.
       Length of the description is limited to 1024 characters.
       
      string description = 2;
      Specified by:
      getDescription in interface OSPolicyOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Policy description.
       Length of the description is limited to 1024 characters.
       
      string description = 2;
      Specified by:
      getDescriptionBytes in interface OSPolicyOrBuilder
      Returns:
      The bytes for description.
    • setDescription

      public OSPolicy.Builder setDescription(String value)
       Policy description.
       Length of the description is limited to 1024 characters.
       
      string description = 2;
      Parameters:
      value - The description to set.
      Returns:
      This builder for chaining.
    • clearDescription

      public OSPolicy.Builder clearDescription()
       Policy description.
       Length of the description is limited to 1024 characters.
       
      string description = 2;
      Returns:
      This builder for chaining.
    • setDescriptionBytes

      public OSPolicy.Builder setDescriptionBytes(com.google.protobuf.ByteString value)
       Policy description.
       Length of the description is limited to 1024 characters.
       
      string description = 2;
      Parameters:
      value - The bytes for description to set.
      Returns:
      This builder for chaining.
    • getModeValue

      public int getModeValue()
       Required. Policy mode
       
      .google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getModeValue in interface OSPolicyOrBuilder
      Returns:
      The enum numeric value on the wire for mode.
    • setModeValue

      public OSPolicy.Builder setModeValue(int value)
       Required. Policy mode
       
      .google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enum numeric value on the wire for mode to set.
      Returns:
      This builder for chaining.
    • getMode

      public OSPolicy.Mode getMode()
       Required. Policy mode
       
      .google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMode in interface OSPolicyOrBuilder
      Returns:
      The mode.
    • setMode

      public OSPolicy.Builder setMode(OSPolicy.Mode value)
       Required. Policy mode
       
      .google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The mode to set.
      Returns:
      This builder for chaining.
    • clearMode

      public OSPolicy.Builder clearMode()
       Required. Policy mode
       
      .google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getResourceGroupsList

      public List<OSPolicy.ResourceGroup> getResourceGroupsList()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getResourceGroupsList in interface OSPolicyOrBuilder
    • getResourceGroupsCount

      public int getResourceGroupsCount()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getResourceGroupsCount in interface OSPolicyOrBuilder
    • getResourceGroups

      public OSPolicy.ResourceGroup getResourceGroups(int index)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getResourceGroups in interface OSPolicyOrBuilder
    • setResourceGroups

      public OSPolicy.Builder setResourceGroups(int index, OSPolicy.ResourceGroup value)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • setResourceGroups

      public OSPolicy.Builder setResourceGroups(int index, OSPolicy.ResourceGroup.Builder builderForValue)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addResourceGroups

      public OSPolicy.Builder addResourceGroups(OSPolicy.ResourceGroup value)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addResourceGroups

      public OSPolicy.Builder addResourceGroups(int index, OSPolicy.ResourceGroup value)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addResourceGroups

      public OSPolicy.Builder addResourceGroups(OSPolicy.ResourceGroup.Builder builderForValue)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addResourceGroups

      public OSPolicy.Builder addResourceGroups(int index, OSPolicy.ResourceGroup.Builder builderForValue)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addAllResourceGroups

      public OSPolicy.Builder addAllResourceGroups(Iterable<? extends OSPolicy.ResourceGroup> values)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • clearResourceGroups

      public OSPolicy.Builder clearResourceGroups()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • removeResourceGroups

      public OSPolicy.Builder removeResourceGroups(int index)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • getResourceGroupsBuilder

      public OSPolicy.ResourceGroup.Builder getResourceGroupsBuilder(int index)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • getResourceGroupsOrBuilder

      public OSPolicy.ResourceGroupOrBuilder getResourceGroupsOrBuilder(int index)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getResourceGroupsOrBuilder in interface OSPolicyOrBuilder
    • getResourceGroupsOrBuilderList

      public List<? extends OSPolicy.ResourceGroupOrBuilder> getResourceGroupsOrBuilderList()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getResourceGroupsOrBuilderList in interface OSPolicyOrBuilder
    • addResourceGroupsBuilder

      public OSPolicy.ResourceGroup.Builder addResourceGroupsBuilder()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • addResourceGroupsBuilder

      public OSPolicy.ResourceGroup.Builder addResourceGroupsBuilder(int index)
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • getResourceGroupsBuilderList

      public List<OSPolicy.ResourceGroup.Builder> getResourceGroupsBuilderList()
       Required. List of resource groups for the policy.
       For a particular VM, resource groups are evaluated in the order specified
       and the first resource group that is applicable is selected and the rest
       are ignored.
      
       If none of the resource groups are applicable for a VM, the VM is
       considered to be non-compliant w.r.t this policy. This behavior can be
       toggled by the flag `allow_no_resource_group_match`
       
      repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];
    • getAllowNoResourceGroupMatch

      public boolean getAllowNoResourceGroupMatch()
       This flag determines the OS policy compliance status when none of the
       resource groups within the policy are applicable for a VM. Set this value
       to `true` if the policy needs to be reported as compliant even if the
       policy has nothing to validate or enforce.
       
      bool allow_no_resource_group_match = 5;
      Specified by:
      getAllowNoResourceGroupMatch in interface OSPolicyOrBuilder
      Returns:
      The allowNoResourceGroupMatch.
    • setAllowNoResourceGroupMatch

      public OSPolicy.Builder setAllowNoResourceGroupMatch(boolean value)
       This flag determines the OS policy compliance status when none of the
       resource groups within the policy are applicable for a VM. Set this value
       to `true` if the policy needs to be reported as compliant even if the
       policy has nothing to validate or enforce.
       
      bool allow_no_resource_group_match = 5;
      Parameters:
      value - The allowNoResourceGroupMatch to set.
      Returns:
      This builder for chaining.
    • clearAllowNoResourceGroupMatch

      public OSPolicy.Builder clearAllowNoResourceGroupMatch()
       This flag determines the OS policy compliance status when none of the
       resource groups within the policy are applicable for a VM. Set this value
       to `true` if the policy needs to be reported as compliant even if the
       policy has nothing to validate or enforce.
       
      bool allow_no_resource_group_match = 5;
      Returns:
      This builder for chaining.