// Code generated by gRPC proto compiler.  DO NOT EDIT!
// source: keyapis/invoice/v1/keyapis_invoice_invoice_v1.proto

#if !defined(GPB_GRPC_PROTOCOL_ONLY) || !GPB_GRPC_PROTOCOL_ONLY
#import "keyapis/invoice/v1/KeyapisInvoiceInvoiceV1.pbrpc.h"
#import "keyapis/invoice/v1/KeyapisInvoiceInvoiceV1.pbobjc.h"
#import <ProtoRPC/ProtoRPCLegacy.h>
#import <RxLibrary/GRXWriter+Immediate.h>

#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBTimestamp.pbobjc.h>
#else
#import "GPBTimestamp.pbobjc.h"
#endif
#import "google/api/Annotations.pbobjc.h"
#import "google/api/FieldBehavior.pbobjc.h"
#import "keyapis/invoice/v1/KeyapisInvoicePaymethodV1.pbobjc.h"
#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBWrappers.pbobjc.h>
#else
#import "GPBWrappers.pbobjc.h"
#endif

@implementation KEYAPISINVOICEV1InvoiceService

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"

// Designated initializer
- (instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [super initWithHost:host
                 packageName:@"keyapis.invoice.v1"
                 serviceName:@"InvoiceService"
                 callOptions:callOptions];
}

- (instancetype)initWithHost:(NSString *)host {
  return [super initWithHost:host
                 packageName:@"keyapis.invoice.v1"
                 serviceName:@"InvoiceService"];
}

#pragma clang diagnostic pop

// Override superclass initializer to disallow different package and service names.
- (instancetype)initWithHost:(NSString *)host
                 packageName:(NSString *)packageName
                 serviceName:(NSString *)serviceName {
  return [self initWithHost:host];
}

- (instancetype)initWithHost:(NSString *)host
                 packageName:(NSString *)packageName
                 serviceName:(NSString *)serviceName
                 callOptions:(GRPCCallOptions *)callOptions {
  return [self initWithHost:host callOptions:callOptions];
}

#pragma mark - Class Methods

+ (instancetype)serviceWithHost:(NSString *)host {
  return [[self alloc] initWithHost:host];
}

+ (instancetype)serviceWithHost:(NSString *)host callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [[self alloc] initWithHost:host callOptions:callOptions];
}

#pragma mark - Method Implementations

#pragma mark CreateInvoice(CreateInvoiceRequest) returns (CreateInvoiceResponse)

/**
 * Метод создания платежа.
 * Создание платежа в своей и внешней платежной системе.
 * Метод доступен для: service
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)createInvoiceWithRequest:(KEYAPISINVOICEV1CreateInvoiceRequest *)request handler:(void(^)(KEYAPISINVOICEV1CreateInvoiceResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToCreateInvoiceWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод создания платежа.
 * Создание платежа в своей и внешней платежной системе.
 * Метод доступен для: service
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToCreateInvoiceWithRequest:(KEYAPISINVOICEV1CreateInvoiceRequest *)request handler:(void(^)(KEYAPISINVOICEV1CreateInvoiceResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"CreateInvoice"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISINVOICEV1CreateInvoiceResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод создания платежа.
 * Создание платежа в своей и внешней платежной системе.
 * Метод доступен для: service
 */
- (GRPCUnaryProtoCall *)createInvoiceWithMessage:(KEYAPISINVOICEV1CreateInvoiceRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"CreateInvoice"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISINVOICEV1CreateInvoiceResponse class]];
}

#pragma mark GetInvoice(GetInvoiceRequest) returns (GetInvoiceResponse)

/**
 * Метод получения платежа.
 * Для master доступно получение платежа только с user_id из токена.
 * Метод доступен для: admin, service, master
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getInvoiceWithRequest:(KEYAPISINVOICEV1GetInvoiceRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetInvoiceWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения платежа.
 * Для master доступно получение платежа только с user_id из токена.
 * Метод доступен для: admin, service, master
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetInvoiceWithRequest:(KEYAPISINVOICEV1GetInvoiceRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetInvoice"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISINVOICEV1GetInvoiceResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения платежа.
 * Для master доступно получение платежа только с user_id из токена.
 * Метод доступен для: admin, service, master
 */
