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

#if !defined(GPB_GRPC_PROTOCOL_ONLY) || !GPB_GRPC_PROTOCOL_ONLY
#import "keyapis/identity/v1/KeyapisIdentityOauth2V1.pbrpc.h"
#import "keyapis/identity/v1/KeyapisIdentityOauth2V1.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
#import "keyapis/identity/v1/KeyapisIdentityAuthorizationV1.pbobjc.h"

@implementation KEYAPISIDENTITYV1Oauth2Service

#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:@"Oauth2Service"
                 callOptions:callOptions];
}

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

#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 PostOauth2LoginByCode(PostOauth2LoginByCodeRequest) returns (PostOauth2LoginByCodeResponse)

/**
 * Метод авторизации по ОТП-коду по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postOauth2LoginByCodeWithRequest:(KEYAPISIDENTITYV1PostOauth2LoginByCodeRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostOauth2LoginByCodeResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostOauth2LoginByCodeWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод авторизации по ОТП-коду по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostOauth2LoginByCodeWithRequest:(KEYAPISIDENTITYV1PostOauth2LoginByCodeRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostOauth2LoginByCodeResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostOauth2LoginByCode"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1PostOauth2LoginByCodeResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод авторизации по ОТП-коду по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postOauth2LoginByCodeWithMessage:(KEYAPISIDENTITYV1PostOauth2LoginByCodeRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostOauth2LoginByCode"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1PostOauth2LoginByCodeResponse class]];
}

#pragma mark PostOauth2LoginByPassword(PostOauth2LoginByPasswordRequest) returns (PostOauth2LoginByPasswordResponse)

/**
 * Метод авторизации по паролю по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postOauth2LoginByPasswordWithRequest:(KEYAPISIDENTITYV1PostOauth2LoginByPasswordRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostOauth2LoginByPasswordResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostOauth2LoginByPasswordWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод авторизации по паролю по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostOauth2LoginByPasswordWithRequest:(KEYAPISIDENTITYV1PostOauth2LoginByPasswordRequest *)request handler:(void(^)(KEYAPISIDENTITYV1PostOauth2LoginByPasswordResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostOauth2LoginByPassword"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1PostOauth2LoginByPasswordResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод авторизации по паролю по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)postOauth2LoginByPasswordWithMessage:(KEYAPISIDENTITYV1PostOauth2LoginByPasswordRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostOauth2LoginByPassword"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1PostOauth2LoginByPasswordResponse class]];
}

#pragma mark GetOauth2Consent(GetOauth2ConsentRequest) returns (GetOauth2ConsentResponse)

/**
 * Метод запроса соглашения пользователя по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getOauth2ConsentWithRequest:(KEYAPISIDENTITYV1GetOauth2ConsentRequest *)request handler:(void(^)(KEYAPISIDENTITYV1GetOauth2ConsentResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetOauth2ConsentWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод запроса соглашения пользователя по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetOauth2ConsentWithRequest:(KEYAPISIDENTITYV1GetOauth2ConsentRequest *)request handler:(void(^)(KEYAPISIDENTITYV1GetOauth2ConsentResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetOauth2Consent"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIDENTITYV1GetOauth2ConsentResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод запроса соглашения пользователя по процедуре OAuth2.
 * Метод возвращает переадресацию в виде GRPC метаданных x-http-code и location.
 * Не требует авторизации
 */
- (GRPCUnaryProtoCall *)getOauth2ConsentWithMessage:(KEYAPISIDENTITYV1GetOauth2ConsentRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetOauth2Consent"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIDENTITYV1GetOauth2ConsentResponse class]];
}

@end
#endif
