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

#include "keyapis/invoice/v1/keyapis_invoice_invoice_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 invoice {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR Invoice_ExternalError_ExternalSystemError::Invoice_ExternalError_ExternalSystemError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct Invoice_ExternalError_ExternalSystemErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Invoice_ExternalError_ExternalSystemErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Invoice_ExternalError_ExternalSystemErrorDefaultTypeInternal() {}
  union {
    Invoice_ExternalError_ExternalSystemError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Invoice_ExternalError_ExternalSystemErrorDefaultTypeInternal _Invoice_ExternalError_ExternalSystemError_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Invoice_ExternalError::Invoice_ExternalError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct Invoice_ExternalErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Invoice_ExternalErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Invoice_ExternalErrorDefaultTypeInternal() {}
  union {
    Invoice_ExternalError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Invoice_ExternalErrorDefaultTypeInternal _Invoice_ExternalError_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Invoice_Position::Invoice_Position(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

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

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

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

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

  , /*decltype(_impl_.created_at_)*/nullptr
  , /*decltype(_impl_.updated_at_)*/nullptr
  , /*decltype(_impl_.due_date_at_)*/nullptr
  , /*decltype(_impl_.amount_)*/ 0

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

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

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

  , /*decltype(_impl_.is_discount_)*/ false
} {}
struct Invoice_PositionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Invoice_PositionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Invoice_PositionDefaultTypeInternal() {}
  union {
    Invoice_Position _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Invoice_PositionDefaultTypeInternal _Invoice_Position_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Invoice_SavingError_InvoiceAlreadyExists::Invoice_SavingError_InvoiceAlreadyExists(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct Invoice_SavingError_InvoiceAlreadyExistsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Invoice_SavingError_InvoiceAlreadyExistsDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Invoice_SavingError_InvoiceAlreadyExistsDefaultTypeInternal() {}
  union {
    Invoice_SavingError_InvoiceAlreadyExists _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Invoice_SavingError_InvoiceAlreadyExistsDefaultTypeInternal _Invoice_SavingError_InvoiceAlreadyExists_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Invoice_SavingError::Invoice_SavingError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct Invoice_SavingErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Invoice_SavingErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Invoice_SavingErrorDefaultTypeInternal() {}
  union {
    Invoice_SavingError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Invoice_SavingErrorDefaultTypeInternal _Invoice_SavingError_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Invoice::Invoice(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.positions_)*/{}
  , /*decltype(_impl_.id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

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

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

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

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

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

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

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

  , /*decltype(_impl_.created_at_)*/nullptr
  , /*decltype(_impl_.updated_at_)*/nullptr
  , /*decltype(_impl_.status_changed_at_)*/nullptr
  , /*decltype(_impl_.paid_at_)*/nullptr
  , /*decltype(_impl_.user_id_)*/ 0

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

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

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

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

  , /*decltype(_impl_.espp_req_status_)*/ 0
} {}
struct InvoiceDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvoiceDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvoiceDefaultTypeInternal() {}
  union {
    Invoice _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvoiceDefaultTypeInternal _Invoice_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR InvoiceFilter::InvoiceFilter(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.user_id_)*/ 0

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

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvoiceFilterDefaultTypeInternal _InvoiceFilter_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR InvoicePaging::InvoicePaging(
    ::_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 InvoicePagingDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvoicePagingDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvoicePagingDefaultTypeInternal() {}
  union {
    InvoicePaging _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvoicePagingDefaultTypeInternal _InvoicePaging_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CreateInvoiceRequest::CreateInvoiceRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.positions_)*/{}
  , /*decltype(_impl_.return_url_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

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

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

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

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

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

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInvoiceRequestDefaultTypeInternal _CreateInvoiceRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CreateInvoiceResponse_Error_MissingUserContacts::CreateInvoiceResponse_Error_MissingUserContacts(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct CreateInvoiceResponse_Error_MissingUserContactsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CreateInvoiceResponse_Error_MissingUserContactsDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CreateInvoiceResponse_Error_MissingUserContactsDefaultTypeInternal() {}
  union {
    CreateInvoiceResponse_Error_MissingUserContacts _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInvoiceResponse_Error_MissingUserContactsDefaultTypeInternal _CreateInvoiceResponse_Error_MissingUserContacts_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CreateInvoiceResponse_Error::CreateInvoiceResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct CreateInvoiceResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CreateInvoiceResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CreateInvoiceResponse_ErrorDefaultTypeInternal() {}
  union {
    CreateInvoiceResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInvoiceResponse_ErrorDefaultTypeInternal _CreateInvoiceResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CreateInvoiceResponse::CreateInvoiceResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct CreateInvoiceResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CreateInvoiceResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CreateInvoiceResponseDefaultTypeInternal() {}
  union {
    CreateInvoiceResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateInvoiceResponseDefaultTypeInternal _CreateInvoiceResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceRequest::GetInvoiceRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.invoice_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceRequestDefaultTypeInternal _GetInvoiceRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceResponse_Error::GetInvoiceResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetInvoiceResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceResponse_ErrorDefaultTypeInternal() {}
  union {
    GetInvoiceResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceResponse_ErrorDefaultTypeInternal _GetInvoiceResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceResponse::GetInvoiceResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetInvoiceResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceResponseDefaultTypeInternal() {}
  union {
    GetInvoiceResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceResponseDefaultTypeInternal _GetInvoiceResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostInvoiceConfirmRequest_Card::PostInvoiceConfirmRequest_Card(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.card_num_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

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

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

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostInvoiceConfirmRequest_CardDefaultTypeInternal _PostInvoiceConfirmRequest_Card_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostInvoiceConfirmRequest::PostInvoiceConfirmRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.src_pay_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

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

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

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

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

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

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

  , /*decltype(_impl_.create_time_at_)*/nullptr
  , /*decltype(_impl_.pay_time_at_)*/nullptr
  , /*decltype(_impl_.abandon_time_at_)*/nullptr
  , /*decltype(_impl_.card_)*/nullptr
  , /*decltype(_impl_.pay_status_)*/ 0

  , /*decltype(_impl_.amount_)*/ 0
} {}
struct PostInvoiceConfirmRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostInvoiceConfirmRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostInvoiceConfirmRequestDefaultTypeInternal() {}
  union {
    PostInvoiceConfirmRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostInvoiceConfirmRequestDefaultTypeInternal _PostInvoiceConfirmRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostInvoiceConfirmResponse::PostInvoiceConfirmResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct PostInvoiceConfirmResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostInvoiceConfirmResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostInvoiceConfirmResponseDefaultTypeInternal() {}
  union {
    PostInvoiceConfirmResponse _instance;
  };
};

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceListRequestDefaultTypeInternal _GetInvoiceListRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceListResponse_Error::GetInvoiceListResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetInvoiceListResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceListResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceListResponse_ErrorDefaultTypeInternal() {}
  union {
    GetInvoiceListResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceListResponse_ErrorDefaultTypeInternal _GetInvoiceListResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceListResponse::GetInvoiceListResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.data_)*/{}
  , /*decltype(_impl_.error_)*/nullptr} {}
struct GetInvoiceListResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceListResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceListResponseDefaultTypeInternal() {}
  union {
    GetInvoiceListResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceListResponseDefaultTypeInternal _GetInvoiceListResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceCountRequest::GetInvoiceCountRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.filter_)*/nullptr} {}
struct GetInvoiceCountRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceCountRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceCountRequestDefaultTypeInternal() {}
  union {
    GetInvoiceCountRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceCountRequestDefaultTypeInternal _GetInvoiceCountRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetInvoiceCountResponse::GetInvoiceCountResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetInvoiceCountResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetInvoiceCountResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetInvoiceCountResponseDefaultTypeInternal() {}
  union {
    GetInvoiceCountResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetInvoiceCountResponseDefaultTypeInternal _GetInvoiceCountResponse_default_instance_;
}  // namespace v1
}  // namespace invoice
}  // namespace keyapis
namespace keyapis {
namespace invoice {
namespace v1 {
bool Invoice_InvoiceStatusType_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>
    Invoice_InvoiceStatusType_strings[6] = {};

static const char Invoice_InvoiceStatusType_names[] = {
    "CANCELLED"
    "ERROR"
    "INVOICE_STATUS_TYPE_UNKNOWN"
    "PAID"
    "PENDING"
    "PLANNED"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Invoice_InvoiceStatusType_entries[] =
    {
        {{&Invoice_InvoiceStatusType_names[0], 9}, 5},
        {{&Invoice_InvoiceStatusType_names[9], 5}, 3},
        {{&Invoice_InvoiceStatusType_names[14], 27}, 0},
        {{&Invoice_InvoiceStatusType_names[41], 4}, 4},
        {{&Invoice_InvoiceStatusType_names[45], 7}, 2},
        {{&Invoice_InvoiceStatusType_names[52], 7}, 1},
};

static const int Invoice_InvoiceStatusType_entries_by_number[] = {
    2,  // 0 -> INVOICE_STATUS_TYPE_UNKNOWN
    5,  // 1 -> PLANNED
    4,  // 2 -> PENDING
    1,  // 3 -> ERROR
    3,  // 4 -> PAID
    0,  // 5 -> CANCELLED
};

const std::string& Invoice_InvoiceStatusType_Name(Invoice_InvoiceStatusType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Invoice_InvoiceStatusType_entries, Invoice_InvoiceStatusType_entries_by_number,
          6, Invoice_InvoiceStatusType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Invoice_InvoiceStatusType_entries, Invoice_InvoiceStatusType_entries_by_number, 6,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : Invoice_InvoiceStatusType_strings[idx].get();
}

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

constexpr Invoice_InvoiceStatusType Invoice::INVOICE_STATUS_TYPE_UNKNOWN;
constexpr Invoice_InvoiceStatusType Invoice::PLANNED;
constexpr Invoice_InvoiceStatusType Invoice::PENDING;
constexpr Invoice_InvoiceStatusType Invoice::ERROR;
constexpr Invoice_InvoiceStatusType Invoice::PAID;
constexpr Invoice_InvoiceStatusType Invoice::CANCELLED;
constexpr Invoice_InvoiceStatusType Invoice::InvoiceStatusType_MIN;
constexpr Invoice_InvoiceStatusType Invoice::InvoiceStatusType_MAX;
constexpr int Invoice::InvoiceStatusType_ARRAYSIZE;

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

static const char Invoice_CardType_names[] = {
    "AMEX"
    "CARD_TYPE_UNKNOWN"
    "DCL"
    "EC_MC"
    "JCB"
    "MIR"
    "VISA"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Invoice_CardType_entries[] =
    {
        {{&Invoice_CardType_names[0], 4}, 5},
        {{&Invoice_CardType_names[4], 17}, 0},
        {{&Invoice_CardType_names[21], 3}, 3},
        {{&Invoice_CardType_names[24], 5}, 2},
        {{&Invoice_CardType_names[29], 3}, 4},
        {{&Invoice_CardType_names[32], 3}, 6},
        {{&Invoice_CardType_names[35], 4}, 1},
};

static const int Invoice_CardType_entries_by_number[] = {
    1,  // 0 -> CARD_TYPE_UNKNOWN
    6,  // 1 -> VISA
    3,  // 2 -> EC_MC
    2,  // 3 -> DCL
    4,  // 4 -> JCB
    0,  // 5 -> AMEX
    5,  // 6 -> MIR
};

const std::string& Invoice_CardType_Name(Invoice_CardType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Invoice_CardType_entries, Invoice_CardType_entries_by_number,
          7, Invoice_CardType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Invoice_CardType_entries, Invoice_CardType_entries_by_number, 7,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : Invoice_CardType_strings[idx].get();
}

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

constexpr Invoice_CardType Invoice::CARD_TYPE_UNKNOWN;
constexpr Invoice_CardType Invoice::VISA;
constexpr Invoice_CardType Invoice::EC_MC;
constexpr Invoice_CardType Invoice::DCL;
constexpr Invoice_CardType Invoice::JCB;
constexpr Invoice_CardType Invoice::AMEX;
constexpr Invoice_CardType Invoice::MIR;
constexpr Invoice_CardType Invoice::CardType_MIN;
constexpr Invoice_CardType Invoice::CardType_MAX;
constexpr int Invoice::CardType_ARRAYSIZE;

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

static const char Invoice_PayInterfaceType_names[] = {
    "GUI"
    "M2M"
    "PAY_INTERFACE_TYPE_UNKNOWN"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Invoice_PayInterfaceType_entries[] =
    {
        {{&Invoice_PayInterfaceType_names[0], 3}, 1},
        {{&Invoice_PayInterfaceType_names[3], 3}, 2},
        {{&Invoice_PayInterfaceType_names[6], 26}, 0},
};

static const int Invoice_PayInterfaceType_entries_by_number[] = {
    2,  // 0 -> PAY_INTERFACE_TYPE_UNKNOWN
    0,  // 1 -> GUI
    1,  // 2 -> M2M
};

const std::string& Invoice_PayInterfaceType_Name(Invoice_PayInterfaceType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Invoice_PayInterfaceType_entries, Invoice_PayInterfaceType_entries_by_number,
          3, Invoice_PayInterfaceType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Invoice_PayInterfaceType_entries, Invoice_PayInterfaceType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : Invoice_PayInterfaceType_strings[idx].get();
}

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

constexpr Invoice_PayInterfaceType Invoice::PAY_INTERFACE_TYPE_UNKNOWN;
constexpr Invoice_PayInterfaceType Invoice::GUI;
constexpr Invoice_PayInterfaceType Invoice::M2M;
constexpr Invoice_PayInterfaceType Invoice::PayInterfaceType_MIN;
constexpr Invoice_PayInterfaceType Invoice::PayInterfaceType_MAX;
constexpr int Invoice::PayInterfaceType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool Invoice_PaywayType_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>
    Invoice_PaywayType_strings[4] = {};

static const char Invoice_PaywayType_names[] = {
    "BANK_CARD"
    "PAYWAY_TYPE_UNKNOWN"
    "SBER_PAY"
    "SBP"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Invoice_PaywayType_entries[] =
    {
        {{&Invoice_PaywayType_names[0], 9}, 1},
        {{&Invoice_PaywayType_names[9], 19}, 0},
        {{&Invoice_PaywayType_names[28], 8}, 3},
        {{&Invoice_PaywayType_names[36], 3}, 2},
};

static const int Invoice_PaywayType_entries_by_number[] = {
    1,  // 0 -> PAYWAY_TYPE_UNKNOWN
    0,  // 1 -> BANK_CARD
    3,  // 2 -> SBP
    2,  // 3 -> SBER_PAY
};

const std::string& Invoice_PaywayType_Name(Invoice_PaywayType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Invoice_PaywayType_entries, Invoice_PaywayType_entries_by_number,
          4, Invoice_PaywayType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Invoice_PaywayType_entries, Invoice_PaywayType_entries_by_number, 4,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : Invoice_PaywayType_strings[idx].get();
}

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

constexpr Invoice_PaywayType Invoice::PAYWAY_TYPE_UNKNOWN;
constexpr Invoice_PaywayType Invoice::BANK_CARD;
constexpr Invoice_PaywayType Invoice::SBP;
constexpr Invoice_PaywayType Invoice::SBER_PAY;
constexpr Invoice_PaywayType Invoice::PaywayType_MIN;
constexpr Invoice_PaywayType Invoice::PaywayType_MAX;
constexpr int Invoice::PaywayType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool InvoicePaging_OrderByType_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>
    InvoicePaging_OrderByType_strings[4] = {};

static const char InvoicePaging_OrderByType_names[] = {
    "CREATED_AT"
    "ID"
    "ORDER_BY_TYPE_UNKNOWN"
    "PAID_AT"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry InvoicePaging_OrderByType_entries[] =
    {
        {{&InvoicePaging_OrderByType_names[0], 10}, 3},
        {{&InvoicePaging_OrderByType_names[10], 2}, 1},
        {{&InvoicePaging_OrderByType_names[12], 21}, 0},
        {{&InvoicePaging_OrderByType_names[33], 7}, 2},
};

static const int InvoicePaging_OrderByType_entries_by_number[] = {
    2,  // 0 -> ORDER_BY_TYPE_UNKNOWN
    1,  // 1 -> ID
    3,  // 2 -> PAID_AT
    0,  // 3 -> CREATED_AT
};

const std::string& InvoicePaging_OrderByType_Name(InvoicePaging_OrderByType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          InvoicePaging_OrderByType_entries, InvoicePaging_OrderByType_entries_by_number,
          4, InvoicePaging_OrderByType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      InvoicePaging_OrderByType_entries, InvoicePaging_OrderByType_entries_by_number, 4,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : InvoicePaging_OrderByType_strings[idx].get();
}

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

constexpr InvoicePaging_OrderByType InvoicePaging::ORDER_BY_TYPE_UNKNOWN;
constexpr InvoicePaging_OrderByType InvoicePaging::ID;
constexpr InvoicePaging_OrderByType InvoicePaging::PAID_AT;
constexpr InvoicePaging_OrderByType InvoicePaging::CREATED_AT;
constexpr InvoicePaging_OrderByType InvoicePaging::OrderByType_MIN;
constexpr InvoicePaging_OrderByType InvoicePaging::OrderByType_MAX;
constexpr int InvoicePaging::OrderByType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool InvoicePaging_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>
    InvoicePaging_DirectionType_strings[3] = {};

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

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

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

const std::string& InvoicePaging_DirectionType_Name(InvoicePaging_DirectionType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          InvoicePaging_DirectionType_entries, InvoicePaging_DirectionType_entries_by_number,
          3, InvoicePaging_DirectionType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      InvoicePaging_DirectionType_entries, InvoicePaging_DirectionType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : InvoicePaging_DirectionType_strings[idx].get();
}

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

constexpr InvoicePaging_DirectionType InvoicePaging::DIRECTION_TYPE_UNKNOWN;
constexpr InvoicePaging_DirectionType InvoicePaging::DESC;
constexpr InvoicePaging_DirectionType InvoicePaging::ASC;
constexpr InvoicePaging_DirectionType InvoicePaging::DirectionType_MIN;
constexpr InvoicePaging_DirectionType InvoicePaging::DirectionType_MAX;
constexpr int InvoicePaging::DirectionType_ARRAYSIZE;

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

class Invoice_ExternalError_ExternalSystemError::_Internal {
 public:
};

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

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

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

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

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

void Invoice_ExternalError_ExternalSystemError::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  ::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* Invoice_ExternalError_ExternalSystemError::_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* Invoice_ExternalError_ExternalSystemError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  ::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.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  return target;
}

::size_t Invoice_ExternalError_ExternalSystemError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  ::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 Invoice_ExternalError_ExternalSystemError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice_ExternalError_ExternalSystemError*>(
      &from));
}

void Invoice_ExternalError_ExternalSystemError::MergeFrom(const Invoice_ExternalError_ExternalSystemError& from) {
  Invoice_ExternalError_ExternalSystemError* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  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 Invoice_ExternalError_ExternalSystemError::CopyFrom(const Invoice_ExternalError_ExternalSystemError& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string Invoice_ExternalError_ExternalSystemError::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError";
}

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

class Invoice_ExternalError::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::Invoice_ExternalError, _impl_._oneof_case_);
  static const ::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError& external_system_error(const Invoice_ExternalError* msg);
};

const ::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError&
Invoice_ExternalError::_Internal::external_system_error(const Invoice_ExternalError* msg) {
  return *msg->_impl_.reason_.external_system_error_;
}
void Invoice_ExternalError::set_allocated_external_system_error(::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError* external_system_error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (external_system_error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(external_system_error);
    if (message_arena != submessage_arena) {
      external_system_error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, external_system_error, submessage_arena);
    }
    set_has_external_system_error();
    _impl_.reason_.external_system_error_ = external_system_error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.invoice.v1.Invoice.ExternalError.external_system_error)
}
Invoice_ExternalError::Invoice_ExternalError(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.Invoice.ExternalError)
}
Invoice_ExternalError::Invoice_ExternalError(const Invoice_ExternalError& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Invoice_ExternalError* 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 kExternalSystemError: {
      _this->_internal_mutable_external_system_error()->::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError::MergeFrom(
          from._internal_external_system_error());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.Invoice.ExternalError)
}

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

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

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

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

void Invoice_ExternalError::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.Invoice.ExternalError)
  switch (reason_case()) {
    case kExternalSystemError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.external_system_error_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void Invoice_ExternalError::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.Invoice.ExternalError)
  ::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* Invoice_ExternalError::_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.invoice.v1.Invoice.ExternalError.ExternalSystemError external_system_error = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_external_system_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* Invoice_ExternalError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice.ExternalError)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.invoice.v1.Invoice.ExternalError.ExternalSystemError external_system_error = 1;
  if (reason_case() == kExternalSystemError) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::external_system_error(this),
        _Internal::external_system_error(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.invoice.v1.Invoice.ExternalError)
  return target;
}

::size_t Invoice_ExternalError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice.ExternalError)
  ::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.invoice.v1.Invoice.ExternalError.ExternalSystemError external_system_error = 1;
    case kExternalSystemError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.external_system_error_);
      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 Invoice_ExternalError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice_ExternalError*>(
      &from));
}

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

  switch (from.reason_case()) {
    case kExternalSystemError: {
      _this->_internal_mutable_external_system_error()->::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError::MergeFrom(
          from._internal_external_system_error());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Invoice_ExternalError::InternalSwap(Invoice_ExternalError* 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 Invoice_ExternalError::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice.ExternalError";
}

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

class Invoice_Position::_Internal {
 public:
  using HasBits = decltype(std::declval<Invoice_Position>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(Invoice_Position, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& created_at(const Invoice_Position* msg);
  static void set_has_created_at(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& updated_at(const Invoice_Position* msg);
  static void set_has_updated_at(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& due_date_at(const Invoice_Position* msg);
  static void set_has_due_date_at(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice_Position::_Internal::created_at(const Invoice_Position* msg) {
  return *msg->_impl_.created_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice_Position::_Internal::updated_at(const Invoice_Position* msg) {
  return *msg->_impl_.updated_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice_Position::_Internal::due_date_at(const Invoice_Position* msg) {
  return *msg->_impl_.due_date_at_;
}
void Invoice_Position::clear_created_at() {
  if (_impl_.created_at_ != nullptr) _impl_.created_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void Invoice_Position::clear_updated_at() {
  if (_impl_.updated_at_ != nullptr) _impl_.updated_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
void Invoice_Position::clear_due_date_at() {
  if (_impl_.due_date_at_ != nullptr) _impl_.due_date_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
Invoice_Position::Invoice_Position(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.Invoice.Position)
}
Invoice_Position::Invoice_Position(const Invoice_Position& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Invoice_Position* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.id_) {}

    , decltype(_impl_.invoice_id_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.category_) {}

    , decltype(_impl_.instance_id_) {}

    , decltype(_impl_.svc_type_id_) {}

    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.due_date_at_){nullptr}
    , decltype(_impl_.amount_) {}

    , decltype(_impl_.mrf_id_) {}

    , decltype(_impl_.rf_id_) {}

    , decltype(_impl_.offering_id_) {}

    , decltype(_impl_.is_discount_) {}
  };

  _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_.invoice_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.invoice_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_invoice_id().empty()) {
    _this->_impl_.invoice_id_.Set(from._internal_invoice_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());
  }
  _impl_.category_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.category_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_category().empty()) {
    _this->_impl_.category_.Set(from._internal_category(), _this->GetArenaForAllocation());
  }
  _impl_.instance_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.instance_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_instance_id().empty()) {
    _this->_impl_.instance_id_.Set(from._internal_instance_id(), _this->GetArenaForAllocation());
  }
  _impl_.svc_type_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.svc_type_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_svc_type_id().empty()) {
    _this->_impl_.svc_type_id_.Set(from._internal_svc_type_id(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.created_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.created_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.updated_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.updated_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000004u) != 0) {
    _this->_impl_.due_date_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.due_date_at_);
  }
  ::memcpy(&_impl_.amount_, &from._impl_.amount_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.is_discount_) -
    reinterpret_cast<char*>(&_impl_.amount_)) + sizeof(_impl_.is_discount_));
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.Invoice.Position)
}

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

    , decltype(_impl_.invoice_id_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.category_) {}

    , decltype(_impl_.instance_id_) {}

    , decltype(_impl_.svc_type_id_) {}

    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.due_date_at_){nullptr}
    , decltype(_impl_.amount_) { 0 }

    , decltype(_impl_.mrf_id_) { 0 }

    , decltype(_impl_.rf_id_) { 0 }

    , decltype(_impl_.offering_id_) { 0 }

    , decltype(_impl_.is_discount_) { false }

  };
  _impl_.id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.invoice_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.invoice_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
  _impl_.category_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.category_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.instance_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.instance_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.svc_type_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.svc_type_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void Invoice_Position::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.id_.Destroy();
  _impl_.invoice_id_.Destroy();
  _impl_.title_.Destroy();
  _impl_.category_.Destroy();
  _impl_.instance_id_.Destroy();
  _impl_.svc_type_id_.Destroy();
  if (this != internal_default_instance()) delete _impl_.created_at_;
  if (this != internal_default_instance()) delete _impl_.updated_at_;
  if (this != internal_default_instance()) delete _impl_.due_date_at_;
}

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

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

  _impl_.id_.ClearToEmpty();
  _impl_.invoice_id_.ClearToEmpty();
  _impl_.title_.ClearToEmpty();
  _impl_.category_.ClearToEmpty();
  _impl_.instance_id_.ClearToEmpty();
  _impl_.svc_type_id_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.created_at_ != nullptr);
      _impl_.created_at_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.updated_at_ != nullptr);
      _impl_.updated_at_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      ABSL_DCHECK(_impl_.due_date_at_ != nullptr);
      _impl_.due_date_at_->Clear();
    }
  }
  ::memset(&_impl_.amount_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.is_discount_) -
      reinterpret_cast<char*>(&_impl_.amount_)) + sizeof(_impl_.is_discount_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Invoice_Position::_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;
      // string invoice_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_invoice_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } 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;
      // string category = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_category();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // float amount = 5 [(.google.api.field_behavior) = REQUIRED];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 45)) {
          _impl_.amount_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp created_at = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_created_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp updated_at = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          ptr = ctx->ParseMessage(_internal_mutable_updated_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 mrf_id = 8 [(.google.api.field_behavior) = REQUIRED];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
          _impl_.mrf_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 rf_id = 9 [(.google.api.field_behavior) = REQUIRED];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
          _impl_.rf_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string instance_id = 10 [(.google.api.field_behavior) = REQUIRED];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_instance_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 offering_id = 11 [(.google.api.field_behavior) = REQUIRED];
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
          _impl_.offering_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp due_date_at = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 98)) {
          ptr = ctx->ParseMessage(_internal_mutable_due_date_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string svc_type_id = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
          auto str = _internal_mutable_svc_type_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_discount = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
          _impl_.is_discount_ = ::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:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* Invoice_Position::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice.Position)
  ::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.invoice.v1.Invoice.Position.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // string invoice_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_invoice_id().empty()) {
    const std::string& _s = this->_internal_invoice_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.Position.invoice_id");
    target = stream->WriteStringMaybeAliased(2, _s, 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.invoice.v1.Invoice.Position.title");
    target = stream->WriteStringMaybeAliased(3, _s, target);
  }

  // string category = 4 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_category().empty()) {
    const std::string& _s = this->_internal_category();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.Position.category");
    target = stream->WriteStringMaybeAliased(4, _s, target);
  }

  // float amount = 5 [(.google.api.field_behavior) = REQUIRED];
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = this->_internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(
        5, this->_internal_amount(), target);
  }

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

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

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

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

  // string instance_id = 10 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_instance_id().empty()) {
    const std::string& _s = this->_internal_instance_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.Position.instance_id");
    target = stream->WriteStringMaybeAliased(10, _s, target);
  }

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

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

  // string svc_type_id = 13;
  if (!this->_internal_svc_type_id().empty()) {
    const std::string& _s = this->_internal_svc_type_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.Position.svc_type_id");
    target = stream->WriteStringMaybeAliased(13, _s, target);
  }

  // bool is_discount = 14;
  if (this->_internal_is_discount() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        14, this->_internal_is_discount(), 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.invoice.v1.Invoice.Position)
  return target;
}

