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

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

#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/GPBTimestamp.pbobjc.h>
#else
#import "GPBTimestamp.pbobjc.h"
#endif
#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBWrappers.pbobjc.h>
#else
#import "GPBWrappers.pbobjc.h"
#endif

@implementation KEYAPISPRESETV1PresetService

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

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

#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 PostPreset(PostPresetRequest) returns (PostPresetResponse)

/**
 * Метод сохранения пресетов.
 * Поддерживает создание и обновление.
 * При обновлении пресета посылается задача PresetInstallTask в очередь key.preset.install.
 * Данное сообщение должно отправляться только если изменению подверглось одно из следующих полей:
 * - Sip;
 * - Ntp;
 * - Syslog;
 * - Room;
 * - VideoConfig;
 * - Dtmf.
 * Метод доступен для: admin, service
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postPresetWithRequest:(KEYAPISPRESETV1PostPresetRequest *)request handler:(void(^)(KEYAPISPRESETV1PostPresetResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostPresetWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод сохранения пресетов.
 * Поддерживает создание и обновление.
 * При обновлении пресета посылается задача PresetInstallTask в очередь key.preset.install.
 * Данное сообщение должно отправляться только если изменению подверглось одно из следующих полей:
 * - Sip;
 * - Ntp;
 * - Syslog;
 * - Room;
 * - VideoConfig;
 * - Dtmf.
 * Метод доступен для: admin, service
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostPresetWithRequest:(KEYAPISPRESETV1PostPresetRequest *)request handler:(void(^)(KEYAPISPRESETV1PostPresetResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostPreset"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISPRESETV1PostPresetResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод сохранения пресетов.
 * Поддерживает создание и обновление.
 * При обновлении пресета посылается задача PresetInstallTask в очередь key.preset.install.
 * Данное сообщение должно отправляться только если изменению подверглось одно из следующих полей:
 * - Sip;
 * - Ntp;
 * - Syslog;
 * - Room;
 * - VideoConfig;
 * - Dtmf.
 * Метод доступен для: admin, service
 */
- (GRPCUnaryProtoCall *)postPresetWithMessage:(KEYAPISPRESETV1PostPresetRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostPreset"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISPRESETV1PostPresetResponse class]];
}

#pragma mark GetPreset(GetPresetRequest) returns (GetPresetResponse)

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

#pragma mark GetPresetDefault(GetPresetDefaultRequest) returns (GetPresetDefaultResponse)

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

#pragma mark GetPresetList(GetPresetListRequest) returns (stream GetPresetListResponse)

/**
 * Метод получения пресетов.
 * Метод доступен для: admin, service, bti, ltp_first, owner, employee
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getPresetListWithRequest:(KEYAPISPRESETV1GetPresetListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISPRESETV1GetPresetListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  [[self RPCToGetPresetListWithRequest:request eventHandler:eventHandler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения пресетов.
 * Метод доступен для: admin, service, bti, ltp_first, owner, employee
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetPresetListWithRequest:(KEYAPISPRESETV1GetPresetListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISPRESETV1GetPresetListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  return [self RPCToMethod:@"GetPresetList"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISPRESETV1GetPresetListResponse class]
        responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]];
}
/**
 * Метод получения пресетов.
 * Метод доступен для: admin, service, bti, ltp_first, owner, employee
 */
- (GRPCUnaryProtoCall *)getPresetListWithMessage:(KEYAPISPRESETV1GetPresetListRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetPresetList"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISPRESETV1GetPresetListResponse class]];
}

#pragma mark GetPresetCount(GetPresetCountRequest) returns (GetPresetCountResponse)

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

#pragma mark DeletePreset(DeletePresetRequest) returns (DeletePresetResponse)

/**
 * Метод удаления пресета.
 * Нельзя удалить пресет, если он используется на устройстве.
 * Нельзя удалить дефолтный пресет.
 * Метод доступен для: admin, service
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)deletePresetWithRequest:(KEYAPISPRESETV1DeletePresetRequest *)request handler:(void(^)(KEYAPISPRESETV1DeletePresetResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToDeletePresetWithRequest: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 *)RPCToDeletePresetWithRequest:(KEYAPISPRESETV1DeletePresetRequest *)request handler:(void(^)(KEYAPISPRESETV1DeletePresetResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"DeletePreset"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISPRESETV1DeletePresetResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод удаления пресета.
 * Нельзя удалить пресет, если он используется на устройстве.
 * Нельзя удалить дефолтный пресет.
 * Метод доступен для: admin, service
 */
- (GRPCUnaryProtoCall *)deletePresetWithMessage:(KEYAPISPRESETV1DeletePresetRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"DeletePreset"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISPRESETV1DeletePresetResponse class]];
}

@end
#endif
