// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/resource.proto

package com.google.api;

/**
 * <pre>
 * A simple descriptor of a resource type.
 * ResourceDescriptor annotates a resource message (either by means of a
 * protobuf annotation or use in the service config), and associates the
 * resource's schema, the resource type, and the pattern of the resource name.
 * Example:
 *     message Topic {
 *       // Indicates this message defines a resource schema.
 *       // Declares the resource type in the format of {service}/{kind}.
 *       // For Kubernetes resources, the format is {api group}/{kind}.
 *       option (google.api.resource) = {
 *         type: "pubsub.googleapis.com/Topic"
 *         name_descriptor: {
 *           pattern: "projects/{project}/topics/{topic}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         }
 *       };
 *     }
 * The ResourceDescriptor Yaml config will look like:
 *     resources:
 *     - type: "pubsub.googleapis.com/Topic"
 *       name_descriptor:
 *         - pattern: "projects/{project}/topics/{topic}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 * Sometimes, resources have multiple patterns, typically because they can
 * live under multiple parents.
 * Example:
 *     message LogEntry {
 *       option (google.api.resource) = {
 *         type: "logging.googleapis.com/LogEntry"
 *         name_descriptor: {
 *           pattern: "projects/{project}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         }
 *         name_descriptor: {
 *           pattern: "folders/{folder}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *           parent_name_extractor: "folders/{folder}"
 *         }
 *         name_descriptor: {
 *           pattern: "organizations/{organization}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
 *           parent_name_extractor: "organizations/{organization}"
 *         }
 *         name_descriptor: {
 *           pattern: "billingAccounts/{billing_account}/logs/{log}"
 *           parent_type: "billing.googleapis.com/BillingAccount"
 *           parent_name_extractor: "billingAccounts/{billing_account}"
 *         }
 *       };
 *     }
 * The ResourceDescriptor Yaml config will look like:
 *     resources:
 *     - type: 'logging.googleapis.com/LogEntry'
 *       name_descriptor:
 *         - pattern: "projects/{project}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         - pattern: "folders/{folder}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *           parent_name_extractor: "folders/{folder}"
 *         - pattern: "organizations/{organization}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
 *           parent_name_extractor: "organizations/{organization}"
 *         - pattern: "billingAccounts/{billing_account}/logs/{log}"
 *           parent_type: "billing.googleapis.com/BillingAccount"
 *           parent_name_extractor: "billingAccounts/{billing_account}"
 * For flexible resources, the resource name doesn't contain parent names, but
 * the resource itself has parents for policy evaluation.
 * Example:
 *     message Shelf {
 *       option (google.api.resource) = {
 *         type: "library.googleapis.com/Shelf"
 *         name_descriptor: {
 *           pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *         }
 *         name_descriptor: {
 *           pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *         }
 *       };
 *     }
 * The ResourceDescriptor Yaml config will look like:
 *     resources:
 *     - type: 'library.googleapis.com/Shelf'
 *       name_descriptor:
 *         - pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *         - pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 * </pre>
 *
 * Protobuf type {@code google.api.ResourceDescriptor}
 */
