Class ResourceContext.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ResourceContext.Builder>
com.google.cloud.policysimulator.v1.ResourceContext.Builder
All Implemented Interfaces:
ResourceContextOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ResourceContext

public static final class ResourceContext.Builder extends com.google.protobuf.GeneratedMessage.Builder<ResourceContext.Builder> implements ResourceContextOrBuilder
 ResourceContext provides the context we know about a resource.
 It is similar in concept to google.cloud.asset.v1.Resource, but focuses
 on the information specifically used by Simulator.
 
Protobuf type google.cloud.policysimulator.v1.ResourceContext
  • Method Summary

    Modifier and Type
    Method
    Description
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    addAncestorsBytes(com.google.protobuf.ByteString value)
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
     
     
     
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    The asset type of the resource as defined by CAIS.
    The full name of the resource.
    getAncestors(int index)
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    com.google.protobuf.ByteString
    getAncestorsBytes(int index)
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    int
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    com.google.protobuf.ProtocolStringList
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    The asset type of the resource as defined by CAIS.
    com.google.protobuf.ByteString
    The asset type of the resource as defined by CAIS.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    The full name of the resource.
    com.google.protobuf.ByteString
    The full name of the resource.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    setAncestors(int index, String value)
    The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names.
    The asset type of the resource as defined by CAIS.
    setAssetTypeBytes(com.google.protobuf.ByteString value)
    The asset type of the resource as defined by CAIS.
    The full name of the resource.
    setResourceBytes(com.google.protobuf.ByteString value)
    The full name of the resource.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • 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<ResourceContext.Builder>
    • clear

      public ResourceContext.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<ResourceContext.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<ResourceContext.Builder>
    • getDefaultInstanceForType

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

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

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

      public ResourceContext.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<ResourceContext.Builder>
    • mergeFrom

      public ResourceContext.Builder mergeFrom(ResourceContext other)
    • isInitialized

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

      public ResourceContext.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<ResourceContext.Builder>
      Throws:
      IOException
    • getResource

      public String getResource()
       The full name of the resource. Example:
       `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
      
       See [Resource
       names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
       for more information.
       
      string resource = 1;
      Specified by:
      getResource in interface ResourceContextOrBuilder
      Returns:
      The resource.
    • getResourceBytes

      public com.google.protobuf.ByteString getResourceBytes()
       The full name of the resource. Example:
       `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
      
       See [Resource
       names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
       for more information.
       
      string resource = 1;
      Specified by:
      getResourceBytes in interface ResourceContextOrBuilder
      Returns:
      The bytes for resource.
    • setResource

      public ResourceContext.Builder setResource(String value)
       The full name of the resource. Example:
       `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
      
       See [Resource
       names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
       for more information.
       
      string resource = 1;
      Parameters:
      value - The resource to set.
      Returns:
      This builder for chaining.
    • clearResource

      public ResourceContext.Builder clearResource()
       The full name of the resource. Example:
       `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
      
       See [Resource
       names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
       for more information.
       
      string resource = 1;
      Returns:
      This builder for chaining.
    • setResourceBytes

      public ResourceContext.Builder setResourceBytes(com.google.protobuf.ByteString value)
       The full name of the resource. Example:
       `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
      
       See [Resource
       names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
       for more information.
       
      string resource = 1;
      Parameters:
      value - The bytes for resource to set.
      Returns:
      This builder for chaining.
    • getAssetType

      public String getAssetType()
       The asset type of the resource as defined by CAIS.
      
       Example: `compute.googleapis.com/Firewall`
      
       See [Supported asset
       types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
       for more information.
       
      string asset_type = 2;
      Specified by:
      getAssetType in interface ResourceContextOrBuilder
      Returns:
      The assetType.
    • getAssetTypeBytes

      public com.google.protobuf.ByteString getAssetTypeBytes()
       The asset type of the resource as defined by CAIS.
      
       Example: `compute.googleapis.com/Firewall`
      
       See [Supported asset
       types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
       for more information.
       
      string asset_type = 2;
      Specified by:
      getAssetTypeBytes in interface ResourceContextOrBuilder
      Returns:
      The bytes for assetType.
    • setAssetType

      public ResourceContext.Builder setAssetType(String value)
       The asset type of the resource as defined by CAIS.
      
       Example: `compute.googleapis.com/Firewall`
      
       See [Supported asset
       types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
       for more information.
       
      string asset_type = 2;
      Parameters:
      value - The assetType to set.
      Returns:
      This builder for chaining.
    • clearAssetType

      public ResourceContext.Builder clearAssetType()
       The asset type of the resource as defined by CAIS.
      
       Example: `compute.googleapis.com/Firewall`
      
       See [Supported asset
       types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
       for more information.
       
      string asset_type = 2;
      Returns:
      This builder for chaining.
    • setAssetTypeBytes

      public ResourceContext.Builder setAssetTypeBytes(com.google.protobuf.ByteString value)
       The asset type of the resource as defined by CAIS.
      
       Example: `compute.googleapis.com/Firewall`
      
       See [Supported asset
       types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
       for more information.
       
      string asset_type = 2;
      Parameters:
      value - The bytes for assetType to set.
      Returns:
      This builder for chaining.
    • getAncestorsList

      public com.google.protobuf.ProtocolStringList getAncestorsList()
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Specified by:
      getAncestorsList in interface ResourceContextOrBuilder
      Returns:
      A list containing the ancestors.
    • getAncestorsCount

      public int getAncestorsCount()
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Specified by:
      getAncestorsCount in interface ResourceContextOrBuilder
      Returns:
      The count of ancestors.
    • getAncestors

      public String getAncestors(int index)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Specified by:
      getAncestors in interface ResourceContextOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The ancestors at the given index.
    • getAncestorsBytes

      public com.google.protobuf.ByteString getAncestorsBytes(int index)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Specified by:
      getAncestorsBytes in interface ResourceContextOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the ancestors at the given index.
    • setAncestors

      public ResourceContext.Builder setAncestors(int index, String value)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Parameters:
      index - The index to set the value at.
      value - The ancestors to set.
      Returns:
      This builder for chaining.
    • addAncestors

      public ResourceContext.Builder addAncestors(String value)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Parameters:
      value - The ancestors to add.
      Returns:
      This builder for chaining.
    • addAllAncestors

      public ResourceContext.Builder addAllAncestors(Iterable<String> values)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Parameters:
      values - The ancestors to add.
      Returns:
      This builder for chaining.
    • clearAncestors

      public ResourceContext.Builder clearAncestors()
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Returns:
      This builder for chaining.
    • addAncestorsBytes

      public ResourceContext.Builder addAncestorsBytes(com.google.protobuf.ByteString value)
       The ancestry path of the resource in Google Cloud [resource
       hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
       represented as a list of relative resource names. An ancestry path starts
       with the closest ancestor in the hierarchy and ends at root. If the
       resource is a project, folder, or organization, the ancestry path starts
       from the resource itself.
      
       Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
       
      repeated string ancestors = 3;
      Parameters:
      value - The bytes of the ancestors to add.
      Returns:
      This builder for chaining.