::size_t Invoice_Position::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice.Position)
  ::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;
  if (!this->_internal_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_id());
  }

  // string invoice_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_invoice_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_invoice_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());
  }

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

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

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

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

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

    // .google.protobuf.Timestamp due_date_at = 12;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.due_date_at_);
    }

  }
  // float amount = 5 [(.google.api.field_behavior) = REQUIRED];
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = this->_internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    total_size += 5;
  }

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

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

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

  // bool is_discount = 14;
  if (this->_internal_is_discount() != 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 Invoice_Position::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice_Position*>(
      &from));
}

void Invoice_Position::MergeFrom(const Invoice_Position& from) {
  Invoice_Position* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.Invoice.Position)
  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());
  }
  if (!from._internal_invoice_id().empty()) {
    _this->_internal_set_invoice_id(from._internal_invoice_id());
  }
  if (!from._internal_title().empty()) {
    _this->_internal_set_title(from._internal_title());
  }
  if (!from._internal_category().empty()) {
    _this->_internal_set_category(from._internal_category());
  }
  if (!from._internal_instance_id().empty()) {
    _this->_internal_set_instance_id(from._internal_instance_id());
  }
  if (!from._internal_svc_type_id().empty()) {
    _this->_internal_set_svc_type_id(from._internal_svc_type_id());
  }
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_created_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_created_at());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_updated_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_updated_at());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_due_date_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_due_date_at());
    }
  }
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = from._internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    _this->_internal_set_amount(from._internal_amount());
  }
  if (from._internal_mrf_id() != 0) {
    _this->_internal_set_mrf_id(from._internal_mrf_id());
  }
  if (from._internal_rf_id() != 0) {
    _this->_internal_set_rf_id(from._internal_rf_id());
  }
  if (from._internal_offering_id() != 0) {
    _this->_internal_set_offering_id(from._internal_offering_id());
  }
  if (from._internal_is_discount() != 0) {
    _this->_internal_set_is_discount(from._internal_is_discount());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Invoice_Position::InternalSwap(Invoice_Position* 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]);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.invoice_id_, lhs_arena,
                                       &other->_impl_.invoice_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.title_, lhs_arena,
                                       &other->_impl_.title_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.category_, lhs_arena,
                                       &other->_impl_.category_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.instance_id_, lhs_arena,
                                       &other->_impl_.instance_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.svc_type_id_, lhs_arena,
                                       &other->_impl_.svc_type_id_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Invoice_Position, _impl_.is_discount_)
      + sizeof(Invoice_Position::_impl_.is_discount_)
      - PROTOBUF_FIELD_OFFSET(Invoice_Position, _impl_.created_at_)>(
          reinterpret_cast<char*>(&_impl_.created_at_),
          reinterpret_cast<char*>(&other->_impl_.created_at_));
}

