// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: keyapis/subscription/v1/keyapis_subscription_offer_template_v1.proto

#include "keyapis/subscription/v1/keyapis_subscription_offer_template_v1.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/io/zero_copy_stream_impl_lite.h"
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
namespace keyapis {
namespace subscription {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate_ApplicabilityRules::OfferTemplate_ApplicabilityRules(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.rf_ids_)*/ {}
  ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

  , /*decltype(_impl_.contract_type_)*/ 0

  , /*decltype(_impl_.client_type_)*/ 0

  , /*decltype(_impl_.billing_system_type_)*/ 0

  , /*decltype(_impl_.is_external_payment_for_smart_intercom_)*/ false

  , /*decltype(_impl_.is_cms_phone_)*/ false

  , /*decltype(_impl_.is_sip_phone_)*/ false

  , /*decltype(_impl_.is_video_monitor_)*/ false

  , /*decltype(_impl_.room_device_contract_type_)*/ 0

  , /*decltype(_impl_.mobile_app_package_type_)*/ 0

  , /*decltype(_impl_.is_call_forwarding_enabled_)*/ false

  , /*decltype(_impl_.is_digital_way_)*/ false

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct OfferTemplate_ApplicabilityRulesDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplate_ApplicabilityRulesDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplate_ApplicabilityRulesDefaultTypeInternal() {}
  union {
    OfferTemplate_ApplicabilityRules _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplate_ApplicabilityRulesDefaultTypeInternal _OfferTemplate_ApplicabilityRules_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate_Item::OfferTemplate_Item(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.offer_url_)*/nullptr
  , /*decltype(_impl_.plan_id_)*/ 0

  , /*decltype(_impl_.type_)*/ 0

  , /*decltype(_impl_.is_enable_auto_subscribe_)*/ false