- (GRPCUnaryProtoCall *)getInvoiceWithMessage:(KEYAPISINVOICEV1GetInvoiceRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetInvoice"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISINVOICEV1GetInvoiceResponse class]];
}

#pragma mark PostInvoiceConfirm(PostInvoiceConfirmRequest) returns (PostInvoiceConfirmResponse)

/**
 * Метод подтверждения платежа (вызывается со стороны внешней системы).
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postInvoiceConfirmWithRequest:(KEYAPISINVOICEV1PostInvoiceConfirmRequest *)request handler:(void(^)(KEYAPISINVOICEV1PostInvoiceConfirmResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostInvoiceConfirmWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод подтверждения платежа (вызывается со стороны внешней системы).
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostInvoiceConfirmWithRequest:(KEYAPISINVOICEV1PostInvoiceConfirmRequest *)request handler:(void(^)(KEYAPISINVOICEV1PostInvoiceConfirmResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostInvoiceConfirm"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISINVOICEV1PostInvoiceConfirmResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод подтверждения платежа (вызывается со стороны внешней системы).
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postInvoiceConfirmWithMessage:(KEYAPISINVOICEV1PostInvoiceConfirmRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostInvoiceConfirm"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISINVOICEV1PostInvoiceConfirmResponse class]];
}

#pragma mark GetInvoiceList(GetInvoiceListRequest) returns (GetInvoiceListResponse)

/**
 * Метод получения списка платежей.
 * Для master доступно получение только собственных платежей, если параметр filter.user_id передан и не совпадает с user_id из токена, возвращается ошибка доступа.
 * Метод доступен для: admin, service, master, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getInvoiceListWithRequest:(KEYAPISINVOICEV1GetInvoiceListRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceListResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetInvoiceListWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения списка платежей.
 * Для master доступно получение только собственных платежей, если параметр filter.user_id передан и не совпадает с user_id из токена, возвращается ошибка доступа.
 * Метод доступен для: admin, service, master, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetInvoiceListWithRequest:(KEYAPISINVOICEV1GetInvoiceListRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceListResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetInvoiceList"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISINVOICEV1GetInvoiceListResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения списка платежей.
 * Для master доступно получение только собственных платежей, если параметр filter.user_id передан и не совпадает с user_id из токена, возвращается ошибка доступа.
 * Метод доступен для: admin, service, master, ltp_first
 */
- (GRPCUnaryProtoCall *)getInvoiceListWithMessage:(KEYAPISINVOICEV1GetInvoiceListRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetInvoiceList"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISINVOICEV1GetInvoiceListResponse class]];
}

#pragma mark GetInvoiceCount(GetInvoiceCountRequest) returns (GetInvoiceCountResponse)

/**
 * Метод получения количества платежей.
 * Для master в параметр filter.user_id подставляется user_id из токена.
 * Метод доступен для: admin, service, master, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getInvoiceCountWithRequest:(KEYAPISINVOICEV1GetInvoiceCountRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceCountResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetInvoiceCountWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения количества платежей.
 * Для master в параметр filter.user_id подставляется user_id из токена.
 * Метод доступен для: admin, service, master, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetInvoiceCountWithRequest:(KEYAPISINVOICEV1GetInvoiceCountRequest *)request handler:(void(^)(KEYAPISINVOICEV1GetInvoiceCountResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetInvoiceCount"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISINVOICEV1GetInvoiceCountResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения количества платежей.
 * Для master в параметр filter.user_id подставляется user_id из токена.
 * Метод доступен для: admin, service, master, ltp_first
 */
- (GRPCUnaryProtoCall *)getInvoiceCountWithMessage:(KEYAPISINVOICEV1GetInvoiceCountRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetInvoiceCount"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISINVOICEV1GetInvoiceCountResponse class]];
}

@end
#endif