std::string Invoice_Position::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice.Position";
}

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

class Invoice_SavingError_InvoiceAlreadyExists::_Internal {
 public:
};

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

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

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

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

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

void Invoice_SavingError_InvoiceAlreadyExists::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  ::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* Invoice_SavingError_InvoiceAlreadyExists::_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* Invoice_SavingError_InvoiceAlreadyExists::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  ::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.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  return target;
}

::size_t Invoice_SavingError_InvoiceAlreadyExists::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  ::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 Invoice_SavingError_InvoiceAlreadyExists::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice_SavingError_InvoiceAlreadyExists*>(
      &from));
}

void Invoice_SavingError_InvoiceAlreadyExists::MergeFrom(const Invoice_SavingError_InvoiceAlreadyExists& from) {
  Invoice_SavingError_InvoiceAlreadyExists* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  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 Invoice_SavingError_InvoiceAlreadyExists::CopyFrom(const Invoice_SavingError_InvoiceAlreadyExists& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string Invoice_SavingError_InvoiceAlreadyExists::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists";
}

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

class Invoice_SavingError::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::Invoice_SavingError, _impl_._oneof_case_);
  static const ::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists& invoice_already_exists(const Invoice_SavingError* msg);
};

const ::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists&
Invoice_SavingError::_Internal::invoice_already_exists(const Invoice_SavingError* msg) {
  return *msg->_impl_.reason_.invoice_already_exists_;
}
void Invoice_SavingError::set_allocated_invoice_already_exists(::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists* invoice_already_exists) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (invoice_already_exists) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(invoice_already_exists);
    if (message_arena != submessage_arena) {
      invoice_already_exists = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, invoice_already_exists, submessage_arena);
    }
    set_has_invoice_already_exists();
    _impl_.reason_.invoice_already_exists_ = invoice_already_exists;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.invoice.v1.Invoice.SavingError.invoice_already_exists)
}
Invoice_SavingError::Invoice_SavingError(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.Invoice.SavingError)
}
Invoice_SavingError::Invoice_SavingError(const Invoice_SavingError& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Invoice_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 kInvoiceAlreadyExists: {
      _this->_internal_mutable_invoice_already_exists()->::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists::MergeFrom(
          from._internal_invoice_already_exists());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.Invoice.SavingError)
}

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

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

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

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

void Invoice_SavingError::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.Invoice.SavingError)
  switch (reason_case()) {
    case kInvoiceAlreadyExists: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.invoice_already_exists_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void Invoice_SavingError::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.Invoice.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* Invoice_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.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists invoice_already_exists = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_invoice_already_exists(), 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* Invoice_SavingError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice.SavingError)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists invoice_already_exists = 1;
  if (reason_case() == kInvoiceAlreadyExists) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::invoice_already_exists(this),
        _Internal::invoice_already_exists(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.invoice.v1.Invoice.SavingError)
  return target;
}