  , /*decltype(_impl_.is_digital_way_)*/ false
} {}
struct OfferTemplate_ItemDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplate_ItemDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplate_ItemDefaultTypeInternal() {}
  union {
    OfferTemplate_Item _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplate_ItemDefaultTypeInternal _OfferTemplate_Item_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate_SavingError_Conflict::OfferTemplate_SavingError_Conflict(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct OfferTemplate_SavingError_ConflictDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplate_SavingError_ConflictDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplate_SavingError_ConflictDefaultTypeInternal() {}
  union {
    OfferTemplate_SavingError_Conflict _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplate_SavingError_ConflictDefaultTypeInternal _OfferTemplate_SavingError_Conflict_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate_SavingError_DuplicateTemplate::OfferTemplate_SavingError_DuplicateTemplate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct OfferTemplate_SavingError_DuplicateTemplateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplate_SavingError_DuplicateTemplateDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplate_SavingError_DuplicateTemplateDefaultTypeInternal() {}
  union {
    OfferTemplate_SavingError_DuplicateTemplate _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplate_SavingError_DuplicateTemplateDefaultTypeInternal _OfferTemplate_SavingError_DuplicateTemplate_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate_SavingError::OfferTemplate_SavingError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct OfferTemplate_SavingErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplate_SavingErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplate_SavingErrorDefaultTypeInternal() {}
  union {
    OfferTemplate_SavingError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplate_SavingErrorDefaultTypeInternal _OfferTemplate_SavingError_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplate::OfferTemplate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.items_)*/{}
  , /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.title_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.description_)*/nullptr
  , /*decltype(_impl_.applicability_rules_)*/nullptr
  , /*decltype(_impl_.created_at_)*/nullptr
  , /*decltype(_impl_.updated_at_)*/nullptr
  , /*decltype(_impl_.service_type_)*/ 0

  , /*decltype(_impl_.status_type_)*/ 0
} {}
struct OfferTemplateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplateDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplateDefaultTypeInternal() {}
  union {
    OfferTemplate _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplateDefaultTypeInternal _OfferTemplate_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplateFilter::OfferTemplateFilter(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.status_types_)*/ {}
  , /*decltype(_impl_._status_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.service_types_)*/ {}
  , /*decltype(_impl_._service_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.rf_ids_)*/ {}
  ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

  , /*decltype(_impl_.applicability_rules_contract_types_)*/ {}
  , /*decltype(_impl_._applicability_rules_contract_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.applicability_rules_client_types_)*/ {}
  , /*decltype(_impl_._applicability_rules_client_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.applicability_rules_billing_system_types_)*/ {}
  , /*decltype(_impl_._applicability_rules_billing_system_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.applicability_rules_room_device_contract_types_)*/ {}
  , /*decltype(_impl_._applicability_rules_room_device_contract_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.applicability_rules_mobile_app_package_types_)*/ {}
  , /*decltype(_impl_._applicability_rules_mobile_app_package_types_cached_byte_size_)*/ { 0 }

  , /*decltype(_impl_.plan_ids_)*/ {}
  ,/* _impl_._plan_ids_cached_byte_size_ = */ { 0 }

  , /*decltype(_impl_.text_)*/nullptr
  , /*decltype(_impl_.is_external_payment_for_smart_intercom_)*/nullptr
  , /*decltype(_impl_.applicability_rules_is_cms_phone_)*/nullptr
  , /*decltype(_impl_.applicability_rules_is_sip_phone_)*/nullptr
  , /*decltype(_impl_.applicability_rules_is_video_monitor_)*/nullptr
  , /*decltype(_impl_.is_call_forwarding_enabled_)*/nullptr
  , /*decltype(_impl_.is_digital_way_)*/nullptr} {}
struct OfferTemplateFilterDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplateFilterDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplateFilterDefaultTypeInternal() {}
  union {
    OfferTemplateFilter _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplateFilterDefaultTypeInternal _OfferTemplateFilter_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR OfferTemplatePaging::OfferTemplatePaging(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.order_by_type_)*/ 0

  , /*decltype(_impl_.direction_type_)*/ 0

  , /*decltype(_impl_.limit_)*/ 0

  , /*decltype(_impl_.offset_)*/ 0

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct OfferTemplatePagingDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OfferTemplatePagingDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~OfferTemplatePagingDefaultTypeInternal() {}
  union {
    OfferTemplatePaging _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OfferTemplatePagingDefaultTypeInternal _OfferTemplatePaging_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateRequest::GetOfferTemplateRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct GetOfferTemplateRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateRequestDefaultTypeInternal() {}
  union {
    GetOfferTemplateRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateRequestDefaultTypeInternal _GetOfferTemplateRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateResponse::GetOfferTemplateResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateResponseDefaultTypeInternal() {}
  union {
    GetOfferTemplateResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateResponseDefaultTypeInternal _GetOfferTemplateResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateListRequest::GetOfferTemplateListRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.filter_)*/nullptr
  , /*decltype(_impl_.pagination_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateListRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateListRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateListRequestDefaultTypeInternal() {}
  union {
    GetOfferTemplateListRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateListRequestDefaultTypeInternal _GetOfferTemplateListRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateListResponse_Error::GetOfferTemplateListResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateListResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateListResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateListResponse_ErrorDefaultTypeInternal() {}
  union {
    GetOfferTemplateListResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateListResponse_ErrorDefaultTypeInternal _GetOfferTemplateListResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateListResponse::GetOfferTemplateListResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateListResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateListResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateListResponseDefaultTypeInternal() {}
  union {
    GetOfferTemplateListResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateListResponseDefaultTypeInternal _GetOfferTemplateListResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListRequest::GetOfferTemplateByOrponListRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.orpon_)*/ ::int64_t{0}

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct GetOfferTemplateByOrponListRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponListRequestDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponListRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponListRequestDefaultTypeInternal _GetOfferTemplateByOrponListRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListResponse_Error::GetOfferTemplateByOrponListResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateByOrponListResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponListResponse_ErrorDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponListResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponListResponse_ErrorDefaultTypeInternal _GetOfferTemplateByOrponListResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListResponse::GetOfferTemplateByOrponListResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateByOrponListResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponListResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponListResponseDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponListResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponListResponseDefaultTypeInternal _GetOfferTemplateByOrponListResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateCountRequest::GetOfferTemplateCountRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.filter_)*/nullptr} {}
struct GetOfferTemplateCountRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateCountRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateCountRequestDefaultTypeInternal() {}
  union {
    GetOfferTemplateCountRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateCountRequestDefaultTypeInternal _GetOfferTemplateCountRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateCountResponse_Error::GetOfferTemplateCountResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateCountResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateCountResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateCountResponse_ErrorDefaultTypeInternal() {}
  union {
    GetOfferTemplateCountResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateCountResponse_ErrorDefaultTypeInternal _GetOfferTemplateCountResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateCountResponse::GetOfferTemplateCountResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateCountResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateCountResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateCountResponseDefaultTypeInternal() {}
  union {
    GetOfferTemplateCountResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateCountResponseDefaultTypeInternal _GetOfferTemplateCountResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountRequest::GetOfferTemplateByOrponCountRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.orpon_)*/ ::int64_t{0}

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct GetOfferTemplateByOrponCountRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponCountRequestDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponCountRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponCountRequestDefaultTypeInternal _GetOfferTemplateByOrponCountRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountResponse_Error::GetOfferTemplateByOrponCountResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateByOrponCountResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponCountResponse_ErrorDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponCountResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponCountResponse_ErrorDefaultTypeInternal _GetOfferTemplateByOrponCountResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountResponse::GetOfferTemplateByOrponCountResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetOfferTemplateByOrponCountResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetOfferTemplateByOrponCountResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetOfferTemplateByOrponCountResponseDefaultTypeInternal() {}
  union {
    GetOfferTemplateByOrponCountResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetOfferTemplateByOrponCountResponseDefaultTypeInternal _GetOfferTemplateByOrponCountResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostOfferTemplateRequest::PostOfferTemplateRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.data_)*/nullptr} {}
struct PostOfferTemplateRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostOfferTemplateRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostOfferTemplateRequestDefaultTypeInternal() {}
  union {
    PostOfferTemplateRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostOfferTemplateRequestDefaultTypeInternal _PostOfferTemplateRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostOfferTemplateResponse_Error::PostOfferTemplateResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct PostOfferTemplateResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostOfferTemplateResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostOfferTemplateResponse_ErrorDefaultTypeInternal() {}
  union {
    PostOfferTemplateResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostOfferTemplateResponse_ErrorDefaultTypeInternal _PostOfferTemplateResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostOfferTemplateResponse::PostOfferTemplateResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct PostOfferTemplateResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostOfferTemplateResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostOfferTemplateResponseDefaultTypeInternal() {}
  union {
    PostOfferTemplateResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostOfferTemplateResponseDefaultTypeInternal _PostOfferTemplateResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR DeleteOfferTemplateRequest::DeleteOfferTemplateRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct DeleteOfferTemplateRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR DeleteOfferTemplateRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~DeleteOfferTemplateRequestDefaultTypeInternal() {}
  union {
    DeleteOfferTemplateRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeleteOfferTemplateRequestDefaultTypeInternal _DeleteOfferTemplateRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR DeleteOfferTemplateResponse::DeleteOfferTemplateResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct DeleteOfferTemplateResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR DeleteOfferTemplateResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~DeleteOfferTemplateResponseDefaultTypeInternal() {}
  union {
    DeleteOfferTemplateResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeleteOfferTemplateResponseDefaultTypeInternal _DeleteOfferTemplateResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostOfferTemplateRestoreRequest::PostOfferTemplateRestoreRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct PostOfferTemplateRestoreRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostOfferTemplateRestoreRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostOfferTemplateRestoreRequestDefaultTypeInternal() {}
  union {
    PostOfferTemplateRestoreRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostOfferTemplateRestoreRequestDefaultTypeInternal _PostOfferTemplateRestoreRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostOfferTemplateRestoreResponse::PostOfferTemplateRestoreResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct PostOfferTemplateRestoreResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostOfferTemplateRestoreResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostOfferTemplateRestoreResponseDefaultTypeInternal() {}
  union {
    PostOfferTemplateRestoreResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostOfferTemplateRestoreResponseDefaultTypeInternal _PostOfferTemplateRestoreResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR ValidationError::ValidationError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.path_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.message_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ValidationErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ValidationErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~ValidationErrorDefaultTypeInternal() {}
  union {
    ValidationError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValidationErrorDefaultTypeInternal _ValidationError_default_instance_;
}  // namespace v1
}  // namespace subscription
}  // namespace keyapis
namespace keyapis {
namespace subscription {
namespace v1 {
bool OfferTemplate_ApplicabilityRules_ContractType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ApplicabilityRules_ContractType_strings[4] = {};

static const char OfferTemplate_ApplicabilityRules_ContractType_names[] = {
    "B2B"
    "B2B2C"
    "B2C"
    "CONTRACT_TYPE_UNKNOWN"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ApplicabilityRules_ContractType_entries[] =
    {
        {{&OfferTemplate_ApplicabilityRules_ContractType_names[0], 3}, 1},
        {{&OfferTemplate_ApplicabilityRules_ContractType_names[3], 5}, 3},
        {{&OfferTemplate_ApplicabilityRules_ContractType_names[8], 3}, 2},
        {{&OfferTemplate_ApplicabilityRules_ContractType_names[11], 21}, 0},
};

static const int OfferTemplate_ApplicabilityRules_ContractType_entries_by_number[] = {
    3,  // 0 -> CONTRACT_TYPE_UNKNOWN
    0,  // 1 -> B2B
    2,  // 2 -> B2C
    1,  // 3 -> B2B2C
};

const std::string& OfferTemplate_ApplicabilityRules_ContractType_Name(OfferTemplate_ApplicabilityRules_ContractType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ApplicabilityRules_ContractType_entries, OfferTemplate_ApplicabilityRules_ContractType_entries_by_number,
          4, OfferTemplate_ApplicabilityRules_ContractType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ApplicabilityRules_ContractType_entries, OfferTemplate_ApplicabilityRules_ContractType_entries_by_number, 4,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ApplicabilityRules_ContractType_strings[idx].get();
}

bool OfferTemplate_ApplicabilityRules_ContractType_Parse(absl::string_view name, OfferTemplate_ApplicabilityRules_ContractType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ApplicabilityRules_ContractType_entries, 4, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ApplicabilityRules_ContractType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::CONTRACT_TYPE_UNKNOWN;
constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::B2B;
constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::B2C;
constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::B2B2C;
constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::ContractType_MIN;
constexpr OfferTemplate_ApplicabilityRules_ContractType OfferTemplate_ApplicabilityRules::ContractType_MAX;
constexpr int OfferTemplate_ApplicabilityRules::ContractType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_ApplicabilityRules_ClientType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ApplicabilityRules_ClientType_strings[3] = {};

static const char OfferTemplate_ApplicabilityRules_ClientType_names[] = {
    "CLIENT_TYPE_UNKNOWN"
    "INTERCOM_COMPANY"
    "MANAGEMENT_COMPANY"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ApplicabilityRules_ClientType_entries[] =
    {
        {{&OfferTemplate_ApplicabilityRules_ClientType_names[0], 19}, 0},
        {{&OfferTemplate_ApplicabilityRules_ClientType_names[19], 16}, 2},
        {{&OfferTemplate_ApplicabilityRules_ClientType_names[35], 18}, 1},
};

static const int OfferTemplate_ApplicabilityRules_ClientType_entries_by_number[] = {
    0,  // 0 -> CLIENT_TYPE_UNKNOWN
    2,  // 1 -> MANAGEMENT_COMPANY
    1,  // 2 -> INTERCOM_COMPANY
};

const std::string& OfferTemplate_ApplicabilityRules_ClientType_Name(OfferTemplate_ApplicabilityRules_ClientType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ApplicabilityRules_ClientType_entries, OfferTemplate_ApplicabilityRules_ClientType_entries_by_number,
          3, OfferTemplate_ApplicabilityRules_ClientType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ApplicabilityRules_ClientType_entries, OfferTemplate_ApplicabilityRules_ClientType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ApplicabilityRules_ClientType_strings[idx].get();
}

bool OfferTemplate_ApplicabilityRules_ClientType_Parse(absl::string_view name, OfferTemplate_ApplicabilityRules_ClientType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ApplicabilityRules_ClientType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ApplicabilityRules_ClientType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ApplicabilityRules_ClientType OfferTemplate_ApplicabilityRules::CLIENT_TYPE_UNKNOWN;
constexpr OfferTemplate_ApplicabilityRules_ClientType OfferTemplate_ApplicabilityRules::MANAGEMENT_COMPANY;
constexpr OfferTemplate_ApplicabilityRules_ClientType OfferTemplate_ApplicabilityRules::INTERCOM_COMPANY;
constexpr OfferTemplate_ApplicabilityRules_ClientType OfferTemplate_ApplicabilityRules::ClientType_MIN;
constexpr OfferTemplate_ApplicabilityRules_ClientType OfferTemplate_ApplicabilityRules::ClientType_MAX;
constexpr int OfferTemplate_ApplicabilityRules::ClientType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_ApplicabilityRules_BillingSystemType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ApplicabilityRules_BillingSystemType_strings[3] = {};

static const char OfferTemplate_ApplicabilityRules_BillingSystemType_names[] = {
    "ASR_MRF"
    "BILLING_SYSTEM_TYPE_UNKNOWN"
    "KEY_PLATFORM"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ApplicabilityRules_BillingSystemType_entries[] =
    {
        {{&OfferTemplate_ApplicabilityRules_BillingSystemType_names[0], 7}, 1},
        {{&OfferTemplate_ApplicabilityRules_BillingSystemType_names[7], 27}, 0},
        {{&OfferTemplate_ApplicabilityRules_BillingSystemType_names[34], 12}, 2},
};

static const int OfferTemplate_ApplicabilityRules_BillingSystemType_entries_by_number[] = {
    1,  // 0 -> BILLING_SYSTEM_TYPE_UNKNOWN
    0,  // 1 -> ASR_MRF
    2,  // 2 -> KEY_PLATFORM
};

const std::string& OfferTemplate_ApplicabilityRules_BillingSystemType_Name(OfferTemplate_ApplicabilityRules_BillingSystemType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ApplicabilityRules_BillingSystemType_entries, OfferTemplate_ApplicabilityRules_BillingSystemType_entries_by_number,
          3, OfferTemplate_ApplicabilityRules_BillingSystemType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ApplicabilityRules_BillingSystemType_entries, OfferTemplate_ApplicabilityRules_BillingSystemType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ApplicabilityRules_BillingSystemType_strings[idx].get();
}

bool OfferTemplate_ApplicabilityRules_BillingSystemType_Parse(absl::string_view name, OfferTemplate_ApplicabilityRules_BillingSystemType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ApplicabilityRules_BillingSystemType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ApplicabilityRules_BillingSystemType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ApplicabilityRules_BillingSystemType OfferTemplate_ApplicabilityRules::BILLING_SYSTEM_TYPE_UNKNOWN;
constexpr OfferTemplate_ApplicabilityRules_BillingSystemType OfferTemplate_ApplicabilityRules::ASR_MRF;
constexpr OfferTemplate_ApplicabilityRules_BillingSystemType OfferTemplate_ApplicabilityRules::KEY_PLATFORM;
constexpr OfferTemplate_ApplicabilityRules_BillingSystemType OfferTemplate_ApplicabilityRules::BillingSystemType_MIN;
constexpr OfferTemplate_ApplicabilityRules_BillingSystemType OfferTemplate_ApplicabilityRules::BillingSystemType_MAX;
constexpr int OfferTemplate_ApplicabilityRules::BillingSystemType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_ApplicabilityRules_RoomDeviceContractType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ApplicabilityRules_RoomDeviceContractType_strings[3] = {};

static const char OfferTemplate_ApplicabilityRules_RoomDeviceContractType_names[] = {
    "ROOM_DEVICE_B2B"
    "ROOM_DEVICE_B2C"
    "ROOM_DEVICE_CONTRACT_TYPE_UNKNOWN"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries[] =
    {
        {{&OfferTemplate_ApplicabilityRules_RoomDeviceContractType_names[0], 15}, 1},
        {{&OfferTemplate_ApplicabilityRules_RoomDeviceContractType_names[15], 15}, 2},
        {{&OfferTemplate_ApplicabilityRules_RoomDeviceContractType_names[30], 33}, 0},
};

static const int OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries_by_number[] = {
    2,  // 0 -> ROOM_DEVICE_CONTRACT_TYPE_UNKNOWN
    0,  // 1 -> ROOM_DEVICE_B2B
    1,  // 2 -> ROOM_DEVICE_B2C
};

const std::string& OfferTemplate_ApplicabilityRules_RoomDeviceContractType_Name(OfferTemplate_ApplicabilityRules_RoomDeviceContractType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries, OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries_by_number,
          3, OfferTemplate_ApplicabilityRules_RoomDeviceContractType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries, OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ApplicabilityRules_RoomDeviceContractType_strings[idx].get();
}

bool OfferTemplate_ApplicabilityRules_RoomDeviceContractType_Parse(absl::string_view name, OfferTemplate_ApplicabilityRules_RoomDeviceContractType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ApplicabilityRules_RoomDeviceContractType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ApplicabilityRules_RoomDeviceContractType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ApplicabilityRules_RoomDeviceContractType OfferTemplate_ApplicabilityRules::ROOM_DEVICE_CONTRACT_TYPE_UNKNOWN;
constexpr OfferTemplate_ApplicabilityRules_RoomDeviceContractType OfferTemplate_ApplicabilityRules::ROOM_DEVICE_B2B;
constexpr OfferTemplate_ApplicabilityRules_RoomDeviceContractType OfferTemplate_ApplicabilityRules::ROOM_DEVICE_B2C;
constexpr OfferTemplate_ApplicabilityRules_RoomDeviceContractType OfferTemplate_ApplicabilityRules::RoomDeviceContractType_MIN;
constexpr OfferTemplate_ApplicabilityRules_RoomDeviceContractType OfferTemplate_ApplicabilityRules::RoomDeviceContractType_MAX;
constexpr int OfferTemplate_ApplicabilityRules::RoomDeviceContractType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_ApplicabilityRules_MobileAppPackageType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ApplicabilityRules_MobileAppPackageType_strings[4] = {};

static const char OfferTemplate_ApplicabilityRules_MobileAppPackageType_names[] = {
    "MOBILE_APP_PACKAGE_TYPE_UNKNOWN"
    "OPEN_DOOR_AND_KEYS"
    "OPEN_DOOR_AND_KEYS_AUDIO_CALLS"
    "OPEN_DOOR_AND_KEYS_VIDEO_CALLS"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries[] =
    {
        {{&OfferTemplate_ApplicabilityRules_MobileAppPackageType_names[0], 31}, 0},
        {{&OfferTemplate_ApplicabilityRules_MobileAppPackageType_names[31], 18}, 1},
        {{&OfferTemplate_ApplicabilityRules_MobileAppPackageType_names[49], 30}, 2},
        {{&OfferTemplate_ApplicabilityRules_MobileAppPackageType_names[79], 30}, 3},
};

static const int OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries_by_number[] = {
    0,  // 0 -> MOBILE_APP_PACKAGE_TYPE_UNKNOWN
    1,  // 1 -> OPEN_DOOR_AND_KEYS
    2,  // 2 -> OPEN_DOOR_AND_KEYS_AUDIO_CALLS
    3,  // 3 -> OPEN_DOOR_AND_KEYS_VIDEO_CALLS
};

const std::string& OfferTemplate_ApplicabilityRules_MobileAppPackageType_Name(OfferTemplate_ApplicabilityRules_MobileAppPackageType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries, OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries_by_number,
          4, OfferTemplate_ApplicabilityRules_MobileAppPackageType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries, OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries_by_number, 4,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ApplicabilityRules_MobileAppPackageType_strings[idx].get();
}

bool OfferTemplate_ApplicabilityRules_MobileAppPackageType_Parse(absl::string_view name, OfferTemplate_ApplicabilityRules_MobileAppPackageType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ApplicabilityRules_MobileAppPackageType_entries, 4, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ApplicabilityRules_MobileAppPackageType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::MOBILE_APP_PACKAGE_TYPE_UNKNOWN;
constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::OPEN_DOOR_AND_KEYS;
constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::OPEN_DOOR_AND_KEYS_AUDIO_CALLS;
constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::OPEN_DOOR_AND_KEYS_VIDEO_CALLS;
constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::MobileAppPackageType_MIN;
constexpr OfferTemplate_ApplicabilityRules_MobileAppPackageType OfferTemplate_ApplicabilityRules::MobileAppPackageType_MAX;
constexpr int OfferTemplate_ApplicabilityRules::MobileAppPackageType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_ServiceType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_ServiceType_strings[6] = {};

static const char OfferTemplate_ServiceType_names[] = {
    "ACCESS_CONTROL_PANEL"
    "BARRIER"
    "CAMERAS"
    "INTERCOM"
    "SERVICE_TYPE_UNKNOWN"
    "TELEMETRY"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_ServiceType_entries[] =
    {
        {{&OfferTemplate_ServiceType_names[0], 20}, 4},
        {{&OfferTemplate_ServiceType_names[20], 7}, 5},
        {{&OfferTemplate_ServiceType_names[27], 7}, 2},
        {{&OfferTemplate_ServiceType_names[34], 8}, 1},
        {{&OfferTemplate_ServiceType_names[42], 20}, 0},
        {{&OfferTemplate_ServiceType_names[62], 9}, 3},
};

static const int OfferTemplate_ServiceType_entries_by_number[] = {
    4,  // 0 -> SERVICE_TYPE_UNKNOWN
    3,  // 1 -> INTERCOM
    2,  // 2 -> CAMERAS
    5,  // 3 -> TELEMETRY
    0,  // 4 -> ACCESS_CONTROL_PANEL
    1,  // 5 -> BARRIER
};

const std::string& OfferTemplate_ServiceType_Name(OfferTemplate_ServiceType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_ServiceType_entries, OfferTemplate_ServiceType_entries_by_number,
          6, OfferTemplate_ServiceType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_ServiceType_entries, OfferTemplate_ServiceType_entries_by_number, 6,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_ServiceType_strings[idx].get();
}

bool OfferTemplate_ServiceType_Parse(absl::string_view name, OfferTemplate_ServiceType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_ServiceType_entries, 6, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_ServiceType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_ServiceType OfferTemplate::SERVICE_TYPE_UNKNOWN;
constexpr OfferTemplate_ServiceType OfferTemplate::INTERCOM;
constexpr OfferTemplate_ServiceType OfferTemplate::CAMERAS;
constexpr OfferTemplate_ServiceType OfferTemplate::TELEMETRY;
constexpr OfferTemplate_ServiceType OfferTemplate::ACCESS_CONTROL_PANEL;
constexpr OfferTemplate_ServiceType OfferTemplate::BARRIER;
constexpr OfferTemplate_ServiceType OfferTemplate::ServiceType_MIN;
constexpr OfferTemplate_ServiceType OfferTemplate::ServiceType_MAX;
constexpr int OfferTemplate::ServiceType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplate_StatusType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplate_StatusType_strings[3] = {};

static const char OfferTemplate_StatusType_names[] = {
    "ACTIVE"
    "ARCHIVED"
    "STATUS_TYPE_UNKNOWN"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplate_StatusType_entries[] =
    {
        {{&OfferTemplate_StatusType_names[0], 6}, 1},
        {{&OfferTemplate_StatusType_names[6], 8}, 2},
        {{&OfferTemplate_StatusType_names[14], 19}, 0},
};

static const int OfferTemplate_StatusType_entries_by_number[] = {
    2,  // 0 -> STATUS_TYPE_UNKNOWN
    0,  // 1 -> ACTIVE
    1,  // 2 -> ARCHIVED
};

const std::string& OfferTemplate_StatusType_Name(OfferTemplate_StatusType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplate_StatusType_entries, OfferTemplate_StatusType_entries_by_number,
          3, OfferTemplate_StatusType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplate_StatusType_entries, OfferTemplate_StatusType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplate_StatusType_strings[idx].get();
}

bool OfferTemplate_StatusType_Parse(absl::string_view name, OfferTemplate_StatusType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplate_StatusType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplate_StatusType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplate_StatusType OfferTemplate::STATUS_TYPE_UNKNOWN;
constexpr OfferTemplate_StatusType OfferTemplate::ACTIVE;
constexpr OfferTemplate_StatusType OfferTemplate::ARCHIVED;
constexpr OfferTemplate_StatusType OfferTemplate::StatusType_MIN;
constexpr OfferTemplate_StatusType OfferTemplate::StatusType_MAX;
constexpr int OfferTemplate::StatusType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplatePaging_OrderByType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplatePaging_OrderByType_strings[3] = {};

static const char OfferTemplatePaging_OrderByType_names[] = {
    "CREATED_AT"
    "ORDER_BY_TYPE_UNKNOWN"
    "TITLE"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplatePaging_OrderByType_entries[] =
    {
        {{&OfferTemplatePaging_OrderByType_names[0], 10}, 1},
        {{&OfferTemplatePaging_OrderByType_names[10], 21}, 0},
        {{&OfferTemplatePaging_OrderByType_names[31], 5}, 2},
};

static const int OfferTemplatePaging_OrderByType_entries_by_number[] = {
    1,  // 0 -> ORDER_BY_TYPE_UNKNOWN
    0,  // 1 -> CREATED_AT
    2,  // 2 -> TITLE
};

const std::string& OfferTemplatePaging_OrderByType_Name(OfferTemplatePaging_OrderByType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplatePaging_OrderByType_entries, OfferTemplatePaging_OrderByType_entries_by_number,
          3, OfferTemplatePaging_OrderByType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplatePaging_OrderByType_entries, OfferTemplatePaging_OrderByType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplatePaging_OrderByType_strings[idx].get();
}

bool OfferTemplatePaging_OrderByType_Parse(absl::string_view name, OfferTemplatePaging_OrderByType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplatePaging_OrderByType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplatePaging_OrderByType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplatePaging_OrderByType OfferTemplatePaging::ORDER_BY_TYPE_UNKNOWN;
constexpr OfferTemplatePaging_OrderByType OfferTemplatePaging::CREATED_AT;
constexpr OfferTemplatePaging_OrderByType OfferTemplatePaging::TITLE;
constexpr OfferTemplatePaging_OrderByType OfferTemplatePaging::OrderByType_MIN;
constexpr OfferTemplatePaging_OrderByType OfferTemplatePaging::OrderByType_MAX;
constexpr int OfferTemplatePaging::OrderByType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool OfferTemplatePaging_DirectionType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    OfferTemplatePaging_DirectionType_strings[3] = {};

static const char OfferTemplatePaging_DirectionType_names[] = {
    "ASC"
    "DESC"
    "DIRECTION_TYPE_UNKNOWN"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry OfferTemplatePaging_DirectionType_entries[] =
    {
        {{&OfferTemplatePaging_DirectionType_names[0], 3}, 2},
        {{&OfferTemplatePaging_DirectionType_names[3], 4}, 1},
        {{&OfferTemplatePaging_DirectionType_names[7], 22}, 0},
};

static const int OfferTemplatePaging_DirectionType_entries_by_number[] = {
    2,  // 0 -> DIRECTION_TYPE_UNKNOWN
    1,  // 1 -> DESC
    0,  // 2 -> ASC
};

const std::string& OfferTemplatePaging_DirectionType_Name(OfferTemplatePaging_DirectionType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          OfferTemplatePaging_DirectionType_entries, OfferTemplatePaging_DirectionType_entries_by_number,
          3, OfferTemplatePaging_DirectionType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      OfferTemplatePaging_DirectionType_entries, OfferTemplatePaging_DirectionType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : OfferTemplatePaging_DirectionType_strings[idx].get();
}

bool OfferTemplatePaging_DirectionType_Parse(absl::string_view name, OfferTemplatePaging_DirectionType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      OfferTemplatePaging_DirectionType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<OfferTemplatePaging_DirectionType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr OfferTemplatePaging_DirectionType OfferTemplatePaging::DIRECTION_TYPE_UNKNOWN;
constexpr OfferTemplatePaging_DirectionType OfferTemplatePaging::DESC;
constexpr OfferTemplatePaging_DirectionType OfferTemplatePaging::ASC;
constexpr OfferTemplatePaging_DirectionType OfferTemplatePaging::DirectionType_MIN;
constexpr OfferTemplatePaging_DirectionType OfferTemplatePaging::DirectionType_MAX;
constexpr int OfferTemplatePaging::DirectionType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================

class OfferTemplate_ApplicabilityRules::_Internal {
 public:
};

OfferTemplate_ApplicabilityRules::OfferTemplate_ApplicabilityRules(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
}
OfferTemplate_ApplicabilityRules::OfferTemplate_ApplicabilityRules(const OfferTemplate_ApplicabilityRules& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  OfferTemplate_ApplicabilityRules* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.rf_ids_) { from._impl_.rf_ids_ }
    ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.contract_type_) {}

    , decltype(_impl_.client_type_) {}

    , decltype(_impl_.billing_system_type_) {}

    , decltype(_impl_.is_external_payment_for_smart_intercom_) {}

    , decltype(_impl_.is_cms_phone_) {}

    , decltype(_impl_.is_sip_phone_) {}

    , decltype(_impl_.is_video_monitor_) {}

    , decltype(_impl_.room_device_contract_type_) {}

    , decltype(_impl_.mobile_app_package_type_) {}

    , decltype(_impl_.is_call_forwarding_enabled_) {}

    , decltype(_impl_.is_digital_way_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&_impl_.contract_type_, &from._impl_.contract_type_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.is_digital_way_) -
    reinterpret_cast<char*>(&_impl_.contract_type_)) + sizeof(_impl_.is_digital_way_));
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
}

inline void OfferTemplate_ApplicabilityRules::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.rf_ids_) { arena }
    ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.contract_type_) { 0 }

    , decltype(_impl_.client_type_) { 0 }

    , decltype(_impl_.billing_system_type_) { 0 }

    , decltype(_impl_.is_external_payment_for_smart_intercom_) { false }

    , decltype(_impl_.is_cms_phone_) { false }

    , decltype(_impl_.is_sip_phone_) { false }

    , decltype(_impl_.is_video_monitor_) { false }

    , decltype(_impl_.room_device_contract_type_) { 0 }

    , decltype(_impl_.mobile_app_package_type_) { 0 }

    , decltype(_impl_.is_call_forwarding_enabled_) { false }

    , decltype(_impl_.is_digital_way_) { false }

    , /*decltype(_impl_._cached_size_)*/{}
  };
}

OfferTemplate_ApplicabilityRules::~OfferTemplate_ApplicabilityRules() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate_ApplicabilityRules::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.rf_ids_.~RepeatedField();
}

void OfferTemplate_ApplicabilityRules::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate_ApplicabilityRules::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_mutable_rf_ids()->Clear();
  ::memset(&_impl_.contract_type_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.is_digital_way_) -
      reinterpret_cast<char*>(&_impl_.contract_type_)) + sizeof(_impl_.is_digital_way_));
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate_ApplicabilityRules::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated int32 rf_ids = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_rf_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 8) {
          _internal_add_rf_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType contract_type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_contract_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_ContractType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType client_type = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_client_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_ClientType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType billing_system_type = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_billing_system_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_BillingSystemType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_external_payment_for_smart_intercom = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
          _impl_.is_external_payment_for_smart_intercom_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_cms_phone = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
          _impl_.is_cms_phone_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_sip_phone = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
          _impl_.is_sip_phone_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_video_monitor = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
          _impl_.is_video_monitor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType room_device_contract_type = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_room_device_contract_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_RoomDeviceContractType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType mobile_app_package_type = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_mobile_app_package_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_MobileAppPackageType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_call_forwarding_enabled = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
          _impl_.is_call_forwarding_enabled_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_digital_way = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
          _impl_.is_digital_way_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate_ApplicabilityRules::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 rf_ids = 1;
  {
    int byte_size = _impl_._rf_ids_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(1, _internal_rf_ids(),
                                                 byte_size, target);
    }
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType contract_type = 2;
  if (this->_internal_contract_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        2, this->_internal_contract_type(), target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType client_type = 3;
  if (this->_internal_client_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        3, this->_internal_client_type(), target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType billing_system_type = 4;
  if (this->_internal_billing_system_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        4, this->_internal_billing_system_type(), target);
  }

  // bool is_external_payment_for_smart_intercom = 5;
  if (this->_internal_is_external_payment_for_smart_intercom() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        5, this->_internal_is_external_payment_for_smart_intercom(), target);
  }

  // bool is_cms_phone = 6;
  if (this->_internal_is_cms_phone() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        6, this->_internal_is_cms_phone(), target);
  }

  // bool is_sip_phone = 7;
  if (this->_internal_is_sip_phone() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        7, this->_internal_is_sip_phone(), target);
  }

  // bool is_video_monitor = 8;
  if (this->_internal_is_video_monitor() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        8, this->_internal_is_video_monitor(), target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType room_device_contract_type = 9;
  if (this->_internal_room_device_contract_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        9, this->_internal_room_device_contract_type(), target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType mobile_app_package_type = 10;
  if (this->_internal_mobile_app_package_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        10, this->_internal_mobile_app_package_type(), target);
  }

  // bool is_call_forwarding_enabled = 11;
  if (this->_internal_is_call_forwarding_enabled() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        11, this->_internal_is_call_forwarding_enabled(), target);
  }

  // bool is_digital_way = 12;
  if (this->_internal_is_digital_way() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        12, this->_internal_is_digital_way(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  return target;
}

::size_t OfferTemplate_ApplicabilityRules::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  ::size_t total_size = 0;

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

  // repeated int32 rf_ids = 1;
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
        this->_internal_rf_ids())
    ;
    _impl_._rf_ids_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 1 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType contract_type = 2;
  if (this->_internal_contract_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_contract_type());
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType client_type = 3;
  if (this->_internal_client_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_client_type());
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType billing_system_type = 4;
  if (this->_internal_billing_system_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_billing_system_type());
  }

  // bool is_external_payment_for_smart_intercom = 5;
  if (this->_internal_is_external_payment_for_smart_intercom() != 0) {
    total_size += 2;
  }

  // bool is_cms_phone = 6;
  if (this->_internal_is_cms_phone() != 0) {
    total_size += 2;
  }

  // bool is_sip_phone = 7;
  if (this->_internal_is_sip_phone() != 0) {
    total_size += 2;
  }

  // bool is_video_monitor = 8;
  if (this->_internal_is_video_monitor() != 0) {
    total_size += 2;
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType room_device_contract_type = 9;
  if (this->_internal_room_device_contract_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_room_device_contract_type());
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType mobile_app_package_type = 10;
  if (this->_internal_mobile_app_package_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_mobile_app_package_type());
  }

  // bool is_call_forwarding_enabled = 11;
  if (this->_internal_is_call_forwarding_enabled() != 0) {
    total_size += 2;
  }

  // bool is_digital_way = 12;
  if (this->_internal_is_digital_way() != 0) {
    total_size += 2;
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate_ApplicabilityRules::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate_ApplicabilityRules*>(
      &from));
}

void OfferTemplate_ApplicabilityRules::MergeFrom(const OfferTemplate_ApplicabilityRules& from) {
  OfferTemplate_ApplicabilityRules* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.rf_ids_.MergeFrom(from._impl_.rf_ids_);
  if (from._internal_contract_type() != 0) {
    _this->_internal_set_contract_type(from._internal_contract_type());
  }
  if (from._internal_client_type() != 0) {
    _this->_internal_set_client_type(from._internal_client_type());
  }
  if (from._internal_billing_system_type() != 0) {
    _this->_internal_set_billing_system_type(from._internal_billing_system_type());
  }
  if (from._internal_is_external_payment_for_smart_intercom() != 0) {
    _this->_internal_set_is_external_payment_for_smart_intercom(from._internal_is_external_payment_for_smart_intercom());
  }
  if (from._internal_is_cms_phone() != 0) {
    _this->_internal_set_is_cms_phone(from._internal_is_cms_phone());
  }
  if (from._internal_is_sip_phone() != 0) {
    _this->_internal_set_is_sip_phone(from._internal_is_sip_phone());
  }
  if (from._internal_is_video_monitor() != 0) {
    _this->_internal_set_is_video_monitor(from._internal_is_video_monitor());
  }
  if (from._internal_room_device_contract_type() != 0) {
    _this->_internal_set_room_device_contract_type(from._internal_room_device_contract_type());
  }
  if (from._internal_mobile_app_package_type() != 0) {
    _this->_internal_set_mobile_app_package_type(from._internal_mobile_app_package_type());
  }
  if (from._internal_is_call_forwarding_enabled() != 0) {
    _this->_internal_set_is_call_forwarding_enabled(from._internal_is_call_forwarding_enabled());
  }
  if (from._internal_is_digital_way() != 0) {
    _this->_internal_set_is_digital_way(from._internal_is_digital_way());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate_ApplicabilityRules::CopyFrom(const OfferTemplate_ApplicabilityRules& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate.ApplicabilityRules)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplate_ApplicabilityRules::InternalSwap(OfferTemplate_ApplicabilityRules* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.rf_ids_.InternalSwap(&other->_impl_.rf_ids_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OfferTemplate_ApplicabilityRules, _impl_.is_digital_way_)
      + sizeof(OfferTemplate_ApplicabilityRules::_impl_.is_digital_way_)
      - PROTOBUF_FIELD_OFFSET(OfferTemplate_ApplicabilityRules, _impl_.contract_type_)>(
          reinterpret_cast<char*>(&_impl_.contract_type_),
          reinterpret_cast<char*>(&other->_impl_.contract_type_));
}

std::string OfferTemplate_ApplicabilityRules::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate.ApplicabilityRules";
}

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

class OfferTemplate_Item::_Internal {
 public:
  using HasBits = decltype(std::declval<OfferTemplate_Item>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(OfferTemplate_Item, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::StringValue& offer_url(const OfferTemplate_Item* msg);
  static void set_has_offer_url(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::StringValue&
OfferTemplate_Item::_Internal::offer_url(const OfferTemplate_Item* msg) {
  return *msg->_impl_.offer_url_;
}
void OfferTemplate_Item::clear_offer_url() {
  if (_impl_.offer_url_ != nullptr) _impl_.offer_url_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
OfferTemplate_Item::OfferTemplate_Item(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate.Item)
}
OfferTemplate_Item::OfferTemplate_Item(const OfferTemplate_Item& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  OfferTemplate_Item* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.offer_url_){nullptr}
    , decltype(_impl_.plan_id_) {}

    , decltype(_impl_.type_) {}

    , decltype(_impl_.is_enable_auto_subscribe_) {}

    , decltype(_impl_.is_digital_way_) {}
  };

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.offer_url_ = new ::PROTOBUF_NAMESPACE_ID::StringValue(*from._impl_.offer_url_);
  }
  ::memcpy(&_impl_.plan_id_, &from._impl_.plan_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.is_digital_way_) -
    reinterpret_cast<char*>(&_impl_.plan_id_)) + sizeof(_impl_.is_digital_way_));
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate.Item)
}

inline void OfferTemplate_Item::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.offer_url_){nullptr}
    , decltype(_impl_.plan_id_) { 0 }

    , decltype(_impl_.type_) { 0 }

    , decltype(_impl_.is_enable_auto_subscribe_) { false }

    , decltype(_impl_.is_digital_way_) { false }

  };
}

OfferTemplate_Item::~OfferTemplate_Item() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate.Item)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate_Item::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.offer_url_;
}

void OfferTemplate_Item::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate_Item::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate.Item)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.offer_url_ != nullptr);
    _impl_.offer_url_->Clear();
  }
  ::memset(&_impl_.plan_id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.is_digital_way_) -
      reinterpret_cast<char*>(&_impl_.plan_id_)) + sizeof(_impl_.is_digital_way_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate_Item::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.plan_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_type(static_cast<::keyapis::subscription::v1::Offer_Type>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_enable_auto_subscribe = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.is_enable_auto_subscribe_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_digital_way = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
          _impl_.is_digital_way_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.StringValue offer_url = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_offer_url(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate_Item::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate.Item)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_plan_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_plan_id(), target);
  }

  // .keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        2, this->_internal_type(), target);
  }

  // bool is_enable_auto_subscribe = 3;
  if (this->_internal_is_enable_auto_subscribe() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        3, this->_internal_is_enable_auto_subscribe(), target);
  }

  // bool is_digital_way = 4;
  if (this->_internal_is_digital_way() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        4, this->_internal_is_digital_way(), target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.StringValue offer_url = 5;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, _Internal::offer_url(this),
        _Internal::offer_url(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate.Item)
  return target;
}

::size_t OfferTemplate_Item::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate.Item)
  ::size_t total_size = 0;

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

  // .google.protobuf.StringValue offer_url = 5;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.offer_url_);
  }

