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

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

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

@implementation KEYAPISIDENTITYV1AuthorizationService

#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.identity.v1"
                 serviceName:@"AuthorizationService"
                 callOptions:callOptions];
}

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

#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 PostAuthorizationLogin(PostAuthorizationLoginRequest) returns (PostAuthorizationLoginResponse)

/**
 * Метод авторизации по ОТП-коду.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postAuthorizationLoginWithRequest:(KEYAPISIDENTITYV1PostAuthorizationLoginRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationLoginResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostAuthorizationLoginWithRequest: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 *)RPCToPostAuthorizationLoginWithRequest:(KEYAPISIDENTITYV1PostAuthorizationLoginRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationLoginResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostAuthorizationLogin"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationLoginResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод авторизации по ОТП-коду.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postAuthorizationLoginWithMessage:(KEYAPISIDENTITYV1PostAuthorizationLoginRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostAuthorizationLogin"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationLoginResponse class]];
}

#pragma mark PostAuthorizationSendCode(PostAuthorizationSendCodeRequest) returns (PostAuthorizationSendCodeResponse)

/**
 * Метод запроса ОТП-кода.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postAuthorizationSendCodeWithRequest:(KEYAPISIDENTITYV1PostAuthorizationSendCodeRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationSendCodeResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostAuthorizationSendCodeWithRequest: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 *)RPCToPostAuthorizationSendCodeWithRequest:(KEYAPISIDENTITYV1PostAuthorizationSendCodeRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationSendCodeResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostAuthorizationSendCode"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationSendCodeResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод запроса ОТП-кода.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postAuthorizationSendCodeWithMessage:(KEYAPISIDENTITYV1PostAuthorizationSendCodeRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostAuthorizationSendCode"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationSendCodeResponse class]];
}

#pragma mark PostAuthorizationLoginByPassword(PostAuthorizationLoginByPasswordRequest) returns (PostAuthorizationLoginByPasswordResponse)

/**
 * Метод авторизации по паролю.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postAuthorizationLoginByPasswordWithRequest:(KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostAuthorizationLoginByPasswordWithRequest: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 *)RPCToPostAuthorizationLoginByPasswordWithRequest:(KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostAuthorizationLoginByPassword"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод авторизации по паролю.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postAuthorizationLoginByPasswordWithMessage:(KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostAuthorizationLoginByPassword"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1PostAuthorizationLoginByPasswordResponse class]];
}

@end
#endif