::size_t Invoice_SavingError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice.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.invoice.v1.Invoice.SavingError.InvoiceAlreadyExists invoice_already_exists = 1;
    case kInvoiceAlreadyExists: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.invoice_already_exists_);
      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 Invoice_SavingError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice_SavingError*>(
      &from));
}

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

  switch (from.reason_case()) {
    case kInvoiceAlreadyExists: {
      _this->_internal_mutable_invoice_already_exists()->::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists::MergeFrom(
          from._internal_invoice_already_exists());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Invoice_SavingError::InternalSwap(Invoice_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 Invoice_SavingError::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice.SavingError";
}

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

class Invoice::_Internal {
 public:
  using HasBits = decltype(std::declval<Invoice>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(Invoice, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& created_at(const Invoice* msg);
  static void set_has_created_at(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& updated_at(const Invoice* msg);
  static void set_has_updated_at(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& status_changed_at(const Invoice* msg);
  static void set_has_status_changed_at(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& paid_at(const Invoice* msg);
  static void set_has_paid_at(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice::_Internal::created_at(const Invoice* msg) {
  return *msg->_impl_.created_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice::_Internal::updated_at(const Invoice* msg) {
  return *msg->_impl_.updated_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice::_Internal::status_changed_at(const Invoice* msg) {
  return *msg->_impl_.status_changed_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
Invoice::_Internal::paid_at(const Invoice* msg) {
  return *msg->_impl_.paid_at_;
}
void Invoice::clear_created_at() {
  if (_impl_.created_at_ != nullptr) _impl_.created_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void Invoice::clear_updated_at() {
  if (_impl_.updated_at_ != nullptr) _impl_.updated_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
void Invoice::clear_status_changed_at() {
  if (_impl_.status_changed_at_ != nullptr) _impl_.status_changed_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
void Invoice::clear_paid_at() {
  if (_impl_.paid_at_ != nullptr) _impl_.paid_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000008u;
}
Invoice::Invoice(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.Invoice)
}
Invoice::Invoice(const Invoice& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Invoice* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.positions_){from._impl_.positions_}
    , decltype(_impl_.id_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.pay_url_) {}

    , decltype(_impl_.paid_by_card_masked_) {}

    , decltype(_impl_.paid_by_card_espp_id_) {}

    , decltype(_impl_.espp_req_user_msg_) {}

    , decltype(_impl_.espp_invoice_id_) {}

    , decltype(_impl_.phone_number_) {}

    , decltype(_impl_.email_) {}

    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.status_changed_at_){nullptr}
    , decltype(_impl_.paid_at_){nullptr}
    , decltype(_impl_.user_id_) {}

    , decltype(_impl_.invoice_status_type_) {}

    , decltype(_impl_.pay_interface_type_) {}

    , decltype(_impl_.payway_type_) {}

    , decltype(_impl_.card_type_) {}

    , decltype(_impl_.espp_req_status_) {}
  };

  _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());
  }
  _impl_.pay_url_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.pay_url_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_pay_url().empty()) {
    _this->_impl_.pay_url_.Set(from._internal_pay_url(), _this->GetArenaForAllocation());
  }
  _impl_.paid_by_card_masked_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.paid_by_card_masked_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_paid_by_card_masked().empty()) {
    _this->_impl_.paid_by_card_masked_.Set(from._internal_paid_by_card_masked(), _this->GetArenaForAllocation());
  }
  _impl_.paid_by_card_espp_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.paid_by_card_espp_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_paid_by_card_espp_id().empty()) {
    _this->_impl_.paid_by_card_espp_id_.Set(from._internal_paid_by_card_espp_id(), _this->GetArenaForAllocation());
  }
  _impl_.espp_req_user_msg_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_req_user_msg_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_espp_req_user_msg().empty()) {
    _this->_impl_.espp_req_user_msg_.Set(from._internal_espp_req_user_msg(), _this->GetArenaForAllocation());
  }
  _impl_.espp_invoice_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_invoice_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_espp_invoice_id().empty()) {
    _this->_impl_.espp_invoice_id_.Set(from._internal_espp_invoice_id(), _this->GetArenaForAllocation());
  }
  _impl_.phone_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.phone_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_phone_number().empty()) {
    _this->_impl_.phone_number_.Set(from._internal_phone_number(), _this->GetArenaForAllocation());
  }
  _impl_.email_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.email_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_email().empty()) {
    _this->_impl_.email_.Set(from._internal_email(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.created_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.created_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.updated_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.updated_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000004u) != 0) {
    _this->_impl_.status_changed_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.status_changed_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000008u) != 0) {
    _this->_impl_.paid_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.paid_at_);
  }
  ::memcpy(&_impl_.user_id_, &from._impl_.user_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.espp_req_status_) -
    reinterpret_cast<char*>(&_impl_.user_id_)) + sizeof(_impl_.espp_req_status_));
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.Invoice)
}

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

    , decltype(_impl_.title_) {}

    , decltype(_impl_.pay_url_) {}

    , decltype(_impl_.paid_by_card_masked_) {}

    , decltype(_impl_.paid_by_card_espp_id_) {}

    , decltype(_impl_.espp_req_user_msg_) {}

    , decltype(_impl_.espp_invoice_id_) {}

    , decltype(_impl_.phone_number_) {}

    , decltype(_impl_.email_) {}

    , decltype(_impl_.created_at_){nullptr}
    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.status_changed_at_){nullptr}
    , decltype(_impl_.paid_at_){nullptr}
    , decltype(_impl_.user_id_) { 0 }

    , decltype(_impl_.invoice_status_type_) { 0 }

    , decltype(_impl_.pay_interface_type_) { 0 }

    , decltype(_impl_.payway_type_) { 0 }

    , decltype(_impl_.card_type_) { 0 }

    , decltype(_impl_.espp_req_status_) { 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
  _impl_.pay_url_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.pay_url_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.paid_by_card_masked_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.paid_by_card_masked_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.paid_by_card_espp_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.paid_by_card_espp_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.espp_req_user_msg_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_req_user_msg_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.espp_invoice_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_invoice_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.phone_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.phone_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.email_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.email_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void Invoice::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_positions()->~RepeatedPtrField();
  _impl_.id_.Destroy();
  _impl_.title_.Destroy();
  _impl_.pay_url_.Destroy();
  _impl_.paid_by_card_masked_.Destroy();
  _impl_.paid_by_card_espp_id_.Destroy();
  _impl_.espp_req_user_msg_.Destroy();
  _impl_.espp_invoice_id_.Destroy();
  _impl_.phone_number_.Destroy();
  _impl_.email_.Destroy();
  if (this != internal_default_instance()) delete _impl_.created_at_;
  if (this != internal_default_instance()) delete _impl_.updated_at_;
  if (this != internal_default_instance()) delete _impl_.status_changed_at_;
  if (this != internal_default_instance()) delete _impl_.paid_at_;
}

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

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

  _internal_mutable_positions()->Clear();
  _impl_.id_.ClearToEmpty();
  _impl_.title_.ClearToEmpty();
  _impl_.pay_url_.ClearToEmpty();
  _impl_.paid_by_card_masked_.ClearToEmpty();
  _impl_.paid_by_card_espp_id_.ClearToEmpty();
  _impl_.espp_req_user_msg_.ClearToEmpty();
  _impl_.espp_invoice_id_.ClearToEmpty();
  _impl_.phone_number_.ClearToEmpty();
  _impl_.email_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.created_at_ != nullptr);
      _impl_.created_at_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.updated_at_ != nullptr);
      _impl_.updated_at_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      ABSL_DCHECK(_impl_.status_changed_at_ != nullptr);
      _impl_.status_changed_at_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      ABSL_DCHECK(_impl_.paid_at_ != nullptr);
      _impl_.paid_at_->Clear();
    }
  }
  ::memset(&_impl_.user_id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.espp_req_status_) -
      reinterpret_cast<char*>(&_impl_.user_id_)) + sizeof(_impl_.espp_req_status_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Invoice::_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 [(.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;
      // string title = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_title();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 user_id = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.user_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];
      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_invoice_status_type(static_cast<::keyapis::invoice::v1::Invoice_InvoiceStatusType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = REQUIRED];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_created_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp updated_at = 6 [(.google.api.field_behavior) = REQUIRED];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_updated_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.invoice.v1.Invoice.Position positions = 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_positions(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_pay_interface_type(static_cast<::keyapis::invoice::v1::Invoice_PayInterfaceType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.PaywayType payway_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_payway_type(static_cast<::keyapis::invoice::v1::Invoice_PaywayType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp status_changed_at = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_status_changed_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp paid_at = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_paid_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string pay_url = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 98)) {
          auto str = _internal_mutable_pay_url();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string paid_by_card_masked = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
          auto str = _internal_mutable_paid_by_card_masked();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string paid_by_card_espp_id = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 114)) {
          auto str = _internal_mutable_paid_by_card_espp_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.CardType card_type = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 120)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_card_type(static_cast<::keyapis::invoice::v1::Invoice_CardType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 espp_req_status = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 128)) {
          _impl_.espp_req_status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string espp_req_user_msg = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 138)) {
          auto str = _internal_mutable_espp_req_user_msg();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string espp_invoice_id = 18;
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 146)) {
          auto str = _internal_mutable_espp_invoice_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string phone_number = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 154)) {
          auto str = _internal_mutable_phone_number();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string email = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 162)) {
          auto str = _internal_mutable_email();
          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:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* Invoice::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.Invoice)
  ::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.invoice.v1.Invoice.id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // string title = 2 [(.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.invoice.v1.Invoice.title");
    target = stream->WriteStringMaybeAliased(2, _s, target);
  }

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

  // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_invoice_status_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        4, this->_internal_invoice_status_type(), target);
  }

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

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

  // repeated .keyapis.invoice.v1.Invoice.Position positions = 7 [(.google.api.field_behavior) = REQUIRED];
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_positions_size()); i < n; i++) {
    const auto& repfield = this->_internal_positions(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;
  if (this->_internal_pay_interface_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        8, this->_internal_pay_interface_type(), target);
  }

  // .keyapis.invoice.v1.Invoice.PaywayType payway_type = 9;
  if (this->_internal_payway_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        9, this->_internal_payway_type(), target);
  }

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

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

  // string pay_url = 12;
  if (!this->_internal_pay_url().empty()) {
    const std::string& _s = this->_internal_pay_url();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.pay_url");
    target = stream->WriteStringMaybeAliased(12, _s, target);
  }

  // string paid_by_card_masked = 13;
  if (!this->_internal_paid_by_card_masked().empty()) {
    const std::string& _s = this->_internal_paid_by_card_masked();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.paid_by_card_masked");
    target = stream->WriteStringMaybeAliased(13, _s, target);
  }

  // string paid_by_card_espp_id = 14;
  if (!this->_internal_paid_by_card_espp_id().empty()) {
    const std::string& _s = this->_internal_paid_by_card_espp_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.paid_by_card_espp_id");
    target = stream->WriteStringMaybeAliased(14, _s, target);
  }

  // .keyapis.invoice.v1.Invoice.CardType card_type = 15;
  if (this->_internal_card_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        15, this->_internal_card_type(), target);
  }

  // int32 espp_req_status = 16;
  if (this->_internal_espp_req_status() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        16, this->_internal_espp_req_status(), target);
  }

  // string espp_req_user_msg = 17;
  if (!this->_internal_espp_req_user_msg().empty()) {
    const std::string& _s = this->_internal_espp_req_user_msg();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.espp_req_user_msg");
    target = stream->WriteStringMaybeAliased(17, _s, target);
  }

  // string espp_invoice_id = 18;
  if (!this->_internal_espp_invoice_id().empty()) {
    const std::string& _s = this->_internal_espp_invoice_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.espp_invoice_id");
    target = stream->WriteStringMaybeAliased(18, _s, target);
  }

  // string phone_number = 19;
  if (!this->_internal_phone_number().empty()) {
    const std::string& _s = this->_internal_phone_number();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.phone_number");
    target = stream->WriteStringMaybeAliased(19, _s, target);
  }

  // string email = 20;
  if (!this->_internal_email().empty()) {
    const std::string& _s = this->_internal_email();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.Invoice.email");
    target = stream->WriteStringMaybeAliased(20, _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.invoice.v1.Invoice)
  return target;
}

::size_t Invoice::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.Invoice)
  ::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.invoice.v1.Invoice.Position positions = 7 [(.google.api.field_behavior) = REQUIRED];
  total_size += 1UL * this->_internal_positions_size();
  for (const auto& msg : this->_internal_positions()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // 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());
  }

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

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

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

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

  // string espp_req_user_msg = 17;
  if (!this->_internal_espp_req_user_msg().empty()) {
    total_size += 2 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_espp_req_user_msg());
  }

  // string espp_invoice_id = 18;
  if (!this->_internal_espp_invoice_id().empty()) {
    total_size += 2 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_espp_invoice_id());
  }

  // string phone_number = 19;
  if (!this->_internal_phone_number().empty()) {
    total_size += 2 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_phone_number());
  }

  // string email = 20;
  if (!this->_internal_email().empty()) {
    total_size += 2 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_email());
  }

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    // .google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = REQUIRED];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.created_at_);
    }

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

    // .google.protobuf.Timestamp status_changed_at = 10;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.status_changed_at_);
    }

    // .google.protobuf.Timestamp paid_at = 11;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.paid_at_);
    }

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

  // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_invoice_status_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_invoice_status_type());
  }

  // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;
  if (this->_internal_pay_interface_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_pay_interface_type());
  }

  // .keyapis.invoice.v1.Invoice.PaywayType payway_type = 9;
  if (this->_internal_payway_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_payway_type());
  }

  // .keyapis.invoice.v1.Invoice.CardType card_type = 15;
  if (this->_internal_card_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_card_type());
  }

  // int32 espp_req_status = 16;
  if (this->_internal_espp_req_status() != 0) {
    total_size += 2 + ::_pbi::WireFormatLite::Int32Size(
                                    this->_internal_espp_req_status());
  }

  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 Invoice::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Invoice*>(
      &from));
}

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

  _this->_internal_mutable_positions()->MergeFrom(from._internal_positions());
  if (!from._internal_id().empty()) {
    _this->_internal_set_id(from._internal_id());
  }
  if (!from._internal_title().empty()) {
    _this->_internal_set_title(from._internal_title());
  }
  if (!from._internal_pay_url().empty()) {
    _this->_internal_set_pay_url(from._internal_pay_url());
  }
  if (!from._internal_paid_by_card_masked().empty()) {
    _this->_internal_set_paid_by_card_masked(from._internal_paid_by_card_masked());
  }
  if (!from._internal_paid_by_card_espp_id().empty()) {
    _this->_internal_set_paid_by_card_espp_id(from._internal_paid_by_card_espp_id());
  }
  if (!from._internal_espp_req_user_msg().empty()) {
    _this->_internal_set_espp_req_user_msg(from._internal_espp_req_user_msg());
  }
  if (!from._internal_espp_invoice_id().empty()) {
    _this->_internal_set_espp_invoice_id(from._internal_espp_invoice_id());
  }
  if (!from._internal_phone_number().empty()) {
    _this->_internal_set_phone_number(from._internal_phone_number());
  }
  if (!from._internal_email().empty()) {
    _this->_internal_set_email(from._internal_email());
  }
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_created_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_created_at());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_updated_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_updated_at());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_status_changed_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_status_changed_at());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_paid_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_paid_at());
    }
  }
  if (from._internal_user_id() != 0) {
    _this->_internal_set_user_id(from._internal_user_id());
  }
  if (from._internal_invoice_status_type() != 0) {
    _this->_internal_set_invoice_status_type(from._internal_invoice_status_type());
  }
  if (from._internal_pay_interface_type() != 0) {
    _this->_internal_set_pay_interface_type(from._internal_pay_interface_type());
  }
  if (from._internal_payway_type() != 0) {
    _this->_internal_set_payway_type(from._internal_payway_type());
  }
  if (from._internal_card_type() != 0) {
    _this->_internal_set_card_type(from._internal_card_type());
  }
  if (from._internal_espp_req_status() != 0) {
    _this->_internal_set_espp_req_status(from._internal_espp_req_status());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Invoice::InternalSwap(Invoice* 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_positions()->InternalSwap(other->_internal_mutable_positions());
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.id_, lhs_arena,
                                       &other->_impl_.id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.title_, lhs_arena,
                                       &other->_impl_.title_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.pay_url_, lhs_arena,
                                       &other->_impl_.pay_url_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.paid_by_card_masked_, lhs_arena,
                                       &other->_impl_.paid_by_card_masked_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.paid_by_card_espp_id_, lhs_arena,
                                       &other->_impl_.paid_by_card_espp_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.espp_req_user_msg_, lhs_arena,
                                       &other->_impl_.espp_req_user_msg_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.espp_invoice_id_, lhs_arena,
                                       &other->_impl_.espp_invoice_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.phone_number_, lhs_arena,
                                       &other->_impl_.phone_number_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.email_, lhs_arena,
                                       &other->_impl_.email_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Invoice, _impl_.espp_req_status_)
      + sizeof(Invoice::_impl_.espp_req_status_)
      - PROTOBUF_FIELD_OFFSET(Invoice, _impl_.created_at_)>(
          reinterpret_cast<char*>(&_impl_.created_at_),
          reinterpret_cast<char*>(&other->_impl_.created_at_));
}

std::string Invoice::GetTypeName() const {
  return "keyapis.invoice.v1.Invoice";
}

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

class InvoiceFilter::_Internal {
 public:
};

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

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

    , decltype(_impl_.invoice_status_type_) { 0 }

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

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

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

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

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

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

