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

// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif

#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
 #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
 #import "GPBProtocolBuffers_RuntimeSupport.h"
#endif

#if GOOGLE_PROTOBUF_OBJC_VERSION < 30007
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
#endif
#if 30007 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
#endif

#import <stdatomic.h>

#import "keyapis/invoice/v1/KeyapisInvoiceInvoiceV1.pbobjc.h"
#import "google/api/Annotations.pbobjc.h"
#import "google/api/FieldBehavior.pbobjc.h"
#import "keyapis/invoice/v1/KeyapisInvoicePaymethodV1.pbobjc.h"
// @@protoc_insertion_point(imports)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wdirect-ivar-access"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"

#pragma mark - Objective-C Class declarations
// Forward declarations of Objective-C classes that we can use as
// static values in struct initializers.
// We don't use [Foo class] because it is not a static value.
GPBObjCClassDeclaration(GPBTimestamp);
GPBObjCClassDeclaration(KEYAPISINVOICEV1CreateInvoiceRequest);
GPBObjCClassDeclaration(KEYAPISINVOICEV1CreateInvoiceResponse);
GPBObjCClassDeclaration(KEYAPISINVOICEV1CreateInvoiceResponse_Error);
GPBObjCClassDeclaration(KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceCountRequest);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceCountResponse);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceListRequest);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceListResponse);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceListResponse_Error);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceRequest);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceResponse);
GPBObjCClassDeclaration(KEYAPISINVOICEV1GetInvoiceResponse_Error);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice);
GPBObjCClassDeclaration(KEYAPISINVOICEV1InvoiceFilter);
GPBObjCClassDeclaration(KEYAPISINVOICEV1InvoicePaging);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice_ExternalError);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice_Position);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice_SavingError);
GPBObjCClassDeclaration(KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists);
GPBObjCClassDeclaration(KEYAPISINVOICEV1PostInvoiceConfirmRequest);
GPBObjCClassDeclaration(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card);
GPBObjCClassDeclaration(KEYAPISINVOICEV1PostInvoiceConfirmResponse);
GPBObjCClassDeclaration(KEYAPISINVOICEV1ValidationError);

#pragma mark - KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root

@implementation KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root

+ (GPBExtensionRegistry*)extensionRegistry {
  // This is called by +initialize so there is no need to worry
  // about thread safety and initialization of registry.
  static GPBExtensionRegistry* registry = nil;
  if (!registry) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    registry = [[GPBExtensionRegistry alloc] init];
    // Merge in the imports (direct or indirect) that defined extensions.
    [registry addExtensions:[GAPIAnnotationsRoot extensionRegistry]];
    [registry addExtensions:[GAPIFieldBehaviorRoot extensionRegistry]];
  }
  return registry;
}

@end

static GPBFileDescription KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription = {
  .package = "keyapis.invoice.v1",
  .prefix = "KEYAPISINVOICEV1",
  .syntax = GPBFileSyntaxProto3
};

#pragma mark - Enum KEYAPISINVOICEV1Invoice_InvoiceStatusType

GPBEnumDescriptor *KEYAPISINVOICEV1Invoice_InvoiceStatusType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "InvoiceStatusTypeUnknown\000Planned\000Pending"
        "\000Error\000Paid\000Cancelled\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_InvoiceStatusTypeUnknown,
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_Planned,
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_Pending,
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_Error,
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_Paid,
        KEYAPISINVOICEV1Invoice_InvoiceStatusType_Cancelled,
    };
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1Invoice_InvoiceStatusType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1Invoice_InvoiceStatusType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1Invoice_InvoiceStatusType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_InvoiceStatusTypeUnknown:
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_Planned:
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_Pending:
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_Error:
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_Paid:
    case KEYAPISINVOICEV1Invoice_InvoiceStatusType_Cancelled:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - Enum KEYAPISINVOICEV1Invoice_CardType

GPBEnumDescriptor *KEYAPISINVOICEV1Invoice_CardType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "CardTypeUnknown\000Visa\000EcMc\000Dcl\000Jcb\000Amex\000M"
        "ir\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1Invoice_CardType_CardTypeUnknown,
        KEYAPISINVOICEV1Invoice_CardType_Visa,
        KEYAPISINVOICEV1Invoice_CardType_EcMc,
        KEYAPISINVOICEV1Invoice_CardType_Dcl,
        KEYAPISINVOICEV1Invoice_CardType_Jcb,
        KEYAPISINVOICEV1Invoice_CardType_Amex,
        KEYAPISINVOICEV1Invoice_CardType_Mir,
    };
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1Invoice_CardType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1Invoice_CardType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1Invoice_CardType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1Invoice_CardType_CardTypeUnknown:
    case KEYAPISINVOICEV1Invoice_CardType_Visa:
    case KEYAPISINVOICEV1Invoice_CardType_EcMc:
    case KEYAPISINVOICEV1Invoice_CardType_Dcl:
    case KEYAPISINVOICEV1Invoice_CardType_Jcb:
    case KEYAPISINVOICEV1Invoice_CardType_Amex:
    case KEYAPISINVOICEV1Invoice_CardType_Mir:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - Enum KEYAPISINVOICEV1Invoice_PayInterfaceType