public  final class ResourceDescriptor extends
    com.google.protobuf.GeneratedMessageLite<
        ResourceDescriptor, ResourceDescriptor.Builder> implements
    // @@protoc_insertion_point(message_implements:google.api.ResourceDescriptor)
    ResourceDescriptorOrBuilder {
  private ResourceDescriptor() {
    type_ = "";
    pattern_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
    nameField_ = "";
    plural_ = "";
    singular_ = "";
    style_ = emptyIntList();
  }
  /**
   * <pre>
   * A description of the historical or future-looking state of the
   * resource pattern.
   * </pre>
   *
   * Protobuf enum {@code google.api.ResourceDescriptor.History}
   */
  public enum History
      implements com.google.protobuf.Internal.EnumLite {
    /**
     * <pre>
     * The "unset" value.
     * </pre>
     *
     * <code>HISTORY_UNSPECIFIED = 0;</code>
     */
    HISTORY_UNSPECIFIED(0),
    /**
     * <pre>
     * The resource originally had one pattern and launched as such, and
     * additional patterns were added later.
     * </pre>
     *
     * <code>ORIGINALLY_SINGLE_PATTERN = 1;</code>
     */
    ORIGINALLY_SINGLE_PATTERN(1),
    /**
     * <pre>
     * The resource has one pattern, but the API owner expects to add more
     * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
     * that from being necessary once there are multiple patterns.)
     * </pre>
     *
     * <code>FUTURE_MULTI_PATTERN = 2;</code>
     */
    FUTURE_MULTI_PATTERN(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * The "unset" value.
     * </pre>
     *
     * <code>HISTORY_UNSPECIFIED = 0;</code>
     */
    public static final int HISTORY_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * The resource originally had one pattern and launched as such, and
     * additional patterns were added later.
     * </pre>
     *
     * <code>ORIGINALLY_SINGLE_PATTERN = 1;</code>
     */
    public static final int ORIGINALLY_SINGLE_PATTERN_VALUE = 1;
    /**
     * <pre>
     * The resource has one pattern, but the API owner expects to add more
     * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
     * that from being necessary once there are multiple patterns.)
     * </pre>
     *
     * <code>FUTURE_MULTI_PATTERN = 2;</code>
     */
    public static final int FUTURE_MULTI_PATTERN_VALUE = 2;


    @java.lang.Override
    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static History valueOf(int value) {
      return forNumber(value);
    }

    public static History forNumber(int value) {
      switch (value) {
        case 0: return HISTORY_UNSPECIFIED;
        case 1: return ORIGINALLY_SINGLE_PATTERN;
        case 2: return FUTURE_MULTI_PATTERN;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<History>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        History> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<History>() {
            @java.lang.Override
            public History findValueByNumber(int number) {
              return History.forNumber(number);
            }
          };

    public static com.google.protobuf.Internal.EnumVerifier 
        internalGetVerifier() {
      return HistoryVerifier.INSTANCE;
    }

    private static final class HistoryVerifier implements 
         com.google.protobuf.Internal.EnumVerifier { 
            static final com.google.protobuf.Internal.EnumVerifier           INSTANCE = new HistoryVerifier();
            @java.lang.Override
            public boolean isInRange(int number) {
              return History.forNumber(number) != null;
            }
          };

    private final int value;

    private History(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.api.ResourceDescriptor.History)
  }

  /**
   * <pre>
   * A flag representing a specific style that a resource claims to conform to.
   * </pre>
   *
   * Protobuf enum {@code google.api.ResourceDescriptor.Style}
   */
  public enum Style
      implements com.google.protobuf.Internal.EnumLite {
    /**
     * <pre>
     * The unspecified value. Do not use.
     * </pre>
     *
     * <code>STYLE_UNSPECIFIED = 0;</code>
     */
    STYLE_UNSPECIFIED(0),
    /**
     * <pre>
     * This resource is intended to be "declarative-friendly".
     * Declarative-friendly resources must be more strictly consistent, and
     * setting this to true communicates to tools that this resource should
     * adhere to declarative-friendly expectations.
     * Note: This is used by the API linter (linter.aip.dev) to enable
     * additional checks.
     * </pre>
     *
     * <code>DECLARATIVE_FRIENDLY = 1;</code>
     */
    DECLARATIVE_FRIENDLY(1),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * The unspecified value. Do not use.
     * </pre>
     *
     * <code>STYLE_UNSPECIFIED = 0;</code>
     */
    public static final int STYLE_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * This resource is intended to be "declarative-friendly".
     * Declarative-friendly resources must be more strictly consistent, and
     * setting this to true communicates to tools that this resource should
     * adhere to declarative-friendly expectations.
     * Note: This is used by the API linter (linter.aip.dev) to enable
     * additional checks.
     * </pre>
     *
     * <code>DECLARATIVE_FRIENDLY = 1;</code>
     */
    public static final int DECLARATIVE_FRIENDLY_VALUE = 1;


    @java.lang.Override
    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static Style valueOf(int value) {
      return forNumber(value);
    }

    public static Style forNumber(int value) {
      switch (value) {
        case 0: return STYLE_UNSPECIFIED;
        case 1: return DECLARATIVE_FRIENDLY;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Style>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        Style> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Style>() {
            @java.lang.Override
            public Style findValueByNumber(int number) {
              return Style.forNumber(number);
            }
          };

    public static com.google.protobuf.Internal.EnumVerifier 
        internalGetVerifier() {
      return StyleVerifier.INSTANCE;
    }

    private static final class StyleVerifier implements 
         com.google.protobuf.Internal.EnumVerifier { 
            static final com.google.protobuf.Internal.EnumVerifier           INSTANCE = new StyleVerifier();
            @java.lang.Override
            public boolean isInRange(int number) {
              return Style.forNumber(number) != null;
            }
          };

    private final int value;

    private Style(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.api.ResourceDescriptor.Style)
  }

  public static final int TYPE_FIELD_NUMBER = 1;
  private java.lang.String type_;
  /**
   * <pre>
   * The resource type. It must be in the format of
   * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
   * singular and must not include version numbers.
   * Example: `storage.googleapis.com/Bucket`
   * The value of the resource_type_kind must follow the regular expression
   * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
   * should use PascalCase (UpperCamelCase). The maximum number of
   * characters allowed for the `resource_type_kind` is 100.
   * </pre>
   *
   * <code>string type = 1;</code>
   * @return The type.
   */
  @java.lang.Override
  public java.lang.String getType() {
    return type_;
  }
  /**
   * <pre>
   * The resource type. It must be in the format of
   * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
   * singular and must not include version numbers.
   * Example: `storage.googleapis.com/Bucket`
   * The value of the resource_type_kind must follow the regular expression
   * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
   * should use PascalCase (UpperCamelCase). The maximum number of
   * characters allowed for the `resource_type_kind` is 100.
   * </pre>
   *
   * <code>string type = 1;</code>
   * @return The bytes for type.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getTypeBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(type_);
  }
  /**
   * <pre>
   * The resource type. It must be in the format of
   * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
   * singular and must not include version numbers.
   * Example: `storage.googleapis.com/Bucket`
   * The value of the resource_type_kind must follow the regular expression
   * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
   * should use PascalCase (UpperCamelCase). The maximum number of
   * characters allowed for the `resource_type_kind` is 100.
   * </pre>
   *
   * <code>string type = 1;</code>
   * @param value The type to set.
   */
  private void setType(
      java.lang.String value) {
    value.getClass();
  
    type_ = value;
  }
  /**
   * <pre>
   * The resource type. It must be in the format of
   * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
   * singular and must not include version numbers.
   * Example: `storage.googleapis.com/Bucket`
   * The value of the resource_type_kind must follow the regular expression
   * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
   * should use PascalCase (UpperCamelCase). The maximum number of
   * characters allowed for the `resource_type_kind` is 100.
   * </pre>
   *
   * <code>string type = 1;</code>
   */
  private void clearType() {
    
    type_ = getDefaultInstance().getType();
  }
  /**
   * <pre>
   * The resource type. It must be in the format of
   * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
   * singular and must not include version numbers.
   * Example: `storage.googleapis.com/Bucket`
   * The value of the resource_type_kind must follow the regular expression
   * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
   * should use PascalCase (UpperCamelCase). The maximum number of
   * characters allowed for the `resource_type_kind` is 100.
   * </pre>
   *
   * <code>string type = 1;</code>
   * @param value The bytes for type to set.
   */
  private void setTypeBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    type_ = value.toStringUtf8();
    
  }

  public static final int PATTERN_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.ProtobufList<java.lang.String> pattern_;
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @return A list containing the pattern.
   */
  @java.lang.Override
  public java.util.List<java.lang.String> getPatternList() {
    return pattern_;
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @return The count of pattern.
   */
  @java.lang.Override
  public int getPatternCount() {
    return pattern_.size();
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param index The index of the element to return.
   * @return The pattern at the given index.
   */
  @java.lang.Override
  public java.lang.String getPattern(int index) {
    return pattern_.get(index);
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param index The index of the value to return.
   * @return The bytes of the pattern at the given index.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getPatternBytes(int index) {
    return com.google.protobuf.ByteString.copyFromUtf8(
        pattern_.get(index));
  }
  private void ensurePatternIsMutable() {
    com.google.protobuf.Internal.ProtobufList<java.lang.String> tmp =
        pattern_;  if (!tmp.isModifiable()) {
      pattern_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param index The index to set the value at.
   * @param value The pattern to set.
   */
  private void setPattern(
      int index, java.lang.String value) {
    value.getClass();
  ensurePatternIsMutable();
    pattern_.set(index, value);
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param value The pattern to add.
   */
  private void addPattern(
      java.lang.String value) {
    value.getClass();
  ensurePatternIsMutable();
    pattern_.add(value);
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param values The pattern to add.
   */
  private void addAllPattern(
      java.lang.Iterable<java.lang.String> values) {
    ensurePatternIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, pattern_);
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   */
  private void clearPattern() {
    pattern_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
  }
  /**
   * <pre>
   * Optional. The relative resource name pattern associated with this resource
   * type. The DNS prefix of the full resource name shouldn't be specified here.
   * The path pattern must follow the syntax, which aligns with HTTP binding
   * syntax:
   *     Template = Segment { "/" Segment } ;
   *     Segment = LITERAL | Variable ;
   *     Variable = "{" LITERAL "}" ;
   * Examples:
   *     - "projects/{project}/topics/{topic}"
   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
   * The components in braces correspond to the IDs for each resource in the
   * hierarchy. It is expected that, if multiple patterns are provided,
   * the same component name (e.g. "project") refers to IDs of the same
   * type of resource.
   * </pre>
   *
   * <code>repeated string pattern = 2;</code>
   * @param value The bytes of the pattern to add.
   */
  private void addPatternBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    ensurePatternIsMutable();
    pattern_.add(value.toStringUtf8());
  }

  public static final int NAME_FIELD_FIELD_NUMBER = 3;
  private java.lang.String nameField_;
  /**
   * <pre>
   * Optional. The field on the resource that designates the resource name
   * field. If omitted, this is assumed to be "name".
   * </pre>
   *
   * <code>string name_field = 3;</code>
   * @return The nameField.
   */
  @java.lang.Override
  public java.lang.String getNameField() {
    return nameField_;
  }
  /**
   * <pre>
   * Optional. The field on the resource that designates the resource name
   * field. If omitted, this is assumed to be "name".
   * </pre>
   *
   * <code>string name_field = 3;</code>
   * @return The bytes for nameField.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getNameFieldBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(nameField_);
  }
  /**
   * <pre>
   * Optional. The field on the resource that designates the resource name
   * field. If omitted, this is assumed to be "name".
   * </pre>
   *
   * <code>string name_field = 3;</code>
   * @param value The nameField to set.
   */
  private void setNameField(
      java.lang.String value) {
    value.getClass();
  
    nameField_ = value;
  }
  /**
   * <pre>
   * Optional. The field on the resource that designates the resource name
   * field. If omitted, this is assumed to be "name".
   * </pre>
   *
   * <code>string name_field = 3;</code>
   */
  private void clearNameField() {
    
    nameField_ = getDefaultInstance().getNameField();
  }
  /**
   * <pre>
   * Optional. The field on the resource that designates the resource name
   * field. If omitted, this is assumed to be "name".
   * </pre>
   *
   * <code>string name_field = 3;</code>
   * @param value The bytes for nameField to set.
   */
  private void setNameFieldBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    nameField_ = value.toStringUtf8();
    
  }

  public static final int HISTORY_FIELD_NUMBER = 4;
  private int history_;
  /**
   * <pre>
   * Optional. The historical or future-looking state of the resource pattern.
   * Example:
   *     // The InspectTemplate message originally only supported resource
   *     // names with organization, and project was added later.
   *     message InspectTemplate {
   *       option (google.api.resource) = {
   *         type: "dlp.googleapis.com/InspectTemplate"
   *         pattern:
   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
   *         history: ORIGINALLY_SINGLE_PATTERN
   *       };
   *     }
   * </pre>
   *
   * <code>.google.api.ResourceDescriptor.History history = 4;</code>
   * @return The enum numeric value on the wire for history.
   */
  @java.lang.Override
  public int getHistoryValue() {
    return history_;
  }
  /**
   * <pre>
   * Optional. The historical or future-looking state of the resource pattern.
   * Example:
   *     // The InspectTemplate message originally only supported resource
   *     // names with organization, and project was added later.
   *     message InspectTemplate {
   *       option (google.api.resource) = {
   *         type: "dlp.googleapis.com/InspectTemplate"
   *         pattern:
   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
   *         history: ORIGINALLY_SINGLE_PATTERN
   *       };
   *     }
   * </pre>
   *
   * <code>.google.api.ResourceDescriptor.History history = 4;</code>
   * @return The history.
   */
  @java.lang.Override
  public com.google.api.ResourceDescriptor.History getHistory() {
    com.google.api.ResourceDescriptor.History result = com.google.api.ResourceDescriptor.History.forNumber(history_);
    return result == null ? com.google.api.ResourceDescriptor.History.UNRECOGNIZED : result;
  }
  /**
   * <pre>
   * Optional. The historical or future-looking state of the resource pattern.
   * Example:
   *     // The InspectTemplate message originally only supported resource
   *     // names with organization, and project was added later.
   *     message InspectTemplate {
   *       option (google.api.resource) = {
   *         type: "dlp.googleapis.com/InspectTemplate"
   *         pattern:
   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
   *         history: ORIGINALLY_SINGLE_PATTERN
   *       };
   *     }
   * </pre>
   *
   * <code>.google.api.ResourceDescriptor.History history = 4;</code>
   * @param value The enum numeric value on the wire for history to set.
   */
  private void setHistoryValue(int value) {
      history_ = value;
  }
  /**
   * <pre>
   * Optional. The historical or future-looking state of the resource pattern.
   * Example:
   *     // The InspectTemplate message originally only supported resource
   *     // names with organization, and project was added later.
   *     message InspectTemplate {
   *       option (google.api.resource) = {
   *         type: "dlp.googleapis.com/InspectTemplate"
   *         pattern:
   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
   *         history: ORIGINALLY_SINGLE_PATTERN
   *       };
   *     }
   * </pre>
   *
   * <code>.google.api.ResourceDescriptor.History history = 4;</code>
   * @param value The history to set.
   */
  private void setHistory(com.google.api.ResourceDescriptor.History value) {
    history_ = value.getNumber();
    
  }
  /**
   * <pre>
   * Optional. The historical or future-looking state of the resource pattern.
   * Example:
   *     // The InspectTemplate message originally only supported resource
   *     // names with organization, and project was added later.
   *     message InspectTemplate {
   *       option (google.api.resource) = {
   *         type: "dlp.googleapis.com/InspectTemplate"
   *         pattern:
   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
   *         history: ORIGINALLY_SINGLE_PATTERN
   *       };
   *     }
   * </pre>
   *
   * <code>.google.api.ResourceDescriptor.History history = 4;</code>
   */
  private void clearHistory() {
    
    history_ = 0;
  }

  public static final int PLURAL_FIELD_NUMBER = 5;
  private java.lang.String plural_;
  /**
   * <pre>
   * The plural name used in the resource name and permission names, such as
   * 'projects' for the resource name of 'projects/{project}' and the permission
   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
   * concept of the `plural` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Note: The plural form is required even for singleton resources. See
   * https://aip.dev/156
   * </pre>
   *
   * <code>string plural = 5;</code>
   * @return The plural.
   */
  @java.lang.Override
  public java.lang.String getPlural() {
    return plural_;
  }
  /**
   * <pre>
   * The plural name used in the resource name and permission names, such as
   * 'projects' for the resource name of 'projects/{project}' and the permission
   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
   * concept of the `plural` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Note: The plural form is required even for singleton resources. See
   * https://aip.dev/156
   * </pre>
   *
   * <code>string plural = 5;</code>
   * @return The bytes for plural.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getPluralBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(plural_);
  }
  /**
   * <pre>
   * The plural name used in the resource name and permission names, such as
   * 'projects' for the resource name of 'projects/{project}' and the permission
   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
   * concept of the `plural` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Note: The plural form is required even for singleton resources. See
   * https://aip.dev/156
   * </pre>
   *
   * <code>string plural = 5;</code>
   * @param value The plural to set.
   */
  private void setPlural(
      java.lang.String value) {
    value.getClass();
  
    plural_ = value;
  }
  /**
   * <pre>
   * The plural name used in the resource name and permission names, such as
   * 'projects' for the resource name of 'projects/{project}' and the permission
   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
   * concept of the `plural` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Note: The plural form is required even for singleton resources. See
   * https://aip.dev/156
   * </pre>
   *
   * <code>string plural = 5;</code>
   */
  private void clearPlural() {
    
    plural_ = getDefaultInstance().getPlural();
  }
  /**
   * <pre>
   * The plural name used in the resource name and permission names, such as
   * 'projects' for the resource name of 'projects/{project}' and the permission
   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
   * concept of the `plural` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Note: The plural form is required even for singleton resources. See
   * https://aip.dev/156
   * </pre>
   *
   * <code>string plural = 5;</code>
   * @param value The bytes for plural to set.
   */
  private void setPluralBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    plural_ = value.toStringUtf8();
    
  }

  public static final int SINGULAR_FIELD_NUMBER = 6;
  private java.lang.String singular_;
  /**
   * <pre>
   * The same concept of the `singular` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
   * </pre>
   *
   * <code>string singular = 6;</code>
   * @return The singular.
   */
  @java.lang.Override
  public java.lang.String getSingular() {
    return singular_;
  }
  /**
   * <pre>
   * The same concept of the `singular` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
   * </pre>
   *
   * <code>string singular = 6;</code>
   * @return The bytes for singular.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getSingularBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(singular_);
  }
  /**
   * <pre>
   * The same concept of the `singular` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
   * </pre>
   *
   * <code>string singular = 6;</code>
   * @param value The singular to set.
   */
  private void setSingular(
      java.lang.String value) {
    value.getClass();
  
    singular_ = value;
  }
  /**
   * <pre>
   * The same concept of the `singular` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
   * </pre>
   *
   * <code>string singular = 6;</code>
   */
  private void clearSingular() {
    
    singular_ = getDefaultInstance().getSingular();
  }
  /**
   * <pre>
   * The same concept of the `singular` field in k8s CRD spec
   * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
   * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
   * </pre>
   *
   * <code>string singular = 6;</code>
   * @param value The bytes for singular to set.
   */
  private void setSingularBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    singular_ = value.toStringUtf8();
    
  }

  public static final int STYLE_FIELD_NUMBER = 10;
  private com.google.protobuf.Internal.IntList style_;
  private static final com.google.protobuf.Internal.ListAdapter.Converter<
      java.lang.Integer, com.google.api.ResourceDescriptor.Style> style_converter_ =
          new com.google.protobuf.Internal.ListAdapter.Converter<
              java.lang.Integer, com.google.api.ResourceDescriptor.Style>() {
            @java.lang.Override
            public com.google.api.ResourceDescriptor.Style convert(java.lang.Integer from) {
              com.google.api.ResourceDescriptor.Style result = com.google.api.ResourceDescriptor.Style.forNumber(from);
              return result == null ? com.google.api.ResourceDescriptor.Style.UNRECOGNIZED : result;
            }
          };
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @return A list containing the style.
   */
  @java.lang.Override
  public java.util.List<com.google.api.ResourceDescriptor.Style> getStyleList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, com.google.api.ResourceDescriptor.Style>(style_, style_converter_);
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @return The count of style.
   */
  @java.lang.Override
  public int getStyleCount() {
    return style_.size();
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param index The index of the element to return.
   * @return The style at the given index.
   */
  @java.lang.Override
  public com.google.api.ResourceDescriptor.Style getStyle(int index) {
    return style_converter_.convert(style_.getInt(index));
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @return A list containing the enum numeric values on the wire for style.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer>
  getStyleValueList() {
    return style_;
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param index The index of the value to return.
   * @return The enum numeric value on the wire of style at the given index.
   */
  @java.lang.Override
  public int getStyleValue(int index) {
    return style_.getInt(index);
  }
  private int styleMemoizedSerializedSize;
  private void ensureStyleIsMutable() {
    com.google.protobuf.Internal.IntList tmp = style_;
    if (!tmp.isModifiable()) {
      style_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
    }
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param index The index to set the value at.
   * @param value The style to set.
   */
  private void setStyle(
      int index, com.google.api.ResourceDescriptor.Style value) {
    value.getClass();
  ensureStyleIsMutable();
    style_.setInt(index, value.getNumber());
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param value The style to add.
   */
  private void addStyle(com.google.api.ResourceDescriptor.Style value) {
    value.getClass();
  ensureStyleIsMutable();
    style_.addInt(value.getNumber());
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param values The style to add.
   */
  private void addAllStyle(
      java.lang.Iterable<? extends com.google.api.ResourceDescriptor.Style> values) {
    ensureStyleIsMutable();
    for (com.google.api.ResourceDescriptor.Style value : values) {
      style_.addInt(value.getNumber());
    }
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   */
  private void clearStyle() {
    style_ = emptyIntList();
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param value The enum numeric value on the wire for style to set.
   */
  private void setStyleValue(
      int index, int value) {
    ensureStyleIsMutable();
    style_.setInt(index, value);
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param value The enum numeric value on the wire for style to add.
   */
  private void addStyleValue(int value) {
    ensureStyleIsMutable();
    style_.addInt(value);
  }
  /**
   * <pre>
   * Style flag(s) for this resource.
   * These indicate that a resource is expected to conform to a given
   * style. See the specific style flags for additional information.
   * </pre>
   *
   * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
   * @param values The enum numeric values on the wire for style to add.
   */
  private void addAllStyleValue(
      java.lang.Iterable<java.lang.Integer> values) {
    ensureStyleIsMutable();
    for (int value : values) {
      style_.addInt(value);
    }
  }

  public static com.google.api.ResourceDescriptor parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.api.ResourceDescriptor parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.api.ResourceDescriptor parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.api.ResourceDescriptor parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input);
  }
  public static com.google.api.ResourceDescriptor parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.api.ResourceDescriptor parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }

  public static Builder newBuilder() {
    return (Builder) DEFAULT_INSTANCE.createBuilder();
  }
  public static Builder newBuilder(com.google.api.ResourceDescriptor prototype) {
    return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
  }

  /**
   * <pre>
   * A simple descriptor of a resource type.
   * ResourceDescriptor annotates a resource message (either by means of a
   * protobuf annotation or use in the service config), and associates the
   * resource's schema, the resource type, and the pattern of the resource name.
   * Example:
   *     message Topic {
   *       // Indicates this message defines a resource schema.
   *       // Declares the resource type in the format of {service}/{kind}.
   *       // For Kubernetes resources, the format is {api group}/{kind}.
   *       option (google.api.resource) = {
   *         type: "pubsub.googleapis.com/Topic"
   *         name_descriptor: {
   *           pattern: "projects/{project}/topics/{topic}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *           parent_name_extractor: "projects/{project}"
   *         }
   *       };
   *     }
   * The ResourceDescriptor Yaml config will look like:
   *     resources:
   *     - type: "pubsub.googleapis.com/Topic"
   *       name_descriptor:
   *         - pattern: "projects/{project}/topics/{topic}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *           parent_name_extractor: "projects/{project}"
   * Sometimes, resources have multiple patterns, typically because they can
   * live under multiple parents.
   * Example:
   *     message LogEntry {
   *       option (google.api.resource) = {
   *         type: "logging.googleapis.com/LogEntry"
   *         name_descriptor: {
   *           pattern: "projects/{project}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *           parent_name_extractor: "projects/{project}"
   *         }
   *         name_descriptor: {
   *           pattern: "folders/{folder}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
   *           parent_name_extractor: "folders/{folder}"
   *         }
   *         name_descriptor: {
   *           pattern: "organizations/{organization}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
   *           parent_name_extractor: "organizations/{organization}"
   *         }
   *         name_descriptor: {
   *           pattern: "billingAccounts/{billing_account}/logs/{log}"
   *           parent_type: "billing.googleapis.com/BillingAccount"
   *           parent_name_extractor: "billingAccounts/{billing_account}"
   *         }
   *       };
   *     }
   * The ResourceDescriptor Yaml config will look like:
   *     resources:
   *     - type: 'logging.googleapis.com/LogEntry'
   *       name_descriptor:
   *         - pattern: "projects/{project}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *           parent_name_extractor: "projects/{project}"
   *         - pattern: "folders/{folder}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
   *           parent_name_extractor: "folders/{folder}"
   *         - pattern: "organizations/{organization}/logs/{log}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
   *           parent_name_extractor: "organizations/{organization}"
   *         - pattern: "billingAccounts/{billing_account}/logs/{log}"
   *           parent_type: "billing.googleapis.com/BillingAccount"
   *           parent_name_extractor: "billingAccounts/{billing_account}"
   * For flexible resources, the resource name doesn't contain parent names, but
   * the resource itself has parents for policy evaluation.
   * Example:
   *     message Shelf {
   *       option (google.api.resource) = {
   *         type: "library.googleapis.com/Shelf"
   *         name_descriptor: {
   *           pattern: "shelves/{shelf}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *         }
   *         name_descriptor: {
   *           pattern: "shelves/{shelf}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
   *         }
   *       };
   *     }
   * The ResourceDescriptor Yaml config will look like:
   *     resources:
   *     - type: 'library.googleapis.com/Shelf'
   *       name_descriptor:
   *         - pattern: "shelves/{shelf}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Project"
   *         - pattern: "shelves/{shelf}"
   *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
   * </pre>
   *
   * Protobuf type {@code google.api.ResourceDescriptor}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.api.ResourceDescriptor, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.api.ResourceDescriptor)
      com.google.api.ResourceDescriptorOrBuilder {
    // Construct using com.google.api.ResourceDescriptor.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     * Example: `storage.googleapis.com/Bucket`
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The type.
     */
    @java.lang.Override
    public java.lang.String getType() {
      return instance.getType();
    }
    /**
     * <pre>
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     * Example: `storage.googleapis.com/Bucket`
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return The bytes for type.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getTypeBytes() {
      return instance.getTypeBytes();
    }
    /**
     * <pre>
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     * Example: `storage.googleapis.com/Bucket`
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * </pre>
     *
     * <code>string type = 1;</code>
     * @param value The type to set.
     * @return This builder for chaining.
     */
    public Builder setType(
        java.lang.String value) {
      copyOnWrite();
      instance.setType(value);
      return this;
    }
    /**
     * <pre>
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     * Example: `storage.googleapis.com/Bucket`
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * </pre>
     *
     * <code>string type = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearType() {
      copyOnWrite();
      instance.clearType();
      return this;
    }
    /**
     * <pre>
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     * Example: `storage.googleapis.com/Bucket`
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * </pre>
     *
     * <code>string type = 1;</code>
     * @param value The bytes for type to set.
     * @return This builder for chaining.
     */
    public Builder setTypeBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setTypeBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @return A list containing the pattern.
     */
    @java.lang.Override
    public java.util.List<java.lang.String>
        getPatternList() {
      return java.util.Collections.unmodifiableList(
          instance.getPatternList());
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @return The count of pattern.
     */
    @java.lang.Override
    public int getPatternCount() {
      return instance.getPatternCount();
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param index The index of the element to return.
     * @return The pattern at the given index.
     */
    @java.lang.Override
    public java.lang.String getPattern(int index) {
      return instance.getPattern(index);
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param index The index of the value to return.
     * @return The bytes of the pattern at the given index.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getPatternBytes(int index) {
      return instance.getPatternBytes(index);
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param index The index to set the value at.
     * @param value The pattern to set.
     * @return This builder for chaining.
     */
    public Builder setPattern(
        int index, java.lang.String value) {
      copyOnWrite();
      instance.setPattern(index, value);
      return this;
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param value The pattern to add.
     * @return This builder for chaining.
     */
    public Builder addPattern(
        java.lang.String value) {
      copyOnWrite();
      instance.addPattern(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param values The pattern to add.
     * @return This builder for chaining.
     */
    public Builder addAllPattern(
        java.lang.Iterable<java.lang.String> values) {
      copyOnWrite();
      instance.addAllPattern(values);
      return this;
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearPattern() {
      copyOnWrite();
      instance.clearPattern();
      return this;
    }
    /**
     * <pre>
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     * Examples:
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * </pre>
     *
     * <code>repeated string pattern = 2;</code>
     * @param value The bytes of the pattern to add.
     * @return This builder for chaining.
     */
    public Builder addPatternBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.addPatternBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * </pre>
     *
     * <code>string name_field = 3;</code>
     * @return The nameField.
     */
    @java.lang.Override
    public java.lang.String getNameField() {
      return instance.getNameField();
    }
    /**
     * <pre>
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * </pre>
     *
     * <code>string name_field = 3;</code>
     * @return The bytes for nameField.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getNameFieldBytes() {
      return instance.getNameFieldBytes();
    }
    /**
     * <pre>
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * </pre>
     *
     * <code>string name_field = 3;</code>
     * @param value The nameField to set.
     * @return This builder for chaining.
     */
    public Builder setNameField(
        java.lang.String value) {
      copyOnWrite();
      instance.setNameField(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * </pre>
     *
     * <code>string name_field = 3;</code>
     * @return This builder for chaining.
     */
    public Builder clearNameField() {
      copyOnWrite();
      instance.clearNameField();
      return this;
    }
    /**
     * <pre>
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * </pre>
     *
     * <code>string name_field = 3;</code>
     * @param value The bytes for nameField to set.
     * @return This builder for chaining.
     */
    public Builder setNameFieldBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setNameFieldBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. The historical or future-looking state of the resource pattern.
     * Example:
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * </pre>
     *
     * <code>.google.api.ResourceDescriptor.History history = 4;</code>
     * @return The enum numeric value on the wire for history.
     */
    @java.lang.Override
    public int getHistoryValue() {
      return instance.getHistoryValue();
    }
    /**
     * <pre>
     * Optional. The historical or future-looking state of the resource pattern.
     * Example:
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * </pre>
     *
     * <code>.google.api.ResourceDescriptor.History history = 4;</code>
     * @param value The history to set.
     * @return This builder for chaining.
     */
    public Builder setHistoryValue(int value) {
      copyOnWrite();
      instance.setHistoryValue(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The historical or future-looking state of the resource pattern.
     * Example:
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * </pre>
     *
     * <code>.google.api.ResourceDescriptor.History history = 4;</code>
     * @return The history.
     */
    @java.lang.Override
    public com.google.api.ResourceDescriptor.History getHistory() {
      return instance.getHistory();
    }
    /**
     * <pre>
     * Optional. The historical or future-looking state of the resource pattern.
     * Example:
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * </pre>
     *
     * <code>.google.api.ResourceDescriptor.History history = 4;</code>
     * @param value The enum numeric value on the wire for history to set.
     * @return This builder for chaining.
     */
    public Builder setHistory(com.google.api.ResourceDescriptor.History value) {
      copyOnWrite();
      instance.setHistory(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The historical or future-looking state of the resource pattern.
     * Example:
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * </pre>
     *
     * <code>.google.api.ResourceDescriptor.History history = 4;</code>
     * @return This builder for chaining.
     */
    public Builder clearHistory() {
      copyOnWrite();
      instance.clearHistory();
      return this;
    }

    /**
     * <pre>
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * </pre>
     *
     * <code>string plural = 5;</code>
     * @return The plural.
     */
    @java.lang.Override
    public java.lang.String getPlural() {
      return instance.getPlural();
    }
    /**
     * <pre>
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * </pre>
     *
     * <code>string plural = 5;</code>
     * @return The bytes for plural.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getPluralBytes() {
      return instance.getPluralBytes();
    }
    /**
     * <pre>
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * </pre>
     *
     * <code>string plural = 5;</code>
     * @param value The plural to set.
     * @return This builder for chaining.
     */
    public Builder setPlural(
        java.lang.String value) {
      copyOnWrite();
      instance.setPlural(value);
      return this;
    }
    /**
     * <pre>
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * </pre>
     *
     * <code>string plural = 5;</code>
     * @return This builder for chaining.
     */
    public Builder clearPlural() {
      copyOnWrite();
      instance.clearPlural();
      return this;
    }
    /**
     * <pre>
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * </pre>
     *
     * <code>string plural = 5;</code>
     * @param value The bytes for plural to set.
     * @return This builder for chaining.
     */
    public Builder setPluralBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setPluralBytes(value);
      return this;
    }

    /**
     * <pre>
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * </pre>
     *
     * <code>string singular = 6;</code>
     * @return The singular.
     */
    @java.lang.Override
    public java.lang.String getSingular() {
      return instance.getSingular();
    }
    /**
     * <pre>
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * </pre>
     *
     * <code>string singular = 6;</code>
     * @return The bytes for singular.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getSingularBytes() {
      return instance.getSingularBytes();
    }
    /**
     * <pre>
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * </pre>
     *
     * <code>string singular = 6;</code>
     * @param value The singular to set.
     * @return This builder for chaining.
     */
    public Builder setSingular(
        java.lang.String value) {
      copyOnWrite();
      instance.setSingular(value);
      return this;
    }
    /**
     * <pre>
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * </pre>
     *
     * <code>string singular = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearSingular() {
      copyOnWrite();
      instance.clearSingular();
      return this;
    }
    /**
     * <pre>
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * </pre>
     *
     * <code>string singular = 6;</code>
     * @param value The bytes for singular to set.
     * @return This builder for chaining.
     */
    public Builder setSingularBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setSingularBytes(value);
      return this;
    }

    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @return A list containing the style.
     */
    @java.lang.Override
    public java.util.List<com.google.api.ResourceDescriptor.Style> getStyleList() {
      return instance.getStyleList();
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @return The count of style.
     */
    @java.lang.Override
    public int getStyleCount() {
      return instance.getStyleCount();
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param index The index of the element to return.
     * @return The style at the given index.
     */
    @java.lang.Override
    public com.google.api.ResourceDescriptor.Style getStyle(int index) {
      return instance.getStyle(index);
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param index The index to set the value at.
     * @param value The style to set.
     * @return This builder for chaining.
     */
    public Builder setStyle(
        int index, com.google.api.ResourceDescriptor.Style value) {
      copyOnWrite();
      instance.setStyle(index, value);
      return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param value The style to add.
     * @return This builder for chaining.
     */
    public Builder addStyle(com.google.api.ResourceDescriptor.Style value) {
      copyOnWrite();
      instance.addStyle(value);
      return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param values The style to add.
     * @return This builder for chaining.
     */
    public Builder addAllStyle(
        java.lang.Iterable<? extends com.google.api.ResourceDescriptor.Style> values) {
      copyOnWrite();
      instance.addAllStyle(values);  return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @return This builder for chaining.
     */
    public Builder clearStyle() {
      copyOnWrite();
      instance.clearStyle();
      return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @return A list containing the enum numeric values on the wire for style.
     */
    @java.lang.Override
    public java.util.List<java.lang.Integer>
    getStyleValueList() {
      return java.util.Collections.unmodifiableList(
          instance.getStyleValueList());
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param index The index of the value to return.
     * @return The enum numeric value on the wire of style at the given index.
     */
    @java.lang.Override
    public int getStyleValue(int index) {
      return instance.getStyleValue(index);
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param index The index to set the value at.
     * @param value The enum numeric value on the wire for style to set.
     * @return This builder for chaining.
     */
    public Builder setStyleValue(
        int index, int value) {
      copyOnWrite();
      instance.setStyleValue(index, value);
      return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param value The enum numeric value on the wire for style to add.
     * @return This builder for chaining.
     */
    public Builder addStyleValue(int value) {
      instance.addStyleValue(value);
      return this;
    }
    /**
     * <pre>
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * </pre>
     *
     * <code>repeated .google.api.ResourceDescriptor.Style style = 10;</code>
     * @param values The enum numeric values on the wire for style to add.
     * @return This builder for chaining.
     */
    public Builder addAllStyleValue(
        java.lang.Iterable<java.lang.Integer> values) {
      copyOnWrite();
      instance.addAllStyleValue(values);
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.api.ResourceDescriptor)
  }
  @java.lang.Override
  @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
  protected final java.lang.Object dynamicMethod(
      com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
      java.lang.Object arg0, java.lang.Object arg1) {
    switch (method) {
      case NEW_MUTABLE_INSTANCE: {
        return new com.google.api.ResourceDescriptor();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "type_",
            "pattern_",
            "nameField_",
            "history_",
            "plural_",
            "singular_",
            "style_",
          };
          java.lang.String info =
              "\u0000\u0007\u0000\u0000\u0001\n\u0007\u0000\u0002\u0000\u0001\u0208\u0002\u021a" +
              "\u0003\u0208\u0004\f\u0005\u0208\u0006\u0208\n,";
          return newMessageInfo(DEFAULT_INSTANCE, info, objects);
      }
      // fall through
      case GET_DEFAULT_INSTANCE: {
        return DEFAULT_INSTANCE;
      }
      case GET_PARSER: {
        com.google.protobuf.Parser<com.google.api.ResourceDescriptor> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.api.ResourceDescriptor.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.api.ResourceDescriptor>(
                      DEFAULT_INSTANCE);
              PARSER = parser;
            }
          }
        }
        return parser;
    }
    case GET_MEMOIZED_IS_INITIALIZED: {
      return (byte) 1;
    }
    case SET_MEMOIZED_IS_INITIALIZED: {
      return null;
    }
    }
    throw new UnsupportedOperationException();
  }


  // @@protoc_insertion_point(class_scope:google.api.ResourceDescriptor)
  private static final com.google.api.ResourceDescriptor DEFAULT_INSTANCE;
  static {
    ResourceDescriptor defaultInstance = new ResourceDescriptor();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      ResourceDescriptor.class, defaultInstance);
  }

  public static com.google.api.ResourceDescriptor getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static volatile com.google.protobuf.Parser<ResourceDescriptor> PARSER;

  public static com.google.protobuf.Parser<ResourceDescriptor> parser() {
    return DEFAULT_INSTANCE.getParserForType();
  }
}