const char* InvoiceFilter::_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 user_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.user_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_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_invoice_status_type(static_cast<::keyapis::invoice::v1::Invoice_InvoiceStatusType>(val));
        } 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* InvoiceFilter::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.InvoiceFilter)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 user_id = 1;
  if (this->_internal_user_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_user_id(), target);
  }

  // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 2;
  if (this->_internal_invoice_status_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        2, this->_internal_invoice_status_type(), 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.invoice.v1.InvoiceFilter)
  return target;
}

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

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

  // int32 user_id = 1;
  if (this->_internal_user_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_user_id());
  }

  // .keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 2;
  if (this->_internal_invoice_status_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_invoice_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 InvoiceFilter::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const InvoiceFilter*>(
      &from));
}

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

  if (from._internal_user_id() != 0) {
    _this->_internal_set_user_id(from._internal_user_id());
  }
  if (from._internal_invoice_status_type() != 0) {
    _this->_internal_set_invoice_status_type(from._internal_invoice_status_type());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

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

std::string InvoiceFilter::GetTypeName() const {
  return "keyapis.invoice.v1.InvoiceFilter";
}

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

class InvoicePaging::_Internal {
 public:
};

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

inline void InvoicePaging::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_)*/{}
  };
}

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

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

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

void InvoicePaging::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.InvoicePaging)
  ::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* InvoicePaging::_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.invoice.v1.InvoicePaging.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::invoice::v1::InvoicePaging_OrderByType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.InvoicePaging.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::invoice::v1::InvoicePaging_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* InvoicePaging::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.InvoicePaging)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.invoice.v1.InvoicePaging.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.invoice.v1.InvoicePaging.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.invoice.v1.InvoicePaging)
  return target;
}

::size_t InvoicePaging::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.InvoicePaging)
  ::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.invoice.v1.InvoicePaging.OrderByType order_by_type = 1;
  if (this->_internal_order_by_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_order_by_type());
  }

  // .keyapis.invoice.v1.InvoicePaging.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 InvoicePaging::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const InvoicePaging*>(
      &from));
}

void InvoicePaging::MergeFrom(const InvoicePaging& from) {
  InvoicePaging* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.InvoicePaging)
  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 InvoicePaging::CopyFrom(const InvoicePaging& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.invoice.v1.InvoicePaging)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string InvoicePaging::GetTypeName() const {
  return "keyapis.invoice.v1.InvoicePaging";
}

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

class CreateInvoiceRequest::_Internal {
 public:
};

CreateInvoiceRequest::CreateInvoiceRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.CreateInvoiceRequest)
}
CreateInvoiceRequest::CreateInvoiceRequest(const CreateInvoiceRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CreateInvoiceRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.positions_){from._impl_.positions_}
    , decltype(_impl_.return_url_) {}

    , decltype(_impl_.phone_number_) {}

    , decltype(_impl_.email_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.user_id_) {}

    , decltype(_impl_.pay_interface_type_) {}

    , decltype(_impl_.payway_type_) {}

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

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.return_url_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.return_url_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_return_url().empty()) {
    _this->_impl_.return_url_.Set(from._internal_return_url(), _this->GetArenaForAllocation());
  }
  _impl_.phone_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.phone_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_phone_number().empty()) {
    _this->_impl_.phone_number_.Set(from._internal_phone_number(), _this->GetArenaForAllocation());
  }
  _impl_.email_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.email_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_email().empty()) {
    _this->_impl_.email_.Set(from._internal_email(), _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());
  }
  ::memcpy(&_impl_.user_id_, &from._impl_.user_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.payway_type_) -
    reinterpret_cast<char*>(&_impl_.user_id_)) + sizeof(_impl_.payway_type_));
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.CreateInvoiceRequest)
}

inline void CreateInvoiceRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.positions_){arena}
    , decltype(_impl_.return_url_) {}

    , decltype(_impl_.phone_number_) {}

    , decltype(_impl_.email_) {}

    , decltype(_impl_.title_) {}

    , decltype(_impl_.user_id_) { 0 }

    , decltype(_impl_.pay_interface_type_) { 0 }

    , decltype(_impl_.payway_type_) { 0 }

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.return_url_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.return_url_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.phone_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.phone_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.email_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.email_.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
}

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

inline void CreateInvoiceRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_positions()->~RepeatedPtrField();
  _impl_.return_url_.Destroy();
  _impl_.phone_number_.Destroy();
  _impl_.email_.Destroy();
  _impl_.title_.Destroy();
}

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

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

  _internal_mutable_positions()->Clear();
  _impl_.return_url_.ClearToEmpty();
  _impl_.phone_number_.ClearToEmpty();
  _impl_.email_.ClearToEmpty();
  _impl_.title_.ClearToEmpty();
  ::memset(&_impl_.user_id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.payway_type_) -
      reinterpret_cast<char*>(&_impl_.user_id_)) + sizeof(_impl_.payway_type_));
  _internal_metadata_.Clear<std::string>();
}

const char* CreateInvoiceRequest::_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 user_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.user_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated .keyapis.invoice.v1.Invoice.Position positions = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_positions(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 3 [(.google.api.field_behavior) = REQUIRED];
      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_pay_interface_type(static_cast<::keyapis::invoice::v1::Invoice_PayInterfaceType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.PaywayType payway_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_payway_type(static_cast<::keyapis::invoice::v1::Invoice_PaywayType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // string return_url = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_return_url();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string phone_number = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_phone_number();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string email = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_email();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string title = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
          auto str = _internal_mutable_title();
          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* CreateInvoiceRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.CreateInvoiceRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // repeated .keyapis.invoice.v1.Invoice.Position positions = 2 [(.google.api.field_behavior) = REQUIRED];
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_positions_size()); i < n; i++) {
    const auto& repfield = this->_internal_positions(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_pay_interface_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        3, this->_internal_pay_interface_type(), target);
  }

  // .keyapis.invoice.v1.Invoice.PaywayType payway_type = 4;
  if (this->_internal_payway_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        4, this->_internal_payway_type(), target);
  }

  // string return_url = 5;
  if (!this->_internal_return_url().empty()) {
    const std::string& _s = this->_internal_return_url();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.CreateInvoiceRequest.return_url");
    target = stream->WriteStringMaybeAliased(5, _s, target);
  }

  // string phone_number = 6;
  if (!this->_internal_phone_number().empty()) {
    const std::string& _s = this->_internal_phone_number();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.CreateInvoiceRequest.phone_number");
    target = stream->WriteStringMaybeAliased(6, _s, target);
  }

  // string email = 7;
  if (!this->_internal_email().empty()) {
    const std::string& _s = this->_internal_email();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.CreateInvoiceRequest.email");
    target = stream->WriteStringMaybeAliased(7, _s, target);
  }

  // string title = 8;
  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.invoice.v1.CreateInvoiceRequest.title");
    target = stream->WriteStringMaybeAliased(8, _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.invoice.v1.CreateInvoiceRequest)
  return target;
}

::size_t CreateInvoiceRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.CreateInvoiceRequest)
  ::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.invoice.v1.Invoice.Position positions = 2 [(.google.api.field_behavior) = REQUIRED];
  total_size += 1UL * this->_internal_positions_size();
  for (const auto& msg : this->_internal_positions()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

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

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

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

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

  // .keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_pay_interface_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_pay_interface_type());
  }

  // .keyapis.invoice.v1.Invoice.PaywayType payway_type = 4;
  if (this->_internal_payway_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_payway_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 CreateInvoiceRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CreateInvoiceRequest*>(
      &from));
}

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

  _this->_internal_mutable_positions()->MergeFrom(from._internal_positions());
  if (!from._internal_return_url().empty()) {
    _this->_internal_set_return_url(from._internal_return_url());
  }
  if (!from._internal_phone_number().empty()) {
    _this->_internal_set_phone_number(from._internal_phone_number());
  }
  if (!from._internal_email().empty()) {
    _this->_internal_set_email(from._internal_email());
  }
  if (!from._internal_title().empty()) {
    _this->_internal_set_title(from._internal_title());
  }
  if (from._internal_user_id() != 0) {
    _this->_internal_set_user_id(from._internal_user_id());
  }
  if (from._internal_pay_interface_type() != 0) {
    _this->_internal_set_pay_interface_type(from._internal_pay_interface_type());
  }
  if (from._internal_payway_type() != 0) {
    _this->_internal_set_payway_type(from._internal_payway_type());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void CreateInvoiceRequest::InternalSwap(CreateInvoiceRequest* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _internal_mutable_positions()->InternalSwap(other->_internal_mutable_positions());
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.return_url_, lhs_arena,
                                       &other->_impl_.return_url_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.phone_number_, lhs_arena,
                                       &other->_impl_.phone_number_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.email_, lhs_arena,
                                       &other->_impl_.email_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.title_, lhs_arena,
                                       &other->_impl_.title_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(CreateInvoiceRequest, _impl_.payway_type_)
      + sizeof(CreateInvoiceRequest::_impl_.payway_type_)
      - PROTOBUF_FIELD_OFFSET(CreateInvoiceRequest, _impl_.user_id_)>(
          reinterpret_cast<char*>(&_impl_.user_id_),
          reinterpret_cast<char*>(&other->_impl_.user_id_));
}

std::string CreateInvoiceRequest::GetTypeName() const {
  return "keyapis.invoice.v1.CreateInvoiceRequest";
}

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

class CreateInvoiceResponse_Error_MissingUserContacts::_Internal {
 public:
};

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

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

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

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

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

void CreateInvoiceResponse_Error_MissingUserContacts::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  ::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* CreateInvoiceResponse_Error_MissingUserContacts::_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* CreateInvoiceResponse_Error_MissingUserContacts::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  ::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.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  return target;
}

::size_t CreateInvoiceResponse_Error_MissingUserContacts::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  ::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 CreateInvoiceResponse_Error_MissingUserContacts::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CreateInvoiceResponse_Error_MissingUserContacts*>(
      &from));
}

void CreateInvoiceResponse_Error_MissingUserContacts::MergeFrom(const CreateInvoiceResponse_Error_MissingUserContacts& from) {
  CreateInvoiceResponse_Error_MissingUserContacts* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  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 CreateInvoiceResponse_Error_MissingUserContacts::CopyFrom(const CreateInvoiceResponse_Error_MissingUserContacts& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string CreateInvoiceResponse_Error_MissingUserContacts::GetTypeName() const {
  return "keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts";
}

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

class CreateInvoiceResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::CreateInvoiceResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::invoice::v1::ValidationError& validation(const CreateInvoiceResponse_Error* msg);
  static const ::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts& missing_user_contacts(const CreateInvoiceResponse_Error* msg);
  static const ::keyapis::invoice::v1::Invoice_ExternalError& external(const CreateInvoiceResponse_Error* msg);
  static const ::keyapis::invoice::v1::Invoice_SavingError& saving(const CreateInvoiceResponse_Error* msg);
};

const ::keyapis::invoice::v1::ValidationError&
CreateInvoiceResponse_Error::_Internal::validation(const CreateInvoiceResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
const ::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts&
CreateInvoiceResponse_Error::_Internal::missing_user_contacts(const CreateInvoiceResponse_Error* msg) {
  return *msg->_impl_.reason_.missing_user_contacts_;
}
const ::keyapis::invoice::v1::Invoice_ExternalError&
CreateInvoiceResponse_Error::_Internal::external(const CreateInvoiceResponse_Error* msg) {
  return *msg->_impl_.reason_.external_;
}
const ::keyapis::invoice::v1::Invoice_SavingError&
CreateInvoiceResponse_Error::_Internal::saving(const CreateInvoiceResponse_Error* msg) {
  return *msg->_impl_.reason_.saving_;
}
void CreateInvoiceResponse_Error::set_allocated_validation(::keyapis::invoice::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(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(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.invoice.v1.CreateInvoiceResponse.Error.validation)
}
void CreateInvoiceResponse_Error::clear_validation() {
  if (reason_case() == kValidation) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.reason_.validation_;
    }
    clear_has_reason();
  }
}
void CreateInvoiceResponse_Error::set_allocated_missing_user_contacts(::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts* missing_user_contacts) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (missing_user_contacts) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(missing_user_contacts);
    if (message_arena != submessage_arena) {
      missing_user_contacts = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, missing_user_contacts, submessage_arena);
    }
    set_has_missing_user_contacts();
    _impl_.reason_.missing_user_contacts_ = missing_user_contacts;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.invoice.v1.CreateInvoiceResponse.Error.missing_user_contacts)
}
void CreateInvoiceResponse_Error::set_allocated_external(::keyapis::invoice::v1::Invoice_ExternalError* external) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (external) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(external);
    if (message_arena != submessage_arena) {
      external = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, external, submessage_arena);
    }
    set_has_external();
    _impl_.reason_.external_ = external;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.invoice.v1.CreateInvoiceResponse.Error.external)
}
void CreateInvoiceResponse_Error::set_allocated_saving(::keyapis::invoice::v1::Invoice_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.invoice.v1.CreateInvoiceResponse.Error.saving)
}
CreateInvoiceResponse_Error::CreateInvoiceResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.CreateInvoiceResponse.Error)
}
CreateInvoiceResponse_Error::CreateInvoiceResponse_Error(const CreateInvoiceResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CreateInvoiceResponse_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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kMissingUserContacts: {
      _this->_internal_mutable_missing_user_contacts()->::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts::MergeFrom(
          from._internal_missing_user_contacts());
      break;
    }
    case kExternal: {
      _this->_internal_mutable_external()->::keyapis::invoice::v1::Invoice_ExternalError::MergeFrom(
          from._internal_external());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::keyapis::invoice::v1::Invoice_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.CreateInvoiceResponse.Error)
}

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

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

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

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

void CreateInvoiceResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.CreateInvoiceResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case kMissingUserContacts: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.missing_user_contacts_;
      }
      break;
    }
    case kExternal: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.external_;
      }
      break;
    }
    case kSaving: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.saving_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void CreateInvoiceResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.CreateInvoiceResponse.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* CreateInvoiceResponse_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.invoice.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.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts missing_user_contacts = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_missing_user_contacts(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.ExternalError external = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_external(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice.SavingError saving = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          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* CreateInvoiceResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.CreateInvoiceResponse.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 kMissingUserContacts: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::missing_user_contacts(this),
          _Internal::missing_user_contacts(this).GetCachedSize(), target, stream);
      break;
    }
    case kExternal: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(3, _Internal::external(this),
          _Internal::external(this).GetCachedSize(), target, stream);
      break;
    }
    case kSaving: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(4, _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.invoice.v1.CreateInvoiceResponse.Error)
  return target;
}

::size_t CreateInvoiceResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.CreateInvoiceResponse.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.invoice.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    // .keyapis.invoice.v1.CreateInvoiceResponse.Error.MissingUserContacts missing_user_contacts = 2;
    case kMissingUserContacts: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.missing_user_contacts_);
      break;
    }
    // .keyapis.invoice.v1.Invoice.ExternalError external = 3;
    case kExternal: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.external_);
      break;
    }
    // .keyapis.invoice.v1.Invoice.SavingError saving = 4;
    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 CreateInvoiceResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CreateInvoiceResponse_Error*>(
      &from));
}

void CreateInvoiceResponse_Error::MergeFrom(const CreateInvoiceResponse_Error& from) {
  CreateInvoiceResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.CreateInvoiceResponse.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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kMissingUserContacts: {
      _this->_internal_mutable_missing_user_contacts()->::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts::MergeFrom(
          from._internal_missing_user_contacts());
      break;
    }
    case kExternal: {
      _this->_internal_mutable_external()->::keyapis::invoice::v1::Invoice_ExternalError::MergeFrom(
          from._internal_external());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::keyapis::invoice::v1::Invoice_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void CreateInvoiceResponse_Error::InternalSwap(CreateInvoiceResponse_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 CreateInvoiceResponse_Error::GetTypeName() const {
  return "keyapis.invoice.v1.CreateInvoiceResponse.Error";
}

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

class CreateInvoiceResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::CreateInvoiceResponse, _impl_._oneof_case_);
  static const ::keyapis::invoice::v1::CreateInvoiceResponse_Error& error(const CreateInvoiceResponse* msg);
  static const ::keyapis::invoice::v1::Invoice& data(const CreateInvoiceResponse* msg);
};

const ::keyapis::invoice::v1::CreateInvoiceResponse_Error&
CreateInvoiceResponse::_Internal::error(const CreateInvoiceResponse* msg) {
  return *msg->_impl_.type_.error_;
}
const ::keyapis::invoice::v1::Invoice&
CreateInvoiceResponse::_Internal::data(const CreateInvoiceResponse* msg) {
  return *msg->_impl_.type_.data_;
}
void CreateInvoiceResponse::set_allocated_error(::keyapis::invoice::v1::CreateInvoiceResponse_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.invoice.v1.CreateInvoiceResponse.error)
}
void CreateInvoiceResponse::set_allocated_data(::keyapis::invoice::v1::Invoice* 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.invoice.v1.CreateInvoiceResponse.data)
}
CreateInvoiceResponse::CreateInvoiceResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.CreateInvoiceResponse)
}
CreateInvoiceResponse::CreateInvoiceResponse(const CreateInvoiceResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CreateInvoiceResponse* 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 kError: {
      _this->_internal_mutable_error()->::keyapis::invoice::v1::CreateInvoiceResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case kData: {
      _this->_internal_mutable_data()->::keyapis::invoice::v1::Invoice::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.CreateInvoiceResponse)
}

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

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

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

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

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


void CreateInvoiceResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.CreateInvoiceResponse)
  ::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* CreateInvoiceResponse::_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.invoice.v1.CreateInvoiceResponse.Error error = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice data = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          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* CreateInvoiceResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.CreateInvoiceResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    case kData: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::data(this),
          _Internal::data(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.invoice.v1.CreateInvoiceResponse)
  return target;
}

::size_t CreateInvoiceResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.CreateInvoiceResponse)
  ::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.invoice.v1.CreateInvoiceResponse.Error error = 1;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    // .keyapis.invoice.v1.Invoice data = 2;
    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 CreateInvoiceResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CreateInvoiceResponse*>(
      &from));
}

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

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

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

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

void CreateInvoiceResponse::InternalSwap(CreateInvoiceResponse* 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 CreateInvoiceResponse::GetTypeName() const {
  return "keyapis.invoice.v1.CreateInvoiceResponse";
}

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

class GetInvoiceRequest::_Internal {
 public:
};

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

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

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

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

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

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

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

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

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

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

const char* GetInvoiceRequest::_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 invoice_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_invoice_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* GetInvoiceRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string invoice_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_invoice_id().empty()) {
    const std::string& _s = this->_internal_invoice_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.GetInvoiceRequest.invoice_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.invoice.v1.GetInvoiceRequest)
  return target;
}

::size_t GetInvoiceRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceRequest)
  ::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 invoice_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_invoice_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_invoice_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 GetInvoiceRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceRequest*>(
      &from));
}

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

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

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

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

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

std::string GetInvoiceRequest::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceRequest";
}

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

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

const ::keyapis::invoice::v1::ValidationError&
GetInvoiceResponse_Error::_Internal::validation(const GetInvoiceResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetInvoiceResponse_Error::set_allocated_validation(::keyapis::invoice::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(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(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.invoice.v1.GetInvoiceResponse.Error.validation)
}
void GetInvoiceResponse_Error::clear_validation() {
  if (reason_case() == kValidation) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.reason_.validation_;
    }
    clear_has_reason();
  }
}
GetInvoiceResponse_Error::GetInvoiceResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceResponse.Error)
}
GetInvoiceResponse_Error::GetInvoiceResponse_Error(const GetInvoiceResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceResponse_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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceResponse.Error)
}

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

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

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

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

void GetInvoiceResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.GetInvoiceResponse.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 GetInvoiceResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceResponse.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* GetInvoiceResponse_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.invoice.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* GetInvoiceResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.invoice.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.invoice.v1.GetInvoiceResponse.Error)
  return target;
}

::size_t GetInvoiceResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceResponse.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.invoice.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 GetInvoiceResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceResponse_Error*>(
      &from));
}

void GetInvoiceResponse_Error::MergeFrom(const GetInvoiceResponse_Error& from) {
  GetInvoiceResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.GetInvoiceResponse.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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetInvoiceResponse_Error::InternalSwap(GetInvoiceResponse_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 GetInvoiceResponse_Error::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceResponse.Error";
}

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

class GetInvoiceResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::GetInvoiceResponse, _impl_._oneof_case_);
  static const ::keyapis::invoice::v1::GetInvoiceResponse_Error& error(const GetInvoiceResponse* msg);
  static const ::keyapis::invoice::v1::Invoice& data(const GetInvoiceResponse* msg);
};

const ::keyapis::invoice::v1::GetInvoiceResponse_Error&
GetInvoiceResponse::_Internal::error(const GetInvoiceResponse* msg) {
  return *msg->_impl_.type_.error_;
}
const ::keyapis::invoice::v1::Invoice&
GetInvoiceResponse::_Internal::data(const GetInvoiceResponse* msg) {
  return *msg->_impl_.type_.data_;
}
void GetInvoiceResponse::set_allocated_error(::keyapis::invoice::v1::GetInvoiceResponse_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.invoice.v1.GetInvoiceResponse.error)
}
void GetInvoiceResponse::set_allocated_data(::keyapis::invoice::v1::Invoice* 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.invoice.v1.GetInvoiceResponse.data)
}
GetInvoiceResponse::GetInvoiceResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceResponse)
}
GetInvoiceResponse::GetInvoiceResponse(const GetInvoiceResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceResponse* 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 kError: {
      _this->_internal_mutable_error()->::keyapis::invoice::v1::GetInvoiceResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case kData: {
      _this->_internal_mutable_data()->::keyapis::invoice::v1::Invoice::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceResponse)
}

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

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

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

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

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


void GetInvoiceResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceResponse)
  ::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* GetInvoiceResponse::_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.invoice.v1.GetInvoiceResponse.Error error = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.Invoice data = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          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* GetInvoiceResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (type_case()) {
    case kError: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::error(this),
          _Internal::error(this).GetCachedSize(), target, stream);
      break;
    }
    case kData: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::data(this),
          _Internal::data(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.invoice.v1.GetInvoiceResponse)
  return target;
}

::size_t GetInvoiceResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceResponse)
  ::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.invoice.v1.GetInvoiceResponse.Error error = 1;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    // .keyapis.invoice.v1.Invoice data = 2;
    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 GetInvoiceResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceResponse*>(
      &from));
}

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

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

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

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

void GetInvoiceResponse::InternalSwap(GetInvoiceResponse* 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 GetInvoiceResponse::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceResponse";
}

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

class PostInvoiceConfirmRequest_Card::_Internal {
 public:
};

PostInvoiceConfirmRequest_Card::PostInvoiceConfirmRequest_Card(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.PostInvoiceConfirmRequest.Card)
}
PostInvoiceConfirmRequest_Card::PostInvoiceConfirmRequest_Card(const PostInvoiceConfirmRequest_Card& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostInvoiceConfirmRequest_Card* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.card_num_) {}

    , decltype(_impl_.card_kind_) {}

    , decltype(_impl_.bank_name_) {}

    , decltype(_impl_.espp_card_id_) {}

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

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.card_num_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.card_num_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_card_num().empty()) {
    _this->_impl_.card_num_.Set(from._internal_card_num(), _this->GetArenaForAllocation());
  }
  _impl_.card_kind_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.card_kind_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_card_kind().empty()) {
    _this->_impl_.card_kind_.Set(from._internal_card_kind(), _this->GetArenaForAllocation());
  }
  _impl_.bank_name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.bank_name_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_bank_name().empty()) {
    _this->_impl_.bank_name_.Set(from._internal_bank_name(), _this->GetArenaForAllocation());
  }
  _this->_impl_.espp_card_id_ = from._impl_.espp_card_id_;
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.PostInvoiceConfirmRequest.Card)
}

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

    , decltype(_impl_.card_kind_) {}

    , decltype(_impl_.bank_name_) {}

    , decltype(_impl_.espp_card_id_) { 0 }

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

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

inline void PostInvoiceConfirmRequest_Card::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.card_num_.Destroy();
  _impl_.card_kind_.Destroy();
  _impl_.bank_name_.Destroy();
}

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

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

  _impl_.card_num_.ClearToEmpty();
  _impl_.card_kind_.ClearToEmpty();
  _impl_.bank_name_.ClearToEmpty();
  _impl_.espp_card_id_ = 0;
  _internal_metadata_.Clear<std::string>();
}

const char* PostInvoiceConfirmRequest_Card::_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 espp_card_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.espp_card_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string card_num = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_card_num();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string card_kind = 3 [json_name = "cardType"];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_card_kind();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string bank_name = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_bank_name();
          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* PostInvoiceConfirmRequest_Card::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.PostInvoiceConfirmRequest.Card)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 espp_card_id = 1;
  if (this->_internal_espp_card_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_espp_card_id(), target);
  }

  // string card_num = 2;
  if (!this->_internal_card_num().empty()) {
    const std::string& _s = this->_internal_card_num();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.Card.card_num");
    target = stream->WriteStringMaybeAliased(2, _s, target);
  }

  // string card_kind = 3 [json_name = "cardType"];
  if (!this->_internal_card_kind().empty()) {
    const std::string& _s = this->_internal_card_kind();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.Card.card_kind");
    target = stream->WriteStringMaybeAliased(3, _s, target);
  }

  // string bank_name = 4;
  if (!this->_internal_bank_name().empty()) {
    const std::string& _s = this->_internal_bank_name();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.Card.bank_name");
    target = stream->WriteStringMaybeAliased(4, _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.invoice.v1.PostInvoiceConfirmRequest.Card)
  return target;
}

