Class InstanceOSPoliciesCompliance.Builder

  • All Implemented Interfaces:
    InstanceOSPoliciesComplianceOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    InstanceOSPoliciesCompliance

    public static final class InstanceOSPoliciesCompliance.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<InstanceOSPoliciesCompliance.Builder>
    implements InstanceOSPoliciesComplianceOrBuilder
     This API resource represents the OS policies compliance data for a Compute
     Engine virtual machine (VM) instance at a given point in time.
    
     A Compute Engine VM can have multiple OS policy assignments, and each
     assignment can have multiple OS policies. As a result, multiple OS policies
     could be applied to a single VM.
    
     You can use this API resource to determine both the compliance state of your
     VM as well as the compliance state of an individual OS policy.
    
     For more information, see [View
     compliance](https://cloud.google.com/compute/docs/os-configuration-management/view-compliance).
     
    Protobuf type google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<InstanceOSPoliciesCompliance.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.GeneratedMessageV3.Builder<InstanceOSPoliciesCompliance.Builder>
      • getDefaultInstanceForType

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

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

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

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

        public InstanceOSPoliciesCompliance.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<InstanceOSPoliciesCompliance.Builder>
        Throws:
        IOException
      • getName

        public String getName()
         Output only. The `InstanceOSPoliciesCompliance` API resource name.
        
         Format:
         `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getName in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Output only. The `InstanceOSPoliciesCompliance` API resource name.
        
         Format:
         `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getNameBytes in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The bytes for name.
      • setName

        public InstanceOSPoliciesCompliance.Builder setName​(String value)
         Output only. The `InstanceOSPoliciesCompliance` API resource name.
        
         Format:
         `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public InstanceOSPoliciesCompliance.Builder clearName()
         Output only. The `InstanceOSPoliciesCompliance` API resource name.
        
         Format:
         `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setNameBytes

        public InstanceOSPoliciesCompliance.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Output only. The `InstanceOSPoliciesCompliance` API resource name.
        
         Format:
         `projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}`
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getInstanceBytes

        public com.google.protobuf.ByteString getInstanceBytes()
         Output only. The Compute Engine VM instance name.
         
        string instance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getInstanceBytes in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The bytes for instance.
      • setInstance

        public InstanceOSPoliciesCompliance.Builder setInstance​(String value)
         Output only. The Compute Engine VM instance name.
         
        string instance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The instance to set.
        Returns:
        This builder for chaining.
      • clearInstance

        public InstanceOSPoliciesCompliance.Builder clearInstance()
         Output only. The Compute Engine VM instance name.
         
        string instance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setInstanceBytes

        public InstanceOSPoliciesCompliance.Builder setInstanceBytes​(com.google.protobuf.ByteString value)
         Output only. The Compute Engine VM instance name.
         
        string instance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for instance to set.
        Returns:
        This builder for chaining.
      • getStateValue

        public int getStateValue()
         Output only. Compliance state of the VM.
         
        .google.cloud.osconfig.v1alpha.OSPolicyComplianceState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getStateValue in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The enum numeric value on the wire for state.
      • setStateValue

        public InstanceOSPoliciesCompliance.Builder setStateValue​(int value)
         Output only. Compliance state of the VM.
         
        .google.cloud.osconfig.v1alpha.OSPolicyComplianceState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The enum numeric value on the wire for state to set.
        Returns:
        This builder for chaining.
      • setState

        public InstanceOSPoliciesCompliance.Builder setState​(OSPolicyComplianceState value)
         Output only. Compliance state of the VM.
         
        .google.cloud.osconfig.v1alpha.OSPolicyComplianceState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The state to set.
        Returns:
        This builder for chaining.
      • clearState

        public InstanceOSPoliciesCompliance.Builder clearState()
         Output only. Compliance state of the VM.
         
        .google.cloud.osconfig.v1alpha.OSPolicyComplianceState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • getDetailedState

        public String getDetailedState()
         Output only. Detailed compliance state of the VM.
         This field is populated only when compliance state is `UNKNOWN`.
        
         It may contain one of the following values:
        
         * `no-compliance-data`: Compliance data is not available for this VM.
         * `no-agent-detected`: OS Config agent is not detected for this VM.
         * `config-not-supported-by-agent`: The version of the OS Config agent
         running on this VM does not support configuration management.
         * `inactive`: VM is not running.
         * `internal-service-errors`: There were internal service errors encountered
         while enforcing compliance.
         * `agent-errors`: OS config agent encountered errors while enforcing
         compliance.
         
        string detailed_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDetailedState in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The detailedState.
      • getDetailedStateBytes

        public com.google.protobuf.ByteString getDetailedStateBytes()
         Output only. Detailed compliance state of the VM.
         This field is populated only when compliance state is `UNKNOWN`.
        
         It may contain one of the following values:
        
         * `no-compliance-data`: Compliance data is not available for this VM.
         * `no-agent-detected`: OS Config agent is not detected for this VM.
         * `config-not-supported-by-agent`: The version of the OS Config agent
         running on this VM does not support configuration management.
         * `inactive`: VM is not running.
         * `internal-service-errors`: There were internal service errors encountered
         while enforcing compliance.
         * `agent-errors`: OS config agent encountered errors while enforcing
         compliance.
         
        string detailed_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDetailedStateBytes in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The bytes for detailedState.
      • setDetailedState

        public InstanceOSPoliciesCompliance.Builder setDetailedState​(String value)
         Output only. Detailed compliance state of the VM.
         This field is populated only when compliance state is `UNKNOWN`.
        
         It may contain one of the following values:
        
         * `no-compliance-data`: Compliance data is not available for this VM.
         * `no-agent-detected`: OS Config agent is not detected for this VM.
         * `config-not-supported-by-agent`: The version of the OS Config agent
         running on this VM does not support configuration management.
         * `inactive`: VM is not running.
         * `internal-service-errors`: There were internal service errors encountered
         while enforcing compliance.
         * `agent-errors`: OS config agent encountered errors while enforcing
         compliance.
         
        string detailed_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The detailedState to set.
        Returns:
        This builder for chaining.
      • clearDetailedState

        public InstanceOSPoliciesCompliance.Builder clearDetailedState()
         Output only. Detailed compliance state of the VM.
         This field is populated only when compliance state is `UNKNOWN`.
        
         It may contain one of the following values:
        
         * `no-compliance-data`: Compliance data is not available for this VM.
         * `no-agent-detected`: OS Config agent is not detected for this VM.
         * `config-not-supported-by-agent`: The version of the OS Config agent
         running on this VM does not support configuration management.
         * `inactive`: VM is not running.
         * `internal-service-errors`: There were internal service errors encountered
         while enforcing compliance.
         * `agent-errors`: OS config agent encountered errors while enforcing
         compliance.
         
        string detailed_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setDetailedStateBytes

        public InstanceOSPoliciesCompliance.Builder setDetailedStateBytes​(com.google.protobuf.ByteString value)
         Output only. Detailed compliance state of the VM.
         This field is populated only when compliance state is `UNKNOWN`.
        
         It may contain one of the following values:
        
         * `no-compliance-data`: Compliance data is not available for this VM.
         * `no-agent-detected`: OS Config agent is not detected for this VM.
         * `config-not-supported-by-agent`: The version of the OS Config agent
         running on this VM does not support configuration management.
         * `inactive`: VM is not running.
         * `internal-service-errors`: There were internal service errors encountered
         while enforcing compliance.
         * `agent-errors`: OS config agent encountered errors while enforcing
         compliance.
         
        string detailed_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for detailedState to set.
        Returns:
        This builder for chaining.
      • getDetailedStateReason

        public String getDetailedStateReason()
         Output only. The reason for the `detailed_state` of the VM (if any).
         
        string detailed_state_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDetailedStateReason in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The detailedStateReason.
      • getDetailedStateReasonBytes

        public com.google.protobuf.ByteString getDetailedStateReasonBytes()
         Output only. The reason for the `detailed_state` of the VM (if any).
         
        string detailed_state_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDetailedStateReasonBytes in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The bytes for detailedStateReason.
      • setDetailedStateReason

        public InstanceOSPoliciesCompliance.Builder setDetailedStateReason​(String value)
         Output only. The reason for the `detailed_state` of the VM (if any).
         
        string detailed_state_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The detailedStateReason to set.
        Returns:
        This builder for chaining.
      • clearDetailedStateReason

        public InstanceOSPoliciesCompliance.Builder clearDetailedStateReason()
         Output only. The reason for the `detailed_state` of the VM (if any).
         
        string detailed_state_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setDetailedStateReasonBytes

        public InstanceOSPoliciesCompliance.Builder setDetailedStateReasonBytes​(com.google.protobuf.ByteString value)
         Output only. The reason for the `detailed_state` of the VM (if any).
         
        string detailed_state_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for detailedStateReason to set.
        Returns:
        This builder for chaining.
      • getOsPolicyCompliancesCount

        public int getOsPolicyCompliancesCount()
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getOsPolicyCompliancesCount in interface InstanceOSPoliciesComplianceOrBuilder
      • clearOsPolicyCompliances

        public InstanceOSPoliciesCompliance.Builder clearOsPolicyCompliances()
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • removeOsPolicyCompliances

        public InstanceOSPoliciesCompliance.Builder removeOsPolicyCompliances​(int index)
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • getOsPolicyCompliancesBuilder

        public InstanceOSPoliciesCompliance.OSPolicyCompliance.Builder getOsPolicyCompliancesBuilder​(int index)
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • addOsPolicyCompliancesBuilder

        public InstanceOSPoliciesCompliance.OSPolicyCompliance.Builder addOsPolicyCompliancesBuilder()
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • addOsPolicyCompliancesBuilder

        public InstanceOSPoliciesCompliance.OSPolicyCompliance.Builder addOsPolicyCompliancesBuilder​(int index)
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • getOsPolicyCompliancesBuilderList

        public List<InstanceOSPoliciesCompliance.OSPolicyCompliance.Builder> getOsPolicyCompliancesBuilderList()
         Output only. Compliance data for each `OSPolicy` that is applied to the VM.
         
        repeated .google.cloud.osconfig.v1alpha.InstanceOSPoliciesCompliance.OSPolicyCompliance os_policy_compliances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • hasLastComplianceCheckTime

        public boolean hasLastComplianceCheckTime()
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasLastComplianceCheckTime in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        Whether the lastComplianceCheckTime field is set.
      • getLastComplianceCheckTime

        public com.google.protobuf.Timestamp getLastComplianceCheckTime()
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getLastComplianceCheckTime in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The lastComplianceCheckTime.
      • setLastComplianceCheckTime

        public InstanceOSPoliciesCompliance.Builder setLastComplianceCheckTime​(com.google.protobuf.Timestamp value)
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • setLastComplianceCheckTime

        public InstanceOSPoliciesCompliance.Builder setLastComplianceCheckTime​(com.google.protobuf.Timestamp.Builder builderForValue)
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • mergeLastComplianceCheckTime

        public InstanceOSPoliciesCompliance.Builder mergeLastComplianceCheckTime​(com.google.protobuf.Timestamp value)
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • clearLastComplianceCheckTime

        public InstanceOSPoliciesCompliance.Builder clearLastComplianceCheckTime()
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • getLastComplianceCheckTimeBuilder

        public com.google.protobuf.Timestamp.Builder getLastComplianceCheckTimeBuilder()
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      • getLastComplianceCheckTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getLastComplianceCheckTimeOrBuilder()
         Output only. Timestamp of the last compliance check for the VM.
         
        .google.protobuf.Timestamp last_compliance_check_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getLastComplianceCheckTimeOrBuilder in interface InstanceOSPoliciesComplianceOrBuilder
      • getLastComplianceRunId

        public String getLastComplianceRunId()
         Output only. Unique identifier for the last compliance run.
         This id will be logged by the OS config agent during a compliance run and
         can be used for debugging and tracing purpose.
         
        string last_compliance_run_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getLastComplianceRunId in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The lastComplianceRunId.
      • getLastComplianceRunIdBytes

        public com.google.protobuf.ByteString getLastComplianceRunIdBytes()
         Output only. Unique identifier for the last compliance run.
         This id will be logged by the OS config agent during a compliance run and
         can be used for debugging and tracing purpose.
         
        string last_compliance_run_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getLastComplianceRunIdBytes in interface InstanceOSPoliciesComplianceOrBuilder
        Returns:
        The bytes for lastComplianceRunId.
      • setLastComplianceRunId

        public InstanceOSPoliciesCompliance.Builder setLastComplianceRunId​(String value)
         Output only. Unique identifier for the last compliance run.
         This id will be logged by the OS config agent during a compliance run and
         can be used for debugging and tracing purpose.
         
        string last_compliance_run_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The lastComplianceRunId to set.
        Returns:
        This builder for chaining.
      • clearLastComplianceRunId

        public InstanceOSPoliciesCompliance.Builder clearLastComplianceRunId()
         Output only. Unique identifier for the last compliance run.
         This id will be logged by the OS config agent during a compliance run and
         can be used for debugging and tracing purpose.
         
        string last_compliance_run_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setLastComplianceRunIdBytes

        public InstanceOSPoliciesCompliance.Builder setLastComplianceRunIdBytes​(com.google.protobuf.ByteString value)
         Output only. Unique identifier for the last compliance run.
         This id will be logged by the OS config agent during a compliance run and
         can be used for debugging and tracing purpose.
         
        string last_compliance_run_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for lastComplianceRunId to set.
        Returns:
        This builder for chaining.