GPBEnumDescriptor *KEYAPISINVOICEV1Invoice_PayInterfaceType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "PayInterfaceTypeUnknown\000Gui\000M2M\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1Invoice_PayInterfaceType_PayInterfaceTypeUnknown,
        KEYAPISINVOICEV1Invoice_PayInterfaceType_Gui,
        KEYAPISINVOICEV1Invoice_PayInterfaceType_M2M,
    };
    static const char *extraTextFormatInfo = "\001\002\003\000";
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1Invoice_PayInterfaceType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1Invoice_PayInterfaceType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None
                              extraTextFormatInfo:extraTextFormatInfo];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1Invoice_PayInterfaceType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1Invoice_PayInterfaceType_PayInterfaceTypeUnknown:
    case KEYAPISINVOICEV1Invoice_PayInterfaceType_Gui:
    case KEYAPISINVOICEV1Invoice_PayInterfaceType_M2M:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - Enum KEYAPISINVOICEV1Invoice_PaywayType

GPBEnumDescriptor *KEYAPISINVOICEV1Invoice_PaywayType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "PaywayTypeUnknown\000BankCard\000Sbp\000SberPay\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1Invoice_PaywayType_PaywayTypeUnknown,
        KEYAPISINVOICEV1Invoice_PaywayType_BankCard,
        KEYAPISINVOICEV1Invoice_PaywayType_Sbp,
        KEYAPISINVOICEV1Invoice_PaywayType_SberPay,
    };
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1Invoice_PaywayType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1Invoice_PaywayType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1Invoice_PaywayType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1Invoice_PaywayType_PaywayTypeUnknown:
    case KEYAPISINVOICEV1Invoice_PaywayType_BankCard:
    case KEYAPISINVOICEV1Invoice_PaywayType_Sbp:
    case KEYAPISINVOICEV1Invoice_PaywayType_SberPay:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - Enum KEYAPISINVOICEV1InvoicePaging_OrderByType

GPBEnumDescriptor *KEYAPISINVOICEV1InvoicePaging_OrderByType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "OrderByTypeUnknown\000Id\000PaidAt\000CreatedAt\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1InvoicePaging_OrderByType_OrderByTypeUnknown,
        KEYAPISINVOICEV1InvoicePaging_OrderByType_Id,
        KEYAPISINVOICEV1InvoicePaging_OrderByType_PaidAt,
        KEYAPISINVOICEV1InvoicePaging_OrderByType_CreatedAt,
    };
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1InvoicePaging_OrderByType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1InvoicePaging_OrderByType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1InvoicePaging_OrderByType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1InvoicePaging_OrderByType_OrderByTypeUnknown:
    case KEYAPISINVOICEV1InvoicePaging_OrderByType_Id:
    case KEYAPISINVOICEV1InvoicePaging_OrderByType_PaidAt:
    case KEYAPISINVOICEV1InvoicePaging_OrderByType_CreatedAt:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - Enum KEYAPISINVOICEV1InvoicePaging_DirectionType

GPBEnumDescriptor *KEYAPISINVOICEV1InvoicePaging_DirectionType_EnumDescriptor(void) {
  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static const char *valueNames =
        "DirectionTypeUnknown\000Desc\000Asc\000";
    static const int32_t values[] = {
        KEYAPISINVOICEV1InvoicePaging_DirectionType_DirectionTypeUnknown,
        KEYAPISINVOICEV1InvoicePaging_DirectionType_Desc,
        KEYAPISINVOICEV1InvoicePaging_DirectionType_Asc,
    };
    GPBEnumDescriptor *worker =
        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(KEYAPISINVOICEV1InvoicePaging_DirectionType)
                                       valueNames:valueNames
                                           values:values
                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
                                     enumVerifier:KEYAPISINVOICEV1InvoicePaging_DirectionType_IsValidValue
                                            flags:GPBEnumDescriptorInitializationFlag_None];
    GPBEnumDescriptor *expected = nil;
    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
      [worker release];
    }
  }
  return descriptor;
}

BOOL KEYAPISINVOICEV1InvoicePaging_DirectionType_IsValidValue(int32_t value__) {
  switch (value__) {
    case KEYAPISINVOICEV1InvoicePaging_DirectionType_DirectionTypeUnknown:
    case KEYAPISINVOICEV1InvoicePaging_DirectionType_Desc:
    case KEYAPISINVOICEV1InvoicePaging_DirectionType_Asc:
      return YES;
    default:
      return NO;
  }
}

#pragma mark - KEYAPISINVOICEV1Invoice

@implementation KEYAPISINVOICEV1Invoice

@dynamic id_p;
@dynamic title;
@dynamic userId;
@dynamic invoiceStatusType;
@dynamic hasCreatedAt, createdAt;
@dynamic hasUpdatedAt, updatedAt;
@dynamic positionsArray, positionsArray_Count;
@dynamic payInterfaceType;
@dynamic paywayType;
@dynamic hasStatusChangedAt, statusChangedAt;
@dynamic hasPaidAt, paidAt;
@dynamic payURL;
@dynamic paidByCardMasked;
@dynamic paidByCardEsppId;
@dynamic cardType;
@dynamic esppReqStatus;
@dynamic esppReqUserMsg;
@dynamic esppInvoiceId;
@dynamic phoneNumber;
@dynamic email;