  // int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_plan_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_plan_id());
  }

  // .keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
  }

  // bool is_enable_auto_subscribe = 3;
  if (this->_internal_is_enable_auto_subscribe() != 0) {
    total_size += 2;
  }

  // bool is_digital_way = 4;
  if (this->_internal_is_digital_way() != 0) {
    total_size += 2;
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate_Item::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate_Item*>(
      &from));
}

void OfferTemplate_Item::MergeFrom(const OfferTemplate_Item& from) {
  OfferTemplate_Item* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate.Item)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_offer_url()->::PROTOBUF_NAMESPACE_ID::StringValue::MergeFrom(
        from._internal_offer_url());
  }
  if (from._internal_plan_id() != 0) {
    _this->_internal_set_plan_id(from._internal_plan_id());
  }
  if (from._internal_type() != 0) {
    _this->_internal_set_type(from._internal_type());
  }
  if (from._internal_is_enable_auto_subscribe() != 0) {
    _this->_internal_set_is_enable_auto_subscribe(from._internal_is_enable_auto_subscribe());
  }
  if (from._internal_is_digital_way() != 0) {
    _this->_internal_set_is_digital_way(from._internal_is_digital_way());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate_Item::CopyFrom(const OfferTemplate_Item& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate.Item)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplate_Item::InternalSwap(OfferTemplate_Item* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OfferTemplate_Item, _impl_.is_digital_way_)
      + sizeof(OfferTemplate_Item::_impl_.is_digital_way_)
      - PROTOBUF_FIELD_OFFSET(OfferTemplate_Item, _impl_.offer_url_)>(
          reinterpret_cast<char*>(&_impl_.offer_url_),
          reinterpret_cast<char*>(&other->_impl_.offer_url_));
}

std::string OfferTemplate_Item::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate.Item";
}

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

class OfferTemplate_SavingError_Conflict::_Internal {
 public:
};

OfferTemplate_SavingError_Conflict::OfferTemplate_SavingError_Conflict(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
}
OfferTemplate_SavingError_Conflict::OfferTemplate_SavingError_Conflict(const OfferTemplate_SavingError_Conflict& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
}

inline void OfferTemplate_SavingError_Conflict::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      /*decltype(_impl_._cached_size_)*/{}
  };
}

OfferTemplate_SavingError_Conflict::~OfferTemplate_SavingError_Conflict() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate_SavingError_Conflict::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void OfferTemplate_SavingError_Conflict::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate_SavingError_Conflict::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate_SavingError_Conflict::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate_SavingError_Conflict::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  return target;
}

::size_t OfferTemplate_SavingError_Conflict::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  ::size_t total_size = 0;

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

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate_SavingError_Conflict::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate_SavingError_Conflict*>(
      &from));
}

void OfferTemplate_SavingError_Conflict::MergeFrom(const OfferTemplate_SavingError_Conflict& from) {
  OfferTemplate_SavingError_Conflict* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate_SavingError_Conflict::CopyFrom(const OfferTemplate_SavingError_Conflict& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate.SavingError.Conflict)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string OfferTemplate_SavingError_Conflict::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate.SavingError.Conflict";
}

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

class OfferTemplate_SavingError_DuplicateTemplate::_Internal {
 public:
};

OfferTemplate_SavingError_DuplicateTemplate::OfferTemplate_SavingError_DuplicateTemplate(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
}
OfferTemplate_SavingError_DuplicateTemplate::OfferTemplate_SavingError_DuplicateTemplate(const OfferTemplate_SavingError_DuplicateTemplate& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
}

inline void OfferTemplate_SavingError_DuplicateTemplate::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      /*decltype(_impl_._cached_size_)*/{}
  };
}

OfferTemplate_SavingError_DuplicateTemplate::~OfferTemplate_SavingError_DuplicateTemplate() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate_SavingError_DuplicateTemplate::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void OfferTemplate_SavingError_DuplicateTemplate::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate_SavingError_DuplicateTemplate::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate_SavingError_DuplicateTemplate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate_SavingError_DuplicateTemplate::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  return target;
}

::size_t OfferTemplate_SavingError_DuplicateTemplate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  ::size_t total_size = 0;

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

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate_SavingError_DuplicateTemplate::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate_SavingError_DuplicateTemplate*>(
      &from));
}