::size_t PostInvoiceConfirmRequest_Card::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.PostInvoiceConfirmRequest.Card)
  ::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 card_num = 2;
  if (!this->_internal_card_num().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_card_num());
  }

  // string card_kind = 3 [json_name = "cardType"];
  if (!this->_internal_card_kind().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_card_kind());
  }

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

  // int32 espp_card_id = 1;
  if (this->_internal_espp_card_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_espp_card_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 PostInvoiceConfirmRequest_Card::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostInvoiceConfirmRequest_Card*>(
      &from));
}

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

  if (!from._internal_card_num().empty()) {
    _this->_internal_set_card_num(from._internal_card_num());
  }
  if (!from._internal_card_kind().empty()) {
    _this->_internal_set_card_kind(from._internal_card_kind());
  }
  if (!from._internal_bank_name().empty()) {
    _this->_internal_set_bank_name(from._internal_bank_name());
  }
  if (from._internal_espp_card_id() != 0) {
    _this->_internal_set_espp_card_id(from._internal_espp_card_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostInvoiceConfirmRequest_Card::InternalSwap(PostInvoiceConfirmRequest_Card* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.card_num_, lhs_arena,
                                       &other->_impl_.card_num_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.card_kind_, lhs_arena,
                                       &other->_impl_.card_kind_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.bank_name_, lhs_arena,
                                       &other->_impl_.bank_name_, rhs_arena);

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

std::string PostInvoiceConfirmRequest_Card::GetTypeName() const {
  return "keyapis.invoice.v1.PostInvoiceConfirmRequest.Card";
}

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

class PostInvoiceConfirmRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<PostInvoiceConfirmRequest>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(PostInvoiceConfirmRequest, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& create_time_at(const PostInvoiceConfirmRequest* msg);
  static void set_has_create_time_at(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& pay_time_at(const PostInvoiceConfirmRequest* msg);
  static void set_has_pay_time_at(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& abandon_time_at(const PostInvoiceConfirmRequest* msg);
  static void set_has_abandon_time_at(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card& card(const PostInvoiceConfirmRequest* msg);
  static void set_has_card(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::Timestamp&
PostInvoiceConfirmRequest::_Internal::create_time_at(const PostInvoiceConfirmRequest* msg) {
  return *msg->_impl_.create_time_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
PostInvoiceConfirmRequest::_Internal::pay_time_at(const PostInvoiceConfirmRequest* msg) {
  return *msg->_impl_.pay_time_at_;
}
const ::PROTOBUF_NAMESPACE_ID::Timestamp&
PostInvoiceConfirmRequest::_Internal::abandon_time_at(const PostInvoiceConfirmRequest* msg) {
  return *msg->_impl_.abandon_time_at_;
}
const ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card&
PostInvoiceConfirmRequest::_Internal::card(const PostInvoiceConfirmRequest* msg) {
  return *msg->_impl_.card_;
}
void PostInvoiceConfirmRequest::clear_create_time_at() {
  if (_impl_.create_time_at_ != nullptr) _impl_.create_time_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void PostInvoiceConfirmRequest::clear_pay_time_at() {
  if (_impl_.pay_time_at_ != nullptr) _impl_.pay_time_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
void PostInvoiceConfirmRequest::clear_abandon_time_at() {
  if (_impl_.abandon_time_at_ != nullptr) _impl_.abandon_time_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
PostInvoiceConfirmRequest::PostInvoiceConfirmRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.PostInvoiceConfirmRequest)
}
PostInvoiceConfirmRequest::PostInvoiceConfirmRequest(const PostInvoiceConfirmRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostInvoiceConfirmRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.src_pay_id_) {}

    , decltype(_impl_.espp_pay_id_) {}

    , decltype(_impl_.req_type_) {}

    , decltype(_impl_.currency_) {}

    , decltype(_impl_.pay_method_) {}

    , decltype(_impl_.req_note_) {}

    , decltype(_impl_.req_user_msg_) {}

    , decltype(_impl_.create_time_at_){nullptr}
    , decltype(_impl_.pay_time_at_){nullptr}
    , decltype(_impl_.abandon_time_at_){nullptr}
    , decltype(_impl_.card_){nullptr}
    , decltype(_impl_.pay_status_) {}

    , decltype(_impl_.amount_) {}
  };

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.src_pay_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.src_pay_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_src_pay_id().empty()) {
    _this->_impl_.src_pay_id_.Set(from._internal_src_pay_id(), _this->GetArenaForAllocation());
  }
  _impl_.espp_pay_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_pay_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_espp_pay_id().empty()) {
    _this->_impl_.espp_pay_id_.Set(from._internal_espp_pay_id(), _this->GetArenaForAllocation());
  }
  _impl_.req_type_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_type_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_req_type().empty()) {
    _this->_impl_.req_type_.Set(from._internal_req_type(), _this->GetArenaForAllocation());
  }
  _impl_.currency_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.currency_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_currency().empty()) {
    _this->_impl_.currency_.Set(from._internal_currency(), _this->GetArenaForAllocation());
  }
  _impl_.pay_method_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.pay_method_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_pay_method().empty()) {
    _this->_impl_.pay_method_.Set(from._internal_pay_method(), _this->GetArenaForAllocation());
  }
  _impl_.req_note_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_note_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_req_note().empty()) {
    _this->_impl_.req_note_.Set(from._internal_req_note(), _this->GetArenaForAllocation());
  }
  _impl_.req_user_msg_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_user_msg_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_req_user_msg().empty()) {
    _this->_impl_.req_user_msg_.Set(from._internal_req_user_msg(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.create_time_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.create_time_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.pay_time_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.pay_time_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000004u) != 0) {
    _this->_impl_.abandon_time_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.abandon_time_at_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000008u) != 0) {
    _this->_impl_.card_ = new ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card(*from._impl_.card_);
  }
  ::memcpy(&_impl_.pay_status_, &from._impl_.pay_status_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.amount_) -
    reinterpret_cast<char*>(&_impl_.pay_status_)) + sizeof(_impl_.amount_));
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.PostInvoiceConfirmRequest)
}

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

    , decltype(_impl_.espp_pay_id_) {}

    , decltype(_impl_.req_type_) {}

    , decltype(_impl_.currency_) {}

    , decltype(_impl_.pay_method_) {}

    , decltype(_impl_.req_note_) {}

    , decltype(_impl_.req_user_msg_) {}

    , decltype(_impl_.create_time_at_){nullptr}
    , decltype(_impl_.pay_time_at_){nullptr}
    , decltype(_impl_.abandon_time_at_){nullptr}
    , decltype(_impl_.card_){nullptr}
    , decltype(_impl_.pay_status_) { 0 }

    , decltype(_impl_.amount_) { 0 }

  };
  _impl_.src_pay_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.src_pay_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.espp_pay_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.espp_pay_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.req_type_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_type_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.currency_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.currency_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.pay_method_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.pay_method_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.req_note_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_note_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.req_user_msg_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.req_user_msg_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void PostInvoiceConfirmRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.src_pay_id_.Destroy();
  _impl_.espp_pay_id_.Destroy();
  _impl_.req_type_.Destroy();
  _impl_.currency_.Destroy();
  _impl_.pay_method_.Destroy();
  _impl_.req_note_.Destroy();
  _impl_.req_user_msg_.Destroy();
  if (this != internal_default_instance()) delete _impl_.create_time_at_;
  if (this != internal_default_instance()) delete _impl_.pay_time_at_;
  if (this != internal_default_instance()) delete _impl_.abandon_time_at_;
  if (this != internal_default_instance()) delete _impl_.card_;
}

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

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

  _impl_.src_pay_id_.ClearToEmpty();
  _impl_.espp_pay_id_.ClearToEmpty();
  _impl_.req_type_.ClearToEmpty();
  _impl_.currency_.ClearToEmpty();
  _impl_.pay_method_.ClearToEmpty();
  _impl_.req_note_.ClearToEmpty();
  _impl_.req_user_msg_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.create_time_at_ != nullptr);
      _impl_.create_time_at_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.pay_time_at_ != nullptr);
      _impl_.pay_time_at_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      ABSL_DCHECK(_impl_.abandon_time_at_ != nullptr);
      _impl_.abandon_time_at_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      ABSL_DCHECK(_impl_.card_ != nullptr);
      _impl_.card_->Clear();
    }
  }
  ::memset(&_impl_.pay_status_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.amount_) -
      reinterpret_cast<char*>(&_impl_.pay_status_)) + sizeof(_impl_.amount_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PostInvoiceConfirmRequest::_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 src_pay_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_src_pay_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string espp_pay_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_espp_pay_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 pay_status = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.pay_status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string req_type = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_req_type();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // float amount = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 45)) {
          _impl_.amount_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else {
          goto handle_unusual;
        }
        continue;
      // string currency = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_currency();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string pay_method = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_pay_method();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp create_time_at = 8 [json_name = "createTime"];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_create_time_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string req_note = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
          auto str = _internal_mutable_req_note();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string req_user_msg = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_req_user_msg();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp pay_time_at = 11 [json_name = "payTime"];
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_pay_time_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp abandon_time_at = 12 [json_name = "abandonTime"];
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 98)) {
          ptr = ctx->ParseMessage(_internal_mutable_abandon_time_at(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.PostInvoiceConfirmRequest.Card card = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
          ptr = ctx->ParseMessage(_internal_mutable_card(), 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* PostInvoiceConfirmRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.PostInvoiceConfirmRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

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

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

  // float amount = 5;
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = this->_internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(
        5, this->_internal_amount(), target);
  }

  // string currency = 6;
  if (!this->_internal_currency().empty()) {
    const std::string& _s = this->_internal_currency();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.currency");
    target = stream->WriteStringMaybeAliased(6, _s, target);
  }

  // string pay_method = 7;
  if (!this->_internal_pay_method().empty()) {
    const std::string& _s = this->_internal_pay_method();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.pay_method");
    target = stream->WriteStringMaybeAliased(7, _s, target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.Timestamp create_time_at = 8 [json_name = "createTime"];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::create_time_at(this),
        _Internal::create_time_at(this).GetCachedSize(), target, stream);
  }

  // string req_note = 9;
  if (!this->_internal_req_note().empty()) {
    const std::string& _s = this->_internal_req_note();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.req_note");
    target = stream->WriteStringMaybeAliased(9, _s, target);
  }

  // string req_user_msg = 10;
  if (!this->_internal_req_user_msg().empty()) {
    const std::string& _s = this->_internal_req_user_msg();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.invoice.v1.PostInvoiceConfirmRequest.req_user_msg");
    target = stream->WriteStringMaybeAliased(10, _s, target);
  }

  // .google.protobuf.Timestamp pay_time_at = 11 [json_name = "payTime"];
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(11, _Internal::pay_time_at(this),
        _Internal::pay_time_at(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.Timestamp abandon_time_at = 12 [json_name = "abandonTime"];
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(12, _Internal::abandon_time_at(this),
        _Internal::abandon_time_at(this).GetCachedSize(), target, stream);
  }

  // .keyapis.invoice.v1.PostInvoiceConfirmRequest.Card card = 13;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(13, _Internal::card(this),
        _Internal::card(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.invoice.v1.PostInvoiceConfirmRequest)
  return target;
}

::size_t PostInvoiceConfirmRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.PostInvoiceConfirmRequest)
  ::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 src_pay_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_src_pay_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_src_pay_id());
  }

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

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

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

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

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    // .google.protobuf.Timestamp create_time_at = 8 [json_name = "createTime"];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.create_time_at_);
    }

    // .google.protobuf.Timestamp pay_time_at = 11 [json_name = "payTime"];
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.pay_time_at_);
    }

    // .google.protobuf.Timestamp abandon_time_at = 12 [json_name = "abandonTime"];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.abandon_time_at_);
    }

    // .keyapis.invoice.v1.PostInvoiceConfirmRequest.Card card = 13;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.card_);
    }

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

  // float amount = 5;
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = this->_internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    total_size += 5;
  }

  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 PostInvoiceConfirmRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostInvoiceConfirmRequest*>(
      &from));
}

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

  if (!from._internal_src_pay_id().empty()) {
    _this->_internal_set_src_pay_id(from._internal_src_pay_id());
  }
  if (!from._internal_espp_pay_id().empty()) {
    _this->_internal_set_espp_pay_id(from._internal_espp_pay_id());
  }
  if (!from._internal_req_type().empty()) {
    _this->_internal_set_req_type(from._internal_req_type());
  }
  if (!from._internal_currency().empty()) {
    _this->_internal_set_currency(from._internal_currency());
  }
  if (!from._internal_pay_method().empty()) {
    _this->_internal_set_pay_method(from._internal_pay_method());
  }
  if (!from._internal_req_note().empty()) {
    _this->_internal_set_req_note(from._internal_req_note());
  }
  if (!from._internal_req_user_msg().empty()) {
    _this->_internal_set_req_user_msg(from._internal_req_user_msg());
  }
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_create_time_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_create_time_at());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_pay_time_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_pay_time_at());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_abandon_time_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
          from._internal_abandon_time_at());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_card()->::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card::MergeFrom(
          from._internal_card());
    }
  }
  if (from._internal_pay_status() != 0) {
    _this->_internal_set_pay_status(from._internal_pay_status());
  }
  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
  float tmp_amount = from._internal_amount();
  ::uint32_t raw_amount;
  memcpy(&raw_amount, &tmp_amount, sizeof(tmp_amount));
  if (raw_amount != 0) {
    _this->_internal_set_amount(from._internal_amount());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostInvoiceConfirmRequest::InternalSwap(PostInvoiceConfirmRequest* 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]);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.src_pay_id_, lhs_arena,
                                       &other->_impl_.src_pay_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.espp_pay_id_, lhs_arena,
                                       &other->_impl_.espp_pay_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.req_type_, lhs_arena,
                                       &other->_impl_.req_type_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.currency_, lhs_arena,
                                       &other->_impl_.currency_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.pay_method_, lhs_arena,
                                       &other->_impl_.pay_method_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.req_note_, lhs_arena,
                                       &other->_impl_.req_note_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.req_user_msg_, lhs_arena,
                                       &other->_impl_.req_user_msg_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PostInvoiceConfirmRequest, _impl_.amount_)
      + sizeof(PostInvoiceConfirmRequest::_impl_.amount_)
      - PROTOBUF_FIELD_OFFSET(PostInvoiceConfirmRequest, _impl_.create_time_at_)>(
          reinterpret_cast<char*>(&_impl_.create_time_at_),
          reinterpret_cast<char*>(&other->_impl_.create_time_at_));
}

