// Code generated by gRPC proto compiler.  DO NOT EDIT!
// source: deviceapis/device/v1/deviceapis_device_update_v1.proto

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

#import "google/api/Annotations.pbobjc.h"
#import "google/api/FieldBehavior.pbobjc.h"
#import "deviceapis/device/v1/DeviceapisDeviceCommonV1.pbobjc.h"
#import "protoc-gen-openapiv2/options/Annotations.pbobjc.h"

@implementation DEVICEAPISDEVICEV1UpdateService

#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:@"deviceapis.device.v1"
                 serviceName:@"UpdateService"
                 callOptions:callOptions];
}

- (instancetype)initWithHost:(NSString *)host {
  return [super initWithHost:host
                 packageName:@"deviceapis.device.v1"
                 serviceName:@"UpdateService"];
}

#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 PostUpdateDownload(PostUpdateDownloadRequest) returns (PostUpdateDownloadResponse)

/**
 * Скачать прошивку для обновления
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postUpdateDownloadWithRequest:(DEVICEAPISDEVICEV1PostUpdateDownloadRequest *)request handler:(void(^)(DEVICEAPISDEVICEV1PostUpdateDownloadResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostUpdateDownloadWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Скачать прошивку для обновления
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostUpdateDownloadWithRequest:(DEVICEAPISDEVICEV1PostUpdateDownloadRequest *)request handler:(void(^)(DEVICEAPISDEVICEV1PostUpdateDownloadResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostUpdateDownload"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[DEVICEAPISDEVICEV1PostUpdateDownloadResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Скачать прошивку для обновления
 */
- (GRPCUnaryProtoCall *)postUpdateDownloadWithMessage:(DEVICEAPISDEVICEV1PostUpdateDownloadRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostUpdateDownload"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[DEVICEAPISDEVICEV1PostUpdateDownloadResponse class]];
}

#pragma mark PostUpdateApply(PostUpdateApplyRequest) returns (PostUpdateApplyResponse)

/**
 * Запустить обновление домофона
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (void)postUpdateApplyWithRequest:(DEVICEAPISDEVICEV1PostUpdateApplyRequest *)request handler:(void(^)(DEVICEAPISDEVICEV1PostUpdateApplyResponse *_Nullable response, NSError *_Nullable error))handler{
  [[self RPCToPostUpdateApplyWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
/**
 * Запустить обновление домофона
 *
 * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended.
 */
- (GRPCProtoCall *)RPCToPostUpdateApplyWithRequest:(DEVICEAPISDEVICEV1PostUpdateApplyRequest *)request handler:(void(^)(DEVICEAPISDEVICEV1PostUpdateApplyResponse *_Nullable response, NSError *_Nullable error))handler{
  return [self RPCToMethod:@"PostUpdateApply"
            requestsWriter:[GRXWriter writerWithValue:request]
             responseClass:[DEVICEAPISDEVICEV1PostUpdateApplyResponse class]
        responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]];
}
/**
 * Запустить обновление домофона
 */
- (GRPCUnaryProtoCall *)postUpdateApplyWithMessage:(DEVICEAPISDEVICEV1PostUpdateApplyRequest *)message responseHandler:(id<GRPCProtoResponseHandler>)handler callOptions:(GRPCCallOptions *_Nullable)callOptions {
  return [self RPCToMethod:@"PostUpdateApply"
                   message:message
           responseHandler:handler
               callOptions:callOptions
             responseClass:[DEVICEAPISDEVICEV1PostUpdateApplyResponse class]];
}

@end
#endif
