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

#if !defined(GPB_GRPC_PROTOCOL_ONLY) || !GPB_GRPC_PROTOCOL_ONLY
#import "keyapis/rfidregistry/v1/KeyapisRfidregistryRecordV1.pbrpc.h"
#import "keyapis/rfidregistry/v1/KeyapisRfidregistryRecordV1.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/GPBWrappers.pbobjc.h>
#else
#import "GPBWrappers.pbobjc.h"
#endif
#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBTimestamp.pbobjc.h>
#else
#import "GPBTimestamp.pbobjc.h"
#endif

@implementation KEYAPISRFIDREGISTRYV1RecordService

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

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

#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 PostRecord(PostRecordRequest) returns (PostRecordResponse)

/**
 * Метод сохранения записи.
 * Нельзя отвязать ключ, который привязал кто-то другой.
 * Разрешения: rfidregistry:record:save.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postRecordWithRequest:(KEYAPISRFIDREGISTRYV1PostRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1PostRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostRecordWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод сохранения записи.
 * Нельзя отвязать ключ, который привязал кто-то другой.
 * Разрешения: rfidregistry:record:save.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostRecordWithRequest:(KEYAPISRFIDREGISTRYV1PostRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1PostRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostRecord"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISRFIDREGISTRYV1PostRecordResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод сохранения записи.
 * Нельзя отвязать ключ, который привязал кто-то другой.
 * Разрешения: rfidregistry:record:save.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 */
- (GRPCUnaryProtoCall *)postRecordWithMessage:(KEYAPISRFIDREGISTRYV1PostRecordRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostRecord"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISRFIDREGISTRYV1PostRecordResponse class]];
}

#pragma mark GetRecord(GetRecordRequest) returns (GetRecordResponse)

/**
 * Метод получения записи.
 * Разрешения: rfidregistry:record:card.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getRecordWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1GetRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetRecordWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения записи.
 * Разрешения: rfidregistry:record:card.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetRecordWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1GetRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetRecord"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения записи.
 * Разрешения: rfidregistry:record:card.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 */
- (GRPCUnaryProtoCall *)getRecordWithMessage:(KEYAPISRFIDREGISTRYV1GetRecordRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetRecord"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordResponse class]];
}

#pragma mark GetRecordList(GetRecordListRequest) returns (stream GetRecordListResponse)

/**
 * Метод получения списка записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getRecordListWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISRFIDREGISTRYV1GetRecordListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  [[self RPCToGetRecordListWithRequest:request eventHandler:eventHandler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения списка записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetRecordListWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordListRequest *)request eventHandler:(void(^)(BOOL done, KEYAPISRFIDREGISTRYV1GetRecordListResponse *_Nullable response, NSError *_Nullable error))eventHandler{
  return [self RPCToMethod:@"GetRecordList"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordListResponse class]
        responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]];
}
/**
 * Метод получения списка записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 */
- (GRPCUnaryProtoCall *)getRecordListWithMessage:(KEYAPISRFIDREGISTRYV1GetRecordListRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetRecordList"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordListResponse class]];
}

#pragma mark GetRecordCount(GetRecordCountRequest) returns (GetRecordCountResponse)

/**
 * Метод получения количества записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)getRecordCountWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordCountRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1GetRecordCountResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToGetRecordCountWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод получения количества записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToGetRecordCountWithRequest:(KEYAPISRFIDREGISTRYV1GetRecordCountRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1GetRecordCountResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"GetRecordCount"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordCountResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод получения количества записей.
 * Разрешения: rfidregistry:record:list.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 */
- (GRPCUnaryProtoCall *)getRecordCountWithMessage:(KEYAPISRFIDREGISTRYV1GetRecordCountRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"GetRecordCount"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISRFIDREGISTRYV1GetRecordCountResponse class]];
}

#pragma mark DeleteRecord(DeleteRecordRequest) returns (DeleteRecordResponse)

/**
 * Метод удаления записи.
 * Можно удалять только свои записи.
 * Нельзя удалить ключ, если его использует кто-то другой.
 * Разрешения: rfidregistry:record:remove.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)deleteRecordWithRequest:(KEYAPISRFIDREGISTRYV1DeleteRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1DeleteRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToDeleteRecordWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Метод удаления записи.
 * Можно удалять только свои записи.
 * Нельзя удалить ключ, если его использует кто-то другой.
 * Разрешения: rfidregistry:record:remove.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToDeleteRecordWithRequest:(KEYAPISRFIDREGISTRYV1DeleteRecordRequest *)request handler:(void(^)(KEYAPISRFIDREGISTRYV1DeleteRecordResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"DeleteRecord"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[KEYAPISRFIDREGISTRYV1DeleteRecordResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Метод удаления записи.
 * Можно удалять только свои записи.
 * Нельзя удалить ключ, если его использует кто-то другой.
 * Разрешения: rfidregistry:record:remove.
 * Метод доступен для: Token: seller, employee, application, service, device_admin, ltp_first, admin, master, owner, mrf, bti, manager, external_seller. При наличии разрешений
 */
- (GRPCUnaryProtoCall *)deleteRecordWithMessage:(KEYAPISRFIDREGISTRYV1DeleteRecordRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"DeleteRecord"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[KEYAPISRFIDREGISTRYV1DeleteRecordResponse class]];
}

@end
#endif
