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

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

#import "google/api/Visibility.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 "google/api/Annotations.pbobjc.h"
#import "google/api/FieldBehavior.pbobjc.h"
#import "google/protobuf/Descriptor.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 KEYAPISUSERV1UserService

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

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

#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 GetUser(GetUserRequest) returns (GetUserResponse)

/**
 * Метод получения пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Роли owner или employee могут запрашивать только пользователей, принадлежащих их компании
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getUserWithRequest:(KEYAPISUSERV1GetUserRequest *)request handler:(void(^)(KEYAPISUSERV1GetUserResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetUserWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Роли owner или employee могут запрашивать только пользователей, принадлежащих их компании
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetUserWithRequest:(KEYAPISUSERV1GetUserRequest *)request handler:(void(^)(KEYAPISUSERV1GetUserResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetUser"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISUSERV1GetUserResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Роли owner или employee могут запрашивать только пользователей, принадлежащих их компании
 */
- (GRPCUnaryProtoCall *)getUserWithMessage:(KEYAPISUSERV1GetUserRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetUser"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISUSERV1GetUserResponse class]];
}

#pragma mark GetUserList(GetUserListRequest) returns (stream GetUserListResponse)

/**
 * Метод получения списка пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getUserListWithRequest:(KEYAPISUSERV1GetUserListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISUSERV1GetUserListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  [[self RPCToGetUserListWithRequest:request eventHandler:eventHandler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения списка пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetUserListWithRequest:(KEYAPISUSERV1GetUserListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISUSERV1GetUserListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  return [self RPCToMethod:@"GetUserList"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISUSERV1GetUserListResponse class]
        responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]];
}
/**
 * Метод получения списка пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 */
- (GRPCUnaryProtoCall *)getUserListWithMessage:(KEYAPISUSERV1GetUserListRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetUserList"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISUSERV1GetUserListResponse class]];
}

#pragma mark GetUserCount(GetUserCountRequest) returns (GetUserCountResponse)

/**
 * Метод получения количества пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getUserCountWithRequest:(KEYAPISUSERV1GetUserCountRequest *)request handler:(void(^)(KEYAPISUSERV1GetUserCountResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetUserCountWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения количества пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetUserCountWithRequest:(KEYAPISUSERV1GetUserCountRequest *)request handler:(void(^)(KEYAPISUSERV1GetUserCountResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetUserCount"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISUSERV1GetUserCountResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения количества пользователей.
 * Метод доступен для: admin, service, manager, bti, ltp_first, owner, empolyee.
 * Если метод вызван ролями owner или employee в фильтре поле company_ids принудительно замещается их company_id
 */
- (GRPCUnaryProtoCall *)getUserCountWithMessage:(KEYAPISUSERV1GetUserCountRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetUserCount"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISUSERV1GetUserCountResponse class]];
}

#pragma mark DeleteUser(DeleteUserRequest) returns (DeleteUserResponse)

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

#pragma mark DeleteUserSessions(DeleteUserSessionsRequest) returns (DeleteUserSessionsResponse)

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

#pragma mark GetUserCode(GetUserCodeRequest) returns (GetUserCodeResponse)

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

#pragma mark PostUserCodeCreate(PostUserCodeCreateRequest) returns (PostUserCodeCreateResponse)

/**
 * Метод создания идентификационного кода пользователя.
 * После создания кода отправляется событие SendingSmsTask.
 * Метод доступен для: admin, service, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postUserCodeCreateWithRequest:(KEYAPISUSERV1PostUserCodeCreateRequest *)request handler:(void(^)(KEYAPISUSERV1PostUserCodeCreateResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostUserCodeCreateWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод создания идентификационного кода пользователя.
 * После создания кода отправляется событие SendingSmsTask.
 * Метод доступен для: admin, service, ltp_first
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostUserCodeCreateWithRequest:(KEYAPISUSERV1PostUserCodeCreateRequest *)request handler:(void(^)(KEYAPISUSERV1PostUserCodeCreateResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostUserCodeCreate"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISUSERV1PostUserCodeCreateResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод создания идентификационного кода пользователя.
 * После создания кода отправляется событие SendingSmsTask.
 * Метод доступен для: admin, service, ltp_first
 */
- (GRPCUnaryProtoCall *)postUserCodeCreateWithMessage:(KEYAPISUSERV1PostUserCodeCreateRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostUserCodeCreate"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISUSERV1PostUserCodeCreateResponse class]];
}

#pragma mark PostUser(PostUserRequest) returns (PostUserResponse)

/**
 * Метод создания пользователя.
 * Метод доступен для: admin, service.
 * Доступно создание пользователей с типом: ADMIN, MRF, BTI, LTP_FIRST, SERVICE, DEVICE_ADMIN, MANAGER
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postUserWithRequest:(KEYAPISUSERV1PostUserRequest *)request handler:(void(^)(KEYAPISUSERV1PostUserResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostUserWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод создания пользователя.
 * Метод доступен для: admin, service.
 * Доступно создание пользователей с типом: ADMIN, MRF, BTI, LTP_FIRST, SERVICE, DEVICE_ADMIN, MANAGER
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostUserWithRequest:(KEYAPISUSERV1PostUserRequest *)request handler:(void(^)(KEYAPISUSERV1PostUserResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostUser"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISUSERV1PostUserResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод создания пользователя.
 * Метод доступен для: admin, service.
 * Доступно создание пользователей с типом: ADMIN, MRF, BTI, LTP_FIRST, SERVICE, DEVICE_ADMIN, MANAGER
 */
- (GRPCUnaryProtoCall *)postUserWithMessage:(KEYAPISUSERV1PostUserRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostUser"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISUSERV1PostUserResponse class]];
}

#pragma mark PatchUser(PatchUserRequest) returns (PatchUserResponse)

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

@end
#endif