typedef struct KEYAPISINVOICEV1Invoice__storage_ {
  uint32_t _has_storage_[1];
  int32_t userId;
  KEYAPISINVOICEV1Invoice_InvoiceStatusType invoiceStatusType;
  KEYAPISINVOICEV1Invoice_PayInterfaceType payInterfaceType;
  KEYAPISINVOICEV1Invoice_PaywayType paywayType;
  KEYAPISINVOICEV1Invoice_CardType cardType;
  int32_t esppReqStatus;
  NSString *id_p;
  NSString *title;
  GPBTimestamp *createdAt;
  GPBTimestamp *updatedAt;
  NSMutableArray *positionsArray;
  GPBTimestamp *statusChangedAt;
  GPBTimestamp *paidAt;
  NSString *payURL;
  NSString *paidByCardMasked;
  NSString *paidByCardEsppId;
  NSString *esppReqUserMsg;
  NSString *esppInvoiceId;
  NSString *phoneNumber;
  NSString *email;
} KEYAPISINVOICEV1Invoice__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "id_p",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_Id_p,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, id_p),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "title",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_Title,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, title),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "userId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_UserId,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, userId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "invoiceStatusType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_InvoiceStatusType_EnumDescriptor,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_InvoiceStatusType,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, invoiceStatusType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "createdAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_CreatedAt,
        .hasIndex = 4,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, createdAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "updatedAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_UpdatedAt,
        .hasIndex = 5,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, updatedAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "positionsArray",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_Position),
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PositionsArray,
        .hasIndex = GPBNoHasBit,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, positionsArray),
        .flags = GPBFieldRepeated,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "payInterfaceType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_PayInterfaceType_EnumDescriptor,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PayInterfaceType,
        .hasIndex = 6,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, payInterfaceType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "paywayType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_PaywayType_EnumDescriptor,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PaywayType,
        .hasIndex = 7,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, paywayType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "statusChangedAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_StatusChangedAt,
        .hasIndex = 8,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, statusChangedAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "paidAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PaidAt,
        .hasIndex = 9,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, paidAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "payURL",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PayURL,
        .hasIndex = 10,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, payURL),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "paidByCardMasked",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PaidByCardMasked,
        .hasIndex = 11,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, paidByCardMasked),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "paidByCardEsppId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PaidByCardEsppId,
        .hasIndex = 12,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, paidByCardEsppId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "cardType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_CardType_EnumDescriptor,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_CardType,
        .hasIndex = 13,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, cardType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "esppReqStatus",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_EsppReqStatus,
        .hasIndex = 14,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, esppReqStatus),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "esppReqUserMsg",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_EsppReqUserMsg,
        .hasIndex = 15,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, esppReqUserMsg),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "esppInvoiceId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_EsppInvoiceId,
        .hasIndex = 16,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, esppInvoiceId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "phoneNumber",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_PhoneNumber,
        .hasIndex = 17,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, phoneNumber),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "email",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_FieldNumber_Email,
        .hasIndex = 18,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice__storage_, email),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice)
                                   messageName:@"Invoice"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    static const char *extraTextFormatInfo =
        "\001\014\003\241!!\000";
    [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
#endif  // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

int32_t KEYAPISINVOICEV1Invoice_InvoiceStatusType_RawValue(KEYAPISINVOICEV1Invoice *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_InvoiceStatusType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1Invoice_InvoiceStatusType_RawValue(KEYAPISINVOICEV1Invoice *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_InvoiceStatusType];
  GPBSetMessageRawEnumField(message, field, value);
}

int32_t KEYAPISINVOICEV1Invoice_PayInterfaceType_RawValue(KEYAPISINVOICEV1Invoice *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_PayInterfaceType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1Invoice_PayInterfaceType_RawValue(KEYAPISINVOICEV1Invoice *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_PayInterfaceType];
  GPBSetMessageRawEnumField(message, field, value);
}

int32_t KEYAPISINVOICEV1Invoice_PaywayType_RawValue(KEYAPISINVOICEV1Invoice *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_PaywayType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1Invoice_PaywayType_RawValue(KEYAPISINVOICEV1Invoice *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_PaywayType];
  GPBSetMessageRawEnumField(message, field, value);
}

int32_t KEYAPISINVOICEV1Invoice_CardType_RawValue(KEYAPISINVOICEV1Invoice *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_CardType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1Invoice_CardType_RawValue(KEYAPISINVOICEV1Invoice *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1Invoice_FieldNumber_CardType];
  GPBSetMessageRawEnumField(message, field, value);
}

#pragma mark - KEYAPISINVOICEV1Invoice_ExternalError

@implementation KEYAPISINVOICEV1Invoice_ExternalError

@dynamic reasonOneOfCase;
@dynamic externalSystemError;

typedef struct KEYAPISINVOICEV1Invoice_ExternalError__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError *externalSystemError;
} KEYAPISINVOICEV1Invoice_ExternalError__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "externalSystemError",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError),
        .number = KEYAPISINVOICEV1Invoice_ExternalError_FieldNumber_ExternalSystemError,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_ExternalError__storage_, externalSystemError),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_ExternalError)
                                   messageName:@"ExternalError"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice_ExternalError__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "reason",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1Invoice)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1Invoice_ExternalError_ClearReasonOneOfCase(KEYAPISINVOICEV1Invoice_ExternalError *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice_ExternalError descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError

@implementation KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError


typedef struct KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError__storage_ {
  uint32_t _has_storage_[1];
} KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError)
                                   messageName:@"ExternalSystemError"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:NULL
                                    fieldCount:0
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice_ExternalError_ExternalSystemError__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_ExternalError)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1Invoice_Position

