/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/run/v2/revision_template.proto

package com.google.cloud.run.v2;

/**
 *
 *
 * <pre>
 * RevisionTemplate describes the data a revision should have when created from
 * a template.
 * </pre>
 *
 * Protobuf type {@code google.cloud.run.v2.RevisionTemplate}
 */
public final class RevisionTemplate extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.run.v2.RevisionTemplate)
    RevisionTemplateOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use RevisionTemplate.newBuilder() to construct.
  private RevisionTemplate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private RevisionTemplate() {
    revision_ = "";
    serviceAccount_ = "";
    containers_ = java.util.Collections.emptyList();
    volumes_ = java.util.Collections.emptyList();
    executionEnvironment_ = 0;
    encryptionKey_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new RevisionTemplate();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.run.v2.RevisionTemplateProto
        .internal_static_google_cloud_run_v2_RevisionTemplate_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 2:
        return internalGetLabels();
      case 3:
        return internalGetAnnotations();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.run.v2.RevisionTemplateProto
        .internal_static_google_cloud_run_v2_RevisionTemplate_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.run.v2.RevisionTemplate.class,
            com.google.cloud.run.v2.RevisionTemplate.Builder.class);
  }

  public static final int REVISION_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object revision_ = "";
  /**
   *
   *
   * <pre>
   * The unique name for the revision. If this field is omitted, it will be
   * automatically generated based on the Service name.
   * </pre>
   *
   * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The revision.
   */
  @java.lang.Override
  public java.lang.String getRevision() {
    java.lang.Object ref = revision_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      revision_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The unique name for the revision. If this field is omitted, it will be
   * automatically generated based on the Service name.
   * </pre>
   *
   * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for revision.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getRevisionBytes() {
    java.lang.Object ref = revision_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      revision_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LABELS_FIELD_NUMBER = 2;

  private static final class LabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.run.v2.RevisionTemplateProto
                .internal_static_google_cloud_run_v2_RevisionTemplate_LabelsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that can be used to organize and categorize
   * objects.
   * User-provided labels are shared with Google's billing system, so they can
   * be used to filter, or break down billing charges by team, component,
   * environment, state, etc. For more information, visit
   * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
   * https://cloud.google.com/run/docs/configuring/labels.
   * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system labels in v1 now have a
   * corresponding field in v2 RevisionTemplate.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 2;</code>
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that can be used to organize and categorize
   * objects.
   * User-provided labels are shared with Google's billing system, so they can
   * be used to filter, or break down billing charges by team, component,
   * environment, state, etc. For more information, visit
   * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
   * https://cloud.google.com/run/docs/configuring/labels.
   * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system labels in v1 now have a
   * corresponding field in v2 RevisionTemplate.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 2;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that can be used to organize and categorize
   * objects.
   * User-provided labels are shared with Google's billing system, so they can
   * be used to filter, or break down billing charges by team, component,
   * environment, state, etc. For more information, visit
   * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
   * https://cloud.google.com/run/docs/configuring/labels.
   * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system labels in v1 now have a
   * corresponding field in v2 RevisionTemplate.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 2;</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getLabelsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that can be used to organize and categorize
   * objects.
   * User-provided labels are shared with Google's billing system, so they can
   * be used to filter, or break down billing charges by team, component,
   * environment, state, etc. For more information, visit
   * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
   * https://cloud.google.com/run/docs/configuring/labels.
   * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system labels in v1 now have a
   * corresponding field in v2 RevisionTemplate.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 2;</code>
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int ANNOTATIONS_FIELD_NUMBER = 3;

  private static final class AnnotationsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.run.v2.RevisionTemplateProto
                .internal_static_google_cloud_run_v2_RevisionTemplate_AnnotationsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
      internalGetAnnotations() {
    if (annotations_ == null) {
      return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry);
    }
    return annotations_;
  }

  public int getAnnotationsCount() {
    return internalGetAnnotations().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that may be set by external tools to store and
   * arbitrary metadata. They are not queryable and should be preserved
   * when modifying objects.
   * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system annotations in v1 now
   * have a corresponding field in v2 RevisionTemplate.
   * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
   * rules.
   * </pre>
   *
   * <code>map&lt;string, string&gt; annotations = 3;</code>
   */
  @java.lang.Override
  public boolean containsAnnotations(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetAnnotations().getMap().containsKey(key);
  }
  /** Use {@link #getAnnotationsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getAnnotations() {
    return getAnnotationsMap();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that may be set by external tools to store and
   * arbitrary metadata. They are not queryable and should be preserved
   * when modifying objects.
   * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system annotations in v1 now
   * have a corresponding field in v2 RevisionTemplate.
   * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
   * rules.
   * </pre>
   *
   * <code>map&lt;string, string&gt; annotations = 3;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() {
    return internalGetAnnotations().getMap();
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that may be set by external tools to store and
   * arbitrary metadata. They are not queryable and should be preserved
   * when modifying objects.
   * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system annotations in v1 now
   * have a corresponding field in v2 RevisionTemplate.
   * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
   * rules.
   * </pre>
   *
   * <code>map&lt;string, string&gt; annotations = 3;</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getAnnotationsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Unstructured key value map that may be set by external tools to store and
   * arbitrary metadata. They are not queryable and should be preserved
   * when modifying objects.
   * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
   * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
   * namespaces, and they will be rejected. All system annotations in v1 now
   * have a corresponding field in v2 RevisionTemplate.
   * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
   * rules.
   * </pre>
   *
   * <code>map&lt;string, string&gt; annotations = 3;</code>
   */
  @java.lang.Override
  public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int SCALING_FIELD_NUMBER = 4;
  private com.google.cloud.run.v2.RevisionScaling scaling_;
  /**
   *
   *
   * <pre>
   * Scaling settings for this Revision.
   * </pre>
   *
   * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
   *
   * @return Whether the scaling field is set.
   */
  @java.lang.Override
  public boolean hasScaling() {
    return scaling_ != null;
  }
  /**
   *
   *
   * <pre>
   * Scaling settings for this Revision.
   * </pre>
   *
   * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
   *
   * @return The scaling.
   */
  @java.lang.Override
  public com.google.cloud.run.v2.RevisionScaling getScaling() {
    return scaling_ == null
        ? com.google.cloud.run.v2.RevisionScaling.getDefaultInstance()
        : scaling_;
  }
  /**
   *
   *
   * <pre>
   * Scaling settings for this Revision.
   * </pre>
   *
   * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.RevisionScalingOrBuilder getScalingOrBuilder() {
    return scaling_ == null
        ? com.google.cloud.run.v2.RevisionScaling.getDefaultInstance()
        : scaling_;
  }

  public static final int VPC_ACCESS_FIELD_NUMBER = 6;
  private com.google.cloud.run.v2.VpcAccess vpcAccess_;
  /**
   *
   *
   * <pre>
   * VPC Access configuration to use for this Revision. For more information,
   * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
   * </pre>
   *
   * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
   *
   * @return Whether the vpcAccess field is set.
   */
  @java.lang.Override
  public boolean hasVpcAccess() {
    return vpcAccess_ != null;
  }
  /**
   *
   *
   * <pre>
   * VPC Access configuration to use for this Revision. For more information,
   * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
   * </pre>
   *
   * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
   *
   * @return The vpcAccess.
   */
  @java.lang.Override
  public com.google.cloud.run.v2.VpcAccess getVpcAccess() {
    return vpcAccess_ == null ? com.google.cloud.run.v2.VpcAccess.getDefaultInstance() : vpcAccess_;
  }
  /**
   *
   *
   * <pre>
   * VPC Access configuration to use for this Revision. For more information,
   * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
   * </pre>
   *
   * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.VpcAccessOrBuilder getVpcAccessOrBuilder() {
    return vpcAccess_ == null ? com.google.cloud.run.v2.VpcAccess.getDefaultInstance() : vpcAccess_;
  }

  public static final int TIMEOUT_FIELD_NUMBER = 8;
  private com.google.protobuf.Duration timeout_;
  /**
   *
   *
   * <pre>
   * Max allowed time for an instance to respond to a request.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 8;</code>
   *
   * @return Whether the timeout field is set.
   */
  @java.lang.Override
  public boolean hasTimeout() {
    return timeout_ != null;
  }
  /**
   *
   *
   * <pre>
   * Max allowed time for an instance to respond to a request.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 8;</code>
   *
   * @return The timeout.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getTimeout() {
    return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
  }
  /**
   *
   *
   * <pre>
   * Max allowed time for an instance to respond to a request.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 8;</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() {
    return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
  }

  public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private volatile java.lang.Object serviceAccount_ = "";
  /**
   *
   *
   * <pre>
   * Email address of the IAM service account associated with the revision of
   * the service. The service account represents the identity of the running
   * revision, and determines what permissions the revision has. If not
   * provided, the revision will use the project's default service account.
   * </pre>
   *
   * <code>string service_account = 9;</code>
   *
   * @return The serviceAccount.
   */
  @java.lang.Override
  public java.lang.String getServiceAccount() {
    java.lang.Object ref = serviceAccount_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      serviceAccount_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Email address of the IAM service account associated with the revision of
   * the service. The service account represents the identity of the running
   * revision, and determines what permissions the revision has. If not
   * provided, the revision will use the project's default service account.
   * </pre>
   *
   * <code>string service_account = 9;</code>
   *
   * @return The bytes for serviceAccount.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getServiceAccountBytes() {
    java.lang.Object ref = serviceAccount_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      serviceAccount_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONTAINERS_FIELD_NUMBER = 10;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.run.v2.Container> containers_;
  /**
   *
   *
   * <pre>
   * Holds the single container that defines the unit of execution for this
   * Revision.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.run.v2.Container> getContainersList() {
    return containers_;
  }
  /**
   *
   *
   * <pre>
   * Holds the single container that defines the unit of execution for this
   * Revision.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.run.v2.ContainerOrBuilder>
      getContainersOrBuilderList() {
    return containers_;
  }
  /**
   *
   *
   * <pre>
   * Holds the single container that defines the unit of execution for this
   * Revision.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
   */
  @java.lang.Override
  public int getContainersCount() {
    return containers_.size();
  }
  /**
   *
   *
   * <pre>
   * Holds the single container that defines the unit of execution for this
   * Revision.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.Container getContainers(int index) {
    return containers_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Holds the single container that defines the unit of execution for this
   * Revision.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.ContainerOrBuilder getContainersOrBuilder(int index) {
    return containers_.get(index);
  }

  public static final int VOLUMES_FIELD_NUMBER = 11;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.run.v2.Volume> volumes_;
  /**
   *
   *
   * <pre>
   * A list of Volumes to make available to containers.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.run.v2.Volume> getVolumesList() {
    return volumes_;
  }
  /**
   *
   *
   * <pre>
   * A list of Volumes to make available to containers.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.run.v2.VolumeOrBuilder>
      getVolumesOrBuilderList() {
    return volumes_;
  }
  /**
   *
   *
   * <pre>
   * A list of Volumes to make available to containers.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
   */
  @java.lang.Override
  public int getVolumesCount() {
    return volumes_.size();
  }
  /**
   *
   *
   * <pre>
   * A list of Volumes to make available to containers.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.Volume getVolumes(int index) {
    return volumes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * A list of Volumes to make available to containers.
   * </pre>
   *
   * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
   */
  @java.lang.Override
  public com.google.cloud.run.v2.VolumeOrBuilder getVolumesOrBuilder(int index) {
    return volumes_.get(index);
  }

  public static final int EXECUTION_ENVIRONMENT_FIELD_NUMBER = 13;
  private int executionEnvironment_ = 0;
  /**
   *
   *
   * <pre>
   * The sandbox environment to host this Revision.
   * </pre>
   *
   * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
   *
   * @return The enum numeric value on the wire for executionEnvironment.
   */
  @java.lang.Override
  public int getExecutionEnvironmentValue() {
    return executionEnvironment_;
  }
  /**
   *
   *
   * <pre>
   * The sandbox environment to host this Revision.
   * </pre>
   *
   * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
   *
   * @return The executionEnvironment.
   */
  @java.lang.Override
  public com.google.cloud.run.v2.ExecutionEnvironment getExecutionEnvironment() {
    com.google.cloud.run.v2.ExecutionEnvironment result =
        com.google.cloud.run.v2.ExecutionEnvironment.forNumber(executionEnvironment_);
    return result == null ? com.google.cloud.run.v2.ExecutionEnvironment.UNRECOGNIZED : result;
  }

  public static final int ENCRYPTION_KEY_FIELD_NUMBER = 14;

  @SuppressWarnings("serial")
  private volatile java.lang.Object encryptionKey_ = "";
  /**
   *
   *
   * <pre>
   * A reference to a customer managed encryption key (CMEK) to use to encrypt
   * this container image. For more information, go to
   * https://cloud.google.com/run/docs/securing/using-cmek
   * </pre>
   *
   * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The encryptionKey.
   */
  @java.lang.Override
  public java.lang.String getEncryptionKey() {
    java.lang.Object ref = encryptionKey_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      encryptionKey_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A reference to a customer managed encryption key (CMEK) to use to encrypt
   * this container image. For more information, go to
   * https://cloud.google.com/run/docs/securing/using-cmek
   * </pre>
   *
   * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for encryptionKey.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getEncryptionKeyBytes() {
    java.lang.Object ref = encryptionKey_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      encryptionKey_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER = 15;
  private int maxInstanceRequestConcurrency_ = 0;
  /**
   *
   *
   * <pre>
   * Sets the maximum number of requests that each serving instance can receive.
   * </pre>
   *
   * <code>int32 max_instance_request_concurrency = 15;</code>
   *
   * @return The maxInstanceRequestConcurrency.
   */
  @java.lang.Override
  public int getMaxInstanceRequestConcurrency() {
    return maxInstanceRequestConcurrency_;
  }

  public static final int SESSION_AFFINITY_FIELD_NUMBER = 19;
  private boolean sessionAffinity_ = false;
  /**
   *
   *
   * <pre>
   * Enable session affinity.
   * </pre>
   *
   * <code>bool session_affinity = 19;</code>
   *
   * @return The sessionAffinity.
   */
  @java.lang.Override
  public boolean getSessionAffinity() {
    return sessionAffinity_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, revision_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2);
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 3);
    if (scaling_ != null) {
      output.writeMessage(4, getScaling());
    }
    if (vpcAccess_ != null) {
      output.writeMessage(6, getVpcAccess());
    }
    if (timeout_ != null) {
      output.writeMessage(8, getTimeout());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 9, serviceAccount_);
    }
    for (int i = 0; i < containers_.size(); i++) {
      output.writeMessage(10, containers_.get(i));
    }
    for (int i = 0; i < volumes_.size(); i++) {
      output.writeMessage(11, volumes_.get(i));
    }
    if (executionEnvironment_
        != com.google.cloud.run.v2.ExecutionEnvironment.EXECUTION_ENVIRONMENT_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(13, executionEnvironment_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encryptionKey_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 14, encryptionKey_);
    }
    if (maxInstanceRequestConcurrency_ != 0) {
      output.writeInt32(15, maxInstanceRequestConcurrency_);
    }
    if (sessionAffinity_ != false) {
      output.writeBool(19, sessionAffinity_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, revision_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetAnnotations().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ =
          AnnotationsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, annotations__);
    }
    if (scaling_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getScaling());
    }
    if (vpcAccess_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getVpcAccess());
    }
    if (timeout_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getTimeout());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, serviceAccount_);
    }
    for (int i = 0; i < containers_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, containers_.get(i));
    }
    for (int i = 0; i < volumes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, volumes_.get(i));
    }
    if (executionEnvironment_
        != com.google.cloud.run.v2.ExecutionEnvironment.EXECUTION_ENVIRONMENT_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, executionEnvironment_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encryptionKey_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, encryptionKey_);
    }
    if (maxInstanceRequestConcurrency_ != 0) {
      size +=
          com.google.protobuf.CodedOutputStream.computeInt32Size(
              15, maxInstanceRequestConcurrency_);
    }
    if (sessionAffinity_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, sessionAffinity_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.run.v2.RevisionTemplate)) {
      return super.equals(obj);
    }
    com.google.cloud.run.v2.RevisionTemplate other = (com.google.cloud.run.v2.RevisionTemplate) obj;

    if (!getRevision().equals(other.getRevision())) return false;
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false;
    if (hasScaling() != other.hasScaling()) return false;
    if (hasScaling()) {
      if (!getScaling().equals(other.getScaling())) return false;
    }
    if (hasVpcAccess() != other.hasVpcAccess()) return false;
    if (hasVpcAccess()) {
      if (!getVpcAccess().equals(other.getVpcAccess())) return false;
    }
    if (hasTimeout() != other.hasTimeout()) return false;
    if (hasTimeout()) {
      if (!getTimeout().equals(other.getTimeout())) return false;
    }
    if (!getServiceAccount().equals(other.getServiceAccount())) return false;
    if (!getContainersList().equals(other.getContainersList())) return false;
    if (!getVolumesList().equals(other.getVolumesList())) return false;
    if (executionEnvironment_ != other.executionEnvironment_) return false;
    if (!getEncryptionKey().equals(other.getEncryptionKey())) return false;
    if (getMaxInstanceRequestConcurrency() != other.getMaxInstanceRequestConcurrency())
      return false;
    if (getSessionAffinity() != other.getSessionAffinity()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + REVISION_FIELD_NUMBER;
    hash = (53 * hash) + getRevision().hashCode();
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    if (!internalGetAnnotations().getMap().isEmpty()) {
      hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetAnnotations().hashCode();
    }
    if (hasScaling()) {
      hash = (37 * hash) + SCALING_FIELD_NUMBER;
      hash = (53 * hash) + getScaling().hashCode();
    }
    if (hasVpcAccess()) {
      hash = (37 * hash) + VPC_ACCESS_FIELD_NUMBER;
      hash = (53 * hash) + getVpcAccess().hashCode();
    }
    if (hasTimeout()) {
      hash = (37 * hash) + TIMEOUT_FIELD_NUMBER;
      hash = (53 * hash) + getTimeout().hashCode();
    }
    hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
    hash = (53 * hash) + getServiceAccount().hashCode();
    if (getContainersCount() > 0) {
      hash = (37 * hash) + CONTAINERS_FIELD_NUMBER;
      hash = (53 * hash) + getContainersList().hashCode();
    }
    if (getVolumesCount() > 0) {
      hash = (37 * hash) + VOLUMES_FIELD_NUMBER;
      hash = (53 * hash) + getVolumesList().hashCode();
    }
    hash = (37 * hash) + EXECUTION_ENVIRONMENT_FIELD_NUMBER;
    hash = (53 * hash) + executionEnvironment_;
    hash = (37 * hash) + ENCRYPTION_KEY_FIELD_NUMBER;
    hash = (53 * hash) + getEncryptionKey().hashCode();
    hash = (37 * hash) + MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER;
    hash = (53 * hash) + getMaxInstanceRequestConcurrency();
    hash = (37 * hash) + SESSION_AFFINITY_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSessionAffinity());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.run.v2.RevisionTemplate parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.run.v2.RevisionTemplate prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * RevisionTemplate describes the data a revision should have when created from
   * a template.
   * </pre>
   *
   * Protobuf type {@code google.cloud.run.v2.RevisionTemplate}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.run.v2.RevisionTemplate)
      com.google.cloud.run.v2.RevisionTemplateOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.run.v2.RevisionTemplateProto
          .internal_static_google_cloud_run_v2_RevisionTemplate_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 2:
          return internalGetLabels();
        case 3:
          return internalGetAnnotations();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 2:
          return internalGetMutableLabels();
        case 3:
          return internalGetMutableAnnotations();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.run.v2.RevisionTemplateProto
          .internal_static_google_cloud_run_v2_RevisionTemplate_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.run.v2.RevisionTemplate.class,
              com.google.cloud.run.v2.RevisionTemplate.Builder.class);
    }

    // Construct using com.google.cloud.run.v2.RevisionTemplate.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      revision_ = "";
      internalGetMutableLabels().clear();
      internalGetMutableAnnotations().clear();
      scaling_ = null;
      if (scalingBuilder_ != null) {
        scalingBuilder_.dispose();
        scalingBuilder_ = null;
      }
      vpcAccess_ = null;
      if (vpcAccessBuilder_ != null) {
        vpcAccessBuilder_.dispose();
        vpcAccessBuilder_ = null;
      }
      timeout_ = null;
      if (timeoutBuilder_ != null) {
        timeoutBuilder_.dispose();
        timeoutBuilder_ = null;
      }
      serviceAccount_ = "";
      if (containersBuilder_ == null) {
        containers_ = java.util.Collections.emptyList();
      } else {
        containers_ = null;
        containersBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000080);
      if (volumesBuilder_ == null) {
        volumes_ = java.util.Collections.emptyList();
      } else {
        volumes_ = null;
        volumesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000100);
      executionEnvironment_ = 0;
      encryptionKey_ = "";
      maxInstanceRequestConcurrency_ = 0;
      sessionAffinity_ = false;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.run.v2.RevisionTemplateProto
          .internal_static_google_cloud_run_v2_RevisionTemplate_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.run.v2.RevisionTemplate getDefaultInstanceForType() {
      return com.google.cloud.run.v2.RevisionTemplate.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.run.v2.RevisionTemplate build() {
      com.google.cloud.run.v2.RevisionTemplate result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.run.v2.RevisionTemplate buildPartial() {
      com.google.cloud.run.v2.RevisionTemplate result =
          new com.google.cloud.run.v2.RevisionTemplate(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.cloud.run.v2.RevisionTemplate result) {
      if (containersBuilder_ == null) {
        if (((bitField0_ & 0x00000080) != 0)) {
          containers_ = java.util.Collections.unmodifiableList(containers_);
          bitField0_ = (bitField0_ & ~0x00000080);
        }
        result.containers_ = containers_;
      } else {
        result.containers_ = containersBuilder_.build();
      }
      if (volumesBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)) {
          volumes_ = java.util.Collections.unmodifiableList(volumes_);
          bitField0_ = (bitField0_ & ~0x00000100);
        }
        result.volumes_ = volumes_;
      } else {
        result.volumes_ = volumesBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.run.v2.RevisionTemplate result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.revision_ = revision_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.annotations_ = internalGetAnnotations();
        result.annotations_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.scaling_ = scalingBuilder_ == null ? scaling_ : scalingBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.vpcAccess_ = vpcAccessBuilder_ == null ? vpcAccess_ : vpcAccessBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.timeout_ = timeoutBuilder_ == null ? timeout_ : timeoutBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.serviceAccount_ = serviceAccount_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.executionEnvironment_ = executionEnvironment_;
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.encryptionKey_ = encryptionKey_;
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.maxInstanceRequestConcurrency_ = maxInstanceRequestConcurrency_;
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.sessionAffinity_ = sessionAffinity_;
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.run.v2.RevisionTemplate) {
        return mergeFrom((com.google.cloud.run.v2.RevisionTemplate) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.run.v2.RevisionTemplate other) {
      if (other == com.google.cloud.run.v2.RevisionTemplate.getDefaultInstance()) return this;
      if (!other.getRevision().isEmpty()) {
        revision_ = other.revision_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00000002;
      internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations());
      bitField0_ |= 0x00000004;
      if (other.hasScaling()) {
        mergeScaling(other.getScaling());
      }
      if (other.hasVpcAccess()) {
        mergeVpcAccess(other.getVpcAccess());
      }
      if (other.hasTimeout()) {
        mergeTimeout(other.getTimeout());
      }
      if (!other.getServiceAccount().isEmpty()) {
        serviceAccount_ = other.serviceAccount_;
        bitField0_ |= 0x00000040;
        onChanged();
      }
      if (containersBuilder_ == null) {
        if (!other.containers_.isEmpty()) {
          if (containers_.isEmpty()) {
            containers_ = other.containers_;
            bitField0_ = (bitField0_ & ~0x00000080);
          } else {
            ensureContainersIsMutable();
            containers_.addAll(other.containers_);
          }
          onChanged();
        }
      } else {
        if (!other.containers_.isEmpty()) {
          if (containersBuilder_.isEmpty()) {
            containersBuilder_.dispose();
            containersBuilder_ = null;
            containers_ = other.containers_;
            bitField0_ = (bitField0_ & ~0x00000080);
            containersBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getContainersFieldBuilder()
                    : null;
          } else {
            containersBuilder_.addAllMessages(other.containers_);
          }
        }
      }
      if (volumesBuilder_ == null) {
        if (!other.volumes_.isEmpty()) {
          if (volumes_.isEmpty()) {
            volumes_ = other.volumes_;
            bitField0_ = (bitField0_ & ~0x00000100);
          } else {
            ensureVolumesIsMutable();
            volumes_.addAll(other.volumes_);
          }
          onChanged();
        }
      } else {
        if (!other.volumes_.isEmpty()) {
          if (volumesBuilder_.isEmpty()) {
            volumesBuilder_.dispose();
            volumesBuilder_ = null;
            volumes_ = other.volumes_;
            bitField0_ = (bitField0_ & ~0x00000100);
            volumesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getVolumesFieldBuilder()
                    : null;
          } else {
            volumesBuilder_.addAllMessages(other.volumes_);
          }
        }
      }
      if (other.executionEnvironment_ != 0) {
        setExecutionEnvironmentValue(other.getExecutionEnvironmentValue());
      }
      if (!other.getEncryptionKey().isEmpty()) {
        encryptionKey_ = other.encryptionKey_;
        bitField0_ |= 0x00000400;
        onChanged();
      }
      if (other.getMaxInstanceRequestConcurrency() != 0) {
        setMaxInstanceRequestConcurrency(other.getMaxInstanceRequestConcurrency());
      }
      if (other.getSessionAffinity() != false) {
        setSessionAffinity(other.getSessionAffinity());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                revision_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ =
                    input.readMessage(
                        AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableAnnotations()
                    .getMutableMap()
                    .put(annotations__.getKey(), annotations__.getValue());
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getScalingFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 50:
              {
                input.readMessage(getVpcAccessFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000010;
                break;
              } // case 50
            case 66:
              {
                input.readMessage(getTimeoutFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000020;
                break;
              } // case 66
            case 74:
              {
                serviceAccount_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000040;
                break;
              } // case 74
            case 82:
              {
                com.google.cloud.run.v2.Container m =
                    input.readMessage(
                        com.google.cloud.run.v2.Container.parser(), extensionRegistry);
                if (containersBuilder_ == null) {
                  ensureContainersIsMutable();
                  containers_.add(m);
                } else {
                  containersBuilder_.addMessage(m);
                }
                break;
              } // case 82
            case 90:
              {
                com.google.cloud.run.v2.Volume m =
                    input.readMessage(com.google.cloud.run.v2.Volume.parser(), extensionRegistry);
                if (volumesBuilder_ == null) {
                  ensureVolumesIsMutable();
                  volumes_.add(m);
                } else {
                  volumesBuilder_.addMessage(m);
                }
                break;
              } // case 90
            case 104:
              {
                executionEnvironment_ = input.readEnum();
                bitField0_ |= 0x00000200;
                break;
              } // case 104
            case 114:
              {
                encryptionKey_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000400;
                break;
              } // case 114
            case 120:
              {
                maxInstanceRequestConcurrency_ = input.readInt32();
                bitField0_ |= 0x00000800;
                break;
              } // case 120
            case 152:
              {
                sessionAffinity_ = input.readBool();
                bitField0_ |= 0x00001000;
                break;
              } // case 152
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object revision_ = "";
    /**
     *
     *
     * <pre>
     * The unique name for the revision. If this field is omitted, it will be
     * automatically generated based on the Service name.
     * </pre>
     *
     * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The revision.
     */
    public java.lang.String getRevision() {
      java.lang.Object ref = revision_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        revision_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The unique name for the revision. If this field is omitted, it will be
     * automatically generated based on the Service name.
     * </pre>
     *
     * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for revision.
     */
    public com.google.protobuf.ByteString getRevisionBytes() {
      java.lang.Object ref = revision_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        revision_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The unique name for the revision. If this field is omitted, it will be
     * automatically generated based on the Service name.
     * </pre>
     *
     * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The revision to set.
     * @return This builder for chaining.
     */
    public Builder setRevision(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      revision_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The unique name for the revision. If this field is omitted, it will be
     * automatically generated based on the Service name.
     * </pre>
     *
     * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRevision() {
      revision_ = getDefaultInstance().getRevision();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The unique name for the revision. If this field is omitted, it will be
     * automatically generated based on the Service name.
     * </pre>
     *
     * <code>string revision = 1 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for revision to set.
     * @return This builder for chaining.
     */
    public Builder setRevisionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      revision_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getLabelsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      bitField0_ = (bitField0_ & ~0x00000002);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      bitField0_ |= 0x00000002;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableLabels().getMutableMap().put(key, value);
      bitField0_ |= 0x00000002;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that can be used to organize and categorize
     * objects.
     * User-provided labels are shared with Google's billing system, so they can
     * be used to filter, or break down billing charges by team, component,
     * environment, state, etc. For more information, visit
     * https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * &lt;p&gt;Cloud Run API v2 does not support labels with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system labels in v1 now have a
     * corresponding field in v2 RevisionTemplate.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 2;</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00000002;
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetAnnotations() {
      if (annotations_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            AnnotationsDefaultEntryHolder.defaultEntry);
      }
      return annotations_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableAnnotations() {
      if (annotations_ == null) {
        annotations_ =
            com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry);
      }
      if (!annotations_.isMutable()) {
        annotations_ = annotations_.copy();
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return annotations_;
    }

    public int getAnnotationsCount() {
      return internalGetAnnotations().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    @java.lang.Override
    public boolean containsAnnotations(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetAnnotations().getMap().containsKey(key);
    }
    /** Use {@link #getAnnotationsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getAnnotations() {
      return getAnnotationsMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() {
      return internalGetAnnotations().getMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getAnnotationsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    @java.lang.Override
    public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearAnnotations() {
      bitField0_ = (bitField0_ & ~0x00000004);
      internalGetMutableAnnotations().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    public Builder removeAnnotations(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableAnnotations().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableAnnotations() {
      bitField0_ |= 0x00000004;
      return internalGetMutableAnnotations().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    public Builder putAnnotations(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableAnnotations().getMutableMap().put(key, value);
      bitField0_ |= 0x00000004;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unstructured key value map that may be set by external tools to store and
     * arbitrary metadata. They are not queryable and should be preserved
     * when modifying objects.
     * &lt;p&gt;Cloud Run API v2 does not support annotations with `run.googleapis.com`,
     * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
     * namespaces, and they will be rejected. All system annotations in v1 now
     * have a corresponding field in v2 RevisionTemplate.
     * &lt;p&gt;This field follows Kubernetes annotations' namespacing, limits, and
     * rules.
     * </pre>
     *
     * <code>map&lt;string, string&gt; annotations = 3;</code>
     */
    public Builder putAllAnnotations(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableAnnotations().getMutableMap().putAll(values);
      bitField0_ |= 0x00000004;
      return this;
    }

    private com.google.cloud.run.v2.RevisionScaling scaling_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.run.v2.RevisionScaling,
            com.google.cloud.run.v2.RevisionScaling.Builder,
            com.google.cloud.run.v2.RevisionScalingOrBuilder>
        scalingBuilder_;
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     *
     * @return Whether the scaling field is set.
     */
    public boolean hasScaling() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     *
     * @return The scaling.
     */
    public com.google.cloud.run.v2.RevisionScaling getScaling() {
      if (scalingBuilder_ == null) {
        return scaling_ == null
            ? com.google.cloud.run.v2.RevisionScaling.getDefaultInstance()
            : scaling_;
      } else {
        return scalingBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public Builder setScaling(com.google.cloud.run.v2.RevisionScaling value) {
      if (scalingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        scaling_ = value;
      } else {
        scalingBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public Builder setScaling(com.google.cloud.run.v2.RevisionScaling.Builder builderForValue) {
      if (scalingBuilder_ == null) {
        scaling_ = builderForValue.build();
      } else {
        scalingBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public Builder mergeScaling(com.google.cloud.run.v2.RevisionScaling value) {
      if (scalingBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && scaling_ != null
            && scaling_ != com.google.cloud.run.v2.RevisionScaling.getDefaultInstance()) {
          getScalingBuilder().mergeFrom(value);
        } else {
          scaling_ = value;
        }
      } else {
        scalingBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public Builder clearScaling() {
      bitField0_ = (bitField0_ & ~0x00000008);
      scaling_ = null;
      if (scalingBuilder_ != null) {
        scalingBuilder_.dispose();
        scalingBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public com.google.cloud.run.v2.RevisionScaling.Builder getScalingBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getScalingFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    public com.google.cloud.run.v2.RevisionScalingOrBuilder getScalingOrBuilder() {
      if (scalingBuilder_ != null) {
        return scalingBuilder_.getMessageOrBuilder();
      } else {
        return scaling_ == null
            ? com.google.cloud.run.v2.RevisionScaling.getDefaultInstance()
            : scaling_;
      }
    }
    /**
     *
     *
     * <pre>
     * Scaling settings for this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.RevisionScaling scaling = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.run.v2.RevisionScaling,
            com.google.cloud.run.v2.RevisionScaling.Builder,
            com.google.cloud.run.v2.RevisionScalingOrBuilder>
        getScalingFieldBuilder() {
      if (scalingBuilder_ == null) {
        scalingBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.run.v2.RevisionScaling,
                com.google.cloud.run.v2.RevisionScaling.Builder,
                com.google.cloud.run.v2.RevisionScalingOrBuilder>(
                getScaling(), getParentForChildren(), isClean());
        scaling_ = null;
      }
      return scalingBuilder_;
    }

    private com.google.cloud.run.v2.VpcAccess vpcAccess_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.run.v2.VpcAccess,
            com.google.cloud.run.v2.VpcAccess.Builder,
            com.google.cloud.run.v2.VpcAccessOrBuilder>
        vpcAccessBuilder_;
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     *
     * @return Whether the vpcAccess field is set.
     */
    public boolean hasVpcAccess() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     *
     * @return The vpcAccess.
     */
    public com.google.cloud.run.v2.VpcAccess getVpcAccess() {
      if (vpcAccessBuilder_ == null) {
        return vpcAccess_ == null
            ? com.google.cloud.run.v2.VpcAccess.getDefaultInstance()
            : vpcAccess_;
      } else {
        return vpcAccessBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public Builder setVpcAccess(com.google.cloud.run.v2.VpcAccess value) {
      if (vpcAccessBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        vpcAccess_ = value;
      } else {
        vpcAccessBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public Builder setVpcAccess(com.google.cloud.run.v2.VpcAccess.Builder builderForValue) {
      if (vpcAccessBuilder_ == null) {
        vpcAccess_ = builderForValue.build();
      } else {
        vpcAccessBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public Builder mergeVpcAccess(com.google.cloud.run.v2.VpcAccess value) {
      if (vpcAccessBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)
            && vpcAccess_ != null
            && vpcAccess_ != com.google.cloud.run.v2.VpcAccess.getDefaultInstance()) {
          getVpcAccessBuilder().mergeFrom(value);
        } else {
          vpcAccess_ = value;
        }
      } else {
        vpcAccessBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public Builder clearVpcAccess() {
      bitField0_ = (bitField0_ & ~0x00000010);
      vpcAccess_ = null;
      if (vpcAccessBuilder_ != null) {
        vpcAccessBuilder_.dispose();
        vpcAccessBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public com.google.cloud.run.v2.VpcAccess.Builder getVpcAccessBuilder() {
      bitField0_ |= 0x00000010;
      onChanged();
      return getVpcAccessFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    public com.google.cloud.run.v2.VpcAccessOrBuilder getVpcAccessOrBuilder() {
      if (vpcAccessBuilder_ != null) {
        return vpcAccessBuilder_.getMessageOrBuilder();
      } else {
        return vpcAccess_ == null
            ? com.google.cloud.run.v2.VpcAccess.getDefaultInstance()
            : vpcAccess_;
      }
    }
    /**
     *
     *
     * <pre>
     * VPC Access configuration to use for this Revision. For more information,
     * visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
     * </pre>
     *
     * <code>.google.cloud.run.v2.VpcAccess vpc_access = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.run.v2.VpcAccess,
            com.google.cloud.run.v2.VpcAccess.Builder,
            com.google.cloud.run.v2.VpcAccessOrBuilder>
        getVpcAccessFieldBuilder() {
      if (vpcAccessBuilder_ == null) {
        vpcAccessBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.run.v2.VpcAccess,
                com.google.cloud.run.v2.VpcAccess.Builder,
                com.google.cloud.run.v2.VpcAccessOrBuilder>(
                getVpcAccess(), getParentForChildren(), isClean());
        vpcAccess_ = null;
      }
      return vpcAccessBuilder_;
    }

    private com.google.protobuf.Duration timeout_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        timeoutBuilder_;
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     *
     * @return Whether the timeout field is set.
     */
    public boolean hasTimeout() {
      return ((bitField0_ & 0x00000020) != 0);
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     *
     * @return The timeout.
     */
    public com.google.protobuf.Duration getTimeout() {
      if (timeoutBuilder_ == null) {
        return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
      } else {
        return timeoutBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public Builder setTimeout(com.google.protobuf.Duration value) {
      if (timeoutBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        timeout_ = value;
      } else {
        timeoutBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) {
      if (timeoutBuilder_ == null) {
        timeout_ = builderForValue.build();
      } else {
        timeoutBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public Builder mergeTimeout(com.google.protobuf.Duration value) {
      if (timeoutBuilder_ == null) {
        if (((bitField0_ & 0x00000020) != 0)
            && timeout_ != null
            && timeout_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getTimeoutBuilder().mergeFrom(value);
        } else {
          timeout_ = value;
        }
      } else {
        timeoutBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public Builder clearTimeout() {
      bitField0_ = (bitField0_ & ~0x00000020);
      timeout_ = null;
      if (timeoutBuilder_ != null) {
        timeoutBuilder_.dispose();
        timeoutBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public com.google.protobuf.Duration.Builder getTimeoutBuilder() {
      bitField0_ |= 0x00000020;
      onChanged();
      return getTimeoutFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() {
      if (timeoutBuilder_ != null) {
        return timeoutBuilder_.getMessageOrBuilder();
      } else {
        return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
      }
    }
    /**
     *
     *
     * <pre>
     * Max allowed time for an instance to respond to a request.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getTimeoutFieldBuilder() {
      if (timeoutBuilder_ == null) {
        timeoutBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getTimeout(), getParentForChildren(), isClean());
        timeout_ = null;
      }
      return timeoutBuilder_;
    }

    private java.lang.Object serviceAccount_ = "";
    /**
     *
     *
     * <pre>
     * Email address of the IAM service account associated with the revision of
     * the service. The service account represents the identity of the running
     * revision, and determines what permissions the revision has. If not
     * provided, the revision will use the project's default service account.
     * </pre>
     *
     * <code>string service_account = 9;</code>
     *
     * @return The serviceAccount.
     */
    public java.lang.String getServiceAccount() {
      java.lang.Object ref = serviceAccount_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        serviceAccount_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Email address of the IAM service account associated with the revision of
     * the service. The service account represents the identity of the running
     * revision, and determines what permissions the revision has. If not
     * provided, the revision will use the project's default service account.
     * </pre>
     *
     * <code>string service_account = 9;</code>
     *
     * @return The bytes for serviceAccount.
     */
    public com.google.protobuf.ByteString getServiceAccountBytes() {
      java.lang.Object ref = serviceAccount_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        serviceAccount_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Email address of the IAM service account associated with the revision of
     * the service. The service account represents the identity of the running
     * revision, and determines what permissions the revision has. If not
     * provided, the revision will use the project's default service account.
     * </pre>
     *
     * <code>string service_account = 9;</code>
     *
     * @param value The serviceAccount to set.
     * @return This builder for chaining.
     */
    public Builder setServiceAccount(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      serviceAccount_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Email address of the IAM service account associated with the revision of
     * the service. The service account represents the identity of the running
     * revision, and determines what permissions the revision has. If not
     * provided, the revision will use the project's default service account.
     * </pre>
     *
     * <code>string service_account = 9;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearServiceAccount() {
      serviceAccount_ = getDefaultInstance().getServiceAccount();
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Email address of the IAM service account associated with the revision of
     * the service. The service account represents the identity of the running
     * revision, and determines what permissions the revision has. If not
     * provided, the revision will use the project's default service account.
     * </pre>
     *
     * <code>string service_account = 9;</code>
     *
     * @param value The bytes for serviceAccount to set.
     * @return This builder for chaining.
     */
    public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      serviceAccount_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.run.v2.Container> containers_ =
        java.util.Collections.emptyList();

    private void ensureContainersIsMutable() {
      if (!((bitField0_ & 0x00000080) != 0)) {
        containers_ = new java.util.ArrayList<com.google.cloud.run.v2.Container>(containers_);
        bitField0_ |= 0x00000080;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.run.v2.Container,
            com.google.cloud.run.v2.Container.Builder,
            com.google.cloud.run.v2.ContainerOrBuilder>
        containersBuilder_;

    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public java.util.List<com.google.cloud.run.v2.Container> getContainersList() {
      if (containersBuilder_ == null) {
        return java.util.Collections.unmodifiableList(containers_);
      } else {
        return containersBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public int getContainersCount() {
      if (containersBuilder_ == null) {
        return containers_.size();
      } else {
        return containersBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public com.google.cloud.run.v2.Container getContainers(int index) {
      if (containersBuilder_ == null) {
        return containers_.get(index);
      } else {
        return containersBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder setContainers(int index, com.google.cloud.run.v2.Container value) {
      if (containersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureContainersIsMutable();
        containers_.set(index, value);
        onChanged();
      } else {
        containersBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder setContainers(
        int index, com.google.cloud.run.v2.Container.Builder builderForValue) {
      if (containersBuilder_ == null) {
        ensureContainersIsMutable();
        containers_.set(index, builderForValue.build());
        onChanged();
      } else {
        containersBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder addContainers(com.google.cloud.run.v2.Container value) {
      if (containersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureContainersIsMutable();
        containers_.add(value);
        onChanged();
      } else {
        containersBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder addContainers(int index, com.google.cloud.run.v2.Container value) {
      if (containersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureContainersIsMutable();
        containers_.add(index, value);
        onChanged();
      } else {
        containersBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder addContainers(com.google.cloud.run.v2.Container.Builder builderForValue) {
      if (containersBuilder_ == null) {
        ensureContainersIsMutable();
        containers_.add(builderForValue.build());
        onChanged();
      } else {
        containersBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder addContainers(
        int index, com.google.cloud.run.v2.Container.Builder builderForValue) {
      if (containersBuilder_ == null) {
        ensureContainersIsMutable();
        containers_.add(index, builderForValue.build());
        onChanged();
      } else {
        containersBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder addAllContainers(
        java.lang.Iterable<? extends com.google.cloud.run.v2.Container> values) {
      if (containersBuilder_ == null) {
        ensureContainersIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, containers_);
        onChanged();
      } else {
        containersBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder clearContainers() {
      if (containersBuilder_ == null) {
        containers_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000080);
        onChanged();
      } else {
        containersBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public Builder removeContainers(int index) {
      if (containersBuilder_ == null) {
        ensureContainersIsMutable();
        containers_.remove(index);
        onChanged();
      } else {
        containersBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public com.google.cloud.run.v2.Container.Builder getContainersBuilder(int index) {
      return getContainersFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public com.google.cloud.run.v2.ContainerOrBuilder getContainersOrBuilder(int index) {
      if (containersBuilder_ == null) {
        return containers_.get(index);
      } else {
        return containersBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public java.util.List<? extends com.google.cloud.run.v2.ContainerOrBuilder>
        getContainersOrBuilderList() {
      if (containersBuilder_ != null) {
        return containersBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(containers_);
      }
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public com.google.cloud.run.v2.Container.Builder addContainersBuilder() {
      return getContainersFieldBuilder()
          .addBuilder(com.google.cloud.run.v2.Container.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public com.google.cloud.run.v2.Container.Builder addContainersBuilder(int index) {
      return getContainersFieldBuilder()
          .addBuilder(index, com.google.cloud.run.v2.Container.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Holds the single container that defines the unit of execution for this
     * Revision.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Container containers = 10;</code>
     */
    public java.util.List<com.google.cloud.run.v2.Container.Builder> getContainersBuilderList() {
      return getContainersFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.run.v2.Container,
            com.google.cloud.run.v2.Container.Builder,
            com.google.cloud.run.v2.ContainerOrBuilder>
        getContainersFieldBuilder() {
      if (containersBuilder_ == null) {
        containersBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.run.v2.Container,
                com.google.cloud.run.v2.Container.Builder,
                com.google.cloud.run.v2.ContainerOrBuilder>(
                containers_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean());
        containers_ = null;
      }
      return containersBuilder_;
    }

    private java.util.List<com.google.cloud.run.v2.Volume> volumes_ =
        java.util.Collections.emptyList();

    private void ensureVolumesIsMutable() {
      if (!((bitField0_ & 0x00000100) != 0)) {
        volumes_ = new java.util.ArrayList<com.google.cloud.run.v2.Volume>(volumes_);
        bitField0_ |= 0x00000100;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.run.v2.Volume,
            com.google.cloud.run.v2.Volume.Builder,
            com.google.cloud.run.v2.VolumeOrBuilder>
        volumesBuilder_;

    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public java.util.List<com.google.cloud.run.v2.Volume> getVolumesList() {
      if (volumesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(volumes_);
      } else {
        return volumesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public int getVolumesCount() {
      if (volumesBuilder_ == null) {
        return volumes_.size();
      } else {
        return volumesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public com.google.cloud.run.v2.Volume getVolumes(int index) {
      if (volumesBuilder_ == null) {
        return volumes_.get(index);
      } else {
        return volumesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder setVolumes(int index, com.google.cloud.run.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.set(index, value);
        onChanged();
      } else {
        volumesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder setVolumes(int index, com.google.cloud.run.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.set(index, builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder addVolumes(com.google.cloud.run.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.add(value);
        onChanged();
      } else {
        volumesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder addVolumes(int index, com.google.cloud.run.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.add(index, value);
        onChanged();
      } else {
        volumesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder addVolumes(com.google.cloud.run.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.add(builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder addVolumes(int index, com.google.cloud.run.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.add(index, builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder addAllVolumes(
        java.lang.Iterable<? extends com.google.cloud.run.v2.Volume> values) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumes_);
        onChanged();
      } else {
        volumesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder clearVolumes() {
      if (volumesBuilder_ == null) {
        volumes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000100);
        onChanged();
      } else {
        volumesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public Builder removeVolumes(int index) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.remove(index);
        onChanged();
      } else {
        volumesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public com.google.cloud.run.v2.Volume.Builder getVolumesBuilder(int index) {
      return getVolumesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public com.google.cloud.run.v2.VolumeOrBuilder getVolumesOrBuilder(int index) {
      if (volumesBuilder_ == null) {
        return volumes_.get(index);
      } else {
        return volumesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public java.util.List<? extends com.google.cloud.run.v2.VolumeOrBuilder>
        getVolumesOrBuilderList() {
      if (volumesBuilder_ != null) {
        return volumesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(volumes_);
      }
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public com.google.cloud.run.v2.Volume.Builder addVolumesBuilder() {
      return getVolumesFieldBuilder()
          .addBuilder(com.google.cloud.run.v2.Volume.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public com.google.cloud.run.v2.Volume.Builder addVolumesBuilder(int index) {
      return getVolumesFieldBuilder()
          .addBuilder(index, com.google.cloud.run.v2.Volume.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * A list of Volumes to make available to containers.
     * </pre>
     *
     * <code>repeated .google.cloud.run.v2.Volume volumes = 11;</code>
     */
    public java.util.List<com.google.cloud.run.v2.Volume.Builder> getVolumesBuilderList() {
      return getVolumesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.run.v2.Volume,
            com.google.cloud.run.v2.Volume.Builder,
            com.google.cloud.run.v2.VolumeOrBuilder>
        getVolumesFieldBuilder() {
      if (volumesBuilder_ == null) {
        volumesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.run.v2.Volume,
                com.google.cloud.run.v2.Volume.Builder,
                com.google.cloud.run.v2.VolumeOrBuilder>(
                volumes_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean());
        volumes_ = null;
      }
      return volumesBuilder_;
    }

    private int executionEnvironment_ = 0;
    /**
     *
     *
     * <pre>
     * The sandbox environment to host this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
     *
     * @return The enum numeric value on the wire for executionEnvironment.
     */
    @java.lang.Override
    public int getExecutionEnvironmentValue() {
      return executionEnvironment_;
    }
    /**
     *
     *
     * <pre>
     * The sandbox environment to host this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
     *
     * @param value The enum numeric value on the wire for executionEnvironment to set.
     * @return This builder for chaining.
     */
    public Builder setExecutionEnvironmentValue(int value) {
      executionEnvironment_ = value;
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The sandbox environment to host this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
     *
     * @return The executionEnvironment.
     */
    @java.lang.Override
    public com.google.cloud.run.v2.ExecutionEnvironment getExecutionEnvironment() {
      com.google.cloud.run.v2.ExecutionEnvironment result =
          com.google.cloud.run.v2.ExecutionEnvironment.forNumber(executionEnvironment_);
      return result == null ? com.google.cloud.run.v2.ExecutionEnvironment.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * The sandbox environment to host this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
     *
     * @param value The executionEnvironment to set.
     * @return This builder for chaining.
     */
    public Builder setExecutionEnvironment(com.google.cloud.run.v2.ExecutionEnvironment value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000200;
      executionEnvironment_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The sandbox environment to host this Revision.
     * </pre>
     *
     * <code>.google.cloud.run.v2.ExecutionEnvironment execution_environment = 13;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearExecutionEnvironment() {
      bitField0_ = (bitField0_ & ~0x00000200);
      executionEnvironment_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object encryptionKey_ = "";
    /**
     *
     *
     * <pre>
     * A reference to a customer managed encryption key (CMEK) to use to encrypt
     * this container image. For more information, go to
     * https://cloud.google.com/run/docs/securing/using-cmek
     * </pre>
     *
     * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The encryptionKey.
     */
    public java.lang.String getEncryptionKey() {
      java.lang.Object ref = encryptionKey_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        encryptionKey_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A reference to a customer managed encryption key (CMEK) to use to encrypt
     * this container image. For more information, go to
     * https://cloud.google.com/run/docs/securing/using-cmek
     * </pre>
     *
     * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for encryptionKey.
     */
    public com.google.protobuf.ByteString getEncryptionKeyBytes() {
      java.lang.Object ref = encryptionKey_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        encryptionKey_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A reference to a customer managed encryption key (CMEK) to use to encrypt
     * this container image. For more information, go to
     * https://cloud.google.com/run/docs/securing/using-cmek
     * </pre>
     *
     * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The encryptionKey to set.
     * @return This builder for chaining.
     */
    public Builder setEncryptionKey(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      encryptionKey_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A reference to a customer managed encryption key (CMEK) to use to encrypt
     * this container image. For more information, go to
     * https://cloud.google.com/run/docs/securing/using-cmek
     * </pre>
     *
     * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEncryptionKey() {
      encryptionKey_ = getDefaultInstance().getEncryptionKey();
      bitField0_ = (bitField0_ & ~0x00000400);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A reference to a customer managed encryption key (CMEK) to use to encrypt
     * this container image. For more information, go to
     * https://cloud.google.com/run/docs/securing/using-cmek
     * </pre>
     *
     * <code>string encryption_key = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for encryptionKey to set.
     * @return This builder for chaining.
     */
    public Builder setEncryptionKeyBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      encryptionKey_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }

    private int maxInstanceRequestConcurrency_;
    /**
     *
     *
     * <pre>
     * Sets the maximum number of requests that each serving instance can receive.
     * </pre>
     *
     * <code>int32 max_instance_request_concurrency = 15;</code>
     *
     * @return The maxInstanceRequestConcurrency.
     */
    @java.lang.Override
    public int getMaxInstanceRequestConcurrency() {
      return maxInstanceRequestConcurrency_;
    }
    /**
     *
     *
     * <pre>
     * Sets the maximum number of requests that each serving instance can receive.
     * </pre>
     *
     * <code>int32 max_instance_request_concurrency = 15;</code>
     *
     * @param value The maxInstanceRequestConcurrency to set.
     * @return This builder for chaining.
     */
    public Builder setMaxInstanceRequestConcurrency(int value) {

      maxInstanceRequestConcurrency_ = value;
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Sets the maximum number of requests that each serving instance can receive.
     * </pre>
     *
     * <code>int32 max_instance_request_concurrency = 15;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMaxInstanceRequestConcurrency() {
      bitField0_ = (bitField0_ & ~0x00000800);
      maxInstanceRequestConcurrency_ = 0;
      onChanged();
      return this;
    }

    private boolean sessionAffinity_;
    /**
     *
     *
     * <pre>
     * Enable session affinity.
     * </pre>
     *
     * <code>bool session_affinity = 19;</code>
     *
     * @return The sessionAffinity.
     */
    @java.lang.Override
    public boolean getSessionAffinity() {
      return sessionAffinity_;
    }
    /**
     *
     *
     * <pre>
     * Enable session affinity.
     * </pre>
     *
     * <code>bool session_affinity = 19;</code>
     *
     * @param value The sessionAffinity to set.
     * @return This builder for chaining.
     */
    public Builder setSessionAffinity(boolean value) {

      sessionAffinity_ = value;
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Enable session affinity.
     * </pre>
     *
     * <code>bool session_affinity = 19;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSessionAffinity() {
      bitField0_ = (bitField0_ & ~0x00001000);
      sessionAffinity_ = false;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.run.v2.RevisionTemplate)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.run.v2.RevisionTemplate)
  private static final com.google.cloud.run.v2.RevisionTemplate DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.run.v2.RevisionTemplate();
  }

  public static com.google.cloud.run.v2.RevisionTemplate getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RevisionTemplate> PARSER =
      new com.google.protobuf.AbstractParser<RevisionTemplate>() {
        @java.lang.Override
        public RevisionTemplate parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<RevisionTemplate> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<RevisionTemplate> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.run.v2.RevisionTemplate getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