void OfferTemplate_SavingError_DuplicateTemplate::MergeFrom(const OfferTemplate_SavingError_DuplicateTemplate& from) {
  OfferTemplate_SavingError_DuplicateTemplate* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate_SavingError_DuplicateTemplate::CopyFrom(const OfferTemplate_SavingError_DuplicateTemplate& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string OfferTemplate_SavingError_DuplicateTemplate::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate";
}

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

class OfferTemplate_SavingError::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::OfferTemplate_SavingError, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict& conflict(const OfferTemplate_SavingError* msg);
  static const ::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate& duplicate_template(const OfferTemplate_SavingError* msg);
};

const ::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict&
OfferTemplate_SavingError::_Internal::conflict(const OfferTemplate_SavingError* msg) {
  return *msg->_impl_.reason_.conflict_;
}
const ::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate&
OfferTemplate_SavingError::_Internal::duplicate_template(const OfferTemplate_SavingError* msg) {
  return *msg->_impl_.reason_.duplicate_template_;
}
void OfferTemplate_SavingError::set_allocated_conflict(::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict* conflict) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (conflict) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(conflict);
    if (message_arena != submessage_arena) {
      conflict = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, conflict, submessage_arena);
    }
    set_has_conflict();
    _impl_.reason_.conflict_ = conflict;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.OfferTemplate.SavingError.conflict)
}
void OfferTemplate_SavingError::set_allocated_duplicate_template(::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate* duplicate_template) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (duplicate_template) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(duplicate_template);
    if (message_arena != submessage_arena) {
      duplicate_template = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, duplicate_template, submessage_arena);
    }
    set_has_duplicate_template();
    _impl_.reason_.duplicate_template_ = duplicate_template;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.OfferTemplate.SavingError.duplicate_template)
}
OfferTemplate_SavingError::OfferTemplate_SavingError(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate.SavingError)
}
OfferTemplate_SavingError::OfferTemplate_SavingError(const OfferTemplate_SavingError& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  OfferTemplate_SavingError* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kConflict: {
      _this->_internal_mutable_conflict()->::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict::MergeFrom(
          from._internal_conflict());
      break;
    }
    case kDuplicateTemplate: {
      _this->_internal_mutable_duplicate_template()->::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate::MergeFrom(
          from._internal_duplicate_template());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate.SavingError)
}

inline void OfferTemplate_SavingError::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

OfferTemplate_SavingError::~OfferTemplate_SavingError() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate.SavingError)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate_SavingError::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void OfferTemplate_SavingError::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate_SavingError::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  switch (reason_case()) {
    case kConflict: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.conflict_;
      }
      break;
    }
    case kDuplicateTemplate: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.duplicate_template_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void OfferTemplate_SavingError::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate_SavingError::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate.SavingError.Conflict conflict = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_conflict(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate duplicate_template = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_duplicate_template(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate_SavingError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (reason_case()) {
    case kConflict: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::conflict(this),
          _Internal::conflict(this).GetCachedSize(), target, stream);
      break;
    }
    case kDuplicateTemplate: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::duplicate_template(this),
          _Internal::duplicate_template(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate.SavingError)
  return target;
}

::size_t OfferTemplate_SavingError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.OfferTemplate.SavingError.Conflict conflict = 1;
    case kConflict: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.conflict_);
      break;
    }
    // .keyapis.subscription.v1.OfferTemplate.SavingError.DuplicateTemplate duplicate_template = 2;
    case kDuplicateTemplate: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.duplicate_template_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate_SavingError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate_SavingError*>(
      &from));
}

void OfferTemplate_SavingError::MergeFrom(const OfferTemplate_SavingError& from) {
  OfferTemplate_SavingError* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kConflict: {
      _this->_internal_mutable_conflict()->::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict::MergeFrom(
          from._internal_conflict());
      break;
    }
    case kDuplicateTemplate: {
      _this->_internal_mutable_duplicate_template()->::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate::MergeFrom(
          from._internal_duplicate_template());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate_SavingError::CopyFrom(const OfferTemplate_SavingError& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate.SavingError)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplate_SavingError::InternalSwap(OfferTemplate_SavingError* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string OfferTemplate_SavingError::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate.SavingError";
}

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

class OfferTemplate::_Internal {
 public:
  using HasBits = decltype(std::declval<OfferTemplate>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(OfferTemplate, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::StringValue& description(const OfferTemplate* msg);
  static void set_has_description(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules& applicability_rules(const OfferTemplate* msg);
  static void set_has_applicability_rules(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& created_at(const OfferTemplate* msg);
  static void set_has_created_at(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& updated_at(const OfferTemplate* msg);
  static void set_has_updated_at(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::StringValue&
OfferTemplate::_Internal::description(const OfferTemplate* msg) {
  return *msg->_impl_.description_;
}
const ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules&
OfferTemplate::_Internal::applicability_rules(const OfferTemplate* msg) {
  return *msg->_impl_.applicability_rules_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
OfferTemplate::_Internal::created_at(const OfferTemplate* msg) {
  return *msg->_impl_.created_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
OfferTemplate::_Internal::updated_at(const OfferTemplate* msg) {
  return *msg->_impl_.updated_at_;
}
void OfferTemplate::clear_description() {
  if (_impl_.description_ != nullptr) _impl_.description_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void OfferTemplate::clear_created_at() {
  if (_impl_.created_at_ != nullptr) _impl_.created_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
void OfferTemplate::clear_updated_at() {
  if (_impl_.updated_at_ != nullptr) _impl_.updated_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000008u;
}
OfferTemplate::OfferTemplate(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplate)
}
OfferTemplate::OfferTemplate(const OfferTemplate& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  OfferTemplate* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.items_){from._impl_.items_}
    , decltype(_impl_.id_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.description_){nullptr}
    , decltype(_impl_.applicability_rules_){nullptr}
    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.service_type_) {}

    , decltype(_impl_.status_type_) {}
  };

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_id().empty()) {
    _this->_impl_.id_.Set(from._internal_id(), _this->GetArenaForAllocation());
  }
  _impl_.title_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.title_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_title().empty()) {
    _this->_impl_.title_.Set(from._internal_title(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.description_ = new ::PROTOBUF_NAMESPACE_ID::StringValue(*from._impl_.description_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.applicability_rules_ = new ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules(*from._impl_.applicability_rules_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000004u) != 0) {
    _this->_impl_.created_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.created_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000008u) != 0) {
    _this->_impl_.updated_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.updated_at_);
  }
  ::memcpy(&_impl_.service_type_, &from._impl_.service_type_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.status_type_) -
    reinterpret_cast<char*>(&_impl_.service_type_)) + sizeof(_impl_.status_type_));
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplate)
}

inline void OfferTemplate::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.items_){arena}
    , decltype(_impl_.id_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.description_){nullptr}
    , decltype(_impl_.applicability_rules_){nullptr}
    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.service_type_) { 0 }

    , decltype(_impl_.status_type_) { 0 }

  };
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.title_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.title_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

OfferTemplate::~OfferTemplate() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplate)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplate::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_items()->~RepeatedPtrField();
  _impl_.id_.Destroy();
  _impl_.title_.Destroy();
  if (this != internal_default_instance()) delete _impl_.description_;
  if (this != internal_default_instance()) delete _impl_.applicability_rules_;
  if (this != internal_default_instance()) delete _impl_.created_at_;
  if (this != internal_default_instance()) delete _impl_.updated_at_;
}

void OfferTemplate::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplate::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplate)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_mutable_items()->Clear();
  _impl_.id_.ClearToEmpty();
  _impl_.title_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.description_ != nullptr);
      _impl_.description_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.applicability_rules_ != nullptr);
      _impl_.applicability_rules_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      ABSL_DCHECK(_impl_.created_at_ != nullptr);
      _impl_.created_at_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      ABSL_DCHECK(_impl_.updated_at_ != nullptr);
      _impl_.updated_at_->Clear();
    }
  }
  ::memset(&_impl_.service_type_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.status_type_) -
      reinterpret_cast<char*>(&_impl_.service_type_)) + sizeof(_impl_.status_type_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplate::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_service_type(static_cast<::keyapis::subscription::v1::OfferTemplate_ServiceType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // string title = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_title();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.StringValue description = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_description(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_status_type(static_cast<::keyapis::subscription::v1::OfferTemplate_StatusType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_applicability_rules(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_items(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_created_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_updated_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplate::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplate)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1;
  if (!this->_internal_id().empty()) {
    const std::string& _s = this->_internal_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.OfferTemplate.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_service_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        2, this->_internal_service_type(), target);
  }

  // string title = 3 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_title().empty()) {
    const std::string& _s = this->_internal_title();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.OfferTemplate.title");
    target = stream->WriteStringMaybeAliased(3, _s, target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.StringValue description = 4;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::description(this),
        _Internal::description(this).GetCachedSize(), target, stream);
  }

  // .keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
  if (this->_internal_status_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        5, this->_internal_status_type(), target);
  }

  // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(6, _Internal::applicability_rules(this),
        _Internal::applicability_rules(this).GetCachedSize(), target, stream);
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_items_size()); i < n; i++) {
    const auto& repfield = this->_internal_items(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::created_at(this),
        _Internal::created_at(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::updated_at(this),
        _Internal::updated_at(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplate)
  return target;
}

::size_t OfferTemplate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplate)
  ::size_t total_size = 0;

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

  // repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];
  total_size += 1UL * this->_internal_items_size();
  for (const auto& msg : this->_internal_items()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // string id = 1;
  if (!this->_internal_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_id());
  }

  // string title = 3 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_title().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_title());
  }

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    // .google.protobuf.StringValue description = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.description_);
    }

    // .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.applicability_rules_);
    }

    // .google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.created_at_);
    }

    // .google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.updated_at_);
    }

  }
  // .keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_service_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_service_type());
  }

  // .keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
  if (this->_internal_status_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_status_type());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplate::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplate*>(
      &from));
}

void OfferTemplate::MergeFrom(const OfferTemplate& from) {
  OfferTemplate* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplate)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_mutable_items()->MergeFrom(from._internal_items());
  if (!from._internal_id().empty()) {
    _this->_internal_set_id(from._internal_id());
  }
  if (!from._internal_title().empty()) {
    _this->_internal_set_title(from._internal_title());
  }
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_description()->::PROTOBUF_NAMESPACE_ID::StringValue::MergeFrom(
          from._internal_description());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_applicability_rules()->::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules::MergeFrom(
          from._internal_applicability_rules());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_created_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_created_at());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_updated_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_updated_at());
    }
  }
  if (from._internal_service_type() != 0) {
    _this->_internal_set_service_type(from._internal_service_type());
  }
  if (from._internal_status_type() != 0) {
    _this->_internal_set_status_type(from._internal_status_type());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplate::CopyFrom(const OfferTemplate& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplate)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplate::InternalSwap(OfferTemplate* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  _internal_mutable_items()->InternalSwap(other->_internal_mutable_items());
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.title_, lhs_arena,
                                       &other->_impl_.title_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OfferTemplate, _impl_.status_type_)
      + sizeof(OfferTemplate::_impl_.status_type_)
      - PROTOBUF_FIELD_OFFSET(OfferTemplate, _impl_.description_)>(
          reinterpret_cast<char*>(&_impl_.description_),
          reinterpret_cast<char*>(&other->_impl_.description_));
}

std::string OfferTemplate::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplate";
}

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