@implementation KEYAPISINVOICEV1Invoice_Position

@dynamic id_p;
@dynamic invoiceId;
@dynamic title;
@dynamic category;
@dynamic amount;
@dynamic hasCreatedAt, createdAt;
@dynamic hasUpdatedAt, updatedAt;
@dynamic mrfId;
@dynamic rfId;
@dynamic instanceId;
@dynamic offeringId;
@dynamic hasDueDateAt, dueDateAt;
@dynamic svcTypeId;
@dynamic isDiscount;

typedef struct KEYAPISINVOICEV1Invoice_Position__storage_ {
  uint32_t _has_storage_[1];
  float amount;
  int32_t mrfId;
  int32_t rfId;
  int32_t offeringId;
  NSString *id_p;
  NSString *invoiceId;
  NSString *title;
  NSString *category;
  GPBTimestamp *createdAt;
  GPBTimestamp *updatedAt;
  NSString *instanceId;
  GPBTimestamp *dueDateAt;
  NSString *svcTypeId;
} KEYAPISINVOICEV1Invoice_Position__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "id_p",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_Id_p,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, id_p),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "invoiceId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_InvoiceId,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, invoiceId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "title",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_Title,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, title),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "category",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_Category,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, category),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "amount",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_Amount,
        .hasIndex = 4,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, amount),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeFloat,
      },
      {
        .name = "createdAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_CreatedAt,
        .hasIndex = 5,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, createdAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "updatedAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_UpdatedAt,
        .hasIndex = 6,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, updatedAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "mrfId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_MrfId,
        .hasIndex = 7,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, mrfId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "rfId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_RfId,
        .hasIndex = 8,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, rfId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "instanceId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_InstanceId,
        .hasIndex = 9,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, instanceId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "offeringId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_OfferingId,
        .hasIndex = 10,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, offeringId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "dueDateAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_DueDateAt,
        .hasIndex = 11,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, dueDateAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "svcTypeId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_SvcTypeId,
        .hasIndex = 12,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_Position__storage_, svcTypeId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "isDiscount",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1Invoice_Position_FieldNumber_IsDiscount,
        .hasIndex = 13,
        .offset = 14,  // Stored in _has_storage_ to save space.
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeBool,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_Position)
                                   messageName:@"Position"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice_Position__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1Invoice)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1Invoice_SavingError

@implementation KEYAPISINVOICEV1Invoice_SavingError

@dynamic reasonOneOfCase;
@dynamic invoiceAlreadyExists;

typedef struct KEYAPISINVOICEV1Invoice_SavingError__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists *invoiceAlreadyExists;
} KEYAPISINVOICEV1Invoice_SavingError__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "invoiceAlreadyExists",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists),
        .number = KEYAPISINVOICEV1Invoice_SavingError_FieldNumber_InvoiceAlreadyExists,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1Invoice_SavingError__storage_, invoiceAlreadyExists),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_SavingError)
                                   messageName:@"SavingError"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice_SavingError__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "reason",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1Invoice)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1Invoice_SavingError_ClearReasonOneOfCase(KEYAPISINVOICEV1Invoice_SavingError *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1Invoice_SavingError descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists

@implementation KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists


typedef struct KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists__storage_ {
  uint32_t _has_storage_[1];
} KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists)
                                   messageName:@"InvoiceAlreadyExists"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:NULL
                                    fieldCount:0
                                   storageSize:sizeof(KEYAPISINVOICEV1Invoice_SavingError_InvoiceAlreadyExists__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1Invoice_SavingError)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1InvoiceFilter

@implementation KEYAPISINVOICEV1InvoiceFilter

@dynamic userId;
@dynamic invoiceStatusType;

typedef struct KEYAPISINVOICEV1InvoiceFilter__storage_ {
  uint32_t _has_storage_[1];
  int32_t userId;
  KEYAPISINVOICEV1Invoice_InvoiceStatusType invoiceStatusType;
} KEYAPISINVOICEV1InvoiceFilter__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "userId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1InvoiceFilter_FieldNumber_UserId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoiceFilter__storage_, userId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "invoiceStatusType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_InvoiceStatusType_EnumDescriptor,
        .number = KEYAPISINVOICEV1InvoiceFilter_FieldNumber_InvoiceStatusType,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoiceFilter__storage_, invoiceStatusType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1InvoiceFilter)
                                   messageName:@"InvoiceFilter"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1InvoiceFilter__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

