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

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

#import "google/api/Annotations.pbobjc.h"

@implementation KEYAPISIOTCONNECTV1UserService

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

- (instancetype)initWithHost:(NSString *)host {
  return [super initWithHost:host
                 packageName:@"keyapis.iot_connect_sber.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)

/**
 * Метод получения пользователя для соединения аккаунтов.
 * Идентификатор пользователя - это subject из токена.
 * Метод доступен для: TokenACF: Scope: sber_iot
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getUserWithRequest:(KEYAPISIOTCONNECTV1GetUserRequest *)request handler:(void(^)(KEYAPISIOTCONNECTV1GetUserResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetUserWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения пользователя для соединения аккаунтов.
 * Идентификатор пользователя - это subject из токена.
 * Метод доступен для: TokenACF: Scope: sber_iot
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetUserWithRequest:(KEYAPISIOTCONNECTV1GetUserRequest *)request handler:(void(^)(KEYAPISIOTCONNECTV1GetUserResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetUser"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISIOTCONNECTV1GetUserResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения пользователя для соединения аккаунтов.
 * Идентификатор пользователя - это subject из токена.
 * Метод доступен для: TokenACF: Scope: sber_iot
 */
- (GRPCUnaryProtoCall *)getUserWithMessage:(KEYAPISIOTCONNECTV1GetUserRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetUser"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISIOTCONNECTV1GetUserResponse class]];
}

@end
#endif