std::string PostInvoiceConfirmRequest::GetTypeName() const {
  return "keyapis.invoice.v1.PostInvoiceConfirmRequest";
}

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

class PostInvoiceConfirmResponse::_Internal {
 public:
};

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

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

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

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

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

void PostInvoiceConfirmResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.PostInvoiceConfirmResponse)
  ::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* PostInvoiceConfirmResponse::_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* PostInvoiceConfirmResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.PostInvoiceConfirmResponse)
  ::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.invoice.v1.PostInvoiceConfirmResponse)
  return target;
}

::size_t PostInvoiceConfirmResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.PostInvoiceConfirmResponse)
  ::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 PostInvoiceConfirmResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostInvoiceConfirmResponse*>(
      &from));
}

void PostInvoiceConfirmResponse::MergeFrom(const PostInvoiceConfirmResponse& from) {
  PostInvoiceConfirmResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.PostInvoiceConfirmResponse)
  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 PostInvoiceConfirmResponse::CopyFrom(const PostInvoiceConfirmResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.invoice.v1.PostInvoiceConfirmResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string PostInvoiceConfirmResponse::GetTypeName() const {
  return "keyapis.invoice.v1.PostInvoiceConfirmResponse";
}

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

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

const ::keyapis::invoice::v1::InvoiceFilter&
GetInvoiceListRequest::_Internal::filter(const GetInvoiceListRequest* msg) {
  return *msg->_impl_.filter_;
}
const ::keyapis::invoice::v1::InvoicePaging&
GetInvoiceListRequest::_Internal::paging(const GetInvoiceListRequest* msg) {
  return *msg->_impl_.pagination_.paging_;
}
void GetInvoiceListRequest::set_allocated_paging(::keyapis::invoice::v1::InvoicePaging* 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.invoice.v1.GetInvoiceListRequest.paging)
}
GetInvoiceListRequest::GetInvoiceListRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceListRequest)
}
GetInvoiceListRequest::GetInvoiceListRequest(const GetInvoiceListRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceListRequest* 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::invoice::v1::InvoiceFilter(*from._impl_.filter_);
  }
  clear_has_pagination();
  switch (from.pagination_case()) {
    case kPaging: {
      _this->_internal_mutable_paging()->::keyapis::invoice::v1::InvoicePaging::MergeFrom(
          from._internal_paging());
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceListRequest)
}

inline void GetInvoiceListRequest::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();
}

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

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

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

void GetInvoiceListRequest::clear_pagination() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.GetInvoiceListRequest)
  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 GetInvoiceListRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceListRequest)
  ::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* GetInvoiceListRequest::_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.invoice.v1.InvoiceFilter 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.invoice.v1.InvoicePaging 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* GetInvoiceListRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceListRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.invoice.v1.InvoiceFilter 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.invoice.v1.InvoicePaging 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.invoice.v1.GetInvoiceListRequest)
  return target;
}

::size_t GetInvoiceListRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceListRequest)
  ::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.invoice.v1.InvoiceFilter 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.invoice.v1.InvoicePaging 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 GetInvoiceListRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceListRequest*>(
      &from));
}

void GetInvoiceListRequest::MergeFrom(const GetInvoiceListRequest& from) {
  GetInvoiceListRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.GetInvoiceListRequest)
  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::invoice::v1::InvoiceFilter::MergeFrom(
        from._internal_filter());
  }
  switch (from.pagination_case()) {
    case kPaging: {
      _this->_internal_mutable_paging()->::keyapis::invoice::v1::InvoicePaging::MergeFrom(
          from._internal_paging());
      break;
    }
    case PAGINATION_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetInvoiceListRequest::InternalSwap(GetInvoiceListRequest* 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 GetInvoiceListRequest::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceListRequest";
}

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

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

const ::keyapis::invoice::v1::ValidationError&
GetInvoiceListResponse_Error::_Internal::validation(const GetInvoiceListResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void GetInvoiceListResponse_Error::set_allocated_validation(::keyapis::invoice::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(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(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.invoice.v1.GetInvoiceListResponse.Error.validation)
}
void GetInvoiceListResponse_Error::clear_validation() {
  if (reason_case() == kValidation) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.reason_.validation_;
    }
    clear_has_reason();
  }
}
GetInvoiceListResponse_Error::GetInvoiceListResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceListResponse.Error)
}
GetInvoiceListResponse_Error::GetInvoiceListResponse_Error(const GetInvoiceListResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceListResponse_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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceListResponse.Error)
}

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

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

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

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

void GetInvoiceListResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.GetInvoiceListResponse.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 GetInvoiceListResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceListResponse.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* GetInvoiceListResponse_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.invoice.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* GetInvoiceListResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceListResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.invoice.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.invoice.v1.GetInvoiceListResponse.Error)
  return target;
}

::size_t GetInvoiceListResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceListResponse.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.invoice.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 GetInvoiceListResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceListResponse_Error*>(
      &from));
}

void GetInvoiceListResponse_Error::MergeFrom(const GetInvoiceListResponse_Error& from) {
  GetInvoiceListResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.GetInvoiceListResponse.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::invoice::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetInvoiceListResponse_Error::InternalSwap(GetInvoiceListResponse_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 GetInvoiceListResponse_Error::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceListResponse.Error";
}

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

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

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

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

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

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

inline void GetInvoiceListResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_data()->~RepeatedPtrField();
  if (this != internal_default_instance()) delete _impl_.error_;
}

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

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

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

const char* GetInvoiceListResponse::_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.invoice.v1.Invoice data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_data(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.invoice.v1.GetInvoiceListResponse.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:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // repeated .keyapis.invoice.v1.Invoice data = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_data_size()); i < n; i++) {
    const auto& repfield = this->_internal_data(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.invoice.v1.GetInvoiceListResponse.Error error = 2;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::error(this),
        _Internal::error(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.invoice.v1.GetInvoiceListResponse)
  return target;
}

::size_t GetInvoiceListResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceListResponse)
  ::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.invoice.v1.Invoice data = 1;
  total_size += 1UL * this->_internal_data_size();
  for (const auto& msg : this->_internal_data()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // .keyapis.invoice.v1.GetInvoiceListResponse.Error error = 2;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.error_);
  }

  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 GetInvoiceListResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceListResponse*>(
      &from));
}

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

  _this->_internal_mutable_data()->MergeFrom(from._internal_data());
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_error()->::keyapis::invoice::v1::GetInvoiceListResponse_Error::MergeFrom(
        from._internal_error());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

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

std::string GetInvoiceListResponse::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceListResponse";
}

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

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

const ::keyapis::invoice::v1::InvoiceFilter&
GetInvoiceCountRequest::_Internal::filter(const GetInvoiceCountRequest* msg) {
  return *msg->_impl_.filter_;
}
GetInvoiceCountRequest::GetInvoiceCountRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceCountRequest)
}
GetInvoiceCountRequest::GetInvoiceCountRequest(const GetInvoiceCountRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceCountRequest* 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::invoice::v1::InvoiceFilter(*from._impl_.filter_);
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceCountRequest)
}

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

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

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

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

void GetInvoiceCountRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceCountRequest)
  ::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* GetInvoiceCountRequest::_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.invoice.v1.InvoiceFilter filter = 1 [(.google.api.field_behavior) = REQUIRED];
      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* GetInvoiceCountRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceCountRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.invoice.v1.InvoiceFilter filter = 1 [(.google.api.field_behavior) = REQUIRED];
  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.invoice.v1.GetInvoiceCountRequest)
  return target;
}

::size_t GetInvoiceCountRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceCountRequest)
  ::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.invoice.v1.InvoiceFilter filter = 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_.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 GetInvoiceCountRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceCountRequest*>(
      &from));
}

void GetInvoiceCountRequest::MergeFrom(const GetInvoiceCountRequest& from) {
  GetInvoiceCountRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.GetInvoiceCountRequest)
  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::invoice::v1::InvoiceFilter::MergeFrom(
        from._internal_filter());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetInvoiceCountRequest::InternalSwap(GetInvoiceCountRequest* 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 GetInvoiceCountRequest::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceCountRequest";
}

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

class GetInvoiceCountResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::invoice::v1::GetInvoiceCountResponse, _impl_._oneof_case_);
};

GetInvoiceCountResponse::GetInvoiceCountResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.invoice.v1.GetInvoiceCountResponse)
}
GetInvoiceCountResponse::GetInvoiceCountResponse(const GetInvoiceCountResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetInvoiceCountResponse* 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 TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.invoice.v1.GetInvoiceCountResponse)
}

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

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

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

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

void GetInvoiceCountResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.invoice.v1.GetInvoiceCountResponse)
  switch (type_case()) {
    case kData: {
      // No need to clear
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetInvoiceCountResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.invoice.v1.GetInvoiceCountResponse)
  ::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* GetInvoiceCountResponse::_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;
      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* GetInvoiceCountResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.invoice.v1.GetInvoiceCountResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 data = 1;
  if (type_case() == kData) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_data(), 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.invoice.v1.GetInvoiceCountResponse)
  return target;
}

::size_t GetInvoiceCountResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.invoice.v1.GetInvoiceCountResponse)
  ::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;
    }
    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 GetInvoiceCountResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetInvoiceCountResponse*>(
      &from));
}

void GetInvoiceCountResponse::MergeFrom(const GetInvoiceCountResponse& from) {
  GetInvoiceCountResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.invoice.v1.GetInvoiceCountResponse)
  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 TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetInvoiceCountResponse::InternalSwap(GetInvoiceCountResponse* 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 GetInvoiceCountResponse::GetTypeName() const {
  return "keyapis.invoice.v1.GetInvoiceCountResponse";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace invoice
}  // namespace keyapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice_ExternalError_ExternalSystemError >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice_ExternalError*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice_ExternalError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice_ExternalError >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice_Position*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice_Position >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice_Position >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice_SavingError_InvoiceAlreadyExists >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice_SavingError*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice_SavingError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice_SavingError >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::Invoice*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::Invoice >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::Invoice >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::InvoiceFilter*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::InvoiceFilter >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::InvoiceFilter >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::InvoicePaging*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::InvoicePaging >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::InvoicePaging >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::CreateInvoiceRequest*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::CreateInvoiceRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::CreateInvoiceRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::CreateInvoiceResponse_Error_MissingUserContacts >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::CreateInvoiceResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::CreateInvoiceResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::CreateInvoiceResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::CreateInvoiceResponse*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::CreateInvoiceResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::CreateInvoiceResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceRequest*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceResponse*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::PostInvoiceConfirmRequest_Card >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::PostInvoiceConfirmRequest*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::PostInvoiceConfirmRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::PostInvoiceConfirmRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::PostInvoiceConfirmResponse*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::PostInvoiceConfirmResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::PostInvoiceConfirmResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceListRequest*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceListRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceListRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceListResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceListResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceListResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceListResponse*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceListResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceListResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceCountRequest*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceCountRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceCountRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::invoice::v1::GetInvoiceCountResponse*
Arena::CreateMaybeMessage< ::keyapis::invoice::v1::GetInvoiceCountResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::invoice::v1::GetInvoiceCountResponse >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