int32_t KEYAPISINVOICEV1InvoiceFilter_InvoiceStatusType_RawValue(KEYAPISINVOICEV1InvoiceFilter *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoiceFilter descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoiceFilter_FieldNumber_InvoiceStatusType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1InvoiceFilter_InvoiceStatusType_RawValue(KEYAPISINVOICEV1InvoiceFilter *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoiceFilter descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoiceFilter_FieldNumber_InvoiceStatusType];
  GPBSetMessageRawEnumField(message, field, value);
}

#pragma mark - KEYAPISINVOICEV1InvoicePaging

@implementation KEYAPISINVOICEV1InvoicePaging

@dynamic orderByType;
@dynamic directionType;
@dynamic limit;
@dynamic offset;

typedef struct KEYAPISINVOICEV1InvoicePaging__storage_ {
  uint32_t _has_storage_[1];
  KEYAPISINVOICEV1InvoicePaging_OrderByType orderByType;
  KEYAPISINVOICEV1InvoicePaging_DirectionType directionType;
  int32_t limit;
  int32_t offset;
} KEYAPISINVOICEV1InvoicePaging__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "orderByType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1InvoicePaging_OrderByType_EnumDescriptor,
        .number = KEYAPISINVOICEV1InvoicePaging_FieldNumber_OrderByType,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoicePaging__storage_, orderByType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "directionType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1InvoicePaging_DirectionType_EnumDescriptor,
        .number = KEYAPISINVOICEV1InvoicePaging_FieldNumber_DirectionType,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoicePaging__storage_, directionType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "limit",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1InvoicePaging_FieldNumber_Limit,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoicePaging__storage_, limit),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "offset",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1InvoicePaging_FieldNumber_Offset,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1InvoicePaging__storage_, offset),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1InvoicePaging)
                                   messageName:@"InvoicePaging"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1InvoicePaging__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

int32_t KEYAPISINVOICEV1InvoicePaging_OrderByType_RawValue(KEYAPISINVOICEV1InvoicePaging *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoicePaging descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoicePaging_FieldNumber_OrderByType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1InvoicePaging_OrderByType_RawValue(KEYAPISINVOICEV1InvoicePaging *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoicePaging descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoicePaging_FieldNumber_OrderByType];
  GPBSetMessageRawEnumField(message, field, value);
}

int32_t KEYAPISINVOICEV1InvoicePaging_DirectionType_RawValue(KEYAPISINVOICEV1InvoicePaging *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoicePaging descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoicePaging_FieldNumber_DirectionType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1InvoicePaging_DirectionType_RawValue(KEYAPISINVOICEV1InvoicePaging *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1InvoicePaging descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1InvoicePaging_FieldNumber_DirectionType];
  GPBSetMessageRawEnumField(message, field, value);
}

#pragma mark - KEYAPISINVOICEV1CreateInvoiceRequest

@implementation KEYAPISINVOICEV1CreateInvoiceRequest

@dynamic userId;
@dynamic positionsArray, positionsArray_Count;
@dynamic payInterfaceType;
@dynamic paywayType;
@dynamic returnURL;
@dynamic phoneNumber;
@dynamic email;
@dynamic title;

typedef struct KEYAPISINVOICEV1CreateInvoiceRequest__storage_ {
  uint32_t _has_storage_[1];
  int32_t userId;
  KEYAPISINVOICEV1Invoice_PayInterfaceType payInterfaceType;
  KEYAPISINVOICEV1Invoice_PaywayType paywayType;
  NSMutableArray *positionsArray;
  NSString *returnURL;
  NSString *phoneNumber;
  NSString *email;
  NSString *title;
} KEYAPISINVOICEV1CreateInvoiceRequest__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "userId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_UserId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, userId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "positionsArray",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_Position),
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PositionsArray,
        .hasIndex = GPBNoHasBit,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, positionsArray),
        .flags = GPBFieldRepeated,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "payInterfaceType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_PayInterfaceType_EnumDescriptor,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PayInterfaceType,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, payInterfaceType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "paywayType",
        .dataTypeSpecific.enumDescFunc = KEYAPISINVOICEV1Invoice_PaywayType_EnumDescriptor,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PaywayType,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, paywayType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeEnum,
      },
      {
        .name = "returnURL",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_ReturnURL,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, returnURL),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "phoneNumber",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PhoneNumber,
        .hasIndex = 4,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, phoneNumber),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "email",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_Email,
        .hasIndex = 5,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, email),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "title",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_Title,
        .hasIndex = 6,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_, title),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceRequest)
                                   messageName:@"CreateInvoiceRequest"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1CreateInvoiceRequest__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    static const char *extraTextFormatInfo =
        "\001\005\006\241!!\000";
    [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
#endif  // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

int32_t KEYAPISINVOICEV1CreateInvoiceRequest_PayInterfaceType_RawValue(KEYAPISINVOICEV1CreateInvoiceRequest *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceRequest descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PayInterfaceType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1CreateInvoiceRequest_PayInterfaceType_RawValue(KEYAPISINVOICEV1CreateInvoiceRequest *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceRequest descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PayInterfaceType];
  GPBSetMessageRawEnumField(message, field, value);
}

int32_t KEYAPISINVOICEV1CreateInvoiceRequest_PaywayType_RawValue(KEYAPISINVOICEV1CreateInvoiceRequest *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceRequest descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PaywayType];
  return GPBGetMessageRawEnumField(message, field);
}

