/*
 * Copyright 2022 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
 *
 *      http://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/firestore/v1/common.proto

#include "google/firestore/v1/common.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fcommon_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fcommon_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto;
namespace google {
namespace firestore {
namespace v1 {
class DocumentMaskDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DocumentMask> _instance;
} _DocumentMask_default_instance_;
class PreconditionDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Precondition> _instance;
  bool exists_;
  const PROTOBUF_NAMESPACE_ID::Timestamp* update_time_;
} _Precondition_default_instance_;
class TransactionOptions_ReadWriteDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TransactionOptions_ReadWrite> _instance;
} _TransactionOptions_ReadWrite_default_instance_;
class TransactionOptions_ReadOnlyDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TransactionOptions_ReadOnly> _instance;
  const PROTOBUF_NAMESPACE_ID::Timestamp* read_time_;
} _TransactionOptions_ReadOnly_default_instance_;
class TransactionOptionsDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TransactionOptions> _instance;
  const ::google::firestore::v1::TransactionOptions_ReadOnly* read_only_;
  const ::google::firestore::v1::TransactionOptions_ReadWrite* read_write_;
} _TransactionOptions_default_instance_;
}  // namespace v1
}  // namespace firestore
}  // namespace google
static void InitDefaultsscc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_DocumentMask_default_instance_;
    new (ptr) ::google::firestore::v1::DocumentMask();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::DocumentMask::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto}, {}};

static void InitDefaultsscc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_Precondition_default_instance_;
    new (ptr) ::google::firestore::v1::Precondition();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::Precondition::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto}, {
      &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};

static void InitDefaultsscc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_TransactionOptions_default_instance_;
    new (ptr) ::google::firestore::v1::TransactionOptions();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::TransactionOptions::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto}, {
      &scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto.base,
      &scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto.base,}};

static void InitDefaultsscc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_TransactionOptions_ReadOnly_default_instance_;
    new (ptr) ::google::firestore::v1::TransactionOptions_ReadOnly();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::TransactionOptions_ReadOnly::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto}, {
      &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};

static void InitDefaultsscc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_TransactionOptions_ReadWrite_default_instance_;
    new (ptr) ::google::firestore::v1::TransactionOptions_ReadWrite();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::TransactionOptions_ReadWrite::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto}, {}};

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2ffirestore_2fv1_2fcommon_2eproto[5];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2ffirestore_2fv1_2fcommon_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2ffirestore_2fv1_2fcommon_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2ffirestore_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::DocumentMask, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::DocumentMask, field_paths_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Precondition, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Precondition, _oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  offsetof(::google::firestore::v1::PreconditionDefaultTypeInternal, exists_),
  offsetof(::google::firestore::v1::PreconditionDefaultTypeInternal, update_time_),
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Precondition, condition_type_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions_ReadWrite, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions_ReadWrite, retry_transaction_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions_ReadOnly, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions_ReadOnly, _oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  offsetof(::google::firestore::v1::TransactionOptions_ReadOnlyDefaultTypeInternal, read_time_),
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions_ReadOnly, consistency_selector_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions, _oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  offsetof(::google::firestore::v1::TransactionOptionsDefaultTypeInternal, read_only_),
  offsetof(::google::firestore::v1::TransactionOptionsDefaultTypeInternal, read_write_),
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::TransactionOptions, mode_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::google::firestore::v1::DocumentMask)},
  { 6, -1, sizeof(::google::firestore::v1::Precondition)},
  { 14, -1, sizeof(::google::firestore::v1::TransactionOptions_ReadWrite)},
  { 20, -1, sizeof(::google::firestore::v1::TransactionOptions_ReadOnly)},
  { 27, -1, sizeof(::google::firestore::v1::TransactionOptions)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_DocumentMask_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_Precondition_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_TransactionOptions_ReadWrite_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_TransactionOptions_ReadOnly_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_TransactionOptions_default_instance_),
};

const char descriptor_table_protodef_google_2ffirestore_2fv1_2fcommon_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n google/firestore/v1/common.proto\022\023goog"
  "le.firestore.v1\032\037google/protobuf/timesta"
  "mp.proto\"#\n\014DocumentMask\022\023\n\013field_paths\030"
  "\001 \003(\t\"e\n\014Precondition\022\020\n\006exists\030\001 \001(\010H\000\022"
  "1\n\013update_time\030\002 \001(\0132\032.google.protobuf.T"
  "imestampH\000B\020\n\016condition_type\"\251\002\n\022Transac"
  "tionOptions\022E\n\tread_only\030\002 \001(\01320.google."
  "firestore.v1.TransactionOptions.ReadOnly"
  "H\000\022G\n\nread_write\030\003 \001(\01321.google.firestor"
  "e.v1.TransactionOptions.ReadWriteH\000\032&\n\tR"
  "eadWrite\022\031\n\021retry_transaction\030\001 \001(\014\032S\n\010R"
  "eadOnly\022/\n\tread_time\030\002 \001(\0132\032.google.prot"
  "obuf.TimestampH\000B\026\n\024consistency_selector"
  "B\006\n\004modeB\257\001\n\027com.google.firestore.v1B\013Co"
  "mmonProtoP\001Z<google.golang.org/genproto/"
  "googleapis/firestore/v1;firestore\242\002\004GCFS"
  "\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Goog"
  "le\\Cloud\\Firestore\\V1beta1b\006proto3"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_deps[1] = {
  &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_sccs[5] = {
  &scc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto.base,
  &scc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto.base,
  &scc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto.base,
  &scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto.base,
  &scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_once;
static bool descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto = {
  &descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_initialized, descriptor_table_protodef_google_2ffirestore_2fv1_2fcommon_2eproto, "google/firestore/v1/common.proto", 714,
  &descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_once, descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_sccs, descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto_deps, 5, 1,
  schemas, file_default_instances, TableStruct_google_2ffirestore_2fv1_2fcommon_2eproto::offsets,
  file_level_metadata_google_2ffirestore_2fv1_2fcommon_2eproto, 5, file_level_enum_descriptors_google_2ffirestore_2fv1_2fcommon_2eproto, file_level_service_descriptors_google_2ffirestore_2fv1_2fcommon_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_google_2ffirestore_2fv1_2fcommon_2eproto = (  ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto), true);
namespace google {
namespace firestore {
namespace v1 {

// ===================================================================

void DocumentMask::InitAsDefaultInstance() {
}
class DocumentMask::_Internal {
 public:
};

DocumentMask::DocumentMask()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.DocumentMask)
}
DocumentMask::DocumentMask(const DocumentMask& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      field_paths_(from.field_paths_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.DocumentMask)
}

void DocumentMask::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto.base);
}

DocumentMask::~DocumentMask() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.DocumentMask)
  SharedDtor();
}

void DocumentMask::SharedDtor() {
}

void DocumentMask::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const DocumentMask& DocumentMask::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  return *internal_default_instance();
}


void DocumentMask::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.DocumentMask)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  field_paths_.Clear();
  _internal_metadata_.Clear();
}

const char* DocumentMask::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // repeated string field_paths = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_field_paths();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.firestore.v1.DocumentMask.field_paths"));
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* DocumentMask::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.DocumentMask)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated string field_paths = 1;
  for (int i = 0, n = this->_internal_field_paths_size(); i < n; i++) {
    const auto& s = this->_internal_field_paths(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      s.data(), static_cast<int>(s.length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "google.firestore.v1.DocumentMask.field_paths");
    target = stream->WriteString(1, s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.DocumentMask)
  return target;
}

size_t DocumentMask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.DocumentMask)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated string field_paths = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(field_paths_.size());
  for (int i = 0, n = field_paths_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      field_paths_.Get(i));
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DocumentMask::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.DocumentMask)
  GOOGLE_DCHECK_NE(&from, this);
  const DocumentMask* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DocumentMask>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.DocumentMask)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.DocumentMask)
    MergeFrom(*source);
  }
}

void DocumentMask::MergeFrom(const DocumentMask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.DocumentMask)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  field_paths_.MergeFrom(from.field_paths_);
}

void DocumentMask::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.DocumentMask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void DocumentMask::CopyFrom(const DocumentMask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.DocumentMask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DocumentMask::IsInitialized() const {
  return true;
}

void DocumentMask::InternalSwap(DocumentMask* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  field_paths_.InternalSwap(&other->field_paths_);
}

::PROTOBUF_NAMESPACE_ID::Metadata DocumentMask::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void Precondition::InitAsDefaultInstance() {
  ::google::firestore::v1::_Precondition_default_instance_.exists_ = false;
  ::google::firestore::v1::_Precondition_default_instance_.update_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
      PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
}
class Precondition::_Internal {
 public:
  static const PROTOBUF_NAMESPACE_ID::Timestamp& update_time(const Precondition* msg);
};

const PROTOBUF_NAMESPACE_ID::Timestamp&
Precondition::_Internal::update_time(const Precondition* msg) {
  return *msg->condition_type_.update_time_;
}
void Precondition::set_allocated_update_time(PROTOBUF_NAMESPACE_ID::Timestamp* update_time) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  clear_condition_type();
  if (update_time) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(update_time)->GetArena();
    if (message_arena != submessage_arena) {
      update_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, update_time, submessage_arena);
    }
    set_has_update_time();
    condition_type_.update_time_ = update_time;
  }
  // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Precondition.update_time)
}
void Precondition::clear_update_time() {
  if (_internal_has_update_time()) {
    delete condition_type_.update_time_;
    clear_has_condition_type();
  }
}
Precondition::Precondition()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.Precondition)
}
Precondition::Precondition(const Precondition& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  clear_has_condition_type();
  switch (from.condition_type_case()) {
    case kExists: {
      _internal_set_exists(from._internal_exists());
      break;
    }
    case kUpdateTime: {
      _internal_mutable_update_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_update_time());
      break;
    }
    case CONDITION_TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.Precondition)
}

void Precondition::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  clear_has_condition_type();
}

Precondition::~Precondition() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.Precondition)
  SharedDtor();
}

void Precondition::SharedDtor() {
  if (has_condition_type()) {
    clear_condition_type();
  }
}

void Precondition::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Precondition& Precondition::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Precondition_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  return *internal_default_instance();
}


void Precondition::clear_condition_type() {
// @@protoc_insertion_point(one_of_clear_start:google.firestore.v1.Precondition)
  switch (condition_type_case()) {
    case kExists: {
      // No need to clear
      break;
    }
    case kUpdateTime: {
      delete condition_type_.update_time_;
      break;
    }
    case CONDITION_TYPE_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = CONDITION_TYPE_NOT_SET;
}


void Precondition::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.Precondition)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_condition_type();
  _internal_metadata_.Clear();
}

const char* Precondition::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // bool exists = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _internal_set_exists(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // .google.protobuf.Timestamp update_time = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_update_time(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Precondition::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.Precondition)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // bool exists = 1;
  if (_internal_has_exists()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_exists(), target);
  }

  // .google.protobuf.Timestamp update_time = 2;
  if (_internal_has_update_time()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::update_time(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.Precondition)
  return target;
}

size_t Precondition::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.Precondition)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  switch (condition_type_case()) {
    // bool exists = 1;
    case kExists: {
      total_size += 1 + 1;
      break;
    }
    // .google.protobuf.Timestamp update_time = 2;
    case kUpdateTime: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *condition_type_.update_time_);
      break;
    }
    case CONDITION_TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Precondition::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.Precondition)
  GOOGLE_DCHECK_NE(&from, this);
  const Precondition* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Precondition>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.Precondition)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.Precondition)
    MergeFrom(*source);
  }
}

void Precondition::MergeFrom(const Precondition& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.Precondition)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.condition_type_case()) {
    case kExists: {
      _internal_set_exists(from._internal_exists());
      break;
    }
    case kUpdateTime: {
      _internal_mutable_update_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_update_time());
      break;
    }
    case CONDITION_TYPE_NOT_SET: {
      break;
    }
  }
}

void Precondition::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.Precondition)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Precondition::CopyFrom(const Precondition& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.Precondition)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Precondition::IsInitialized() const {
  return true;
}

void Precondition::InternalSwap(Precondition* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(condition_type_, other->condition_type_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata Precondition::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void TransactionOptions_ReadWrite::InitAsDefaultInstance() {
}
class TransactionOptions_ReadWrite::_Internal {
 public:
};

TransactionOptions_ReadWrite::TransactionOptions_ReadWrite()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.TransactionOptions.ReadWrite)
}
TransactionOptions_ReadWrite::TransactionOptions_ReadWrite(const TransactionOptions_ReadWrite& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  retry_transaction_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_retry_transaction().empty()) {
    retry_transaction_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.retry_transaction_);
  }
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.TransactionOptions.ReadWrite)
}

void TransactionOptions_ReadWrite::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  retry_transaction_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

TransactionOptions_ReadWrite::~TransactionOptions_ReadWrite() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.TransactionOptions.ReadWrite)
  SharedDtor();
}

void TransactionOptions_ReadWrite::SharedDtor() {
  retry_transaction_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void TransactionOptions_ReadWrite::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const TransactionOptions_ReadWrite& TransactionOptions_ReadWrite::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TransactionOptions_ReadWrite_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  return *internal_default_instance();
}


void TransactionOptions_ReadWrite::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.TransactionOptions.ReadWrite)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  retry_transaction_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  _internal_metadata_.Clear();
}

const char* TransactionOptions_ReadWrite::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // bytes retry_transaction = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_retry_transaction();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* TransactionOptions_ReadWrite::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.TransactionOptions.ReadWrite)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // bytes retry_transaction = 1;
  if (this->retry_transaction().size() > 0) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_retry_transaction(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.TransactionOptions.ReadWrite)
  return target;
}

size_t TransactionOptions_ReadWrite::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.TransactionOptions.ReadWrite)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // bytes retry_transaction = 1;
  if (this->retry_transaction().size() > 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_retry_transaction());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TransactionOptions_ReadWrite::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.TransactionOptions.ReadWrite)
  GOOGLE_DCHECK_NE(&from, this);
  const TransactionOptions_ReadWrite* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TransactionOptions_ReadWrite>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.TransactionOptions.ReadWrite)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.TransactionOptions.ReadWrite)
    MergeFrom(*source);
  }
}

void TransactionOptions_ReadWrite::MergeFrom(const TransactionOptions_ReadWrite& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.TransactionOptions.ReadWrite)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.retry_transaction().size() > 0) {

    retry_transaction_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.retry_transaction_);
  }
}

void TransactionOptions_ReadWrite::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.TransactionOptions.ReadWrite)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void TransactionOptions_ReadWrite::CopyFrom(const TransactionOptions_ReadWrite& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.TransactionOptions.ReadWrite)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TransactionOptions_ReadWrite::IsInitialized() const {
  return true;
}

void TransactionOptions_ReadWrite::InternalSwap(TransactionOptions_ReadWrite* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  retry_transaction_.Swap(&other->retry_transaction_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
}

::PROTOBUF_NAMESPACE_ID::Metadata TransactionOptions_ReadWrite::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void TransactionOptions_ReadOnly::InitAsDefaultInstance() {
  ::google::firestore::v1::_TransactionOptions_ReadOnly_default_instance_.read_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
      PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
}
class TransactionOptions_ReadOnly::_Internal {
 public:
  static const PROTOBUF_NAMESPACE_ID::Timestamp& read_time(const TransactionOptions_ReadOnly* msg);
};

const PROTOBUF_NAMESPACE_ID::Timestamp&
TransactionOptions_ReadOnly::_Internal::read_time(const TransactionOptions_ReadOnly* msg) {
  return *msg->consistency_selector_.read_time_;
}
void TransactionOptions_ReadOnly::set_allocated_read_time(PROTOBUF_NAMESPACE_ID::Timestamp* read_time) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  clear_consistency_selector();
  if (read_time) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(read_time)->GetArena();
    if (message_arena != submessage_arena) {
      read_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, read_time, submessage_arena);
    }
    set_has_read_time();
    consistency_selector_.read_time_ = read_time;
  }
  // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.TransactionOptions.ReadOnly.read_time)
}
void TransactionOptions_ReadOnly::clear_read_time() {
  if (_internal_has_read_time()) {
    delete consistency_selector_.read_time_;
    clear_has_consistency_selector();
  }
}
TransactionOptions_ReadOnly::TransactionOptions_ReadOnly()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.TransactionOptions.ReadOnly)
}
TransactionOptions_ReadOnly::TransactionOptions_ReadOnly(const TransactionOptions_ReadOnly& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  clear_has_consistency_selector();
  switch (from.consistency_selector_case()) {
    case kReadTime: {
      _internal_mutable_read_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_read_time());
      break;
    }
    case CONSISTENCY_SELECTOR_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.TransactionOptions.ReadOnly)
}

void TransactionOptions_ReadOnly::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  clear_has_consistency_selector();
}

TransactionOptions_ReadOnly::~TransactionOptions_ReadOnly() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.TransactionOptions.ReadOnly)
  SharedDtor();
}

void TransactionOptions_ReadOnly::SharedDtor() {
  if (has_consistency_selector()) {
    clear_consistency_selector();
  }
}

void TransactionOptions_ReadOnly::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const TransactionOptions_ReadOnly& TransactionOptions_ReadOnly::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TransactionOptions_ReadOnly_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  return *internal_default_instance();
}


void TransactionOptions_ReadOnly::clear_consistency_selector() {
// @@protoc_insertion_point(one_of_clear_start:google.firestore.v1.TransactionOptions.ReadOnly)
  switch (consistency_selector_case()) {
    case kReadTime: {
      delete consistency_selector_.read_time_;
      break;
    }
    case CONSISTENCY_SELECTOR_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = CONSISTENCY_SELECTOR_NOT_SET;
}


void TransactionOptions_ReadOnly::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.TransactionOptions.ReadOnly)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_consistency_selector();
  _internal_metadata_.Clear();
}

const char* TransactionOptions_ReadOnly::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // .google.protobuf.Timestamp read_time = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_read_time(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* TransactionOptions_ReadOnly::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.TransactionOptions.ReadOnly)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.protobuf.Timestamp read_time = 2;
  if (_internal_has_read_time()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::read_time(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.TransactionOptions.ReadOnly)
  return target;
}

size_t TransactionOptions_ReadOnly::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.TransactionOptions.ReadOnly)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  switch (consistency_selector_case()) {
    // .google.protobuf.Timestamp read_time = 2;
    case kReadTime: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *consistency_selector_.read_time_);
      break;
    }
    case CONSISTENCY_SELECTOR_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TransactionOptions_ReadOnly::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.TransactionOptions.ReadOnly)
  GOOGLE_DCHECK_NE(&from, this);
  const TransactionOptions_ReadOnly* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TransactionOptions_ReadOnly>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.TransactionOptions.ReadOnly)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.TransactionOptions.ReadOnly)
    MergeFrom(*source);
  }
}

void TransactionOptions_ReadOnly::MergeFrom(const TransactionOptions_ReadOnly& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.TransactionOptions.ReadOnly)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.consistency_selector_case()) {
    case kReadTime: {
      _internal_mutable_read_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_read_time());
      break;
    }
    case CONSISTENCY_SELECTOR_NOT_SET: {
      break;
    }
  }
}

void TransactionOptions_ReadOnly::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.TransactionOptions.ReadOnly)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void TransactionOptions_ReadOnly::CopyFrom(const TransactionOptions_ReadOnly& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.TransactionOptions.ReadOnly)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TransactionOptions_ReadOnly::IsInitialized() const {
  return true;
}

void TransactionOptions_ReadOnly::InternalSwap(TransactionOptions_ReadOnly* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(consistency_selector_, other->consistency_selector_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata TransactionOptions_ReadOnly::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void TransactionOptions::InitAsDefaultInstance() {
  ::google::firestore::v1::_TransactionOptions_default_instance_.read_only_ = const_cast< ::google::firestore::v1::TransactionOptions_ReadOnly*>(
      ::google::firestore::v1::TransactionOptions_ReadOnly::internal_default_instance());
  ::google::firestore::v1::_TransactionOptions_default_instance_.read_write_ = const_cast< ::google::firestore::v1::TransactionOptions_ReadWrite*>(
      ::google::firestore::v1::TransactionOptions_ReadWrite::internal_default_instance());
}
class TransactionOptions::_Internal {
 public:
  static const ::google::firestore::v1::TransactionOptions_ReadOnly& read_only(const TransactionOptions* msg);
  static const ::google::firestore::v1::TransactionOptions_ReadWrite& read_write(const TransactionOptions* msg);
};

const ::google::firestore::v1::TransactionOptions_ReadOnly&
TransactionOptions::_Internal::read_only(const TransactionOptions* msg) {
  return *msg->mode_.read_only_;
}
const ::google::firestore::v1::TransactionOptions_ReadWrite&
TransactionOptions::_Internal::read_write(const TransactionOptions* msg) {
  return *msg->mode_.read_write_;
}
void TransactionOptions::set_allocated_read_only(::google::firestore::v1::TransactionOptions_ReadOnly* read_only) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  clear_mode();
  if (read_only) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
    if (message_arena != submessage_arena) {
      read_only = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, read_only, submessage_arena);
    }
    set_has_read_only();
    mode_.read_only_ = read_only;
  }
  // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.TransactionOptions.read_only)
}
void TransactionOptions::set_allocated_read_write(::google::firestore::v1::TransactionOptions_ReadWrite* read_write) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  clear_mode();
  if (read_write) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
    if (message_arena != submessage_arena) {
      read_write = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, read_write, submessage_arena);
    }
    set_has_read_write();
    mode_.read_write_ = read_write;
  }
  // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.TransactionOptions.read_write)
}
TransactionOptions::TransactionOptions()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.TransactionOptions)
}
TransactionOptions::TransactionOptions(const TransactionOptions& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  clear_has_mode();
  switch (from.mode_case()) {
    case kReadOnly: {
      _internal_mutable_read_only()->::google::firestore::v1::TransactionOptions_ReadOnly::MergeFrom(from._internal_read_only());
      break;
    }
    case kReadWrite: {
      _internal_mutable_read_write()->::google::firestore::v1::TransactionOptions_ReadWrite::MergeFrom(from._internal_read_write());
      break;
    }
    case MODE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.TransactionOptions)
}

void TransactionOptions::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  clear_has_mode();
}

TransactionOptions::~TransactionOptions() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.TransactionOptions)
  SharedDtor();
}

void TransactionOptions::SharedDtor() {
  if (has_mode()) {
    clear_mode();
  }
}

void TransactionOptions::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const TransactionOptions& TransactionOptions::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TransactionOptions_google_2ffirestore_2fv1_2fcommon_2eproto.base);
  return *internal_default_instance();
}


void TransactionOptions::clear_mode() {
// @@protoc_insertion_point(one_of_clear_start:google.firestore.v1.TransactionOptions)
  switch (mode_case()) {
    case kReadOnly: {
      delete mode_.read_only_;
      break;
    }
    case kReadWrite: {
      delete mode_.read_write_;
      break;
    }
    case MODE_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = MODE_NOT_SET;
}


void TransactionOptions::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.TransactionOptions)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_mode();
  _internal_metadata_.Clear();
}

const char* TransactionOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_read_only(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_read_write(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* TransactionOptions::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.TransactionOptions)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
  if (_internal_has_read_only()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::read_only(this), target, stream);
  }

  // .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
  if (_internal_has_read_write()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::read_write(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.TransactionOptions)
  return target;
}

size_t TransactionOptions::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.TransactionOptions)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  switch (mode_case()) {
    // .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
    case kReadOnly: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *mode_.read_only_);
      break;
    }
    // .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
    case kReadWrite: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *mode_.read_write_);
      break;
    }
    case MODE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TransactionOptions::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.TransactionOptions)
  GOOGLE_DCHECK_NE(&from, this);
  const TransactionOptions* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TransactionOptions>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.TransactionOptions)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.TransactionOptions)
    MergeFrom(*source);
  }
}

void TransactionOptions::MergeFrom(const TransactionOptions& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.TransactionOptions)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.mode_case()) {
    case kReadOnly: {
      _internal_mutable_read_only()->::google::firestore::v1::TransactionOptions_ReadOnly::MergeFrom(from._internal_read_only());
      break;
    }
    case kReadWrite: {
      _internal_mutable_read_write()->::google::firestore::v1::TransactionOptions_ReadWrite::MergeFrom(from._internal_read_write());
      break;
    }
    case MODE_NOT_SET: {
      break;
    }
  }
}

void TransactionOptions::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.TransactionOptions)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void TransactionOptions::CopyFrom(const TransactionOptions& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.TransactionOptions)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TransactionOptions::IsInitialized() const {
  return true;
}

void TransactionOptions::InternalSwap(TransactionOptions* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(mode_, other->mode_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata TransactionOptions::GetMetadata() const {
  return GetMetadataStatic();
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace firestore
}  // namespace google
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::google::firestore::v1::DocumentMask* Arena::CreateMaybeMessage< ::google::firestore::v1::DocumentMask >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::DocumentMask >(arena);
}
template<> PROTOBUF_NOINLINE ::google::firestore::v1::Precondition* Arena::CreateMaybeMessage< ::google::firestore::v1::Precondition >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::Precondition >(arena);
}
template<> PROTOBUF_NOINLINE ::google::firestore::v1::TransactionOptions_ReadWrite* Arena::CreateMaybeMessage< ::google::firestore::v1::TransactionOptions_ReadWrite >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::TransactionOptions_ReadWrite >(arena);
}
template<> PROTOBUF_NOINLINE ::google::firestore::v1::TransactionOptions_ReadOnly* Arena::CreateMaybeMessage< ::google::firestore::v1::TransactionOptions_ReadOnly >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::TransactionOptions_ReadOnly >(arena);
}
template<> PROTOBUF_NOINLINE ::google::firestore::v1::TransactionOptions* Arena::CreateMaybeMessage< ::google::firestore::v1::TransactionOptions >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::TransactionOptions >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
