/*
 * 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/dataflow/v1beta3/templates.proto

package com.google.dataflow.v1beta3;

/**
 *
 *
 * <pre>
 * Container Spec.
 * </pre>
 *
 * Protobuf type {@code google.dataflow.v1beta3.ContainerSpec}
 */
public final class ContainerSpec extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.dataflow.v1beta3.ContainerSpec)
    ContainerSpecOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ContainerSpec.newBuilder() to construct.
  private ContainerSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ContainerSpec() {
    image_ = "";
  }

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

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

  private ContainerSpec(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              image_ = s;
              break;
            }
          case 18:
            {
              com.google.dataflow.v1beta3.TemplateMetadata.Builder subBuilder = null;
              if (metadata_ != null) {
                subBuilder = metadata_.toBuilder();
              }
              metadata_ =
                  input.readMessage(
                      com.google.dataflow.v1beta3.TemplateMetadata.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(metadata_);
                metadata_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              com.google.dataflow.v1beta3.SDKInfo.Builder subBuilder = null;
              if (sdkInfo_ != null) {
                subBuilder = sdkInfo_.toBuilder();
              }
              sdkInfo_ =
                  input.readMessage(
                      com.google.dataflow.v1beta3.SDKInfo.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(sdkInfo_);
                sdkInfo_ = subBuilder.buildPartial();
              }

              break;
            }
          case 34:
            {
              com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder subBuilder = null;
              if (defaultEnvironment_ != null) {
                subBuilder = defaultEnvironment_.toBuilder();
              }
              defaultEnvironment_ =
                  input.readMessage(
                      com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(defaultEnvironment_);
                defaultEnvironment_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (com.google.protobuf.UninitializedMessageException e) {
      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.dataflow.v1beta3.TemplatesProto
        .internal_static_google_dataflow_v1beta3_ContainerSpec_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.dataflow.v1beta3.TemplatesProto
        .internal_static_google_dataflow_v1beta3_ContainerSpec_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.dataflow.v1beta3.ContainerSpec.class,
            com.google.dataflow.v1beta3.ContainerSpec.Builder.class);
  }

  public static final int IMAGE_FIELD_NUMBER = 1;
  private volatile java.lang.Object image_;
  /**
   *
   *
   * <pre>
   * Name of the docker container image. E.g., gcr.io/project/some-image
   * </pre>
   *
   * <code>string image = 1;</code>
   *
   * @return The image.
   */
  @java.lang.Override
  public java.lang.String getImage() {
    java.lang.Object ref = image_;
    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();
      image_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Name of the docker container image. E.g., gcr.io/project/some-image
   * </pre>
   *
   * <code>string image = 1;</code>
   *
   * @return The bytes for image.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getImageBytes() {
    java.lang.Object ref = image_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      image_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int METADATA_FIELD_NUMBER = 2;
  private com.google.dataflow.v1beta3.TemplateMetadata metadata_;
  /**
   *
   *
   * <pre>
   * Metadata describing a template including description and validation rules.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
   *
   * @return Whether the metadata field is set.
   */
  @java.lang.Override
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   *
   *
   * <pre>
   * Metadata describing a template including description and validation rules.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
   *
   * @return The metadata.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.TemplateMetadata getMetadata() {
    return metadata_ == null
        ? com.google.dataflow.v1beta3.TemplateMetadata.getDefaultInstance()
        : metadata_;
  }
  /**
   *
   *
   * <pre>
   * Metadata describing a template including description and validation rules.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.TemplateMetadataOrBuilder getMetadataOrBuilder() {
    return getMetadata();
  }

  public static final int SDK_INFO_FIELD_NUMBER = 3;
  private com.google.dataflow.v1beta3.SDKInfo sdkInfo_;
  /**
   *
   *
   * <pre>
   * Required. SDK info of the Flex Template.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
   *
   * @return Whether the sdkInfo field is set.
   */
  @java.lang.Override
  public boolean hasSdkInfo() {
    return sdkInfo_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. SDK info of the Flex Template.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
   *
   * @return The sdkInfo.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.SDKInfo getSdkInfo() {
    return sdkInfo_ == null ? com.google.dataflow.v1beta3.SDKInfo.getDefaultInstance() : sdkInfo_;
  }
  /**
   *
   *
   * <pre>
   * Required. SDK info of the Flex Template.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.SDKInfoOrBuilder getSdkInfoOrBuilder() {
    return getSdkInfo();
  }

  public static final int DEFAULT_ENVIRONMENT_FIELD_NUMBER = 4;
  private com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment defaultEnvironment_;
  /**
   *
   *
   * <pre>
   * Default runtime environment for the job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
   *
   * @return Whether the defaultEnvironment field is set.
   */
  @java.lang.Override
  public boolean hasDefaultEnvironment() {
    return defaultEnvironment_ != null;
  }
  /**
   *
   *
   * <pre>
   * Default runtime environment for the job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
   *
   * @return The defaultEnvironment.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment getDefaultEnvironment() {
    return defaultEnvironment_ == null
        ? com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.getDefaultInstance()
        : defaultEnvironment_;
  }
  /**
   *
   *
   * <pre>
   * Default runtime environment for the job.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironmentOrBuilder
      getDefaultEnvironmentOrBuilder() {
    return getDefaultEnvironment();
  }

  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(image_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_);
    }
    if (metadata_ != null) {
      output.writeMessage(2, getMetadata());
    }
    if (sdkInfo_ != null) {
      output.writeMessage(3, getSdkInfo());
    }
    if (defaultEnvironment_ != null) {
      output.writeMessage(4, getDefaultEnvironment());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(image_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_);
    }
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata());
    }
    if (sdkInfo_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSdkInfo());
    }
    if (defaultEnvironment_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDefaultEnvironment());
    }
    size += unknownFields.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.dataflow.v1beta3.ContainerSpec)) {
      return super.equals(obj);
    }
    com.google.dataflow.v1beta3.ContainerSpec other =
        (com.google.dataflow.v1beta3.ContainerSpec) obj;

    if (!getImage().equals(other.getImage())) return false;
    if (hasMetadata() != other.hasMetadata()) return false;
    if (hasMetadata()) {
      if (!getMetadata().equals(other.getMetadata())) return false;
    }
    if (hasSdkInfo() != other.hasSdkInfo()) return false;
    if (hasSdkInfo()) {
      if (!getSdkInfo().equals(other.getSdkInfo())) return false;
    }
    if (hasDefaultEnvironment() != other.hasDefaultEnvironment()) return false;
    if (hasDefaultEnvironment()) {
      if (!getDefaultEnvironment().equals(other.getDefaultEnvironment())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) 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) + IMAGE_FIELD_NUMBER;
    hash = (53 * hash) + getImage().hashCode();
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    if (hasSdkInfo()) {
      hash = (37 * hash) + SDK_INFO_FIELD_NUMBER;
      hash = (53 * hash) + getSdkInfo().hashCode();
    }
    if (hasDefaultEnvironment()) {
      hash = (37 * hash) + DEFAULT_ENVIRONMENT_FIELD_NUMBER;
      hash = (53 * hash) + getDefaultEnvironment().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.dataflow.v1beta3.ContainerSpec parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec 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.dataflow.v1beta3.ContainerSpec parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec 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.dataflow.v1beta3.ContainerSpec parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec 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.dataflow.v1beta3.ContainerSpec parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.ContainerSpec 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.dataflow.v1beta3.ContainerSpec 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>
   * Container Spec.
   * </pre>
   *
   * Protobuf type {@code google.dataflow.v1beta3.ContainerSpec}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.dataflow.v1beta3.ContainerSpec)
      com.google.dataflow.v1beta3.ContainerSpecOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.dataflow.v1beta3.TemplatesProto
          .internal_static_google_dataflow_v1beta3_ContainerSpec_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.dataflow.v1beta3.TemplatesProto
          .internal_static_google_dataflow_v1beta3_ContainerSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.dataflow.v1beta3.ContainerSpec.class,
              com.google.dataflow.v1beta3.ContainerSpec.Builder.class);
    }

    // Construct using com.google.dataflow.v1beta3.ContainerSpec.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      image_ = "";

      if (metadataBuilder_ == null) {
        metadata_ = null;
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }
      if (sdkInfoBuilder_ == null) {
        sdkInfo_ = null;
      } else {
        sdkInfo_ = null;
        sdkInfoBuilder_ = null;
      }
      if (defaultEnvironmentBuilder_ == null) {
        defaultEnvironment_ = null;
      } else {
        defaultEnvironment_ = null;
        defaultEnvironmentBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.dataflow.v1beta3.TemplatesProto
          .internal_static_google_dataflow_v1beta3_ContainerSpec_descriptor;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.ContainerSpec getDefaultInstanceForType() {
      return com.google.dataflow.v1beta3.ContainerSpec.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.ContainerSpec build() {
      com.google.dataflow.v1beta3.ContainerSpec result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.ContainerSpec buildPartial() {
      com.google.dataflow.v1beta3.ContainerSpec result =
          new com.google.dataflow.v1beta3.ContainerSpec(this);
      result.image_ = image_;
      if (metadataBuilder_ == null) {
        result.metadata_ = metadata_;
      } else {
        result.metadata_ = metadataBuilder_.build();
      }
      if (sdkInfoBuilder_ == null) {
        result.sdkInfo_ = sdkInfo_;
      } else {
        result.sdkInfo_ = sdkInfoBuilder_.build();
      }
      if (defaultEnvironmentBuilder_ == null) {
        result.defaultEnvironment_ = defaultEnvironment_;
      } else {
        result.defaultEnvironment_ = defaultEnvironmentBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @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.dataflow.v1beta3.ContainerSpec) {
        return mergeFrom((com.google.dataflow.v1beta3.ContainerSpec) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.dataflow.v1beta3.ContainerSpec other) {
      if (other == com.google.dataflow.v1beta3.ContainerSpec.getDefaultInstance()) return this;
      if (!other.getImage().isEmpty()) {
        image_ = other.image_;
        onChanged();
      }
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      if (other.hasSdkInfo()) {
        mergeSdkInfo(other.getSdkInfo());
      }
      if (other.hasDefaultEnvironment()) {
        mergeDefaultEnvironment(other.getDefaultEnvironment());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.dataflow.v1beta3.ContainerSpec parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.dataflow.v1beta3.ContainerSpec) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object image_ = "";
    /**
     *
     *
     * <pre>
     * Name of the docker container image. E.g., gcr.io/project/some-image
     * </pre>
     *
     * <code>string image = 1;</code>
     *
     * @return The image.
     */
    public java.lang.String getImage() {
      java.lang.Object ref = image_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        image_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Name of the docker container image. E.g., gcr.io/project/some-image
     * </pre>
     *
     * <code>string image = 1;</code>
     *
     * @return The bytes for image.
     */
    public com.google.protobuf.ByteString getImageBytes() {
      java.lang.Object ref = image_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        image_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Name of the docker container image. E.g., gcr.io/project/some-image
     * </pre>
     *
     * <code>string image = 1;</code>
     *
     * @param value The image to set.
     * @return This builder for chaining.
     */
    public Builder setImage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      image_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Name of the docker container image. E.g., gcr.io/project/some-image
     * </pre>
     *
     * <code>string image = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearImage() {

      image_ = getDefaultInstance().getImage();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Name of the docker container image. E.g., gcr.io/project/some-image
     * </pre>
     *
     * <code>string image = 1;</code>
     *
     * @param value The bytes for image to set.
     * @return This builder for chaining.
     */
    public Builder setImageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      image_ = value;
      onChanged();
      return this;
    }

    private com.google.dataflow.v1beta3.TemplateMetadata metadata_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.TemplateMetadata,
            com.google.dataflow.v1beta3.TemplateMetadata.Builder,
            com.google.dataflow.v1beta3.TemplateMetadataOrBuilder>
        metadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     *
     * @return Whether the metadata field is set.
     */
    public boolean hasMetadata() {
      return metadataBuilder_ != null || metadata_ != null;
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     *
     * @return The metadata.
     */
    public com.google.dataflow.v1beta3.TemplateMetadata getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null
            ? com.google.dataflow.v1beta3.TemplateMetadata.getDefaultInstance()
            : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public Builder setMetadata(com.google.dataflow.v1beta3.TemplateMetadata value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
        onChanged();
      } else {
        metadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public Builder setMetadata(
        com.google.dataflow.v1beta3.TemplateMetadata.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
        onChanged();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public Builder mergeMetadata(com.google.dataflow.v1beta3.TemplateMetadata value) {
      if (metadataBuilder_ == null) {
        if (metadata_ != null) {
          metadata_ =
              com.google.dataflow.v1beta3.TemplateMetadata.newBuilder(metadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          metadata_ = value;
        }
        onChanged();
      } else {
        metadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public Builder clearMetadata() {
      if (metadataBuilder_ == null) {
        metadata_ = null;
        onChanged();
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public com.google.dataflow.v1beta3.TemplateMetadata.Builder getMetadataBuilder() {

      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    public com.google.dataflow.v1beta3.TemplateMetadataOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null
            ? com.google.dataflow.v1beta3.TemplateMetadata.getDefaultInstance()
            : metadata_;
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata describing a template including description and validation rules.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.TemplateMetadata metadata = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.TemplateMetadata,
            com.google.dataflow.v1beta3.TemplateMetadata.Builder,
            com.google.dataflow.v1beta3.TemplateMetadataOrBuilder>
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.TemplateMetadata,
                com.google.dataflow.v1beta3.TemplateMetadata.Builder,
                com.google.dataflow.v1beta3.TemplateMetadataOrBuilder>(
                getMetadata(), getParentForChildren(), isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    private com.google.dataflow.v1beta3.SDKInfo sdkInfo_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.SDKInfo,
            com.google.dataflow.v1beta3.SDKInfo.Builder,
            com.google.dataflow.v1beta3.SDKInfoOrBuilder>
        sdkInfoBuilder_;
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     *
     * @return Whether the sdkInfo field is set.
     */
    public boolean hasSdkInfo() {
      return sdkInfoBuilder_ != null || sdkInfo_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     *
     * @return The sdkInfo.
     */
    public com.google.dataflow.v1beta3.SDKInfo getSdkInfo() {
      if (sdkInfoBuilder_ == null) {
        return sdkInfo_ == null
            ? com.google.dataflow.v1beta3.SDKInfo.getDefaultInstance()
            : sdkInfo_;
      } else {
        return sdkInfoBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public Builder setSdkInfo(com.google.dataflow.v1beta3.SDKInfo value) {
      if (sdkInfoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        sdkInfo_ = value;
        onChanged();
      } else {
        sdkInfoBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public Builder setSdkInfo(com.google.dataflow.v1beta3.SDKInfo.Builder builderForValue) {
      if (sdkInfoBuilder_ == null) {
        sdkInfo_ = builderForValue.build();
        onChanged();
      } else {
        sdkInfoBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public Builder mergeSdkInfo(com.google.dataflow.v1beta3.SDKInfo value) {
      if (sdkInfoBuilder_ == null) {
        if (sdkInfo_ != null) {
          sdkInfo_ =
              com.google.dataflow.v1beta3.SDKInfo.newBuilder(sdkInfo_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          sdkInfo_ = value;
        }
        onChanged();
      } else {
        sdkInfoBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public Builder clearSdkInfo() {
      if (sdkInfoBuilder_ == null) {
        sdkInfo_ = null;
        onChanged();
      } else {
        sdkInfo_ = null;
        sdkInfoBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public com.google.dataflow.v1beta3.SDKInfo.Builder getSdkInfoBuilder() {

      onChanged();
      return getSdkInfoFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    public com.google.dataflow.v1beta3.SDKInfoOrBuilder getSdkInfoOrBuilder() {
      if (sdkInfoBuilder_ != null) {
        return sdkInfoBuilder_.getMessageOrBuilder();
      } else {
        return sdkInfo_ == null
            ? com.google.dataflow.v1beta3.SDKInfo.getDefaultInstance()
            : sdkInfo_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. SDK info of the Flex Template.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.SDKInfo sdk_info = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.SDKInfo,
            com.google.dataflow.v1beta3.SDKInfo.Builder,
            com.google.dataflow.v1beta3.SDKInfoOrBuilder>
        getSdkInfoFieldBuilder() {
      if (sdkInfoBuilder_ == null) {
        sdkInfoBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.SDKInfo,
                com.google.dataflow.v1beta3.SDKInfo.Builder,
                com.google.dataflow.v1beta3.SDKInfoOrBuilder>(
                getSdkInfo(), getParentForChildren(), isClean());
        sdkInfo_ = null;
      }
      return sdkInfoBuilder_;
    }

    private com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment defaultEnvironment_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment,
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder,
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironmentOrBuilder>
        defaultEnvironmentBuilder_;
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     *
     * @return Whether the defaultEnvironment field is set.
     */
    public boolean hasDefaultEnvironment() {
      return defaultEnvironmentBuilder_ != null || defaultEnvironment_ != null;
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     *
     * @return The defaultEnvironment.
     */
    public com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment getDefaultEnvironment() {
      if (defaultEnvironmentBuilder_ == null) {
        return defaultEnvironment_ == null
            ? com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.getDefaultInstance()
            : defaultEnvironment_;
      } else {
        return defaultEnvironmentBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public Builder setDefaultEnvironment(
        com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment value) {
      if (defaultEnvironmentBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        defaultEnvironment_ = value;
        onChanged();
      } else {
        defaultEnvironmentBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public Builder setDefaultEnvironment(
        com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder builderForValue) {
      if (defaultEnvironmentBuilder_ == null) {
        defaultEnvironment_ = builderForValue.build();
        onChanged();
      } else {
        defaultEnvironmentBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public Builder mergeDefaultEnvironment(
        com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment value) {
      if (defaultEnvironmentBuilder_ == null) {
        if (defaultEnvironment_ != null) {
          defaultEnvironment_ =
              com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.newBuilder(
                      defaultEnvironment_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          defaultEnvironment_ = value;
        }
        onChanged();
      } else {
        defaultEnvironmentBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public Builder clearDefaultEnvironment() {
      if (defaultEnvironmentBuilder_ == null) {
        defaultEnvironment_ = null;
        onChanged();
      } else {
        defaultEnvironment_ = null;
        defaultEnvironmentBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder
        getDefaultEnvironmentBuilder() {

      onChanged();
      return getDefaultEnvironmentFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    public com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironmentOrBuilder
        getDefaultEnvironmentOrBuilder() {
      if (defaultEnvironmentBuilder_ != null) {
        return defaultEnvironmentBuilder_.getMessageOrBuilder();
      } else {
        return defaultEnvironment_ == null
            ? com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.getDefaultInstance()
            : defaultEnvironment_;
      }
    }
    /**
     *
     *
     * <pre>
     * Default runtime environment for the job.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment,
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder,
            com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironmentOrBuilder>
        getDefaultEnvironmentFieldBuilder() {
      if (defaultEnvironmentBuilder_ == null) {
        defaultEnvironmentBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment,
                com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.Builder,
                com.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironmentOrBuilder>(
                getDefaultEnvironment(), getParentForChildren(), isClean());
        defaultEnvironment_ = null;
      }
      return defaultEnvironmentBuilder_;
    }

    @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.dataflow.v1beta3.ContainerSpec)
  }

  // @@protoc_insertion_point(class_scope:google.dataflow.v1beta3.ContainerSpec)
  private static final com.google.dataflow.v1beta3.ContainerSpec DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.dataflow.v1beta3.ContainerSpec();
  }

  public static com.google.dataflow.v1beta3.ContainerSpec getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ContainerSpec> PARSER =
      new com.google.protobuf.AbstractParser<ContainerSpec>() {
        @java.lang.Override
        public ContainerSpec parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ContainerSpec(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.dataflow.v1beta3.ContainerSpec getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