void SetKEYAPISINVOICEV1CreateInvoiceRequest_PaywayType_RawValue(KEYAPISINVOICEV1CreateInvoiceRequest *message, int32_t value) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceRequest descriptor];
  GPBFieldDescriptor *field = [descriptor fieldWithNumber:KEYAPISINVOICEV1CreateInvoiceRequest_FieldNumber_PaywayType];
  GPBSetMessageRawEnumField(message, field, value);
}

#pragma mark - KEYAPISINVOICEV1CreateInvoiceResponse

@implementation KEYAPISINVOICEV1CreateInvoiceResponse

@dynamic typeOneOfCase;
@dynamic error;
@dynamic data_p;

typedef struct KEYAPISINVOICEV1CreateInvoiceResponse__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1CreateInvoiceResponse_Error *error;
  KEYAPISINVOICEV1Invoice *data_p;
} KEYAPISINVOICEV1CreateInvoiceResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "error",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse_Error),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_FieldNumber_Error,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse__storage_, error),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "data_p",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_FieldNumber_Data_p,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse__storage_, data_p),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse)
                                   messageName:@"CreateInvoiceResponse"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1CreateInvoiceResponse__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "type",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1CreateInvoiceResponse_ClearTypeOneOfCase(KEYAPISINVOICEV1CreateInvoiceResponse *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceResponse descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1CreateInvoiceResponse_Error

@implementation KEYAPISINVOICEV1CreateInvoiceResponse_Error

@dynamic reasonOneOfCase;
@dynamic validation;
@dynamic missingUserContacts;
@dynamic external;
@dynamic saving;

typedef struct KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1ValidationError *validation;
  KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts *missingUserContacts;
  KEYAPISINVOICEV1Invoice_ExternalError *external;
  KEYAPISINVOICEV1Invoice_SavingError *saving;
} KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "validation",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1ValidationError),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_Error_FieldNumber_Validation,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_, validation),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "missingUserContacts",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_Error_FieldNumber_MissingUserContacts,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_, missingUserContacts),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "external",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_ExternalError),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_Error_FieldNumber_External,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_, external),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "saving",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice_SavingError),
        .number = KEYAPISINVOICEV1CreateInvoiceResponse_Error_FieldNumber_Saving,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_, saving),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse_Error)
                                   messageName:@"Error"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1CreateInvoiceResponse_Error__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "reason",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1CreateInvoiceResponse_Error_ClearReasonOneOfCase(KEYAPISINVOICEV1CreateInvoiceResponse_Error *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1CreateInvoiceResponse_Error descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts

@implementation KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts


typedef struct KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts__storage_ {
  uint32_t _has_storage_[1];
} KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts)
                                   messageName:@"MissingUserContacts"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:NULL
                                    fieldCount:0
                                   storageSize:sizeof(KEYAPISINVOICEV1CreateInvoiceResponse_Error_MissingUserContacts__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1CreateInvoiceResponse_Error)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1GetInvoiceRequest

@implementation KEYAPISINVOICEV1GetInvoiceRequest

@dynamic invoiceId;

typedef struct KEYAPISINVOICEV1GetInvoiceRequest__storage_ {
  uint32_t _has_storage_[1];
  NSString *invoiceId;
} KEYAPISINVOICEV1GetInvoiceRequest__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "invoiceId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1GetInvoiceRequest_FieldNumber_InvoiceId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceRequest__storage_, invoiceId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceRequest)
                                   messageName:@"GetInvoiceRequest"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceRequest__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1GetInvoiceResponse

@implementation KEYAPISINVOICEV1GetInvoiceResponse

@dynamic typeOneOfCase;
@dynamic error;
@dynamic data_p;