class OfferTemplateFilter::_Internal {
 public:
  using HasBits = decltype(std::declval<OfferTemplateFilter>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(OfferTemplateFilter, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::StringValue& text(const OfferTemplateFilter* msg);
  static void set_has_text(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& is_external_payment_for_smart_intercom(const OfferTemplateFilter* msg);
  static void set_has_is_external_payment_for_smart_intercom(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& applicability_rules_is_cms_phone(const OfferTemplateFilter* msg);
  static void set_has_applicability_rules_is_cms_phone(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& applicability_rules_is_sip_phone(const OfferTemplateFilter* msg);
  static void set_has_applicability_rules_is_sip_phone(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& applicability_rules_is_video_monitor(const OfferTemplateFilter* msg);
  static void set_has_applicability_rules_is_video_monitor(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& is_call_forwarding_enabled(const OfferTemplateFilter* msg);
  static void set_has_is_call_forwarding_enabled(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::BoolValue& is_digital_way(const OfferTemplateFilter* msg);
  static void set_has_is_digital_way(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::StringValue&
OfferTemplateFilter::_Internal::text(const OfferTemplateFilter* msg) {
  return *msg->_impl_.text_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::is_external_payment_for_smart_intercom(const OfferTemplateFilter* msg) {
  return *msg->_impl_.is_external_payment_for_smart_intercom_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::applicability_rules_is_cms_phone(const OfferTemplateFilter* msg) {
  return *msg->_impl_.applicability_rules_is_cms_phone_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::applicability_rules_is_sip_phone(const OfferTemplateFilter* msg) {
  return *msg->_impl_.applicability_rules_is_sip_phone_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::applicability_rules_is_video_monitor(const OfferTemplateFilter* msg) {
  return *msg->_impl_.applicability_rules_is_video_monitor_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::is_call_forwarding_enabled(const OfferTemplateFilter* msg) {
  return *msg->_impl_.is_call_forwarding_enabled_;
}
const ::PROTOBUF_NAMESPACE_ID::BoolValue&
OfferTemplateFilter::_Internal::is_digital_way(const OfferTemplateFilter* msg) {
  return *msg->_impl_.is_digital_way_;
}
void OfferTemplateFilter::clear_text() {
  if (_impl_.text_ != nullptr) _impl_.text_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void OfferTemplateFilter::clear_is_external_payment_for_smart_intercom() {
  if (_impl_.is_external_payment_for_smart_intercom_ != nullptr) _impl_.is_external_payment_for_smart_intercom_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
void OfferTemplateFilter::clear_applicability_rules_is_cms_phone() {
  if (_impl_.applicability_rules_is_cms_phone_ != nullptr) _impl_.applicability_rules_is_cms_phone_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
void OfferTemplateFilter::clear_applicability_rules_is_sip_phone() {
  if (_impl_.applicability_rules_is_sip_phone_ != nullptr) _impl_.applicability_rules_is_sip_phone_->Clear();
  _impl_._has_bits_[0] &= ~0x00000008u;
}
void OfferTemplateFilter::clear_applicability_rules_is_video_monitor() {
  if (_impl_.applicability_rules_is_video_monitor_ != nullptr) _impl_.applicability_rules_is_video_monitor_->Clear();
  _impl_._has_bits_[0] &= ~0x00000010u;
}
void OfferTemplateFilter::clear_is_call_forwarding_enabled() {
  if (_impl_.is_call_forwarding_enabled_ != nullptr) _impl_.is_call_forwarding_enabled_->Clear();
  _impl_._has_bits_[0] &= ~0x00000020u;
}
void OfferTemplateFilter::clear_is_digital_way() {
  if (_impl_.is_digital_way_ != nullptr) _impl_.is_digital_way_->Clear();
  _impl_._has_bits_[0] &= ~0x00000040u;
}
OfferTemplateFilter::OfferTemplateFilter(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplateFilter)
}
OfferTemplateFilter::OfferTemplateFilter(const OfferTemplateFilter& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  OfferTemplateFilter* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.status_types_) { from._internal_status_types() }
    , /*decltype(_impl_._status_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.service_types_) { from._internal_service_types() }
    , /*decltype(_impl_._service_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.rf_ids_) { from._impl_.rf_ids_ }
    ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.applicability_rules_contract_types_) { from._internal_applicability_rules_contract_types() }
    , /*decltype(_impl_._applicability_rules_contract_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_client_types_) { from._internal_applicability_rules_client_types() }
    , /*decltype(_impl_._applicability_rules_client_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_billing_system_types_) { from._internal_applicability_rules_billing_system_types() }
    , /*decltype(_impl_._applicability_rules_billing_system_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_room_device_contract_types_) { from._internal_applicability_rules_room_device_contract_types() }
    , /*decltype(_impl_._applicability_rules_room_device_contract_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_mobile_app_package_types_) { from._internal_applicability_rules_mobile_app_package_types() }
    , /*decltype(_impl_._applicability_rules_mobile_app_package_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.plan_ids_) { from._impl_.plan_ids_ }
    ,/* _impl_._plan_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.text_){nullptr}
    , decltype(_impl_.is_external_payment_for_smart_intercom_){nullptr}
    , decltype(_impl_.applicability_rules_is_cms_phone_){nullptr}
    , decltype(_impl_.applicability_rules_is_sip_phone_){nullptr}
    , decltype(_impl_.applicability_rules_is_video_monitor_){nullptr}
    , decltype(_impl_.is_call_forwarding_enabled_){nullptr}
    , decltype(_impl_.is_digital_way_){nullptr}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.text_ = new ::PROTOBUF_NAMESPACE_ID::StringValue(*from._impl_.text_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.is_external_payment_for_smart_intercom_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.is_external_payment_for_smart_intercom_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000004u) != 0) {
    _this->_impl_.applicability_rules_is_cms_phone_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.applicability_rules_is_cms_phone_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000008u) != 0) {
    _this->_impl_.applicability_rules_is_sip_phone_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.applicability_rules_is_sip_phone_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000010u) != 0) {
    _this->_impl_.applicability_rules_is_video_monitor_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.applicability_rules_is_video_monitor_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000020u) != 0) {
    _this->_impl_.is_call_forwarding_enabled_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.is_call_forwarding_enabled_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000040u) != 0) {
    _this->_impl_.is_digital_way_ = new ::PROTOBUF_NAMESPACE_ID::BoolValue(*from._impl_.is_digital_way_);
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplateFilter)
}

inline void OfferTemplateFilter::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.status_types_) { arena }
    , /*decltype(_impl_._status_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.service_types_) { arena }
    , /*decltype(_impl_._service_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.rf_ids_) { arena }
    ,/* _impl_._rf_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.applicability_rules_contract_types_) { arena }
    , /*decltype(_impl_._applicability_rules_contract_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_client_types_) { arena }
    , /*decltype(_impl_._applicability_rules_client_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_billing_system_types_) { arena }
    , /*decltype(_impl_._applicability_rules_billing_system_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_room_device_contract_types_) { arena }
    , /*decltype(_impl_._applicability_rules_room_device_contract_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.applicability_rules_mobile_app_package_types_) { arena }
    , /*decltype(_impl_._applicability_rules_mobile_app_package_types_cached_byte_size_)*/ { 0 }

    , decltype(_impl_.plan_ids_) { arena }
    ,/* _impl_._plan_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.text_){nullptr}
    , decltype(_impl_.is_external_payment_for_smart_intercom_){nullptr}
    , decltype(_impl_.applicability_rules_is_cms_phone_){nullptr}
    , decltype(_impl_.applicability_rules_is_sip_phone_){nullptr}
    , decltype(_impl_.applicability_rules_is_video_monitor_){nullptr}
    , decltype(_impl_.is_call_forwarding_enabled_){nullptr}
    , decltype(_impl_.is_digital_way_){nullptr}
  };
}

OfferTemplateFilter::~OfferTemplateFilter() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplateFilter)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplateFilter::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_status_types()->~RepeatedField();
  _internal_mutable_service_types()->~RepeatedField();
  _impl_.rf_ids_.~RepeatedField();
  _internal_mutable_applicability_rules_contract_types()->~RepeatedField();
  _internal_mutable_applicability_rules_client_types()->~RepeatedField();
  _internal_mutable_applicability_rules_billing_system_types()->~RepeatedField();
  _internal_mutable_applicability_rules_room_device_contract_types()->~RepeatedField();
  _internal_mutable_applicability_rules_mobile_app_package_types()->~RepeatedField();
  _impl_.plan_ids_.~RepeatedField();
  if (this != internal_default_instance()) delete _impl_.text_;
  if (this != internal_default_instance()) delete _impl_.is_external_payment_for_smart_intercom_;
  if (this != internal_default_instance()) delete _impl_.applicability_rules_is_cms_phone_;
  if (this != internal_default_instance()) delete _impl_.applicability_rules_is_sip_phone_;
  if (this != internal_default_instance()) delete _impl_.applicability_rules_is_video_monitor_;
  if (this != internal_default_instance()) delete _impl_.is_call_forwarding_enabled_;
  if (this != internal_default_instance()) delete _impl_.is_digital_way_;
}

void OfferTemplateFilter::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplateFilter::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplateFilter)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_mutable_status_types()->Clear();
  _internal_mutable_service_types()->Clear();
  _internal_mutable_rf_ids()->Clear();
  _internal_mutable_applicability_rules_contract_types()->Clear();
  _internal_mutable_applicability_rules_client_types()->Clear();
  _internal_mutable_applicability_rules_billing_system_types()->Clear();
  _internal_mutable_applicability_rules_room_device_contract_types()->Clear();
  _internal_mutable_applicability_rules_mobile_app_package_types()->Clear();
  _internal_mutable_plan_ids()->Clear();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.text_ != nullptr);
      _impl_.text_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.is_external_payment_for_smart_intercom_ != nullptr);
      _impl_.is_external_payment_for_smart_intercom_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      ABSL_DCHECK(_impl_.applicability_rules_is_cms_phone_ != nullptr);
      _impl_.applicability_rules_is_cms_phone_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      ABSL_DCHECK(_impl_.applicability_rules_is_sip_phone_ != nullptr);
      _impl_.applicability_rules_is_sip_phone_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      ABSL_DCHECK(_impl_.applicability_rules_is_video_monitor_ != nullptr);
      _impl_.applicability_rules_is_video_monitor_->Clear();
    }
    if (cached_has_bits & 0x00000020u) {
      ABSL_DCHECK(_impl_.is_call_forwarding_enabled_ != nullptr);
      _impl_.is_call_forwarding_enabled_->Clear();
    }
    if (cached_has_bits & 0x00000040u) {
      ABSL_DCHECK(_impl_.is_digital_way_ != nullptr);
      _impl_.is_digital_way_->Clear();
    }
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplateFilter::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .keyapis.subscription.v1.OfferTemplate.StatusType status_types = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_status_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 8) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_status_types(static_cast<::keyapis::subscription::v1::OfferTemplate_StatusType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ServiceType service_types = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_service_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 16) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_service_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ServiceType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated int32 rf_ids = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_rf_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 24) {
          _internal_add_rf_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.StringValue text = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_text(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType applicability_rules_contract_types = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_applicability_rules_contract_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 40) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_applicability_rules_contract_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_ContractType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType applicability_rules_client_types = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_applicability_rules_client_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 48) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_applicability_rules_client_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_ClientType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType applicability_rules_billing_system_types = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_applicability_rules_billing_system_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 56) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_applicability_rules_billing_system_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_BillingSystemType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue is_external_payment_for_smart_intercom = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_is_external_payment_for_smart_intercom(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue applicability_rules_is_cms_phone = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_applicability_rules_is_cms_phone(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue applicability_rules_is_sip_phone = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_applicability_rules_is_sip_phone(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue applicability_rules_is_video_monitor = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_applicability_rules_is_video_monitor(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType applicability_rules_room_device_contract_types = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 98)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_applicability_rules_room_device_contract_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 96) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_applicability_rules_room_device_contract_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_RoomDeviceContractType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType applicability_rules_mobile_app_package_types = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_applicability_rules_mobile_app_package_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 104) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_add_applicability_rules_mobile_app_package_types(static_cast<::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules_MobileAppPackageType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue is_call_forwarding_enabled = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 114)) {
          ptr = ctx->ParseMessage(_internal_mutable_is_call_forwarding_enabled(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.BoolValue is_digital_way = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 122)) {
          ptr = ctx->ParseMessage(_internal_mutable_is_digital_way(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated int32 plan_ids = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 130)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_plan_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 128) {
          _internal_add_plan_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplateFilter::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplateFilter)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .keyapis.subscription.v1.OfferTemplate.StatusType status_types = 1;
  {
    int byte_size = _impl_._status_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(1, _internal_status_types(),
                                       byte_size, target);
    }
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ServiceType service_types = 2;
  {
    int byte_size = _impl_._service_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(2, _internal_service_types(),
                                       byte_size, target);
    }
  }

  // repeated int32 rf_ids = 3;
  {
    int byte_size = _impl_._rf_ids_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(3, _internal_rf_ids(),
                                                 byte_size, target);
    }
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.StringValue text = 4;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::text(this),
        _Internal::text(this).GetCachedSize(), target, stream);
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType applicability_rules_contract_types = 5;
  {
    int byte_size = _impl_._applicability_rules_contract_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(5, _internal_applicability_rules_contract_types(),
                                       byte_size, target);
    }
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType applicability_rules_client_types = 6;
  {
    int byte_size = _impl_._applicability_rules_client_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(6, _internal_applicability_rules_client_types(),
                                       byte_size, target);
    }
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType applicability_rules_billing_system_types = 7;
  {
    int byte_size = _impl_._applicability_rules_billing_system_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(7, _internal_applicability_rules_billing_system_types(),
                                       byte_size, target);
    }
  }

  // .google.protobuf.BoolValue is_external_payment_for_smart_intercom = 8;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::is_external_payment_for_smart_intercom(this),
        _Internal::is_external_payment_for_smart_intercom(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.BoolValue applicability_rules_is_cms_phone = 9;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::applicability_rules_is_cms_phone(this),
        _Internal::applicability_rules_is_cms_phone(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.BoolValue applicability_rules_is_sip_phone = 10;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::applicability_rules_is_sip_phone(this),
        _Internal::applicability_rules_is_sip_phone(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.BoolValue applicability_rules_is_video_monitor = 11;
  if (cached_has_bits & 0x00000010u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(11, _Internal::applicability_rules_is_video_monitor(this),
        _Internal::applicability_rules_is_video_monitor(this).GetCachedSize(), target, stream);
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType applicability_rules_room_device_contract_types = 12;
  {
    int byte_size = _impl_._applicability_rules_room_device_contract_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(12, _internal_applicability_rules_room_device_contract_types(),
                                       byte_size, target);
    }
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType applicability_rules_mobile_app_package_types = 13;
  {
    int byte_size = _impl_._applicability_rules_mobile_app_package_types_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(13, _internal_applicability_rules_mobile_app_package_types(),
                                       byte_size, target);
    }
  }

  // .google.protobuf.BoolValue is_call_forwarding_enabled = 14;
  if (cached_has_bits & 0x00000020u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(14, _Internal::is_call_forwarding_enabled(this),
        _Internal::is_call_forwarding_enabled(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.BoolValue is_digital_way = 15;
  if (cached_has_bits & 0x00000040u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(15, _Internal::is_digital_way(this),
        _Internal::is_digital_way(this).GetCachedSize(), target, stream);
  }

  // repeated int32 plan_ids = 16;
  {
    int byte_size = _impl_._plan_ids_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(16, _internal_plan_ids(),
                                                 byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplateFilter)
  return target;
}

::size_t OfferTemplateFilter::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplateFilter)
  ::size_t total_size = 0;

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

  // repeated .keyapis.subscription.v1.OfferTemplate.StatusType status_types = 1;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_status_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_status_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._status_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ServiceType service_types = 2;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_service_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_service_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._service_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated int32 rf_ids = 3;
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
        this->_internal_rf_ids())
    ;
    _impl_._rf_ids_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 1 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ContractType applicability_rules_contract_types = 5;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_applicability_rules_contract_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_applicability_rules_contract_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._applicability_rules_contract_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType applicability_rules_client_types = 6;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_applicability_rules_client_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_applicability_rules_client_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._applicability_rules_client_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.BillingSystemType applicability_rules_billing_system_types = 7;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_applicability_rules_billing_system_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_applicability_rules_billing_system_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._applicability_rules_billing_system_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.RoomDeviceContractType applicability_rules_room_device_contract_types = 12;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_applicability_rules_room_device_contract_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_applicability_rules_room_device_contract_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._applicability_rules_room_device_contract_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated .keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.MobileAppPackageType applicability_rules_mobile_app_package_types = 13;
  {
    std::size_t data_size = 0;
    auto count = static_cast<std::size_t>(this->_internal_applicability_rules_mobile_app_package_types_size());

    for (std::size_t i = 0; i < count; ++i) {
      data_size += ::_pbi::WireFormatLite::EnumSize(
          this->_internal_applicability_rules_mobile_app_package_types(static_cast<int>(i)));
    }
    total_size += data_size;
    if (data_size > 0) {
      total_size += 1;
      total_size += ::_pbi::WireFormatLite::Int32Size(
          static_cast<int32_t>(data_size));
    }
    _impl_._applicability_rules_mobile_app_package_types_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
  }

  // repeated int32 plan_ids = 16;
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
        this->_internal_plan_ids())
    ;
    _impl_._plan_ids_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 2 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    // .google.protobuf.StringValue text = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.text_);
    }

    // .google.protobuf.BoolValue is_external_payment_for_smart_intercom = 8;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.is_external_payment_for_smart_intercom_);
    }

    // .google.protobuf.BoolValue applicability_rules_is_cms_phone = 9;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.applicability_rules_is_cms_phone_);
    }

    // .google.protobuf.BoolValue applicability_rules_is_sip_phone = 10;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.applicability_rules_is_sip_phone_);
    }

    // .google.protobuf.BoolValue applicability_rules_is_video_monitor = 11;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.applicability_rules_is_video_monitor_);
    }

    // .google.protobuf.BoolValue is_call_forwarding_enabled = 14;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.is_call_forwarding_enabled_);
    }

    // .google.protobuf.BoolValue is_digital_way = 15;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.is_digital_way_);
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplateFilter::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplateFilter*>(
      &from));
}

void OfferTemplateFilter::MergeFrom(const OfferTemplateFilter& from) {
  OfferTemplateFilter* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplateFilter)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_mutable_status_types()->MergeFrom(from._internal_status_types());
  _this->_internal_mutable_service_types()->MergeFrom(from._internal_service_types());
  _this->_impl_.rf_ids_.MergeFrom(from._impl_.rf_ids_);
  _this->_internal_mutable_applicability_rules_contract_types()->MergeFrom(from._internal_applicability_rules_contract_types());
  _this->_internal_mutable_applicability_rules_client_types()->MergeFrom(from._internal_applicability_rules_client_types());
  _this->_internal_mutable_applicability_rules_billing_system_types()->MergeFrom(from._internal_applicability_rules_billing_system_types());
  _this->_internal_mutable_applicability_rules_room_device_contract_types()->MergeFrom(from._internal_applicability_rules_room_device_contract_types());
  _this->_internal_mutable_applicability_rules_mobile_app_package_types()->MergeFrom(from._internal_applicability_rules_mobile_app_package_types());
  _this->_impl_.plan_ids_.MergeFrom(from._impl_.plan_ids_);
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_text()->::PROTOBUF_NAMESPACE_ID::StringValue::MergeFrom(
          from._internal_text());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_is_external_payment_for_smart_intercom()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_is_external_payment_for_smart_intercom());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_applicability_rules_is_cms_phone()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_applicability_rules_is_cms_phone());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_applicability_rules_is_sip_phone()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_applicability_rules_is_sip_phone());
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_internal_mutable_applicability_rules_is_video_monitor()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_applicability_rules_is_video_monitor());
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_internal_mutable_is_call_forwarding_enabled()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_is_call_forwarding_enabled());
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_internal_mutable_is_digital_way()->::PROTOBUF_NAMESPACE_ID::BoolValue::MergeFrom(
          from._internal_is_digital_way());
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplateFilter::CopyFrom(const OfferTemplateFilter& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplateFilter)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplateFilter::InternalSwap(OfferTemplateFilter* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  _internal_mutable_status_types()->InternalSwap(
      other->_internal_mutable_status_types());
  _internal_mutable_service_types()->InternalSwap(
      other->_internal_mutable_service_types());
  _impl_.rf_ids_.InternalSwap(&other->_impl_.rf_ids_);
  _internal_mutable_applicability_rules_contract_types()->InternalSwap(
      other->_internal_mutable_applicability_rules_contract_types());
  _internal_mutable_applicability_rules_client_types()->InternalSwap(
      other->_internal_mutable_applicability_rules_client_types());
  _internal_mutable_applicability_rules_billing_system_types()->InternalSwap(
      other->_internal_mutable_applicability_rules_billing_system_types());
  _internal_mutable_applicability_rules_room_device_contract_types()->InternalSwap(
      other->_internal_mutable_applicability_rules_room_device_contract_types());
  _internal_mutable_applicability_rules_mobile_app_package_types()->InternalSwap(
      other->_internal_mutable_applicability_rules_mobile_app_package_types());
  _impl_.plan_ids_.InternalSwap(&other->_impl_.plan_ids_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OfferTemplateFilter, _impl_.is_digital_way_)
      + sizeof(OfferTemplateFilter::_impl_.is_digital_way_)
      - PROTOBUF_FIELD_OFFSET(OfferTemplateFilter, _impl_.text_)>(
          reinterpret_cast<char*>(&_impl_.text_),
          reinterpret_cast<char*>(&other->_impl_.text_));
}

std::string OfferTemplateFilter::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplateFilter";
}

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

class OfferTemplatePaging::_Internal {
 public:
};

OfferTemplatePaging::OfferTemplatePaging(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.OfferTemplatePaging)
}
OfferTemplatePaging::OfferTemplatePaging(const OfferTemplatePaging& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.OfferTemplatePaging)
}

inline void OfferTemplatePaging::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.order_by_type_) { 0 }

    , decltype(_impl_.direction_type_) { 0 }

    , decltype(_impl_.limit_) { 0 }

    , decltype(_impl_.offset_) { 0 }

    , /*decltype(_impl_._cached_size_)*/{}
  };
}

OfferTemplatePaging::~OfferTemplatePaging() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.OfferTemplatePaging)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void OfferTemplatePaging::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void OfferTemplatePaging::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void OfferTemplatePaging::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.OfferTemplatePaging)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  ::memset(&_impl_.order_by_type_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.offset_) -
      reinterpret_cast<char*>(&_impl_.order_by_type_)) + sizeof(_impl_.offset_));
  _internal_metadata_.Clear<std::string>();
}

const char* OfferTemplatePaging::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplatePaging.OrderByType order_by_type = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_order_by_type(static_cast<::keyapis::subscription::v1::OfferTemplatePaging_OrderByType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplatePaging.DirectionType direction_type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_direction_type(static_cast<::keyapis::subscription::v1::OfferTemplatePaging_DirectionType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 limit = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 offset = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
          _impl_.offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* OfferTemplatePaging::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.OfferTemplatePaging)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.OfferTemplatePaging.OrderByType order_by_type = 1;
  if (this->_internal_order_by_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        1, this->_internal_order_by_type(), target);
  }

  // .keyapis.subscription.v1.OfferTemplatePaging.DirectionType direction_type = 2;
  if (this->_internal_direction_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        2, this->_internal_direction_type(), target);
  }

  // int32 limit = 3;
  if (this->_internal_limit() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        3, this->_internal_limit(), target);
  }

  // int32 offset = 4;
  if (this->_internal_offset() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        4, this->_internal_offset(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.OfferTemplatePaging)
  return target;
}

::size_t OfferTemplatePaging::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.OfferTemplatePaging)
  ::size_t total_size = 0;

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

  // .keyapis.subscription.v1.OfferTemplatePaging.OrderByType order_by_type = 1;
  if (this->_internal_order_by_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_order_by_type());
  }

  // .keyapis.subscription.v1.OfferTemplatePaging.DirectionType direction_type = 2;
  if (this->_internal_direction_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_direction_type());
  }

  // int32 limit = 3;
  if (this->_internal_limit() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_limit());
  }

  // int32 offset = 4;
  if (this->_internal_offset() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_offset());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OfferTemplatePaging::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const OfferTemplatePaging*>(
      &from));
}

void OfferTemplatePaging::MergeFrom(const OfferTemplatePaging& from) {
  OfferTemplatePaging* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.OfferTemplatePaging)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_order_by_type() != 0) {
    _this->_internal_set_order_by_type(from._internal_order_by_type());
  }
  if (from._internal_direction_type() != 0) {
    _this->_internal_set_direction_type(from._internal_direction_type());
  }
  if (from._internal_limit() != 0) {
    _this->_internal_set_limit(from._internal_limit());
  }
  if (from._internal_offset() != 0) {
    _this->_internal_set_offset(from._internal_offset());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void OfferTemplatePaging::CopyFrom(const OfferTemplatePaging& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.OfferTemplatePaging)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void OfferTemplatePaging::InternalSwap(OfferTemplatePaging* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OfferTemplatePaging, _impl_.offset_)
      + sizeof(OfferTemplatePaging::_impl_.offset_)
      - PROTOBUF_FIELD_OFFSET(OfferTemplatePaging, _impl_.order_by_type_)>(
          reinterpret_cast<char*>(&_impl_.order_by_type_),
          reinterpret_cast<char*>(&other->_impl_.order_by_type_));
}

std::string OfferTemplatePaging::GetTypeName() const {
  return "keyapis.subscription.v1.OfferTemplatePaging";
}

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

class GetOfferTemplateRequest::_Internal {
 public:
};

GetOfferTemplateRequest::GetOfferTemplateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateRequest)
}
GetOfferTemplateRequest::GetOfferTemplateRequest(const GetOfferTemplateRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_id().empty()) {
    _this->_impl_.id_.Set(from._internal_id(), _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateRequest)
}