typedef struct KEYAPISINVOICEV1GetInvoiceResponse__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1GetInvoiceResponse_Error *error;
  KEYAPISINVOICEV1Invoice *data_p;
} KEYAPISINVOICEV1GetInvoiceResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "error",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1GetInvoiceResponse_Error),
        .number = KEYAPISINVOICEV1GetInvoiceResponse_FieldNumber_Error,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceResponse__storage_, error),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "data_p",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice),
        .number = KEYAPISINVOICEV1GetInvoiceResponse_FieldNumber_Data_p,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceResponse__storage_, data_p),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceResponse)
                                   messageName:@"GetInvoiceResponse"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceResponse__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "type",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1GetInvoiceResponse_ClearTypeOneOfCase(KEYAPISINVOICEV1GetInvoiceResponse *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1GetInvoiceResponse descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1GetInvoiceResponse_Error

@implementation KEYAPISINVOICEV1GetInvoiceResponse_Error

@dynamic reasonOneOfCase;
@dynamic validation;

typedef struct KEYAPISINVOICEV1GetInvoiceResponse_Error__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1ValidationError *validation;
} KEYAPISINVOICEV1GetInvoiceResponse_Error__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "validation",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1ValidationError),
        .number = KEYAPISINVOICEV1GetInvoiceResponse_Error_FieldNumber_Validation,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceResponse_Error__storage_, validation),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceResponse_Error)
                                   messageName:@"Error"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceResponse_Error__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "reason",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceResponse)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1GetInvoiceResponse_Error_ClearReasonOneOfCase(KEYAPISINVOICEV1GetInvoiceResponse_Error *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1GetInvoiceResponse_Error descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1PostInvoiceConfirmRequest

@implementation KEYAPISINVOICEV1PostInvoiceConfirmRequest

@dynamic srcPayId;
@dynamic esppPayId;
@dynamic payStatus;
@dynamic reqType;
@dynamic amount;
@dynamic currency;
@dynamic payMethod;
@dynamic hasCreateTimeAt, createTimeAt;
@dynamic reqNote;
@dynamic reqUserMsg;
@dynamic hasPayTimeAt, payTimeAt;
@dynamic hasAbandonTimeAt, abandonTimeAt;
@dynamic hasCard, card;

typedef struct KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_ {
  uint32_t _has_storage_[1];
  int32_t payStatus;
  float amount;
  NSString *srcPayId;
  NSString *esppPayId;
  NSString *reqType;
  NSString *currency;
  NSString *payMethod;
  GPBTimestamp *createTimeAt;
  NSString *reqNote;
  NSString *reqUserMsg;
  GPBTimestamp *payTimeAt;
  GPBTimestamp *abandonTimeAt;
  KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card *card;
} KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "srcPayId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_SrcPayId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, srcPayId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "esppPayId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_EsppPayId,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, esppPayId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "payStatus",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_PayStatus,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, payStatus),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "reqType",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_ReqType,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, reqType),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "amount",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_Amount,
        .hasIndex = 4,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, amount),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeFloat,
      },
      {
        .name = "currency",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_Currency,
        .hasIndex = 5,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, currency),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "payMethod",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_PayMethod,
        .hasIndex = 6,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, payMethod),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "createTimeAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_CreateTimeAt,
        .hasIndex = 7,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, createTimeAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "reqNote",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_ReqNote,
        .hasIndex = 8,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, reqNote),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "reqUserMsg",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_ReqUserMsg,
        .hasIndex = 9,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, reqUserMsg),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "payTimeAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_PayTimeAt,
        .hasIndex = 10,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, payTimeAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "abandonTimeAt",
        .dataTypeSpecific.clazz = GPBObjCClass(GPBTimestamp),
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_AbandonTimeAt,
        .hasIndex = 11,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, abandonTimeAt),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "card",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card),
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_FieldNumber_Card,
        .hasIndex = 12,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_, card),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1PostInvoiceConfirmRequest)
                                   messageName:@"PostInvoiceConfirmRequest"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1PostInvoiceConfirmRequest__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card

@implementation KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card

@dynamic esppCardId;
@dynamic cardNum;
@dynamic cardKind;
@dynamic bankName;

typedef struct KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_ {
  uint32_t _has_storage_[1];
  int32_t esppCardId;
  NSString *cardNum;
  NSString *cardKind;
  NSString *bankName;
} KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "esppCardId",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card_FieldNumber_EsppCardId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_, esppCardId),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeInt32,
      },
      {
        .name = "cardNum",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card_FieldNumber_CardNum,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_, cardNum),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "cardKind",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card_FieldNumber_CardKind,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_, cardKind),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
      {
        .name = "bankName",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card_FieldNumber_BankName,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_, bankName),
        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
        .dataType = GPBDataTypeString,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card)
                                   messageName:@"Card"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1PostInvoiceConfirmRequest_Card__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1PostInvoiceConfirmRequest)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1PostInvoiceConfirmResponse

@implementation KEYAPISINVOICEV1PostInvoiceConfirmResponse


typedef struct KEYAPISINVOICEV1PostInvoiceConfirmResponse__storage_ {
  uint32_t _has_storage_[1];
} KEYAPISINVOICEV1PostInvoiceConfirmResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1PostInvoiceConfirmResponse)
                                   messageName:@"PostInvoiceConfirmResponse"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:NULL
                                    fieldCount:0
                                   storageSize:sizeof(KEYAPISINVOICEV1PostInvoiceConfirmResponse__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1GetInvoiceListRequest

@implementation KEYAPISINVOICEV1GetInvoiceListRequest

@dynamic paginationOneOfCase;
@dynamic hasFilter, filter;
@dynamic paging;

typedef struct KEYAPISINVOICEV1GetInvoiceListRequest__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1InvoiceFilter *filter;
  KEYAPISINVOICEV1InvoicePaging *paging;
} KEYAPISINVOICEV1GetInvoiceListRequest__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "filter",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1InvoiceFilter),
        .number = KEYAPISINVOICEV1GetInvoiceListRequest_FieldNumber_Filter,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceListRequest__storage_, filter),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "paging",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1InvoicePaging),
        .number = KEYAPISINVOICEV1GetInvoiceListRequest_FieldNumber_Paging,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceListRequest__storage_, paging),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceListRequest)
                                   messageName:@"GetInvoiceListRequest"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceListRequest__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "pagination",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1GetInvoiceListRequest_ClearPaginationOneOfCase(KEYAPISINVOICEV1GetInvoiceListRequest *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1GetInvoiceListRequest descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1GetInvoiceListResponse

@implementation KEYAPISINVOICEV1GetInvoiceListResponse

@dynamic dataArray, dataArray_Count;
@dynamic hasError, error;

typedef struct KEYAPISINVOICEV1GetInvoiceListResponse__storage_ {
  uint32_t _has_storage_[1];
  NSMutableArray *dataArray;
  KEYAPISINVOICEV1GetInvoiceListResponse_Error *error;
} KEYAPISINVOICEV1GetInvoiceListResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "dataArray",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1Invoice),
        .number = KEYAPISINVOICEV1GetInvoiceListResponse_FieldNumber_DataArray,
        .hasIndex = GPBNoHasBit,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceListResponse__storage_, dataArray),
        .flags = GPBFieldRepeated,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "error",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1GetInvoiceListResponse_Error),
        .number = KEYAPISINVOICEV1GetInvoiceListResponse_FieldNumber_Error,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceListResponse__storage_, error),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceListResponse)
                                   messageName:@"GetInvoiceListResponse"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceListResponse__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1GetInvoiceListResponse_Error

@implementation KEYAPISINVOICEV1GetInvoiceListResponse_Error

@dynamic reasonOneOfCase;
@dynamic validation;

typedef struct KEYAPISINVOICEV1GetInvoiceListResponse_Error__storage_ {
  uint32_t _has_storage_[2];
  KEYAPISINVOICEV1ValidationError *validation;
} KEYAPISINVOICEV1GetInvoiceListResponse_Error__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "validation",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1ValidationError),
        .number = KEYAPISINVOICEV1GetInvoiceListResponse_Error_FieldNumber_Validation,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceListResponse_Error__storage_, validation),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceListResponse_Error)
                                   messageName:@"Error"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceListResponse_Error__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "reason",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    [localDescriptor setupContainingMessageClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceListResponse)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1GetInvoiceListResponse_Error_ClearReasonOneOfCase(KEYAPISINVOICEV1GetInvoiceListResponse_Error *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1GetInvoiceListResponse_Error descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}
#pragma mark - KEYAPISINVOICEV1GetInvoiceCountRequest

@implementation KEYAPISINVOICEV1GetInvoiceCountRequest

@dynamic hasFilter, filter;

typedef struct KEYAPISINVOICEV1GetInvoiceCountRequest__storage_ {
  uint32_t _has_storage_[1];
  KEYAPISINVOICEV1InvoiceFilter *filter;
} KEYAPISINVOICEV1GetInvoiceCountRequest__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "filter",
        .dataTypeSpecific.clazz = GPBObjCClass(KEYAPISINVOICEV1InvoiceFilter),
        .number = KEYAPISINVOICEV1GetInvoiceCountRequest_FieldNumber_Filter,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceCountRequest__storage_, filter),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceCountRequest)
                                   messageName:@"GetInvoiceCountRequest"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceCountRequest__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - KEYAPISINVOICEV1GetInvoiceCountResponse

@implementation KEYAPISINVOICEV1GetInvoiceCountResponse

@dynamic typeOneOfCase;
@dynamic data_p;

typedef struct KEYAPISINVOICEV1GetInvoiceCountResponse__storage_ {
  uint32_t _has_storage_[2];
  int32_t data_p;
} KEYAPISINVOICEV1GetInvoiceCountResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "data_p",
        .dataTypeSpecific.clazz = Nil,
        .number = KEYAPISINVOICEV1GetInvoiceCountResponse_FieldNumber_Data_p,
        .hasIndex = -1,
        .offset = (uint32_t)offsetof(KEYAPISINVOICEV1GetInvoiceCountResponse__storage_, data_p),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeInt32,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:GPBObjCClass(KEYAPISINVOICEV1GetInvoiceCountResponse)
                                   messageName:@"GetInvoiceCountResponse"
                               fileDescription:&KEYAPISINVOICEV1KeyapisInvoiceInvoiceV1Root_FileDescription
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(KEYAPISINVOICEV1GetInvoiceCountResponse__storage_)
                                         flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
    static const char *oneofs[] = {
      "type",
    };
    [localDescriptor setupOneofs:oneofs
                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
                   firstHasIndex:-1];
    #if defined(DEBUG) && DEBUG
      NSAssert(descriptor == nil, @"Startup recursed!");
    #endif  // DEBUG
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

void KEYAPISINVOICEV1GetInvoiceCountResponse_ClearTypeOneOfCase(KEYAPISINVOICEV1GetInvoiceCountResponse *message) {
  GPBDescriptor *descriptor = [KEYAPISINVOICEV1GetInvoiceCountResponse descriptor];
  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
  GPBClearOneof(message, oneof);
}

#pragma clang diagnostic pop

// @@protoc_insertion_point(global_scope)

// clang-format on