inline void GetOfferTemplateRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

GetOfferTemplateRequest::~GetOfferTemplateRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.id_.Destroy();
}

void GetOfferTemplateRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.id_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    const std::string& _s = this->_internal_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.GetOfferTemplateRequest.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateRequest)
  return target;
}

::size_t GetOfferTemplateRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateRequest)
  ::size_t total_size = 0;

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

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_id());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateRequest*>(
      &from));
}

void GetOfferTemplateRequest::MergeFrom(const GetOfferTemplateRequest& from) {
  GetOfferTemplateRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_id().empty()) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateRequest::CopyFrom(const GetOfferTemplateRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateRequest::InternalSwap(GetOfferTemplateRequest* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
}

std::string GetOfferTemplateRequest::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateRequest";
}

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

class GetOfferTemplateResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const GetOfferTemplateResponse* msg);
};

const ::keyapis::subscription::v1::OfferTemplate&
GetOfferTemplateResponse::_Internal::data(const GetOfferTemplateResponse* msg) {
  return *msg->_impl_.type_.data_;
}
void GetOfferTemplateResponse::set_allocated_data(::keyapis::subscription::v1::OfferTemplate* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateResponse.data)
}
GetOfferTemplateResponse::GetOfferTemplateResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateResponse)
}
GetOfferTemplateResponse::GetOfferTemplateResponse(const GetOfferTemplateResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateResponse)
}

inline void GetOfferTemplateResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

GetOfferTemplateResponse::~GetOfferTemplateResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void GetOfferTemplateResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetOfferTemplateResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.OfferTemplate data = 1;
  if (type_case() == kData) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::data(this),
        _Internal::data(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateResponse)
  return target;
}

::size_t GetOfferTemplateResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // .keyapis.subscription.v1.OfferTemplate data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateResponse*>(
      &from));
}

void GetOfferTemplateResponse::MergeFrom(const GetOfferTemplateResponse& from) {
  GetOfferTemplateResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateResponse::CopyFrom(const GetOfferTemplateResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateResponse::InternalSwap(GetOfferTemplateResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateResponse::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateResponse";
}

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

class GetOfferTemplateListRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<GetOfferTemplateListRequest>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(GetOfferTemplateListRequest, _impl_._has_bits_);
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateListRequest, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplateFilter& filter(const GetOfferTemplateListRequest* msg);
  static void set_has_filter(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::keyapis::subscription::v1::OfferTemplatePaging& paging(const GetOfferTemplateListRequest* msg);
};

const ::keyapis::subscription::v1::OfferTemplateFilter&
GetOfferTemplateListRequest::_Internal::filter(const GetOfferTemplateListRequest* msg) {
  return *msg->_impl_.filter_;
}
const ::keyapis::subscription::v1::OfferTemplatePaging&
GetOfferTemplateListRequest::_Internal::paging(const GetOfferTemplateListRequest* msg) {
  return *msg->_impl_.pagination_.paging_;
}
void GetOfferTemplateListRequest::set_allocated_paging(::keyapis::subscription::v1::OfferTemplatePaging* paging) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_pagination();
  if (paging) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(paging);
    if (message_arena != submessage_arena) {
      paging = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, paging, submessage_arena);
    }
    set_has_paging();
    _impl_.pagination_.paging_ = paging;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateListRequest.paging)
}
GetOfferTemplateListRequest::GetOfferTemplateListRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateListRequest)
}
GetOfferTemplateListRequest::GetOfferTemplateListRequest(const GetOfferTemplateListRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateListRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.filter_){nullptr}
    , decltype(_impl_.pagination_){}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.filter_ = new ::keyapis::subscription::v1::OfferTemplateFilter(*from._impl_.filter_);
  }
  clear_has_pagination();
  switch (from.pagination_case()) {
    case kPaging: {
      _this->_internal_mutable_paging()->::keyapis::subscription::v1::OfferTemplatePaging::MergeFrom(
          from._internal_paging());
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateListRequest)
}

inline void GetOfferTemplateListRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.filter_){nullptr}
    , decltype(_impl_.pagination_){}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_pagination();
}

GetOfferTemplateListRequest::~GetOfferTemplateListRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateListRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateListRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.filter_;
  if (has_pagination()) {
    clear_pagination();
  }
}

void GetOfferTemplateListRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateListRequest::clear_pagination() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  switch (pagination_case()) {
    case kPaging: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.pagination_.paging_;
      }
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = PAGINATION_NOT_SET;
}


void GetOfferTemplateListRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.filter_ != nullptr);
    _impl_.filter_->Clear();
  }
  clear_pagination();
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateListRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_filter(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplatePaging paging = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_paging(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateListRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::filter(this),
        _Internal::filter(this).GetCachedSize(), target, stream);
  }

  // .keyapis.subscription.v1.OfferTemplatePaging paging = 2;
  if (pagination_case() == kPaging) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::paging(this),
        _Internal::paging(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateListRequest)
  return target;
}

::size_t GetOfferTemplateListRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  ::size_t total_size = 0;

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

  // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.filter_);
  }

  switch (pagination_case()) {
    // .keyapis.subscription.v1.OfferTemplatePaging paging = 2;
    case kPaging: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.pagination_.paging_);
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateListRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateListRequest*>(
      &from));
}

void GetOfferTemplateListRequest::MergeFrom(const GetOfferTemplateListRequest& from) {
  GetOfferTemplateListRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_filter()->::keyapis::subscription::v1::OfferTemplateFilter::MergeFrom(
        from._internal_filter());
  }
  switch (from.pagination_case()) {
    case kPaging: {
      _this->_internal_mutable_paging()->::keyapis::subscription::v1::OfferTemplatePaging::MergeFrom(
          from._internal_paging());
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateListRequest::CopyFrom(const GetOfferTemplateListRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateListRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateListRequest::InternalSwap(GetOfferTemplateListRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.filter_, other->_impl_.filter_);
  swap(_impl_.pagination_, other->_impl_.pagination_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateListRequest::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateListRequest";
}

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

class GetOfferTemplateListResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateListResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::ValidationError& validation(const GetOfferTemplateListResponse_Error* msg);
};

const ::keyapis::subscription::v1::ValidationError&
GetOfferTemplateListResponse_Error::_Internal::validation(const GetOfferTemplateListResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetOfferTemplateListResponse_Error::set_allocated_validation(::keyapis::subscription::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(validation);
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateListResponse.Error.validation)
}
GetOfferTemplateListResponse_Error::GetOfferTemplateListResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
}
GetOfferTemplateListResponse_Error::GetOfferTemplateListResponse_Error(const GetOfferTemplateListResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateListResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
}

inline void GetOfferTemplateListResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

GetOfferTemplateListResponse_Error::~GetOfferTemplateListResponse_Error() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateListResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void GetOfferTemplateListResponse_Error::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateListResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void GetOfferTemplateListResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateListResponse_Error::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateListResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.ValidationError validation = 1;
  if (reason_case() == kValidation) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::validation(this),
        _Internal::validation(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  return target;
}

::size_t GetOfferTemplateListResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateListResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateListResponse_Error*>(
      &from));
}

void GetOfferTemplateListResponse_Error::MergeFrom(const GetOfferTemplateListResponse_Error& from) {
  GetOfferTemplateListResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateListResponse_Error::CopyFrom(const GetOfferTemplateListResponse_Error& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateListResponse.Error)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateListResponse_Error::InternalSwap(GetOfferTemplateListResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateListResponse_Error::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateListResponse.Error";
}

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

class GetOfferTemplateListResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateListResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const GetOfferTemplateListResponse* msg);
  static const ::keyapis::subscription::v1::GetOfferTemplateListResponse_Error& error(const GetOfferTemplateListResponse* msg);
};

const ::keyapis::subscription::v1::OfferTemplate&
GetOfferTemplateListResponse::_Internal::data(const GetOfferTemplateListResponse* msg) {
  return *msg->_impl_.type_.data_;
}
const ::keyapis::subscription::v1::GetOfferTemplateListResponse_Error&
GetOfferTemplateListResponse::_Internal::error(const GetOfferTemplateListResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void GetOfferTemplateListResponse::set_allocated_data(::keyapis::subscription::v1::OfferTemplate* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateListResponse.data)
}
void GetOfferTemplateListResponse::set_allocated_error(::keyapis::subscription::v1::GetOfferTemplateListResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateListResponse.error)
}
GetOfferTemplateListResponse::GetOfferTemplateListResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateListResponse)
}
GetOfferTemplateListResponse::GetOfferTemplateListResponse(const GetOfferTemplateListResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateListResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateListResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateListResponse)
}

inline void GetOfferTemplateListResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

GetOfferTemplateListResponse::~GetOfferTemplateListResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateListResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateListResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void GetOfferTemplateListResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateListResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetOfferTemplateListResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateListResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.GetOfferTemplateListResponse.Error error = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateListResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kData: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::data(this),
          _Internal::data(this).GetCachedSize(), target, stream);
      break;
    }
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateListResponse)
  return target;
}

::size_t GetOfferTemplateListResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // .keyapis.subscription.v1.OfferTemplate data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      break;
    }
    // .keyapis.subscription.v1.GetOfferTemplateListResponse.Error error = 2;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateListResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateListResponse*>(
      &from));
}

void GetOfferTemplateListResponse::MergeFrom(const GetOfferTemplateListResponse& from) {
  GetOfferTemplateListResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateListResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateListResponse::CopyFrom(const GetOfferTemplateListResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateListResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateListResponse::InternalSwap(GetOfferTemplateListResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateListResponse::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateListResponse";
}

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

class GetOfferTemplateByOrponListRequest::_Internal {
 public:
};

GetOfferTemplateByOrponListRequest::GetOfferTemplateByOrponListRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
}
GetOfferTemplateByOrponListRequest::GetOfferTemplateByOrponListRequest(const GetOfferTemplateByOrponListRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
}

inline void GetOfferTemplateByOrponListRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.orpon_) { ::int64_t{0} }

    , /*decltype(_impl_._cached_size_)*/{}
  };
}

GetOfferTemplateByOrponListRequest::~GetOfferTemplateByOrponListRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponListRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void GetOfferTemplateByOrponListRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponListRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.orpon_ = ::int64_t{0};
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponListRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.orpon_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponListRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(
        1, this->_internal_orpon(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  return target;
}

::size_t GetOfferTemplateByOrponListRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  ::size_t total_size = 0;

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

  // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
        this->_internal_orpon());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponListRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponListRequest*>(
      &from));
}

void GetOfferTemplateByOrponListRequest::MergeFrom(const GetOfferTemplateByOrponListRequest& from) {
  GetOfferTemplateByOrponListRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_orpon() != 0) {
    _this->_internal_set_orpon(from._internal_orpon());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponListRequest::CopyFrom(const GetOfferTemplateByOrponListRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponListRequest::InternalSwap(GetOfferTemplateByOrponListRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);

  swap(_impl_.orpon_, other->_impl_.orpon_);
}

std::string GetOfferTemplateByOrponListRequest::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponListRequest";
}

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

class GetOfferTemplateByOrponListResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::ValidationError& validation(const GetOfferTemplateByOrponListResponse_Error* msg);
};

const ::keyapis::subscription::v1::ValidationError&
GetOfferTemplateByOrponListResponse_Error::_Internal::validation(const GetOfferTemplateByOrponListResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetOfferTemplateByOrponListResponse_Error::set_allocated_validation(::keyapis::subscription::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(validation);
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error.validation)
}
GetOfferTemplateByOrponListResponse_Error::GetOfferTemplateByOrponListResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
}
GetOfferTemplateByOrponListResponse_Error::GetOfferTemplateByOrponListResponse_Error(const GetOfferTemplateByOrponListResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateByOrponListResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
}

inline void GetOfferTemplateByOrponListResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

GetOfferTemplateByOrponListResponse_Error::~GetOfferTemplateByOrponListResponse_Error() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponListResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void GetOfferTemplateByOrponListResponse_Error::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponListResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void GetOfferTemplateByOrponListResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponListResponse_Error::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponListResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.ValidationError validation = 1;
  if (reason_case() == kValidation) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::validation(this),
        _Internal::validation(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  return target;
}

::size_t GetOfferTemplateByOrponListResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponListResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponListResponse_Error*>(
      &from));
}

void GetOfferTemplateByOrponListResponse_Error::MergeFrom(const GetOfferTemplateByOrponListResponse_Error& from) {
  GetOfferTemplateByOrponListResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponListResponse_Error::CopyFrom(const GetOfferTemplateByOrponListResponse_Error& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponListResponse_Error::InternalSwap(GetOfferTemplateByOrponListResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateByOrponListResponse_Error::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error";
}

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

class GetOfferTemplateByOrponListResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const GetOfferTemplateByOrponListResponse* msg);
  static const ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error& error(const GetOfferTemplateByOrponListResponse* msg);
};

const ::keyapis::subscription::v1::OfferTemplate&
GetOfferTemplateByOrponListResponse::_Internal::data(const GetOfferTemplateByOrponListResponse* msg) {
  return *msg->_impl_.type_.data_;
}
const ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error&
GetOfferTemplateByOrponListResponse::_Internal::error(const GetOfferTemplateByOrponListResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void GetOfferTemplateByOrponListResponse::set_allocated_data(::keyapis::subscription::v1::OfferTemplate* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.data)
}
void GetOfferTemplateByOrponListResponse::set_allocated_error(::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.error)
}
GetOfferTemplateByOrponListResponse::GetOfferTemplateByOrponListResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
}
GetOfferTemplateByOrponListResponse::GetOfferTemplateByOrponListResponse(const GetOfferTemplateByOrponListResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateByOrponListResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
}

inline void GetOfferTemplateByOrponListResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

GetOfferTemplateByOrponListResponse::~GetOfferTemplateByOrponListResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponListResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void GetOfferTemplateByOrponListResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponListResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetOfferTemplateByOrponListResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponListResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error error = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponListResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kData: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::data(this),
          _Internal::data(this).GetCachedSize(), target, stream);
      break;
    }
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  return target;
}

::size_t GetOfferTemplateByOrponListResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // .keyapis.subscription.v1.OfferTemplate data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      break;
    }
    // .keyapis.subscription.v1.GetOfferTemplateByOrponListResponse.Error error = 2;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponListResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponListResponse*>(
      &from));
}

void GetOfferTemplateByOrponListResponse::MergeFrom(const GetOfferTemplateByOrponListResponse& from) {
  GetOfferTemplateByOrponListResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponListResponse::CopyFrom(const GetOfferTemplateByOrponListResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponListResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponListResponse::InternalSwap(GetOfferTemplateByOrponListResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateByOrponListResponse::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponListResponse";
}

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

class GetOfferTemplateCountRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<GetOfferTemplateCountRequest>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(GetOfferTemplateCountRequest, _impl_._has_bits_);
  static const ::keyapis::subscription::v1::OfferTemplateFilter& filter(const GetOfferTemplateCountRequest* msg);
  static void set_has_filter(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::keyapis::subscription::v1::OfferTemplateFilter&
GetOfferTemplateCountRequest::_Internal::filter(const GetOfferTemplateCountRequest* msg) {
  return *msg->_impl_.filter_;
}
GetOfferTemplateCountRequest::GetOfferTemplateCountRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateCountRequest)
}
GetOfferTemplateCountRequest::GetOfferTemplateCountRequest(const GetOfferTemplateCountRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateCountRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.filter_){nullptr}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.filter_ = new ::keyapis::subscription::v1::OfferTemplateFilter(*from._impl_.filter_);
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateCountRequest)
}

inline void GetOfferTemplateCountRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.filter_){nullptr}
  };
}

GetOfferTemplateCountRequest::~GetOfferTemplateCountRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateCountRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.filter_;
}

void GetOfferTemplateCountRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateCountRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.filter_ != nullptr);
    _impl_.filter_->Clear();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateCountRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_filter(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateCountRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::filter(this),
        _Internal::filter(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  return target;
}

::size_t GetOfferTemplateCountRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  ::size_t total_size = 0;

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

  // .keyapis.subscription.v1.OfferTemplateFilter filter = 1;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.filter_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateCountRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateCountRequest*>(
      &from));
}

void GetOfferTemplateCountRequest::MergeFrom(const GetOfferTemplateCountRequest& from) {
  GetOfferTemplateCountRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_filter()->::keyapis::subscription::v1::OfferTemplateFilter::MergeFrom(
        from._internal_filter());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateCountRequest::CopyFrom(const GetOfferTemplateCountRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateCountRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateCountRequest::InternalSwap(GetOfferTemplateCountRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.filter_, other->_impl_.filter_);
}

std::string GetOfferTemplateCountRequest::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateCountRequest";
}

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

class GetOfferTemplateCountResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::ValidationError& validation(const GetOfferTemplateCountResponse_Error* msg);
};

const ::keyapis::subscription::v1::ValidationError&
GetOfferTemplateCountResponse_Error::_Internal::validation(const GetOfferTemplateCountResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetOfferTemplateCountResponse_Error::set_allocated_validation(::keyapis::subscription::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(validation);
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error.validation)
}
GetOfferTemplateCountResponse_Error::GetOfferTemplateCountResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
}
GetOfferTemplateCountResponse_Error::GetOfferTemplateCountResponse_Error(const GetOfferTemplateCountResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateCountResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
}

inline void GetOfferTemplateCountResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

GetOfferTemplateCountResponse_Error::~GetOfferTemplateCountResponse_Error() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateCountResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void GetOfferTemplateCountResponse_Error::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateCountResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void GetOfferTemplateCountResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateCountResponse_Error::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateCountResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.ValidationError validation = 1;
  if (reason_case() == kValidation) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::validation(this),
        _Internal::validation(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  return target;
}

::size_t GetOfferTemplateCountResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateCountResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateCountResponse_Error*>(
      &from));
}

void GetOfferTemplateCountResponse_Error::MergeFrom(const GetOfferTemplateCountResponse_Error& from) {
  GetOfferTemplateCountResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateCountResponse_Error::CopyFrom(const GetOfferTemplateCountResponse_Error& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateCountResponse.Error)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateCountResponse_Error::InternalSwap(GetOfferTemplateCountResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateCountResponse_Error::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateCountResponse.Error";
}

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

class GetOfferTemplateCountResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateCountResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error& error(const GetOfferTemplateCountResponse* msg);
};

const ::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error&
GetOfferTemplateCountResponse::_Internal::error(const GetOfferTemplateCountResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void GetOfferTemplateCountResponse::set_allocated_error(::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateCountResponse.error)
}
GetOfferTemplateCountResponse::GetOfferTemplateCountResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateCountResponse)
}
GetOfferTemplateCountResponse::GetOfferTemplateCountResponse(const GetOfferTemplateCountResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateCountResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_set_data(from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateCountResponse)
}

inline void GetOfferTemplateCountResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

GetOfferTemplateCountResponse::~GetOfferTemplateCountResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateCountResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void GetOfferTemplateCountResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateCountResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  switch (type_case()) {
    case kData: {
      // No need to clear
      break;
    }
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetOfferTemplateCountResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateCountResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // int32 data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _internal_set_data(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.GetOfferTemplateCountResponse.Error error = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateCountResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kData: {
      target = stream->EnsureSpace(target);
      target = ::_pbi::WireFormatLite::WriteInt32ToArray(
          1, this->_internal_data(), target);
      break;
    }
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  return target;
}

::size_t GetOfferTemplateCountResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // int32 data = 1;
    case kData: {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this->_internal_data());
      break;
    }
    // .keyapis.subscription.v1.GetOfferTemplateCountResponse.Error error = 2;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateCountResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateCountResponse*>(
      &from));
}

void GetOfferTemplateCountResponse::MergeFrom(const GetOfferTemplateCountResponse& from) {
  GetOfferTemplateCountResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_set_data(from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateCountResponse::CopyFrom(const GetOfferTemplateCountResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateCountResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateCountResponse::InternalSwap(GetOfferTemplateCountResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateCountResponse::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateCountResponse";
}

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

class GetOfferTemplateByOrponCountRequest::_Internal {
 public:
};

GetOfferTemplateByOrponCountRequest::GetOfferTemplateByOrponCountRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
}
GetOfferTemplateByOrponCountRequest::GetOfferTemplateByOrponCountRequest(const GetOfferTemplateByOrponCountRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
}

inline void GetOfferTemplateByOrponCountRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.orpon_) { ::int64_t{0} }

    , /*decltype(_impl_._cached_size_)*/{}
  };
}

GetOfferTemplateByOrponCountRequest::~GetOfferTemplateByOrponCountRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponCountRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void GetOfferTemplateByOrponCountRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponCountRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.orpon_ = ::int64_t{0};
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponCountRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.orpon_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponCountRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(
        1, this->_internal_orpon(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  return target;
}

::size_t GetOfferTemplateByOrponCountRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  ::size_t total_size = 0;

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

  // int64 orpon = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
        this->_internal_orpon());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponCountRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponCountRequest*>(
      &from));
}

void GetOfferTemplateByOrponCountRequest::MergeFrom(const GetOfferTemplateByOrponCountRequest& from) {
  GetOfferTemplateByOrponCountRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_orpon() != 0) {
    _this->_internal_set_orpon(from._internal_orpon());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponCountRequest::CopyFrom(const GetOfferTemplateByOrponCountRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponCountRequest::InternalSwap(GetOfferTemplateByOrponCountRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);

  swap(_impl_.orpon_, other->_impl_.orpon_);
}

std::string GetOfferTemplateByOrponCountRequest::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponCountRequest";
}

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

class GetOfferTemplateByOrponCountResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::ValidationError& validation(const GetOfferTemplateByOrponCountResponse_Error* msg);
};

const ::keyapis::subscription::v1::ValidationError&
GetOfferTemplateByOrponCountResponse_Error::_Internal::validation(const GetOfferTemplateByOrponCountResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetOfferTemplateByOrponCountResponse_Error::set_allocated_validation(::keyapis::subscription::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(validation);
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error.validation)
}
GetOfferTemplateByOrponCountResponse_Error::GetOfferTemplateByOrponCountResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
}
GetOfferTemplateByOrponCountResponse_Error::GetOfferTemplateByOrponCountResponse_Error(const GetOfferTemplateByOrponCountResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateByOrponCountResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
}

inline void GetOfferTemplateByOrponCountResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

GetOfferTemplateByOrponCountResponse_Error::~GetOfferTemplateByOrponCountResponse_Error() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponCountResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void GetOfferTemplateByOrponCountResponse_Error::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponCountResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void GetOfferTemplateByOrponCountResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponCountResponse_Error::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponCountResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.ValidationError validation = 1;
  if (reason_case() == kValidation) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::validation(this),
        _Internal::validation(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  return target;
}

::size_t GetOfferTemplateByOrponCountResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponCountResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponCountResponse_Error*>(
      &from));
}

void GetOfferTemplateByOrponCountResponse_Error::MergeFrom(const GetOfferTemplateByOrponCountResponse_Error& from) {
  GetOfferTemplateByOrponCountResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponCountResponse_Error::CopyFrom(const GetOfferTemplateByOrponCountResponse_Error& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponCountResponse_Error::InternalSwap(GetOfferTemplateByOrponCountResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateByOrponCountResponse_Error::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error";
}

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

class GetOfferTemplateByOrponCountResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error& error(const GetOfferTemplateByOrponCountResponse* msg);
};

const ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error&
GetOfferTemplateByOrponCountResponse::_Internal::error(const GetOfferTemplateByOrponCountResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void GetOfferTemplateByOrponCountResponse::set_allocated_error(::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.error)
}
GetOfferTemplateByOrponCountResponse::GetOfferTemplateByOrponCountResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
}
GetOfferTemplateByOrponCountResponse::GetOfferTemplateByOrponCountResponse(const GetOfferTemplateByOrponCountResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetOfferTemplateByOrponCountResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_set_data(from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
}

inline void GetOfferTemplateByOrponCountResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

GetOfferTemplateByOrponCountResponse::~GetOfferTemplateByOrponCountResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GetOfferTemplateByOrponCountResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void GetOfferTemplateByOrponCountResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GetOfferTemplateByOrponCountResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  switch (type_case()) {
    case kData: {
      // No need to clear
      break;
    }
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetOfferTemplateByOrponCountResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* GetOfferTemplateByOrponCountResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // int32 data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _internal_set_data(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error error = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* GetOfferTemplateByOrponCountResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kData: {
      target = stream->EnsureSpace(target);
      target = ::_pbi::WireFormatLite::WriteInt32ToArray(
          1, this->_internal_data(), target);
      break;
    }
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  return target;
}

::size_t GetOfferTemplateByOrponCountResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // int32 data = 1;
    case kData: {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this->_internal_data());
      break;
    }
    // .keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse.Error error = 2;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GetOfferTemplateByOrponCountResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetOfferTemplateByOrponCountResponse*>(
      &from));
}

void GetOfferTemplateByOrponCountResponse::MergeFrom(const GetOfferTemplateByOrponCountResponse& from) {
  GetOfferTemplateByOrponCountResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_set_data(from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GetOfferTemplateByOrponCountResponse::CopyFrom(const GetOfferTemplateByOrponCountResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void GetOfferTemplateByOrponCountResponse::InternalSwap(GetOfferTemplateByOrponCountResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string GetOfferTemplateByOrponCountResponse::GetTypeName() const {
  return "keyapis.subscription.v1.GetOfferTemplateByOrponCountResponse";
}

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

class PostOfferTemplateRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<PostOfferTemplateRequest>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(PostOfferTemplateRequest, _impl_._has_bits_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const PostOfferTemplateRequest* msg);
  static void set_has_data(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::keyapis::subscription::v1::OfferTemplate&
PostOfferTemplateRequest::_Internal::data(const PostOfferTemplateRequest* msg) {
  return *msg->_impl_.data_;
}
PostOfferTemplateRequest::PostOfferTemplateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PostOfferTemplateRequest)
}
PostOfferTemplateRequest::PostOfferTemplateRequest(const PostOfferTemplateRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostOfferTemplateRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.data_){nullptr}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.data_ = new ::keyapis::subscription::v1::OfferTemplate(*from._impl_.data_);
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PostOfferTemplateRequest)
}

inline void PostOfferTemplateRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.data_){nullptr}
  };
}

PostOfferTemplateRequest::~PostOfferTemplateRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PostOfferTemplateRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PostOfferTemplateRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.data_;
}

void PostOfferTemplateRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PostOfferTemplateRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PostOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.data_ != nullptr);
    _impl_.data_->Clear();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PostOfferTemplateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PostOfferTemplateRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PostOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.subscription.v1.OfferTemplate data = 1 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::data(this),
        _Internal::data(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PostOfferTemplateRequest)
  return target;
}

::size_t PostOfferTemplateRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PostOfferTemplateRequest)
  ::size_t total_size = 0;

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

  // .keyapis.subscription.v1.OfferTemplate data = 1 [(.google.api.field_behavior) = REQUIRED];
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.data_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PostOfferTemplateRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostOfferTemplateRequest*>(
      &from));
}

void PostOfferTemplateRequest::MergeFrom(const PostOfferTemplateRequest& from) {
  PostOfferTemplateRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PostOfferTemplateRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
        from._internal_data());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PostOfferTemplateRequest::CopyFrom(const PostOfferTemplateRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PostOfferTemplateRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PostOfferTemplateRequest::InternalSwap(PostOfferTemplateRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.data_, other->_impl_.data_);
}

std::string PostOfferTemplateRequest::GetTypeName() const {
  return "keyapis.subscription.v1.PostOfferTemplateRequest";
}

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

class PostOfferTemplateResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::PostOfferTemplateResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::ValidationError& validation(const PostOfferTemplateResponse_Error* msg);
  static const ::keyapis::subscription::v1::OfferTemplate_SavingError& saving(const PostOfferTemplateResponse_Error* msg);
};

const ::keyapis::subscription::v1::ValidationError&
PostOfferTemplateResponse_Error::_Internal::validation(const PostOfferTemplateResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
const ::keyapis::subscription::v1::OfferTemplate_SavingError&
PostOfferTemplateResponse_Error::_Internal::saving(const PostOfferTemplateResponse_Error* msg) {
  return *msg->_impl_.reason_.saving_;
}
void PostOfferTemplateResponse_Error::set_allocated_validation(::keyapis::subscription::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(validation);
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.PostOfferTemplateResponse.Error.validation)
}
void PostOfferTemplateResponse_Error::set_allocated_saving(::keyapis::subscription::v1::OfferTemplate_SavingError* saving) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (saving) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(saving);
    if (message_arena != submessage_arena) {
      saving = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, saving, submessage_arena);
    }
    set_has_saving();
    _impl_.reason_.saving_ = saving;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.PostOfferTemplateResponse.Error.saving)
}
PostOfferTemplateResponse_Error::PostOfferTemplateResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
}
PostOfferTemplateResponse_Error::PostOfferTemplateResponse_Error(const PostOfferTemplateResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostOfferTemplateResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::keyapis::subscription::v1::OfferTemplate_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
}

inline void PostOfferTemplateResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

PostOfferTemplateResponse_Error::~PostOfferTemplateResponse_Error() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PostOfferTemplateResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

void PostOfferTemplateResponse_Error::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PostOfferTemplateResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case kSaving: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.saving_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void PostOfferTemplateResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_reason();
  _internal_metadata_.Clear<std::string>();
}

const char* PostOfferTemplateResponse_Error::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.OfferTemplate.SavingError saving = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_saving(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PostOfferTemplateResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (reason_case()) {
    case kValidation: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::validation(this),
          _Internal::validation(this).GetCachedSize(), target, stream);
      break;
    }
    case kSaving: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::saving(this),
          _Internal::saving(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  return target;
}

::size_t PostOfferTemplateResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.subscription.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    // .keyapis.subscription.v1.OfferTemplate.SavingError saving = 2;
    case kSaving: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.saving_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PostOfferTemplateResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostOfferTemplateResponse_Error*>(
      &from));
}

void PostOfferTemplateResponse_Error::MergeFrom(const PostOfferTemplateResponse_Error& from) {
  PostOfferTemplateResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::subscription::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::keyapis::subscription::v1::OfferTemplate_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PostOfferTemplateResponse_Error::CopyFrom(const PostOfferTemplateResponse_Error& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PostOfferTemplateResponse.Error)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PostOfferTemplateResponse_Error::InternalSwap(PostOfferTemplateResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string PostOfferTemplateResponse_Error::GetTypeName() const {
  return "keyapis.subscription.v1.PostOfferTemplateResponse.Error";
}

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

class PostOfferTemplateResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::PostOfferTemplateResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const PostOfferTemplateResponse* msg);
  static const ::keyapis::subscription::v1::PostOfferTemplateResponse_Error& error(const PostOfferTemplateResponse* msg);
};

const ::keyapis::subscription::v1::OfferTemplate&
PostOfferTemplateResponse::_Internal::data(const PostOfferTemplateResponse* msg) {
  return *msg->_impl_.type_.data_;
}
const ::keyapis::subscription::v1::PostOfferTemplateResponse_Error&
PostOfferTemplateResponse::_Internal::error(const PostOfferTemplateResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void PostOfferTemplateResponse::set_allocated_data(::keyapis::subscription::v1::OfferTemplate* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.PostOfferTemplateResponse.data)
}
void PostOfferTemplateResponse::set_allocated_error(::keyapis::subscription::v1::PostOfferTemplateResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.PostOfferTemplateResponse.error)
}
PostOfferTemplateResponse::PostOfferTemplateResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PostOfferTemplateResponse)
}
PostOfferTemplateResponse::PostOfferTemplateResponse(const PostOfferTemplateResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostOfferTemplateResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::PostOfferTemplateResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PostOfferTemplateResponse)
}

inline void PostOfferTemplateResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

PostOfferTemplateResponse::~PostOfferTemplateResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PostOfferTemplateResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PostOfferTemplateResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void PostOfferTemplateResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PostOfferTemplateResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void PostOfferTemplateResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* PostOfferTemplateResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.PostOfferTemplateResponse.Error error = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PostOfferTemplateResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kData: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::data(this),
          _Internal::data(this).GetCachedSize(), target, stream);
      break;
    }
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PostOfferTemplateResponse)
  return target;
}

::size_t PostOfferTemplateResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // .keyapis.subscription.v1.OfferTemplate data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      break;
    }
    // .keyapis.subscription.v1.PostOfferTemplateResponse.Error error = 2;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PostOfferTemplateResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostOfferTemplateResponse*>(
      &from));
}

void PostOfferTemplateResponse::MergeFrom(const PostOfferTemplateResponse& from) {
  PostOfferTemplateResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case kError: {
      _this->_internal_mutable_error()->::keyapis::subscription::v1::PostOfferTemplateResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PostOfferTemplateResponse::CopyFrom(const PostOfferTemplateResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PostOfferTemplateResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PostOfferTemplateResponse::InternalSwap(PostOfferTemplateResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string PostOfferTemplateResponse::GetTypeName() const {
  return "keyapis.subscription.v1.PostOfferTemplateResponse";
}

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

class DeleteOfferTemplateRequest::_Internal {
 public:
};

DeleteOfferTemplateRequest::DeleteOfferTemplateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.DeleteOfferTemplateRequest)
}
DeleteOfferTemplateRequest::DeleteOfferTemplateRequest(const DeleteOfferTemplateRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  DeleteOfferTemplateRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_id().empty()) {
    _this->_impl_.id_.Set(from._internal_id(), _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.DeleteOfferTemplateRequest)
}

inline void DeleteOfferTemplateRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

DeleteOfferTemplateRequest::~DeleteOfferTemplateRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void DeleteOfferTemplateRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.id_.Destroy();
}

void DeleteOfferTemplateRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void DeleteOfferTemplateRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.id_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* DeleteOfferTemplateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* DeleteOfferTemplateRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    const std::string& _s = this->_internal_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.DeleteOfferTemplateRequest.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  return target;
}

::size_t DeleteOfferTemplateRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  ::size_t total_size = 0;

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

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_id());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DeleteOfferTemplateRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const DeleteOfferTemplateRequest*>(
      &from));
}

void DeleteOfferTemplateRequest::MergeFrom(const DeleteOfferTemplateRequest& from) {
  DeleteOfferTemplateRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_id().empty()) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void DeleteOfferTemplateRequest::CopyFrom(const DeleteOfferTemplateRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.DeleteOfferTemplateRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void DeleteOfferTemplateRequest::InternalSwap(DeleteOfferTemplateRequest* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
}

std::string DeleteOfferTemplateRequest::GetTypeName() const {
  return "keyapis.subscription.v1.DeleteOfferTemplateRequest";
}

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

class DeleteOfferTemplateResponse::_Internal {
 public:
};

DeleteOfferTemplateResponse::DeleteOfferTemplateResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.DeleteOfferTemplateResponse)
}
DeleteOfferTemplateResponse::DeleteOfferTemplateResponse(const DeleteOfferTemplateResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.DeleteOfferTemplateResponse)
}

inline void DeleteOfferTemplateResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      /*decltype(_impl_._cached_size_)*/{}
  };
}

DeleteOfferTemplateResponse::~DeleteOfferTemplateResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void DeleteOfferTemplateResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

void DeleteOfferTemplateResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void DeleteOfferTemplateResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_metadata_.Clear<std::string>();
}

const char* DeleteOfferTemplateResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* DeleteOfferTemplateResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  return target;
}

::size_t DeleteOfferTemplateResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  ::size_t total_size = 0;

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

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DeleteOfferTemplateResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const DeleteOfferTemplateResponse*>(
      &from));
}

void DeleteOfferTemplateResponse::MergeFrom(const DeleteOfferTemplateResponse& from) {
  DeleteOfferTemplateResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void DeleteOfferTemplateResponse::CopyFrom(const DeleteOfferTemplateResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.DeleteOfferTemplateResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string DeleteOfferTemplateResponse::GetTypeName() const {
  return "keyapis.subscription.v1.DeleteOfferTemplateResponse";
}

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

class PostOfferTemplateRestoreRequest::_Internal {
 public:
};

PostOfferTemplateRestoreRequest::PostOfferTemplateRestoreRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
}
PostOfferTemplateRestoreRequest::PostOfferTemplateRestoreRequest(const PostOfferTemplateRestoreRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostOfferTemplateRestoreRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_id().empty()) {
    _this->_impl_.id_.Set(from._internal_id(), _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
}

inline void PostOfferTemplateRestoreRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) {}

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

PostOfferTemplateRestoreRequest::~PostOfferTemplateRestoreRequest() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PostOfferTemplateRestoreRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.id_.Destroy();
}

void PostOfferTemplateRestoreRequest::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PostOfferTemplateRestoreRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.id_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* PostOfferTemplateRestoreRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PostOfferTemplateRestoreRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    const std::string& _s = this->_internal_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.PostOfferTemplateRestoreRequest.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  return target;
}

::size_t PostOfferTemplateRestoreRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  ::size_t total_size = 0;

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

  // string id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_id());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PostOfferTemplateRestoreRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostOfferTemplateRestoreRequest*>(
      &from));
}

void PostOfferTemplateRestoreRequest::MergeFrom(const PostOfferTemplateRestoreRequest& from) {
  PostOfferTemplateRestoreRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_id().empty()) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PostOfferTemplateRestoreRequest::CopyFrom(const PostOfferTemplateRestoreRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PostOfferTemplateRestoreRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PostOfferTemplateRestoreRequest::InternalSwap(PostOfferTemplateRestoreRequest* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
}

std::string PostOfferTemplateRestoreRequest::GetTypeName() const {
  return "keyapis.subscription.v1.PostOfferTemplateRestoreRequest";
}

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

class PostOfferTemplateRestoreResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::subscription::v1::PostOfferTemplateRestoreResponse, _impl_._oneof_case_);
  static const ::keyapis::subscription::v1::OfferTemplate& data(const PostOfferTemplateRestoreResponse* msg);
};

const ::keyapis::subscription::v1::OfferTemplate&
PostOfferTemplateRestoreResponse::_Internal::data(const PostOfferTemplateRestoreResponse* msg) {
  return *msg->_impl_.type_.data_;
}
void PostOfferTemplateRestoreResponse::set_allocated_data(::keyapis::subscription::v1::OfferTemplate* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.subscription.v1.PostOfferTemplateRestoreResponse.data)
}
PostOfferTemplateRestoreResponse::PostOfferTemplateRestoreResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
}
PostOfferTemplateRestoreResponse::PostOfferTemplateRestoreResponse(const PostOfferTemplateRestoreResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostOfferTemplateRestoreResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
}

inline void PostOfferTemplateRestoreResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

PostOfferTemplateRestoreResponse::~PostOfferTemplateRestoreResponse() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PostOfferTemplateRestoreResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

void PostOfferTemplateRestoreResponse::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PostOfferTemplateRestoreResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void PostOfferTemplateRestoreResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_type();
  _internal_metadata_.Clear<std::string>();
}

const char* PostOfferTemplateRestoreResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .keyapis.subscription.v1.OfferTemplate data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PostOfferTemplateRestoreResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.subscription.v1.OfferTemplate data = 1;
  if (type_case() == kData) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::data(this),
        _Internal::data(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  return target;
}

::size_t PostOfferTemplateRestoreResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  ::size_t total_size = 0;

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

  switch (type_case()) {
    // .keyapis.subscription.v1.OfferTemplate data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PostOfferTemplateRestoreResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostOfferTemplateRestoreResponse*>(
      &from));
}

void PostOfferTemplateRestoreResponse::MergeFrom(const PostOfferTemplateRestoreResponse& from) {
  PostOfferTemplateRestoreResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::keyapis::subscription::v1::OfferTemplate::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PostOfferTemplateRestoreResponse::CopyFrom(const PostOfferTemplateRestoreResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PostOfferTemplateRestoreResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PostOfferTemplateRestoreResponse::InternalSwap(PostOfferTemplateRestoreResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string PostOfferTemplateRestoreResponse::GetTypeName() const {
  return "keyapis.subscription.v1.PostOfferTemplateRestoreResponse";
}

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

class ValidationError::_Internal {
 public:
};

ValidationError::ValidationError(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.ValidationError)
}
ValidationError::ValidationError(const ValidationError& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  ValidationError* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.path_) {}

    , decltype(_impl_.message_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.path_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.path_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_path().empty()) {
    _this->_impl_.path_.Set(from._internal_path(), _this->GetArenaForAllocation());
  }
  _impl_.message_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.message_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_message().empty()) {
    _this->_impl_.message_.Set(from._internal_message(), _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.ValidationError)
}

inline void ValidationError::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.path_) {}

    , decltype(_impl_.message_) {}

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.path_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.path_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.message_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.message_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

ValidationError::~ValidationError() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.ValidationError)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void ValidationError::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.path_.Destroy();
  _impl_.message_.Destroy();
}

void ValidationError::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void ValidationError::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.ValidationError)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.path_.ClearToEmpty();
  _impl_.message_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* ValidationError::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string path = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_path();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string message = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_message();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* ValidationError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.ValidationError)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string path = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_path().empty()) {
    const std::string& _s = this->_internal_path();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.ValidationError.path");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // string message = 2 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_message().empty()) {
    const std::string& _s = this->_internal_message();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.ValidationError.message");
    target = stream->WriteStringMaybeAliased(2, _s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.ValidationError)
  return target;
}

::size_t ValidationError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.ValidationError)
  ::size_t total_size = 0;

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

  // string path = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_path().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_path());
  }

  // string message = 2 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_message().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_message());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ValidationError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const ValidationError*>(
      &from));
}

void ValidationError::MergeFrom(const ValidationError& from) {
  ValidationError* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.ValidationError)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_path().empty()) {
    _this->_internal_set_path(from._internal_path());
  }
  if (!from._internal_message().empty()) {
    _this->_internal_set_message(from._internal_message());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ValidationError::CopyFrom(const ValidationError& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.ValidationError)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ValidationError::InternalSwap(ValidationError* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.path_, lhs_arena,
                                       &other->_impl_.path_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.message_, lhs_arena,
                                       &other->_impl_.message_, rhs_arena);
}

std::string ValidationError::GetTypeName() const {
  return "keyapis.subscription.v1.ValidationError";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace subscription
}  // namespace keyapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate_ApplicabilityRules >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate_Item*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate_Item >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate_Item >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate_SavingError_Conflict >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate_SavingError_DuplicateTemplate >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate_SavingError*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate_SavingError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate_SavingError >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplate*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplate >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplateFilter*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplateFilter >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplateFilter >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::OfferTemplatePaging*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::OfferTemplatePaging >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::OfferTemplatePaging >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateListRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateListRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateListRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateListResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateListResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateListResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateListResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateListResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateListResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponListRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponListRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponListRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponListResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateCountRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateCountRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateCountRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateCountResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateCountResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateCountResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateCountResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponCountRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::GetOfferTemplateByOrponCountResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PostOfferTemplateRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PostOfferTemplateRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PostOfferTemplateRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PostOfferTemplateResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PostOfferTemplateResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PostOfferTemplateResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PostOfferTemplateResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PostOfferTemplateResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PostOfferTemplateResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::DeleteOfferTemplateRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::DeleteOfferTemplateRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::DeleteOfferTemplateRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::DeleteOfferTemplateResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::DeleteOfferTemplateResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::DeleteOfferTemplateResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PostOfferTemplateRestoreRequest*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PostOfferTemplateRestoreRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PostOfferTemplateRestoreRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PostOfferTemplateRestoreResponse*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PostOfferTemplateRestoreResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PostOfferTemplateRestoreResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::ValidationError*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::ValidationError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::ValidationError >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
