diff options
Diffstat (limited to 'src/objective-c/examples/Sample/RemoteTestClient')
18 files changed, 1136 insertions, 3489 deletions
diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.h b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.h deleted file mode 100644 index bf9fa3e36f..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.h +++ /dev/null @@ -1,103 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import <ProtocolBuffers/ProtocolBuffers.h> - -// @@protoc_insertion_point(imports) - -@class ObjectiveCFileOptions; -@class ObjectiveCFileOptionsBuilder; -@class PBDescriptorProto; -@class PBDescriptorProtoBuilder; -@class PBDescriptorProtoExtensionRange; -@class PBDescriptorProtoExtensionRangeBuilder; -@class PBEnumDescriptorProto; -@class PBEnumDescriptorProtoBuilder; -@class PBEnumOptions; -@class PBEnumOptionsBuilder; -@class PBEnumValueDescriptorProto; -@class PBEnumValueDescriptorProtoBuilder; -@class PBEnumValueOptions; -@class PBEnumValueOptionsBuilder; -@class PBFieldDescriptorProto; -@class PBFieldDescriptorProtoBuilder; -@class PBFieldOptions; -@class PBFieldOptionsBuilder; -@class PBFileDescriptorProto; -@class PBFileDescriptorProtoBuilder; -@class PBFileDescriptorSet; -@class PBFileDescriptorSetBuilder; -@class PBFileOptions; -@class PBFileOptionsBuilder; -@class PBMessageOptions; -@class PBMessageOptionsBuilder; -@class PBMethodDescriptorProto; -@class PBMethodDescriptorProtoBuilder; -@class PBMethodOptions; -@class PBMethodOptionsBuilder; -@class PBOneofDescriptorProto; -@class PBOneofDescriptorProtoBuilder; -@class PBServiceDescriptorProto; -@class PBServiceDescriptorProtoBuilder; -@class PBServiceOptions; -@class PBServiceOptionsBuilder; -@class PBSourceCodeInfo; -@class PBSourceCodeInfoBuilder; -@class PBSourceCodeInfoLocation; -@class PBSourceCodeInfoLocationBuilder; -@class PBUninterpretedOption; -@class PBUninterpretedOptionBuilder; -@class PBUninterpretedOptionNamePart; -@class PBUninterpretedOptionNamePartBuilder; -@class RMTEmpty; -@class RMTEmptyBuilder; - - - -@interface RMTEmptyRoot : NSObject { -} -+ (PBExtensionRegistry*) extensionRegistry; -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; -@end - -@interface RMTEmpty : PBGeneratedMessage<GeneratedMessageProtocol> { -@private -} - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTEmptyBuilder*) builder; -+ (RMTEmptyBuilder*) builder; -+ (RMTEmptyBuilder*) builderWithPrototype:(RMTEmpty*) prototype; -- (RMTEmptyBuilder*) toBuilder; - -+ (RMTEmpty*) parseFromData:(NSData*) data; -+ (RMTEmpty*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTEmpty*) parseFromInputStream:(NSInputStream*) input; -+ (RMTEmpty*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTEmpty*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTEmpty*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTEmptyBuilder : PBGeneratedMessageBuilder { -@private - RMTEmpty* resultEmpty; -} - -- (RMTEmpty*) defaultInstance; - -- (RMTEmptyBuilder*) clear; -- (RMTEmptyBuilder*) clone; - -- (RMTEmpty*) build; -- (RMTEmpty*) buildPartial; - -- (RMTEmptyBuilder*) mergeFrom:(RMTEmpty*) other; -- (RMTEmptyBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTEmptyBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.m b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.m deleted file mode 100644 index 8e39cb70d1..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pb.m +++ /dev/null @@ -1,179 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import "Empty.pb.h" -// @@protoc_insertion_point(imports) - -@implementation RMTEmptyRoot -static PBExtensionRegistry* extensionRegistry = nil; -+ (PBExtensionRegistry*) extensionRegistry { - return extensionRegistry; -} - -+ (void) initialize { - if (self == [RMTEmptyRoot class]) { - PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; - [self registerAllExtensions:registry]; - [ObjectivecDescriptorRoot registerAllExtensions:registry]; - extensionRegistry = registry; - } -} -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry { -} -@end - -@interface RMTEmpty () -@end - -@implementation RMTEmpty - -- (instancetype) init { - if ((self = [super init])) { - } - return self; -} -static RMTEmpty* defaultRMTEmptyInstance = nil; -+ (void) initialize { - if (self == [RMTEmpty class]) { - defaultRMTEmptyInstance = [[RMTEmpty alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTEmptyInstance; -} -- (instancetype) defaultInstance { - return defaultRMTEmptyInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTEmpty*) parseFromData:(NSData*) data { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromData:data] build]; -} -+ (RMTEmpty*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTEmpty*) parseFromInputStream:(NSInputStream*) input { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromInputStream:input] build]; -} -+ (RMTEmpty*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTEmpty*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTEmpty*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTEmpty*)[[[RMTEmpty builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTEmptyBuilder*) builder { - return [[RMTEmptyBuilder alloc] init]; -} -+ (RMTEmptyBuilder*) builderWithPrototype:(RMTEmpty*) prototype { - return [[RMTEmpty builder] mergeFrom:prototype]; -} -- (RMTEmptyBuilder*) builder { - return [RMTEmpty builder]; -} -- (RMTEmptyBuilder*) toBuilder { - return [RMTEmpty builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTEmpty class]]) { - return NO; - } - RMTEmpty *otherMessage = other; - return - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTEmptyBuilder() -@property (strong) RMTEmpty* resultEmpty; -@end - -@implementation RMTEmptyBuilder -@synthesize resultEmpty; -- (instancetype) init { - if ((self = [super init])) { - self.resultEmpty = [[RMTEmpty alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultEmpty; -} -- (RMTEmptyBuilder*) clear { - self.resultEmpty = [[RMTEmpty alloc] init]; - return self; -} -- (RMTEmptyBuilder*) clone { - return [RMTEmpty builderWithPrototype:resultEmpty]; -} -- (RMTEmpty*) defaultInstance { - return [RMTEmpty defaultInstance]; -} -- (RMTEmpty*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTEmpty*) buildPartial { - RMTEmpty* returnMe = resultEmpty; - self.resultEmpty = nil; - return returnMe; -} -- (RMTEmptyBuilder*) mergeFrom:(RMTEmpty*) other { - if (other == [RMTEmpty defaultInstance]) { - return self; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTEmptyBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTEmptyBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - } - } -} -@end - - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.h b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.h new file mode 100644 index 0000000000..809d0dde6e --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.h @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: empty.proto + +#import "GPBProtocolBuffers.h" + +#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 +#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. +#endif + +CF_EXTERN_C_BEGIN + +@class RMTEmpty; + + +#pragma mark - RMTEmptyRoot + +@interface RMTEmptyRoot : GPBRootObject +@end + +#pragma mark - RMTEmpty + +// An empty message that you can re-use to avoid defining duplicated empty +// messages in your project. A typical example is to use it as argument or the +// return value of a service API. For instance: +// +// service Foo { +// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; +// }; +@interface RMTEmpty : GPBMessage + +@end + +CF_EXTERN_C_END diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.m b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.m new file mode 100644 index 0000000000..46d481af66 --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.m @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: empty.proto + +#import "GPBProtocolBuffers_RuntimeSupport.h" + +#import "Empty.pbobjc.h" + +#pragma mark - RMTEmptyRoot + +@implementation RMTEmptyRoot + +@end + +static GPBFileDescriptor *RMTEmptyRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - RMTEmpty + +@implementation RMTEmpty + + +typedef struct RMTEmpty_Storage { + uint32_t _has_storage_[0]; +} RMTEmpty_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTEmpty class] + rootClass:[RMTEmptyRoot class] + file:RMTEmptyRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTEmpty_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.h b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.h deleted file mode 100644 index 0a08e67702..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.h +++ /dev/null @@ -1,578 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import <ProtocolBuffers/ProtocolBuffers.h> - -// @@protoc_insertion_point(imports) - -@class ObjectiveCFileOptions; -@class ObjectiveCFileOptionsBuilder; -@class PBDescriptorProto; -@class PBDescriptorProtoBuilder; -@class PBDescriptorProtoExtensionRange; -@class PBDescriptorProtoExtensionRangeBuilder; -@class PBEnumDescriptorProto; -@class PBEnumDescriptorProtoBuilder; -@class PBEnumOptions; -@class PBEnumOptionsBuilder; -@class PBEnumValueDescriptorProto; -@class PBEnumValueDescriptorProtoBuilder; -@class PBEnumValueOptions; -@class PBEnumValueOptionsBuilder; -@class PBFieldDescriptorProto; -@class PBFieldDescriptorProtoBuilder; -@class PBFieldOptions; -@class PBFieldOptionsBuilder; -@class PBFileDescriptorProto; -@class PBFileDescriptorProtoBuilder; -@class PBFileDescriptorSet; -@class PBFileDescriptorSetBuilder; -@class PBFileOptions; -@class PBFileOptionsBuilder; -@class PBMessageOptions; -@class PBMessageOptionsBuilder; -@class PBMethodDescriptorProto; -@class PBMethodDescriptorProtoBuilder; -@class PBMethodOptions; -@class PBMethodOptionsBuilder; -@class PBOneofDescriptorProto; -@class PBOneofDescriptorProtoBuilder; -@class PBServiceDescriptorProto; -@class PBServiceDescriptorProtoBuilder; -@class PBServiceOptions; -@class PBServiceOptionsBuilder; -@class PBSourceCodeInfo; -@class PBSourceCodeInfoBuilder; -@class PBSourceCodeInfoLocation; -@class PBSourceCodeInfoLocationBuilder; -@class PBUninterpretedOption; -@class PBUninterpretedOptionBuilder; -@class PBUninterpretedOptionNamePart; -@class PBUninterpretedOptionNamePartBuilder; -@class RMTPayload; -@class RMTPayloadBuilder; -@class RMTResponseParameters; -@class RMTResponseParametersBuilder; -@class RMTSimpleRequest; -@class RMTSimpleRequestBuilder; -@class RMTSimpleResponse; -@class RMTSimpleResponseBuilder; -@class RMTStreamingInputCallRequest; -@class RMTStreamingInputCallRequestBuilder; -@class RMTStreamingInputCallResponse; -@class RMTStreamingInputCallResponseBuilder; -@class RMTStreamingOutputCallRequest; -@class RMTStreamingOutputCallRequestBuilder; -@class RMTStreamingOutputCallResponse; -@class RMTStreamingOutputCallResponseBuilder; - - -typedef NS_ENUM(SInt32, RMTPayloadType) { - RMTPayloadTypeCompressable = 0, - RMTPayloadTypeUncompressable = 1, - RMTPayloadTypeRandom = 2, -}; - -BOOL RMTPayloadTypeIsValidValue(RMTPayloadType value); -NSString *NSStringFromRMTPayloadType(RMTPayloadType value); - - -@interface RMTMessagesRoot : NSObject { -} -+ (PBExtensionRegistry*) extensionRegistry; -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; -@end - -@interface RMTPayload : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasBody_:1; - BOOL hasType_:1; - NSData* body; - RMTPayloadType type; -} -- (BOOL) hasType; -- (BOOL) hasBody; -@property (readonly) RMTPayloadType type; -@property (readonly, strong) NSData* body; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTPayloadBuilder*) builder; -+ (RMTPayloadBuilder*) builder; -+ (RMTPayloadBuilder*) builderWithPrototype:(RMTPayload*) prototype; -- (RMTPayloadBuilder*) toBuilder; - -+ (RMTPayload*) parseFromData:(NSData*) data; -+ (RMTPayload*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTPayload*) parseFromInputStream:(NSInputStream*) input; -+ (RMTPayload*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTPayload*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTPayload*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTPayloadBuilder : PBGeneratedMessageBuilder { -@private - RMTPayload* resultPayload; -} - -- (RMTPayload*) defaultInstance; - -- (RMTPayloadBuilder*) clear; -- (RMTPayloadBuilder*) clone; - -- (RMTPayload*) build; -- (RMTPayload*) buildPartial; - -- (RMTPayloadBuilder*) mergeFrom:(RMTPayload*) other; -- (RMTPayloadBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTPayloadBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasType; -- (RMTPayloadType) type; -- (RMTPayloadBuilder*) setType:(RMTPayloadType) value; -- (RMTPayloadBuilder*) clearType; - -- (BOOL) hasBody; -- (NSData*) body; -- (RMTPayloadBuilder*) setBody:(NSData*) value; -- (RMTPayloadBuilder*) clearBody; -@end - -@interface RMTSimpleRequest : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasFillUsername_:1; - BOOL hasFillOauthScope_:1; - BOOL hasResponseSize_:1; - BOOL hasPayload_:1; - BOOL hasResponseType_:1; - BOOL fillUsername_:1; - BOOL fillOauthScope_:1; - SInt32 responseSize; - RMTPayload* payload; - RMTPayloadType responseType; -} -- (BOOL) hasResponseType; -- (BOOL) hasResponseSize; -- (BOOL) hasPayload; -- (BOOL) hasFillUsername; -- (BOOL) hasFillOauthScope; -@property (readonly) RMTPayloadType responseType; -@property (readonly) SInt32 responseSize; -@property (readonly, strong) RMTPayload* payload; -- (BOOL) fillUsername; -- (BOOL) fillOauthScope; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTSimpleRequestBuilder*) builder; -+ (RMTSimpleRequestBuilder*) builder; -+ (RMTSimpleRequestBuilder*) builderWithPrototype:(RMTSimpleRequest*) prototype; -- (RMTSimpleRequestBuilder*) toBuilder; - -+ (RMTSimpleRequest*) parseFromData:(NSData*) data; -+ (RMTSimpleRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTSimpleRequest*) parseFromInputStream:(NSInputStream*) input; -+ (RMTSimpleRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTSimpleRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTSimpleRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTSimpleRequestBuilder : PBGeneratedMessageBuilder { -@private - RMTSimpleRequest* resultSimpleRequest; -} - -- (RMTSimpleRequest*) defaultInstance; - -- (RMTSimpleRequestBuilder*) clear; -- (RMTSimpleRequestBuilder*) clone; - -- (RMTSimpleRequest*) build; -- (RMTSimpleRequest*) buildPartial; - -- (RMTSimpleRequestBuilder*) mergeFrom:(RMTSimpleRequest*) other; -- (RMTSimpleRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTSimpleRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasResponseType; -- (RMTPayloadType) responseType; -- (RMTSimpleRequestBuilder*) setResponseType:(RMTPayloadType) value; -- (RMTSimpleRequestBuilder*) clearResponseType; - -- (BOOL) hasResponseSize; -- (SInt32) responseSize; -- (RMTSimpleRequestBuilder*) setResponseSize:(SInt32) value; -- (RMTSimpleRequestBuilder*) clearResponseSize; - -- (BOOL) hasPayload; -- (RMTPayload*) payload; -- (RMTSimpleRequestBuilder*) setPayload:(RMTPayload*) value; -- (RMTSimpleRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue; -- (RMTSimpleRequestBuilder*) mergePayload:(RMTPayload*) value; -- (RMTSimpleRequestBuilder*) clearPayload; - -- (BOOL) hasFillUsername; -- (BOOL) fillUsername; -- (RMTSimpleRequestBuilder*) setFillUsername:(BOOL) value; -- (RMTSimpleRequestBuilder*) clearFillUsername; - -- (BOOL) hasFillOauthScope; -- (BOOL) fillOauthScope; -- (RMTSimpleRequestBuilder*) setFillOauthScope:(BOOL) value; -- (RMTSimpleRequestBuilder*) clearFillOauthScope; -@end - -@interface RMTSimpleResponse : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasUsername_:1; - BOOL hasOauthScope_:1; - BOOL hasPayload_:1; - NSString* username; - NSString* oauthScope; - RMTPayload* payload; -} -- (BOOL) hasPayload; -- (BOOL) hasUsername; -- (BOOL) hasOauthScope; -@property (readonly, strong) RMTPayload* payload; -@property (readonly, strong) NSString* username; -@property (readonly, strong) NSString* oauthScope; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTSimpleResponseBuilder*) builder; -+ (RMTSimpleResponseBuilder*) builder; -+ (RMTSimpleResponseBuilder*) builderWithPrototype:(RMTSimpleResponse*) prototype; -- (RMTSimpleResponseBuilder*) toBuilder; - -+ (RMTSimpleResponse*) parseFromData:(NSData*) data; -+ (RMTSimpleResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTSimpleResponse*) parseFromInputStream:(NSInputStream*) input; -+ (RMTSimpleResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTSimpleResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTSimpleResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTSimpleResponseBuilder : PBGeneratedMessageBuilder { -@private - RMTSimpleResponse* resultSimpleResponse; -} - -- (RMTSimpleResponse*) defaultInstance; - -- (RMTSimpleResponseBuilder*) clear; -- (RMTSimpleResponseBuilder*) clone; - -- (RMTSimpleResponse*) build; -- (RMTSimpleResponse*) buildPartial; - -- (RMTSimpleResponseBuilder*) mergeFrom:(RMTSimpleResponse*) other; -- (RMTSimpleResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTSimpleResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasPayload; -- (RMTPayload*) payload; -- (RMTSimpleResponseBuilder*) setPayload:(RMTPayload*) value; -- (RMTSimpleResponseBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue; -- (RMTSimpleResponseBuilder*) mergePayload:(RMTPayload*) value; -- (RMTSimpleResponseBuilder*) clearPayload; - -- (BOOL) hasUsername; -- (NSString*) username; -- (RMTSimpleResponseBuilder*) setUsername:(NSString*) value; -- (RMTSimpleResponseBuilder*) clearUsername; - -- (BOOL) hasOauthScope; -- (NSString*) oauthScope; -- (RMTSimpleResponseBuilder*) setOauthScope:(NSString*) value; -- (RMTSimpleResponseBuilder*) clearOauthScope; -@end - -@interface RMTStreamingInputCallRequest : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasPayload_:1; - RMTPayload* payload; -} -- (BOOL) hasPayload; -@property (readonly, strong) RMTPayload* payload; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTStreamingInputCallRequestBuilder*) builder; -+ (RMTStreamingInputCallRequestBuilder*) builder; -+ (RMTStreamingInputCallRequestBuilder*) builderWithPrototype:(RMTStreamingInputCallRequest*) prototype; -- (RMTStreamingInputCallRequestBuilder*) toBuilder; - -+ (RMTStreamingInputCallRequest*) parseFromData:(NSData*) data; -+ (RMTStreamingInputCallRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingInputCallRequest*) parseFromInputStream:(NSInputStream*) input; -+ (RMTStreamingInputCallRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingInputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTStreamingInputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTStreamingInputCallRequestBuilder : PBGeneratedMessageBuilder { -@private - RMTStreamingInputCallRequest* resultStreamingInputCallRequest; -} - -- (RMTStreamingInputCallRequest*) defaultInstance; - -- (RMTStreamingInputCallRequestBuilder*) clear; -- (RMTStreamingInputCallRequestBuilder*) clone; - -- (RMTStreamingInputCallRequest*) build; -- (RMTStreamingInputCallRequest*) buildPartial; - -- (RMTStreamingInputCallRequestBuilder*) mergeFrom:(RMTStreamingInputCallRequest*) other; -- (RMTStreamingInputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTStreamingInputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasPayload; -- (RMTPayload*) payload; -- (RMTStreamingInputCallRequestBuilder*) setPayload:(RMTPayload*) value; -- (RMTStreamingInputCallRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue; -- (RMTStreamingInputCallRequestBuilder*) mergePayload:(RMTPayload*) value; -- (RMTStreamingInputCallRequestBuilder*) clearPayload; -@end - -@interface RMTStreamingInputCallResponse : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasAggregatedPayloadSize_:1; - SInt32 aggregatedPayloadSize; -} -- (BOOL) hasAggregatedPayloadSize; -@property (readonly) SInt32 aggregatedPayloadSize; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTStreamingInputCallResponseBuilder*) builder; -+ (RMTStreamingInputCallResponseBuilder*) builder; -+ (RMTStreamingInputCallResponseBuilder*) builderWithPrototype:(RMTStreamingInputCallResponse*) prototype; -- (RMTStreamingInputCallResponseBuilder*) toBuilder; - -+ (RMTStreamingInputCallResponse*) parseFromData:(NSData*) data; -+ (RMTStreamingInputCallResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingInputCallResponse*) parseFromInputStream:(NSInputStream*) input; -+ (RMTStreamingInputCallResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingInputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTStreamingInputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTStreamingInputCallResponseBuilder : PBGeneratedMessageBuilder { -@private - RMTStreamingInputCallResponse* resultStreamingInputCallResponse; -} - -- (RMTStreamingInputCallResponse*) defaultInstance; - -- (RMTStreamingInputCallResponseBuilder*) clear; -- (RMTStreamingInputCallResponseBuilder*) clone; - -- (RMTStreamingInputCallResponse*) build; -- (RMTStreamingInputCallResponse*) buildPartial; - -- (RMTStreamingInputCallResponseBuilder*) mergeFrom:(RMTStreamingInputCallResponse*) other; -- (RMTStreamingInputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTStreamingInputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasAggregatedPayloadSize; -- (SInt32) aggregatedPayloadSize; -- (RMTStreamingInputCallResponseBuilder*) setAggregatedPayloadSize:(SInt32) value; -- (RMTStreamingInputCallResponseBuilder*) clearAggregatedPayloadSize; -@end - -@interface RMTResponseParameters : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasSize_:1; - BOOL hasIntervalUs_:1; - SInt32 size; - SInt32 intervalUs; -} -- (BOOL) hasSize; -- (BOOL) hasIntervalUs; -@property (readonly) SInt32 size; -@property (readonly) SInt32 intervalUs; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTResponseParametersBuilder*) builder; -+ (RMTResponseParametersBuilder*) builder; -+ (RMTResponseParametersBuilder*) builderWithPrototype:(RMTResponseParameters*) prototype; -- (RMTResponseParametersBuilder*) toBuilder; - -+ (RMTResponseParameters*) parseFromData:(NSData*) data; -+ (RMTResponseParameters*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTResponseParameters*) parseFromInputStream:(NSInputStream*) input; -+ (RMTResponseParameters*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTResponseParameters*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTResponseParameters*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTResponseParametersBuilder : PBGeneratedMessageBuilder { -@private - RMTResponseParameters* resultResponseParameters; -} - -- (RMTResponseParameters*) defaultInstance; - -- (RMTResponseParametersBuilder*) clear; -- (RMTResponseParametersBuilder*) clone; - -- (RMTResponseParameters*) build; -- (RMTResponseParameters*) buildPartial; - -- (RMTResponseParametersBuilder*) mergeFrom:(RMTResponseParameters*) other; -- (RMTResponseParametersBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTResponseParametersBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasSize; -- (SInt32) size; -- (RMTResponseParametersBuilder*) setSize:(SInt32) value; -- (RMTResponseParametersBuilder*) clearSize; - -- (BOOL) hasIntervalUs; -- (SInt32) intervalUs; -- (RMTResponseParametersBuilder*) setIntervalUs:(SInt32) value; -- (RMTResponseParametersBuilder*) clearIntervalUs; -@end - -@interface RMTStreamingOutputCallRequest : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasPayload_:1; - BOOL hasResponseType_:1; - RMTPayload* payload; - RMTPayloadType responseType; - NSMutableArray * responseParametersArray; -} -- (BOOL) hasResponseType; -- (BOOL) hasPayload; -@property (readonly) RMTPayloadType responseType; -@property (readonly, strong) NSArray * responseParameters; -@property (readonly, strong) RMTPayload* payload; -- (RMTResponseParameters*)responseParametersAtIndex:(NSUInteger)index; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTStreamingOutputCallRequestBuilder*) builder; -+ (RMTStreamingOutputCallRequestBuilder*) builder; -+ (RMTStreamingOutputCallRequestBuilder*) builderWithPrototype:(RMTStreamingOutputCallRequest*) prototype; -- (RMTStreamingOutputCallRequestBuilder*) toBuilder; - -+ (RMTStreamingOutputCallRequest*) parseFromData:(NSData*) data; -+ (RMTStreamingOutputCallRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingOutputCallRequest*) parseFromInputStream:(NSInputStream*) input; -+ (RMTStreamingOutputCallRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingOutputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTStreamingOutputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTStreamingOutputCallRequestBuilder : PBGeneratedMessageBuilder { -@private - RMTStreamingOutputCallRequest* resultStreamingOutputCallRequest; -} - -- (RMTStreamingOutputCallRequest*) defaultInstance; - -- (RMTStreamingOutputCallRequestBuilder*) clear; -- (RMTStreamingOutputCallRequestBuilder*) clone; - -- (RMTStreamingOutputCallRequest*) build; -- (RMTStreamingOutputCallRequest*) buildPartial; - -- (RMTStreamingOutputCallRequestBuilder*) mergeFrom:(RMTStreamingOutputCallRequest*) other; -- (RMTStreamingOutputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTStreamingOutputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasResponseType; -- (RMTPayloadType) responseType; -- (RMTStreamingOutputCallRequestBuilder*) setResponseType:(RMTPayloadType) value; -- (RMTStreamingOutputCallRequestBuilder*) clearResponseType; - -- (NSMutableArray *)responseParameters; -- (RMTResponseParameters*)responseParametersAtIndex:(NSUInteger)index; -- (RMTStreamingOutputCallRequestBuilder *)addResponseParameters:(RMTResponseParameters*)value; -- (RMTStreamingOutputCallRequestBuilder *)setResponseParametersArray:(NSArray *)array; -- (RMTStreamingOutputCallRequestBuilder *)clearResponseParameters; - -- (BOOL) hasPayload; -- (RMTPayload*) payload; -- (RMTStreamingOutputCallRequestBuilder*) setPayload:(RMTPayload*) value; -- (RMTStreamingOutputCallRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue; -- (RMTStreamingOutputCallRequestBuilder*) mergePayload:(RMTPayload*) value; -- (RMTStreamingOutputCallRequestBuilder*) clearPayload; -@end - -@interface RMTStreamingOutputCallResponse : PBGeneratedMessage<GeneratedMessageProtocol> { -@private - BOOL hasPayload_:1; - RMTPayload* payload; -} -- (BOOL) hasPayload; -@property (readonly, strong) RMTPayload* payload; - -+ (instancetype) defaultInstance; -- (instancetype) defaultInstance; - -- (BOOL) isInitialized; -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RMTStreamingOutputCallResponseBuilder*) builder; -+ (RMTStreamingOutputCallResponseBuilder*) builder; -+ (RMTStreamingOutputCallResponseBuilder*) builderWithPrototype:(RMTStreamingOutputCallResponse*) prototype; -- (RMTStreamingOutputCallResponseBuilder*) toBuilder; - -+ (RMTStreamingOutputCallResponse*) parseFromData:(NSData*) data; -+ (RMTStreamingOutputCallResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingOutputCallResponse*) parseFromInputStream:(NSInputStream*) input; -+ (RMTStreamingOutputCallResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RMTStreamingOutputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RMTStreamingOutputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -@end - -@interface RMTStreamingOutputCallResponseBuilder : PBGeneratedMessageBuilder { -@private - RMTStreamingOutputCallResponse* resultStreamingOutputCallResponse; -} - -- (RMTStreamingOutputCallResponse*) defaultInstance; - -- (RMTStreamingOutputCallResponseBuilder*) clear; -- (RMTStreamingOutputCallResponseBuilder*) clone; - -- (RMTStreamingOutputCallResponse*) build; -- (RMTStreamingOutputCallResponse*) buildPartial; - -- (RMTStreamingOutputCallResponseBuilder*) mergeFrom:(RMTStreamingOutputCallResponse*) other; -- (RMTStreamingOutputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RMTStreamingOutputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - -- (BOOL) hasPayload; -- (RMTPayload*) payload; -- (RMTStreamingOutputCallResponseBuilder*) setPayload:(RMTPayload*) value; -- (RMTStreamingOutputCallResponseBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue; -- (RMTStreamingOutputCallResponseBuilder*) mergePayload:(RMTPayload*) value; -- (RMTStreamingOutputCallResponseBuilder*) clearPayload; -@end - - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.m b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.m deleted file mode 100644 index fbad1a9c09..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pb.m +++ /dev/null @@ -1,2256 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import "Messages.pb.h" -// @@protoc_insertion_point(imports) - -@implementation RMTMessagesRoot -static PBExtensionRegistry* extensionRegistry = nil; -+ (PBExtensionRegistry*) extensionRegistry { - return extensionRegistry; -} - -+ (void) initialize { - if (self == [RMTMessagesRoot class]) { - PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; - [self registerAllExtensions:registry]; - [ObjectivecDescriptorRoot registerAllExtensions:registry]; - extensionRegistry = registry; - } -} -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry { -} -@end - -BOOL RMTPayloadTypeIsValidValue(RMTPayloadType value) { - switch (value) { - case RMTPayloadTypeCompressable: - case RMTPayloadTypeUncompressable: - case RMTPayloadTypeRandom: - return YES; - default: - return NO; - } -} -NSString *NSStringFromRMTPayloadType(RMTPayloadType value) { - switch (value) { - case RMTPayloadTypeCompressable: - return @"RMTPayloadTypeCompressable"; - case RMTPayloadTypeUncompressable: - return @"RMTPayloadTypeUncompressable"; - case RMTPayloadTypeRandom: - return @"RMTPayloadTypeRandom"; - default: - return nil; - } -} - -@interface RMTPayload () -@property RMTPayloadType type; -@property (strong) NSData* body; -@end - -@implementation RMTPayload - -- (BOOL) hasType { - return !!hasType_; -} -- (void) setHasType:(BOOL) _value_ { - hasType_ = !!_value_; -} -@synthesize type; -- (BOOL) hasBody { - return !!hasBody_; -} -- (void) setHasBody:(BOOL) _value_ { - hasBody_ = !!_value_; -} -@synthesize body; -- (instancetype) init { - if ((self = [super init])) { - self.type = RMTPayloadTypeCompressable; - self.body = [NSData data]; - } - return self; -} -static RMTPayload* defaultRMTPayloadInstance = nil; -+ (void) initialize { - if (self == [RMTPayload class]) { - defaultRMTPayloadInstance = [[RMTPayload alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTPayloadInstance; -} -- (instancetype) defaultInstance { - return defaultRMTPayloadInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasType) { - [output writeEnum:1 value:self.type]; - } - if (self.hasBody) { - [output writeData:2 value:self.body]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasType) { - size_ += computeEnumSize(1, self.type); - } - if (self.hasBody) { - size_ += computeDataSize(2, self.body); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTPayload*) parseFromData:(NSData*) data { - return (RMTPayload*)[[[RMTPayload builder] mergeFromData:data] build]; -} -+ (RMTPayload*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTPayload*)[[[RMTPayload builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTPayload*) parseFromInputStream:(NSInputStream*) input { - return (RMTPayload*)[[[RMTPayload builder] mergeFromInputStream:input] build]; -} -+ (RMTPayload*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTPayload*)[[[RMTPayload builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTPayload*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTPayload*)[[[RMTPayload builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTPayload*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTPayload*)[[[RMTPayload builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTPayloadBuilder*) builder { - return [[RMTPayloadBuilder alloc] init]; -} -+ (RMTPayloadBuilder*) builderWithPrototype:(RMTPayload*) prototype { - return [[RMTPayload builder] mergeFrom:prototype]; -} -- (RMTPayloadBuilder*) builder { - return [RMTPayload builder]; -} -- (RMTPayloadBuilder*) toBuilder { - return [RMTPayload builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasType) { - [output appendFormat:@"%@%@: %@\n", indent, @"type", NSStringFromRMTPayloadType(self.type)]; - } - if (self.hasBody) { - [output appendFormat:@"%@%@: %@\n", indent, @"body", self.body]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTPayload class]]) { - return NO; - } - RMTPayload *otherMessage = other; - return - self.hasType == otherMessage.hasType && - (!self.hasType || self.type == otherMessage.type) && - self.hasBody == otherMessage.hasBody && - (!self.hasBody || [self.body isEqual:otherMessage.body]) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasType) { - hashCode = hashCode * 31 + self.type; - } - if (self.hasBody) { - hashCode = hashCode * 31 + [self.body hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTPayloadBuilder() -@property (strong) RMTPayload* resultPayload; -@end - -@implementation RMTPayloadBuilder -@synthesize resultPayload; -- (instancetype) init { - if ((self = [super init])) { - self.resultPayload = [[RMTPayload alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultPayload; -} -- (RMTPayloadBuilder*) clear { - self.resultPayload = [[RMTPayload alloc] init]; - return self; -} -- (RMTPayloadBuilder*) clone { - return [RMTPayload builderWithPrototype:resultPayload]; -} -- (RMTPayload*) defaultInstance { - return [RMTPayload defaultInstance]; -} -- (RMTPayload*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTPayload*) buildPartial { - RMTPayload* returnMe = resultPayload; - self.resultPayload = nil; - return returnMe; -} -- (RMTPayloadBuilder*) mergeFrom:(RMTPayload*) other { - if (other == [RMTPayload defaultInstance]) { - return self; - } - if (other.hasType) { - [self setType:other.type]; - } - if (other.hasBody) { - [self setBody:other.body]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTPayloadBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTPayloadBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 8: { - RMTPayloadType value = (RMTPayloadType)[input readEnum]; - if (RMTPayloadTypeIsValidValue(value)) { - [self setType:value]; - } else { - [unknownFields mergeVarintField:1 value:value]; - } - break; - } - case 18: { - [self setBody:[input readData]]; - break; - } - } - } -} -- (BOOL) hasType { - return resultPayload.hasType; -} -- (RMTPayloadType) type { - return resultPayload.type; -} -- (RMTPayloadBuilder*) setType:(RMTPayloadType) value { - resultPayload.hasType = YES; - resultPayload.type = value; - return self; -} -- (RMTPayloadBuilder*) clearType { - resultPayload.hasType = NO; - resultPayload.type = RMTPayloadTypeCompressable; - return self; -} -- (BOOL) hasBody { - return resultPayload.hasBody; -} -- (NSData*) body { - return resultPayload.body; -} -- (RMTPayloadBuilder*) setBody:(NSData*) value { - resultPayload.hasBody = YES; - resultPayload.body = value; - return self; -} -- (RMTPayloadBuilder*) clearBody { - resultPayload.hasBody = NO; - resultPayload.body = [NSData data]; - return self; -} -@end - -@interface RMTSimpleRequest () -@property RMTPayloadType responseType; -@property SInt32 responseSize; -@property (strong) RMTPayload* payload; -@property BOOL fillUsername; -@property BOOL fillOauthScope; -@end - -@implementation RMTSimpleRequest - -- (BOOL) hasResponseType { - return !!hasResponseType_; -} -- (void) setHasResponseType:(BOOL) _value_ { - hasResponseType_ = !!_value_; -} -@synthesize responseType; -- (BOOL) hasResponseSize { - return !!hasResponseSize_; -} -- (void) setHasResponseSize:(BOOL) _value_ { - hasResponseSize_ = !!_value_; -} -@synthesize responseSize; -- (BOOL) hasPayload { - return !!hasPayload_; -} -- (void) setHasPayload:(BOOL) _value_ { - hasPayload_ = !!_value_; -} -@synthesize payload; -- (BOOL) hasFillUsername { - return !!hasFillUsername_; -} -- (void) setHasFillUsername:(BOOL) _value_ { - hasFillUsername_ = !!_value_; -} -- (BOOL) fillUsername { - return !!fillUsername_; -} -- (void) setFillUsername:(BOOL) _value_ { - fillUsername_ = !!_value_; -} -- (BOOL) hasFillOauthScope { - return !!hasFillOauthScope_; -} -- (void) setHasFillOauthScope:(BOOL) _value_ { - hasFillOauthScope_ = !!_value_; -} -- (BOOL) fillOauthScope { - return !!fillOauthScope_; -} -- (void) setFillOauthScope:(BOOL) _value_ { - fillOauthScope_ = !!_value_; -} -- (instancetype) init { - if ((self = [super init])) { - self.responseType = RMTPayloadTypeCompressable; - self.responseSize = 0; - self.payload = [RMTPayload defaultInstance]; - self.fillUsername = NO; - self.fillOauthScope = NO; - } - return self; -} -static RMTSimpleRequest* defaultRMTSimpleRequestInstance = nil; -+ (void) initialize { - if (self == [RMTSimpleRequest class]) { - defaultRMTSimpleRequestInstance = [[RMTSimpleRequest alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTSimpleRequestInstance; -} -- (instancetype) defaultInstance { - return defaultRMTSimpleRequestInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasResponseType) { - [output writeEnum:1 value:self.responseType]; - } - if (self.hasResponseSize) { - [output writeInt32:2 value:self.responseSize]; - } - if (self.hasPayload) { - [output writeMessage:3 value:self.payload]; - } - if (self.hasFillUsername) { - [output writeBool:4 value:self.fillUsername]; - } - if (self.hasFillOauthScope) { - [output writeBool:5 value:self.fillOauthScope]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasResponseType) { - size_ += computeEnumSize(1, self.responseType); - } - if (self.hasResponseSize) { - size_ += computeInt32Size(2, self.responseSize); - } - if (self.hasPayload) { - size_ += computeMessageSize(3, self.payload); - } - if (self.hasFillUsername) { - size_ += computeBoolSize(4, self.fillUsername); - } - if (self.hasFillOauthScope) { - size_ += computeBoolSize(5, self.fillOauthScope); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTSimpleRequest*) parseFromData:(NSData*) data { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromData:data] build]; -} -+ (RMTSimpleRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleRequest*) parseFromInputStream:(NSInputStream*) input { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromInputStream:input] build]; -} -+ (RMTSimpleRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTSimpleRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleRequest*)[[[RMTSimpleRequest builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleRequestBuilder*) builder { - return [[RMTSimpleRequestBuilder alloc] init]; -} -+ (RMTSimpleRequestBuilder*) builderWithPrototype:(RMTSimpleRequest*) prototype { - return [[RMTSimpleRequest builder] mergeFrom:prototype]; -} -- (RMTSimpleRequestBuilder*) builder { - return [RMTSimpleRequest builder]; -} -- (RMTSimpleRequestBuilder*) toBuilder { - return [RMTSimpleRequest builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasResponseType) { - [output appendFormat:@"%@%@: %@\n", indent, @"responseType", NSStringFromRMTPayloadType(self.responseType)]; - } - if (self.hasResponseSize) { - [output appendFormat:@"%@%@: %@\n", indent, @"responseSize", [NSNumber numberWithInteger:self.responseSize]]; - } - if (self.hasPayload) { - [output appendFormat:@"%@%@ {\n", indent, @"payload"]; - [self.payload writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - } - if (self.hasFillUsername) { - [output appendFormat:@"%@%@: %@\n", indent, @"fillUsername", [NSNumber numberWithBool:self.fillUsername]]; - } - if (self.hasFillOauthScope) { - [output appendFormat:@"%@%@: %@\n", indent, @"fillOauthScope", [NSNumber numberWithBool:self.fillOauthScope]]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTSimpleRequest class]]) { - return NO; - } - RMTSimpleRequest *otherMessage = other; - return - self.hasResponseType == otherMessage.hasResponseType && - (!self.hasResponseType || self.responseType == otherMessage.responseType) && - self.hasResponseSize == otherMessage.hasResponseSize && - (!self.hasResponseSize || self.responseSize == otherMessage.responseSize) && - self.hasPayload == otherMessage.hasPayload && - (!self.hasPayload || [self.payload isEqual:otherMessage.payload]) && - self.hasFillUsername == otherMessage.hasFillUsername && - (!self.hasFillUsername || self.fillUsername == otherMessage.fillUsername) && - self.hasFillOauthScope == otherMessage.hasFillOauthScope && - (!self.hasFillOauthScope || self.fillOauthScope == otherMessage.fillOauthScope) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasResponseType) { - hashCode = hashCode * 31 + self.responseType; - } - if (self.hasResponseSize) { - hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.responseSize] hash]; - } - if (self.hasPayload) { - hashCode = hashCode * 31 + [self.payload hash]; - } - if (self.hasFillUsername) { - hashCode = hashCode * 31 + [[NSNumber numberWithBool:self.fillUsername] hash]; - } - if (self.hasFillOauthScope) { - hashCode = hashCode * 31 + [[NSNumber numberWithBool:self.fillOauthScope] hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTSimpleRequestBuilder() -@property (strong) RMTSimpleRequest* resultSimpleRequest; -@end - -@implementation RMTSimpleRequestBuilder -@synthesize resultSimpleRequest; -- (instancetype) init { - if ((self = [super init])) { - self.resultSimpleRequest = [[RMTSimpleRequest alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultSimpleRequest; -} -- (RMTSimpleRequestBuilder*) clear { - self.resultSimpleRequest = [[RMTSimpleRequest alloc] init]; - return self; -} -- (RMTSimpleRequestBuilder*) clone { - return [RMTSimpleRequest builderWithPrototype:resultSimpleRequest]; -} -- (RMTSimpleRequest*) defaultInstance { - return [RMTSimpleRequest defaultInstance]; -} -- (RMTSimpleRequest*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTSimpleRequest*) buildPartial { - RMTSimpleRequest* returnMe = resultSimpleRequest; - self.resultSimpleRequest = nil; - return returnMe; -} -- (RMTSimpleRequestBuilder*) mergeFrom:(RMTSimpleRequest*) other { - if (other == [RMTSimpleRequest defaultInstance]) { - return self; - } - if (other.hasResponseType) { - [self setResponseType:other.responseType]; - } - if (other.hasResponseSize) { - [self setResponseSize:other.responseSize]; - } - if (other.hasPayload) { - [self mergePayload:other.payload]; - } - if (other.hasFillUsername) { - [self setFillUsername:other.fillUsername]; - } - if (other.hasFillOauthScope) { - [self setFillOauthScope:other.fillOauthScope]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTSimpleRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTSimpleRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 8: { - RMTPayloadType value = (RMTPayloadType)[input readEnum]; - if (RMTPayloadTypeIsValidValue(value)) { - [self setResponseType:value]; - } else { - [unknownFields mergeVarintField:1 value:value]; - } - break; - } - case 16: { - [self setResponseSize:[input readInt32]]; - break; - } - case 26: { - RMTPayloadBuilder* subBuilder = [RMTPayload builder]; - if (self.hasPayload) { - [subBuilder mergeFrom:self.payload]; - } - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self setPayload:[subBuilder buildPartial]]; - break; - } - case 32: { - [self setFillUsername:[input readBool]]; - break; - } - case 40: { - [self setFillOauthScope:[input readBool]]; - break; - } - } - } -} -- (BOOL) hasResponseType { - return resultSimpleRequest.hasResponseType; -} -- (RMTPayloadType) responseType { - return resultSimpleRequest.responseType; -} -- (RMTSimpleRequestBuilder*) setResponseType:(RMTPayloadType) value { - resultSimpleRequest.hasResponseType = YES; - resultSimpleRequest.responseType = value; - return self; -} -- (RMTSimpleRequestBuilder*) clearResponseType { - resultSimpleRequest.hasResponseType = NO; - resultSimpleRequest.responseType = RMTPayloadTypeCompressable; - return self; -} -- (BOOL) hasResponseSize { - return resultSimpleRequest.hasResponseSize; -} -- (SInt32) responseSize { - return resultSimpleRequest.responseSize; -} -- (RMTSimpleRequestBuilder*) setResponseSize:(SInt32) value { - resultSimpleRequest.hasResponseSize = YES; - resultSimpleRequest.responseSize = value; - return self; -} -- (RMTSimpleRequestBuilder*) clearResponseSize { - resultSimpleRequest.hasResponseSize = NO; - resultSimpleRequest.responseSize = 0; - return self; -} -- (BOOL) hasPayload { - return resultSimpleRequest.hasPayload; -} -- (RMTPayload*) payload { - return resultSimpleRequest.payload; -} -- (RMTSimpleRequestBuilder*) setPayload:(RMTPayload*) value { - resultSimpleRequest.hasPayload = YES; - resultSimpleRequest.payload = value; - return self; -} -- (RMTSimpleRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue { - return [self setPayload:[builderForValue build]]; -} -- (RMTSimpleRequestBuilder*) mergePayload:(RMTPayload*) value { - if (resultSimpleRequest.hasPayload && - resultSimpleRequest.payload != [RMTPayload defaultInstance]) { - resultSimpleRequest.payload = - [[[RMTPayload builderWithPrototype:resultSimpleRequest.payload] mergeFrom:value] buildPartial]; - } else { - resultSimpleRequest.payload = value; - } - resultSimpleRequest.hasPayload = YES; - return self; -} -- (RMTSimpleRequestBuilder*) clearPayload { - resultSimpleRequest.hasPayload = NO; - resultSimpleRequest.payload = [RMTPayload defaultInstance]; - return self; -} -- (BOOL) hasFillUsername { - return resultSimpleRequest.hasFillUsername; -} -- (BOOL) fillUsername { - return resultSimpleRequest.fillUsername; -} -- (RMTSimpleRequestBuilder*) setFillUsername:(BOOL) value { - resultSimpleRequest.hasFillUsername = YES; - resultSimpleRequest.fillUsername = value; - return self; -} -- (RMTSimpleRequestBuilder*) clearFillUsername { - resultSimpleRequest.hasFillUsername = NO; - resultSimpleRequest.fillUsername = NO; - return self; -} -- (BOOL) hasFillOauthScope { - return resultSimpleRequest.hasFillOauthScope; -} -- (BOOL) fillOauthScope { - return resultSimpleRequest.fillOauthScope; -} -- (RMTSimpleRequestBuilder*) setFillOauthScope:(BOOL) value { - resultSimpleRequest.hasFillOauthScope = YES; - resultSimpleRequest.fillOauthScope = value; - return self; -} -- (RMTSimpleRequestBuilder*) clearFillOauthScope { - resultSimpleRequest.hasFillOauthScope = NO; - resultSimpleRequest.fillOauthScope = NO; - return self; -} -@end - -@interface RMTSimpleResponse () -@property (strong) RMTPayload* payload; -@property (strong) NSString* username; -@property (strong) NSString* oauthScope; -@end - -@implementation RMTSimpleResponse - -- (BOOL) hasPayload { - return !!hasPayload_; -} -- (void) setHasPayload:(BOOL) _value_ { - hasPayload_ = !!_value_; -} -@synthesize payload; -- (BOOL) hasUsername { - return !!hasUsername_; -} -- (void) setHasUsername:(BOOL) _value_ { - hasUsername_ = !!_value_; -} -@synthesize username; -- (BOOL) hasOauthScope { - return !!hasOauthScope_; -} -- (void) setHasOauthScope:(BOOL) _value_ { - hasOauthScope_ = !!_value_; -} -@synthesize oauthScope; -- (instancetype) init { - if ((self = [super init])) { - self.payload = [RMTPayload defaultInstance]; - self.username = @""; - self.oauthScope = @""; - } - return self; -} -static RMTSimpleResponse* defaultRMTSimpleResponseInstance = nil; -+ (void) initialize { - if (self == [RMTSimpleResponse class]) { - defaultRMTSimpleResponseInstance = [[RMTSimpleResponse alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTSimpleResponseInstance; -} -- (instancetype) defaultInstance { - return defaultRMTSimpleResponseInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasPayload) { - [output writeMessage:1 value:self.payload]; - } - if (self.hasUsername) { - [output writeString:2 value:self.username]; - } - if (self.hasOauthScope) { - [output writeString:3 value:self.oauthScope]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasPayload) { - size_ += computeMessageSize(1, self.payload); - } - if (self.hasUsername) { - size_ += computeStringSize(2, self.username); - } - if (self.hasOauthScope) { - size_ += computeStringSize(3, self.oauthScope); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTSimpleResponse*) parseFromData:(NSData*) data { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromData:data] build]; -} -+ (RMTSimpleResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleResponse*) parseFromInputStream:(NSInputStream*) input { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromInputStream:input] build]; -} -+ (RMTSimpleResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTSimpleResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTSimpleResponse*)[[[RMTSimpleResponse builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTSimpleResponseBuilder*) builder { - return [[RMTSimpleResponseBuilder alloc] init]; -} -+ (RMTSimpleResponseBuilder*) builderWithPrototype:(RMTSimpleResponse*) prototype { - return [[RMTSimpleResponse builder] mergeFrom:prototype]; -} -- (RMTSimpleResponseBuilder*) builder { - return [RMTSimpleResponse builder]; -} -- (RMTSimpleResponseBuilder*) toBuilder { - return [RMTSimpleResponse builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasPayload) { - [output appendFormat:@"%@%@ {\n", indent, @"payload"]; - [self.payload writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - } - if (self.hasUsername) { - [output appendFormat:@"%@%@: %@\n", indent, @"username", self.username]; - } - if (self.hasOauthScope) { - [output appendFormat:@"%@%@: %@\n", indent, @"oauthScope", self.oauthScope]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTSimpleResponse class]]) { - return NO; - } - RMTSimpleResponse *otherMessage = other; - return - self.hasPayload == otherMessage.hasPayload && - (!self.hasPayload || [self.payload isEqual:otherMessage.payload]) && - self.hasUsername == otherMessage.hasUsername && - (!self.hasUsername || [self.username isEqual:otherMessage.username]) && - self.hasOauthScope == otherMessage.hasOauthScope && - (!self.hasOauthScope || [self.oauthScope isEqual:otherMessage.oauthScope]) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasPayload) { - hashCode = hashCode * 31 + [self.payload hash]; - } - if (self.hasUsername) { - hashCode = hashCode * 31 + [self.username hash]; - } - if (self.hasOauthScope) { - hashCode = hashCode * 31 + [self.oauthScope hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTSimpleResponseBuilder() -@property (strong) RMTSimpleResponse* resultSimpleResponse; -@end - -@implementation RMTSimpleResponseBuilder -@synthesize resultSimpleResponse; -- (instancetype) init { - if ((self = [super init])) { - self.resultSimpleResponse = [[RMTSimpleResponse alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultSimpleResponse; -} -- (RMTSimpleResponseBuilder*) clear { - self.resultSimpleResponse = [[RMTSimpleResponse alloc] init]; - return self; -} -- (RMTSimpleResponseBuilder*) clone { - return [RMTSimpleResponse builderWithPrototype:resultSimpleResponse]; -} -- (RMTSimpleResponse*) defaultInstance { - return [RMTSimpleResponse defaultInstance]; -} -- (RMTSimpleResponse*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTSimpleResponse*) buildPartial { - RMTSimpleResponse* returnMe = resultSimpleResponse; - self.resultSimpleResponse = nil; - return returnMe; -} -- (RMTSimpleResponseBuilder*) mergeFrom:(RMTSimpleResponse*) other { - if (other == [RMTSimpleResponse defaultInstance]) { - return self; - } - if (other.hasPayload) { - [self mergePayload:other.payload]; - } - if (other.hasUsername) { - [self setUsername:other.username]; - } - if (other.hasOauthScope) { - [self setOauthScope:other.oauthScope]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTSimpleResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTSimpleResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 10: { - RMTPayloadBuilder* subBuilder = [RMTPayload builder]; - if (self.hasPayload) { - [subBuilder mergeFrom:self.payload]; - } - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self setPayload:[subBuilder buildPartial]]; - break; - } - case 18: { - [self setUsername:[input readString]]; - break; - } - case 26: { - [self setOauthScope:[input readString]]; - break; - } - } - } -} -- (BOOL) hasPayload { - return resultSimpleResponse.hasPayload; -} -- (RMTPayload*) payload { - return resultSimpleResponse.payload; -} -- (RMTSimpleResponseBuilder*) setPayload:(RMTPayload*) value { - resultSimpleResponse.hasPayload = YES; - resultSimpleResponse.payload = value; - return self; -} -- (RMTSimpleResponseBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue { - return [self setPayload:[builderForValue build]]; -} -- (RMTSimpleResponseBuilder*) mergePayload:(RMTPayload*) value { - if (resultSimpleResponse.hasPayload && - resultSimpleResponse.payload != [RMTPayload defaultInstance]) { - resultSimpleResponse.payload = - [[[RMTPayload builderWithPrototype:resultSimpleResponse.payload] mergeFrom:value] buildPartial]; - } else { - resultSimpleResponse.payload = value; - } - resultSimpleResponse.hasPayload = YES; - return self; -} -- (RMTSimpleResponseBuilder*) clearPayload { - resultSimpleResponse.hasPayload = NO; - resultSimpleResponse.payload = [RMTPayload defaultInstance]; - return self; -} -- (BOOL) hasUsername { - return resultSimpleResponse.hasUsername; -} -- (NSString*) username { - return resultSimpleResponse.username; -} -- (RMTSimpleResponseBuilder*) setUsername:(NSString*) value { - resultSimpleResponse.hasUsername = YES; - resultSimpleResponse.username = value; - return self; -} -- (RMTSimpleResponseBuilder*) clearUsername { - resultSimpleResponse.hasUsername = NO; - resultSimpleResponse.username = @""; - return self; -} -- (BOOL) hasOauthScope { - return resultSimpleResponse.hasOauthScope; -} -- (NSString*) oauthScope { - return resultSimpleResponse.oauthScope; -} -- (RMTSimpleResponseBuilder*) setOauthScope:(NSString*) value { - resultSimpleResponse.hasOauthScope = YES; - resultSimpleResponse.oauthScope = value; - return self; -} -- (RMTSimpleResponseBuilder*) clearOauthScope { - resultSimpleResponse.hasOauthScope = NO; - resultSimpleResponse.oauthScope = @""; - return self; -} -@end - -@interface RMTStreamingInputCallRequest () -@property (strong) RMTPayload* payload; -@end - -@implementation RMTStreamingInputCallRequest - -- (BOOL) hasPayload { - return !!hasPayload_; -} -- (void) setHasPayload:(BOOL) _value_ { - hasPayload_ = !!_value_; -} -@synthesize payload; -- (instancetype) init { - if ((self = [super init])) { - self.payload = [RMTPayload defaultInstance]; - } - return self; -} -static RMTStreamingInputCallRequest* defaultRMTStreamingInputCallRequestInstance = nil; -+ (void) initialize { - if (self == [RMTStreamingInputCallRequest class]) { - defaultRMTStreamingInputCallRequestInstance = [[RMTStreamingInputCallRequest alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTStreamingInputCallRequestInstance; -} -- (instancetype) defaultInstance { - return defaultRMTStreamingInputCallRequestInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasPayload) { - [output writeMessage:1 value:self.payload]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasPayload) { - size_ += computeMessageSize(1, self.payload); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTStreamingInputCallRequest*) parseFromData:(NSData*) data { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromData:data] build]; -} -+ (RMTStreamingInputCallRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallRequest*) parseFromInputStream:(NSInputStream*) input { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromInputStream:input] build]; -} -+ (RMTStreamingInputCallRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTStreamingInputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallRequest*)[[[RMTStreamingInputCallRequest builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallRequestBuilder*) builder { - return [[RMTStreamingInputCallRequestBuilder alloc] init]; -} -+ (RMTStreamingInputCallRequestBuilder*) builderWithPrototype:(RMTStreamingInputCallRequest*) prototype { - return [[RMTStreamingInputCallRequest builder] mergeFrom:prototype]; -} -- (RMTStreamingInputCallRequestBuilder*) builder { - return [RMTStreamingInputCallRequest builder]; -} -- (RMTStreamingInputCallRequestBuilder*) toBuilder { - return [RMTStreamingInputCallRequest builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasPayload) { - [output appendFormat:@"%@%@ {\n", indent, @"payload"]; - [self.payload writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTStreamingInputCallRequest class]]) { - return NO; - } - RMTStreamingInputCallRequest *otherMessage = other; - return - self.hasPayload == otherMessage.hasPayload && - (!self.hasPayload || [self.payload isEqual:otherMessage.payload]) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasPayload) { - hashCode = hashCode * 31 + [self.payload hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTStreamingInputCallRequestBuilder() -@property (strong) RMTStreamingInputCallRequest* resultStreamingInputCallRequest; -@end - -@implementation RMTStreamingInputCallRequestBuilder -@synthesize resultStreamingInputCallRequest; -- (instancetype) init { - if ((self = [super init])) { - self.resultStreamingInputCallRequest = [[RMTStreamingInputCallRequest alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultStreamingInputCallRequest; -} -- (RMTStreamingInputCallRequestBuilder*) clear { - self.resultStreamingInputCallRequest = [[RMTStreamingInputCallRequest alloc] init]; - return self; -} -- (RMTStreamingInputCallRequestBuilder*) clone { - return [RMTStreamingInputCallRequest builderWithPrototype:resultStreamingInputCallRequest]; -} -- (RMTStreamingInputCallRequest*) defaultInstance { - return [RMTStreamingInputCallRequest defaultInstance]; -} -- (RMTStreamingInputCallRequest*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTStreamingInputCallRequest*) buildPartial { - RMTStreamingInputCallRequest* returnMe = resultStreamingInputCallRequest; - self.resultStreamingInputCallRequest = nil; - return returnMe; -} -- (RMTStreamingInputCallRequestBuilder*) mergeFrom:(RMTStreamingInputCallRequest*) other { - if (other == [RMTStreamingInputCallRequest defaultInstance]) { - return self; - } - if (other.hasPayload) { - [self mergePayload:other.payload]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTStreamingInputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTStreamingInputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 10: { - RMTPayloadBuilder* subBuilder = [RMTPayload builder]; - if (self.hasPayload) { - [subBuilder mergeFrom:self.payload]; - } - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self setPayload:[subBuilder buildPartial]]; - break; - } - } - } -} -- (BOOL) hasPayload { - return resultStreamingInputCallRequest.hasPayload; -} -- (RMTPayload*) payload { - return resultStreamingInputCallRequest.payload; -} -- (RMTStreamingInputCallRequestBuilder*) setPayload:(RMTPayload*) value { - resultStreamingInputCallRequest.hasPayload = YES; - resultStreamingInputCallRequest.payload = value; - return self; -} -- (RMTStreamingInputCallRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue { - return [self setPayload:[builderForValue build]]; -} -- (RMTStreamingInputCallRequestBuilder*) mergePayload:(RMTPayload*) value { - if (resultStreamingInputCallRequest.hasPayload && - resultStreamingInputCallRequest.payload != [RMTPayload defaultInstance]) { - resultStreamingInputCallRequest.payload = - [[[RMTPayload builderWithPrototype:resultStreamingInputCallRequest.payload] mergeFrom:value] buildPartial]; - } else { - resultStreamingInputCallRequest.payload = value; - } - resultStreamingInputCallRequest.hasPayload = YES; - return self; -} -- (RMTStreamingInputCallRequestBuilder*) clearPayload { - resultStreamingInputCallRequest.hasPayload = NO; - resultStreamingInputCallRequest.payload = [RMTPayload defaultInstance]; - return self; -} -@end - -@interface RMTStreamingInputCallResponse () -@property SInt32 aggregatedPayloadSize; -@end - -@implementation RMTStreamingInputCallResponse - -- (BOOL) hasAggregatedPayloadSize { - return !!hasAggregatedPayloadSize_; -} -- (void) setHasAggregatedPayloadSize:(BOOL) _value_ { - hasAggregatedPayloadSize_ = !!_value_; -} -@synthesize aggregatedPayloadSize; -- (instancetype) init { - if ((self = [super init])) { - self.aggregatedPayloadSize = 0; - } - return self; -} -static RMTStreamingInputCallResponse* defaultRMTStreamingInputCallResponseInstance = nil; -+ (void) initialize { - if (self == [RMTStreamingInputCallResponse class]) { - defaultRMTStreamingInputCallResponseInstance = [[RMTStreamingInputCallResponse alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTStreamingInputCallResponseInstance; -} -- (instancetype) defaultInstance { - return defaultRMTStreamingInputCallResponseInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasAggregatedPayloadSize) { - [output writeInt32:1 value:self.aggregatedPayloadSize]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasAggregatedPayloadSize) { - size_ += computeInt32Size(1, self.aggregatedPayloadSize); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTStreamingInputCallResponse*) parseFromData:(NSData*) data { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromData:data] build]; -} -+ (RMTStreamingInputCallResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallResponse*) parseFromInputStream:(NSInputStream*) input { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromInputStream:input] build]; -} -+ (RMTStreamingInputCallResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTStreamingInputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingInputCallResponse*)[[[RMTStreamingInputCallResponse builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingInputCallResponseBuilder*) builder { - return [[RMTStreamingInputCallResponseBuilder alloc] init]; -} -+ (RMTStreamingInputCallResponseBuilder*) builderWithPrototype:(RMTStreamingInputCallResponse*) prototype { - return [[RMTStreamingInputCallResponse builder] mergeFrom:prototype]; -} -- (RMTStreamingInputCallResponseBuilder*) builder { - return [RMTStreamingInputCallResponse builder]; -} -- (RMTStreamingInputCallResponseBuilder*) toBuilder { - return [RMTStreamingInputCallResponse builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasAggregatedPayloadSize) { - [output appendFormat:@"%@%@: %@\n", indent, @"aggregatedPayloadSize", [NSNumber numberWithInteger:self.aggregatedPayloadSize]]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTStreamingInputCallResponse class]]) { - return NO; - } - RMTStreamingInputCallResponse *otherMessage = other; - return - self.hasAggregatedPayloadSize == otherMessage.hasAggregatedPayloadSize && - (!self.hasAggregatedPayloadSize || self.aggregatedPayloadSize == otherMessage.aggregatedPayloadSize) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasAggregatedPayloadSize) { - hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.aggregatedPayloadSize] hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTStreamingInputCallResponseBuilder() -@property (strong) RMTStreamingInputCallResponse* resultStreamingInputCallResponse; -@end - -@implementation RMTStreamingInputCallResponseBuilder -@synthesize resultStreamingInputCallResponse; -- (instancetype) init { - if ((self = [super init])) { - self.resultStreamingInputCallResponse = [[RMTStreamingInputCallResponse alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultStreamingInputCallResponse; -} -- (RMTStreamingInputCallResponseBuilder*) clear { - self.resultStreamingInputCallResponse = [[RMTStreamingInputCallResponse alloc] init]; - return self; -} -- (RMTStreamingInputCallResponseBuilder*) clone { - return [RMTStreamingInputCallResponse builderWithPrototype:resultStreamingInputCallResponse]; -} -- (RMTStreamingInputCallResponse*) defaultInstance { - return [RMTStreamingInputCallResponse defaultInstance]; -} -- (RMTStreamingInputCallResponse*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTStreamingInputCallResponse*) buildPartial { - RMTStreamingInputCallResponse* returnMe = resultStreamingInputCallResponse; - self.resultStreamingInputCallResponse = nil; - return returnMe; -} -- (RMTStreamingInputCallResponseBuilder*) mergeFrom:(RMTStreamingInputCallResponse*) other { - if (other == [RMTStreamingInputCallResponse defaultInstance]) { - return self; - } - if (other.hasAggregatedPayloadSize) { - [self setAggregatedPayloadSize:other.aggregatedPayloadSize]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTStreamingInputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTStreamingInputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 8: { - [self setAggregatedPayloadSize:[input readInt32]]; - break; - } - } - } -} -- (BOOL) hasAggregatedPayloadSize { - return resultStreamingInputCallResponse.hasAggregatedPayloadSize; -} -- (SInt32) aggregatedPayloadSize { - return resultStreamingInputCallResponse.aggregatedPayloadSize; -} -- (RMTStreamingInputCallResponseBuilder*) setAggregatedPayloadSize:(SInt32) value { - resultStreamingInputCallResponse.hasAggregatedPayloadSize = YES; - resultStreamingInputCallResponse.aggregatedPayloadSize = value; - return self; -} -- (RMTStreamingInputCallResponseBuilder*) clearAggregatedPayloadSize { - resultStreamingInputCallResponse.hasAggregatedPayloadSize = NO; - resultStreamingInputCallResponse.aggregatedPayloadSize = 0; - return self; -} -@end - -@interface RMTResponseParameters () -@property SInt32 size; -@property SInt32 intervalUs; -@end - -@implementation RMTResponseParameters - -- (BOOL) hasSize { - return !!hasSize_; -} -- (void) setHasSize:(BOOL) _value_ { - hasSize_ = !!_value_; -} -@synthesize size; -- (BOOL) hasIntervalUs { - return !!hasIntervalUs_; -} -- (void) setHasIntervalUs:(BOOL) _value_ { - hasIntervalUs_ = !!_value_; -} -@synthesize intervalUs; -- (instancetype) init { - if ((self = [super init])) { - self.size = 0; - self.intervalUs = 0; - } - return self; -} -static RMTResponseParameters* defaultRMTResponseParametersInstance = nil; -+ (void) initialize { - if (self == [RMTResponseParameters class]) { - defaultRMTResponseParametersInstance = [[RMTResponseParameters alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTResponseParametersInstance; -} -- (instancetype) defaultInstance { - return defaultRMTResponseParametersInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasSize) { - [output writeInt32:1 value:self.size]; - } - if (self.hasIntervalUs) { - [output writeInt32:2 value:self.intervalUs]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasSize) { - size_ += computeInt32Size(1, self.size); - } - if (self.hasIntervalUs) { - size_ += computeInt32Size(2, self.intervalUs); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTResponseParameters*) parseFromData:(NSData*) data { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromData:data] build]; -} -+ (RMTResponseParameters*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTResponseParameters*) parseFromInputStream:(NSInputStream*) input { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromInputStream:input] build]; -} -+ (RMTResponseParameters*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTResponseParameters*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTResponseParameters*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTResponseParameters*)[[[RMTResponseParameters builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTResponseParametersBuilder*) builder { - return [[RMTResponseParametersBuilder alloc] init]; -} -+ (RMTResponseParametersBuilder*) builderWithPrototype:(RMTResponseParameters*) prototype { - return [[RMTResponseParameters builder] mergeFrom:prototype]; -} -- (RMTResponseParametersBuilder*) builder { - return [RMTResponseParameters builder]; -} -- (RMTResponseParametersBuilder*) toBuilder { - return [RMTResponseParameters builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasSize) { - [output appendFormat:@"%@%@: %@\n", indent, @"size", [NSNumber numberWithInteger:self.size]]; - } - if (self.hasIntervalUs) { - [output appendFormat:@"%@%@: %@\n", indent, @"intervalUs", [NSNumber numberWithInteger:self.intervalUs]]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTResponseParameters class]]) { - return NO; - } - RMTResponseParameters *otherMessage = other; - return - self.hasSize == otherMessage.hasSize && - (!self.hasSize || self.size == otherMessage.size) && - self.hasIntervalUs == otherMessage.hasIntervalUs && - (!self.hasIntervalUs || self.intervalUs == otherMessage.intervalUs) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasSize) { - hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.size] hash]; - } - if (self.hasIntervalUs) { - hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.intervalUs] hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTResponseParametersBuilder() -@property (strong) RMTResponseParameters* resultResponseParameters; -@end - -@implementation RMTResponseParametersBuilder -@synthesize resultResponseParameters; -- (instancetype) init { - if ((self = [super init])) { - self.resultResponseParameters = [[RMTResponseParameters alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultResponseParameters; -} -- (RMTResponseParametersBuilder*) clear { - self.resultResponseParameters = [[RMTResponseParameters alloc] init]; - return self; -} -- (RMTResponseParametersBuilder*) clone { - return [RMTResponseParameters builderWithPrototype:resultResponseParameters]; -} -- (RMTResponseParameters*) defaultInstance { - return [RMTResponseParameters defaultInstance]; -} -- (RMTResponseParameters*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTResponseParameters*) buildPartial { - RMTResponseParameters* returnMe = resultResponseParameters; - self.resultResponseParameters = nil; - return returnMe; -} -- (RMTResponseParametersBuilder*) mergeFrom:(RMTResponseParameters*) other { - if (other == [RMTResponseParameters defaultInstance]) { - return self; - } - if (other.hasSize) { - [self setSize:other.size]; - } - if (other.hasIntervalUs) { - [self setIntervalUs:other.intervalUs]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTResponseParametersBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTResponseParametersBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 8: { - [self setSize:[input readInt32]]; - break; - } - case 16: { - [self setIntervalUs:[input readInt32]]; - break; - } - } - } -} -- (BOOL) hasSize { - return resultResponseParameters.hasSize; -} -- (SInt32) size { - return resultResponseParameters.size; -} -- (RMTResponseParametersBuilder*) setSize:(SInt32) value { - resultResponseParameters.hasSize = YES; - resultResponseParameters.size = value; - return self; -} -- (RMTResponseParametersBuilder*) clearSize { - resultResponseParameters.hasSize = NO; - resultResponseParameters.size = 0; - return self; -} -- (BOOL) hasIntervalUs { - return resultResponseParameters.hasIntervalUs; -} -- (SInt32) intervalUs { - return resultResponseParameters.intervalUs; -} -- (RMTResponseParametersBuilder*) setIntervalUs:(SInt32) value { - resultResponseParameters.hasIntervalUs = YES; - resultResponseParameters.intervalUs = value; - return self; -} -- (RMTResponseParametersBuilder*) clearIntervalUs { - resultResponseParameters.hasIntervalUs = NO; - resultResponseParameters.intervalUs = 0; - return self; -} -@end - -@interface RMTStreamingOutputCallRequest () -@property RMTPayloadType responseType; -@property (strong) NSMutableArray * responseParametersArray; -@property (strong) RMTPayload* payload; -@end - -@implementation RMTStreamingOutputCallRequest - -- (BOOL) hasResponseType { - return !!hasResponseType_; -} -- (void) setHasResponseType:(BOOL) _value_ { - hasResponseType_ = !!_value_; -} -@synthesize responseType; -@synthesize responseParametersArray; -@dynamic responseParameters; -- (BOOL) hasPayload { - return !!hasPayload_; -} -- (void) setHasPayload:(BOOL) _value_ { - hasPayload_ = !!_value_; -} -@synthesize payload; -- (instancetype) init { - if ((self = [super init])) { - self.responseType = RMTPayloadTypeCompressable; - self.payload = [RMTPayload defaultInstance]; - } - return self; -} -static RMTStreamingOutputCallRequest* defaultRMTStreamingOutputCallRequestInstance = nil; -+ (void) initialize { - if (self == [RMTStreamingOutputCallRequest class]) { - defaultRMTStreamingOutputCallRequestInstance = [[RMTStreamingOutputCallRequest alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTStreamingOutputCallRequestInstance; -} -- (instancetype) defaultInstance { - return defaultRMTStreamingOutputCallRequestInstance; -} -- (NSArray *)responseParameters { - return responseParametersArray; -} -- (RMTResponseParameters*)responseParametersAtIndex:(NSUInteger)index { - return [responseParametersArray objectAtIndex:index]; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasResponseType) { - [output writeEnum:1 value:self.responseType]; - } - [self.responseParametersArray enumerateObjectsUsingBlock:^(RMTResponseParameters *element, NSUInteger idx, BOOL *stop) { - [output writeMessage:2 value:element]; - }]; - if (self.hasPayload) { - [output writeMessage:3 value:self.payload]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasResponseType) { - size_ += computeEnumSize(1, self.responseType); - } - [self.responseParametersArray enumerateObjectsUsingBlock:^(RMTResponseParameters *element, NSUInteger idx, BOOL *stop) { - size_ += computeMessageSize(2, element); - }]; - if (self.hasPayload) { - size_ += computeMessageSize(3, self.payload); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTStreamingOutputCallRequest*) parseFromData:(NSData*) data { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromData:data] build]; -} -+ (RMTStreamingOutputCallRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallRequest*) parseFromInputStream:(NSInputStream*) input { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromInputStream:input] build]; -} -+ (RMTStreamingOutputCallRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTStreamingOutputCallRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallRequest*)[[[RMTStreamingOutputCallRequest builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallRequestBuilder*) builder { - return [[RMTStreamingOutputCallRequestBuilder alloc] init]; -} -+ (RMTStreamingOutputCallRequestBuilder*) builderWithPrototype:(RMTStreamingOutputCallRequest*) prototype { - return [[RMTStreamingOutputCallRequest builder] mergeFrom:prototype]; -} -- (RMTStreamingOutputCallRequestBuilder*) builder { - return [RMTStreamingOutputCallRequest builder]; -} -- (RMTStreamingOutputCallRequestBuilder*) toBuilder { - return [RMTStreamingOutputCallRequest builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasResponseType) { - [output appendFormat:@"%@%@: %@\n", indent, @"responseType", NSStringFromRMTPayloadType(self.responseType)]; - } - [self.responseParametersArray enumerateObjectsUsingBlock:^(RMTResponseParameters *element, NSUInteger idx, BOOL *stop) { - [output appendFormat:@"%@%@ {\n", indent, @"responseParameters"]; - [element writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - }]; - if (self.hasPayload) { - [output appendFormat:@"%@%@ {\n", indent, @"payload"]; - [self.payload writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTStreamingOutputCallRequest class]]) { - return NO; - } - RMTStreamingOutputCallRequest *otherMessage = other; - return - self.hasResponseType == otherMessage.hasResponseType && - (!self.hasResponseType || self.responseType == otherMessage.responseType) && - [self.responseParametersArray isEqualToArray:otherMessage.responseParametersArray] && - self.hasPayload == otherMessage.hasPayload && - (!self.hasPayload || [self.payload isEqual:otherMessage.payload]) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasResponseType) { - hashCode = hashCode * 31 + self.responseType; - } - [self.responseParametersArray enumerateObjectsUsingBlock:^(RMTResponseParameters *element, NSUInteger idx, BOOL *stop) { - hashCode = hashCode * 31 + [element hash]; - }]; - if (self.hasPayload) { - hashCode = hashCode * 31 + [self.payload hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTStreamingOutputCallRequestBuilder() -@property (strong) RMTStreamingOutputCallRequest* resultStreamingOutputCallRequest; -@end - -@implementation RMTStreamingOutputCallRequestBuilder -@synthesize resultStreamingOutputCallRequest; -- (instancetype) init { - if ((self = [super init])) { - self.resultStreamingOutputCallRequest = [[RMTStreamingOutputCallRequest alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultStreamingOutputCallRequest; -} -- (RMTStreamingOutputCallRequestBuilder*) clear { - self.resultStreamingOutputCallRequest = [[RMTStreamingOutputCallRequest alloc] init]; - return self; -} -- (RMTStreamingOutputCallRequestBuilder*) clone { - return [RMTStreamingOutputCallRequest builderWithPrototype:resultStreamingOutputCallRequest]; -} -- (RMTStreamingOutputCallRequest*) defaultInstance { - return [RMTStreamingOutputCallRequest defaultInstance]; -} -- (RMTStreamingOutputCallRequest*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTStreamingOutputCallRequest*) buildPartial { - RMTStreamingOutputCallRequest* returnMe = resultStreamingOutputCallRequest; - self.resultStreamingOutputCallRequest = nil; - return returnMe; -} -- (RMTStreamingOutputCallRequestBuilder*) mergeFrom:(RMTStreamingOutputCallRequest*) other { - if (other == [RMTStreamingOutputCallRequest defaultInstance]) { - return self; - } - if (other.hasResponseType) { - [self setResponseType:other.responseType]; - } - if (other.responseParametersArray.count > 0) { - if (resultStreamingOutputCallRequest.responseParametersArray == nil) { - resultStreamingOutputCallRequest.responseParametersArray = [[NSMutableArray alloc] initWithArray:other.responseParametersArray]; - } else { - [resultStreamingOutputCallRequest.responseParametersArray addObjectsFromArray:other.responseParametersArray]; - } - } - if (other.hasPayload) { - [self mergePayload:other.payload]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTStreamingOutputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTStreamingOutputCallRequestBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 8: { - RMTPayloadType value = (RMTPayloadType)[input readEnum]; - if (RMTPayloadTypeIsValidValue(value)) { - [self setResponseType:value]; - } else { - [unknownFields mergeVarintField:1 value:value]; - } - break; - } - case 18: { - RMTResponseParametersBuilder* subBuilder = [RMTResponseParameters builder]; - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self addResponseParameters:[subBuilder buildPartial]]; - break; - } - case 26: { - RMTPayloadBuilder* subBuilder = [RMTPayload builder]; - if (self.hasPayload) { - [subBuilder mergeFrom:self.payload]; - } - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self setPayload:[subBuilder buildPartial]]; - break; - } - } - } -} -- (BOOL) hasResponseType { - return resultStreamingOutputCallRequest.hasResponseType; -} -- (RMTPayloadType) responseType { - return resultStreamingOutputCallRequest.responseType; -} -- (RMTStreamingOutputCallRequestBuilder*) setResponseType:(RMTPayloadType) value { - resultStreamingOutputCallRequest.hasResponseType = YES; - resultStreamingOutputCallRequest.responseType = value; - return self; -} -- (RMTStreamingOutputCallRequestBuilder*) clearResponseType { - resultStreamingOutputCallRequest.hasResponseType = NO; - resultStreamingOutputCallRequest.responseType = RMTPayloadTypeCompressable; - return self; -} -- (NSMutableArray *)responseParameters { - return resultStreamingOutputCallRequest.responseParametersArray; -} -- (RMTResponseParameters*)responseParametersAtIndex:(NSUInteger)index { - return [resultStreamingOutputCallRequest responseParametersAtIndex:index]; -} -- (RMTStreamingOutputCallRequestBuilder *)addResponseParameters:(RMTResponseParameters*)value { - if (resultStreamingOutputCallRequest.responseParametersArray == nil) { - resultStreamingOutputCallRequest.responseParametersArray = [[NSMutableArray alloc]init]; - } - [resultStreamingOutputCallRequest.responseParametersArray addObject:value]; - return self; -} -- (RMTStreamingOutputCallRequestBuilder *)setResponseParametersArray:(NSArray *)array { - resultStreamingOutputCallRequest.responseParametersArray = [[NSMutableArray alloc]initWithArray:array]; - return self; -} -- (RMTStreamingOutputCallRequestBuilder *)clearResponseParameters { - resultStreamingOutputCallRequest.responseParametersArray = nil; - return self; -} -- (BOOL) hasPayload { - return resultStreamingOutputCallRequest.hasPayload; -} -- (RMTPayload*) payload { - return resultStreamingOutputCallRequest.payload; -} -- (RMTStreamingOutputCallRequestBuilder*) setPayload:(RMTPayload*) value { - resultStreamingOutputCallRequest.hasPayload = YES; - resultStreamingOutputCallRequest.payload = value; - return self; -} -- (RMTStreamingOutputCallRequestBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue { - return [self setPayload:[builderForValue build]]; -} -- (RMTStreamingOutputCallRequestBuilder*) mergePayload:(RMTPayload*) value { - if (resultStreamingOutputCallRequest.hasPayload && - resultStreamingOutputCallRequest.payload != [RMTPayload defaultInstance]) { - resultStreamingOutputCallRequest.payload = - [[[RMTPayload builderWithPrototype:resultStreamingOutputCallRequest.payload] mergeFrom:value] buildPartial]; - } else { - resultStreamingOutputCallRequest.payload = value; - } - resultStreamingOutputCallRequest.hasPayload = YES; - return self; -} -- (RMTStreamingOutputCallRequestBuilder*) clearPayload { - resultStreamingOutputCallRequest.hasPayload = NO; - resultStreamingOutputCallRequest.payload = [RMTPayload defaultInstance]; - return self; -} -@end - -@interface RMTStreamingOutputCallResponse () -@property (strong) RMTPayload* payload; -@end - -@implementation RMTStreamingOutputCallResponse - -- (BOOL) hasPayload { - return !!hasPayload_; -} -- (void) setHasPayload:(BOOL) _value_ { - hasPayload_ = !!_value_; -} -@synthesize payload; -- (instancetype) init { - if ((self = [super init])) { - self.payload = [RMTPayload defaultInstance]; - } - return self; -} -static RMTStreamingOutputCallResponse* defaultRMTStreamingOutputCallResponseInstance = nil; -+ (void) initialize { - if (self == [RMTStreamingOutputCallResponse class]) { - defaultRMTStreamingOutputCallResponseInstance = [[RMTStreamingOutputCallResponse alloc] init]; - } -} -+ (instancetype) defaultInstance { - return defaultRMTStreamingOutputCallResponseInstance; -} -- (instancetype) defaultInstance { - return defaultRMTStreamingOutputCallResponseInstance; -} -- (BOOL) isInitialized { - return YES; -} -- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { - if (self.hasPayload) { - [output writeMessage:1 value:self.payload]; - } - [self.unknownFields writeToCodedOutputStream:output]; -} -- (SInt32) serializedSize { - __block SInt32 size_ = memoizedSerializedSize; - if (size_ != -1) { - return size_; - } - - size_ = 0; - if (self.hasPayload) { - size_ += computeMessageSize(1, self.payload); - } - size_ += self.unknownFields.serializedSize; - memoizedSerializedSize = size_; - return size_; -} -+ (RMTStreamingOutputCallResponse*) parseFromData:(NSData*) data { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromData:data] build]; -} -+ (RMTStreamingOutputCallResponse*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallResponse*) parseFromInputStream:(NSInputStream*) input { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromInputStream:input] build]; -} -+ (RMTStreamingOutputCallResponse*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromCodedInputStream:input] build]; -} -+ (RMTStreamingOutputCallResponse*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RMTStreamingOutputCallResponse*)[[[RMTStreamingOutputCallResponse builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; -} -+ (RMTStreamingOutputCallResponseBuilder*) builder { - return [[RMTStreamingOutputCallResponseBuilder alloc] init]; -} -+ (RMTStreamingOutputCallResponseBuilder*) builderWithPrototype:(RMTStreamingOutputCallResponse*) prototype { - return [[RMTStreamingOutputCallResponse builder] mergeFrom:prototype]; -} -- (RMTStreamingOutputCallResponseBuilder*) builder { - return [RMTStreamingOutputCallResponse builder]; -} -- (RMTStreamingOutputCallResponseBuilder*) toBuilder { - return [RMTStreamingOutputCallResponse builderWithPrototype:self]; -} -- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { - if (self.hasPayload) { - [output appendFormat:@"%@%@ {\n", indent, @"payload"]; - [self.payload writeDescriptionTo:output - withIndent:[NSString stringWithFormat:@"%@ ", indent]]; - [output appendFormat:@"%@}\n", indent]; - } - [self.unknownFields writeDescriptionTo:output withIndent:indent]; -} -- (BOOL) isEqual:(id)other { - if (other == self) { - return YES; - } - if (![other isKindOfClass:[RMTStreamingOutputCallResponse class]]) { - return NO; - } - RMTStreamingOutputCallResponse *otherMessage = other; - return - self.hasPayload == otherMessage.hasPayload && - (!self.hasPayload || [self.payload isEqual:otherMessage.payload]) && - (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); -} -- (NSUInteger) hash { - __block NSUInteger hashCode = 7; - if (self.hasPayload) { - hashCode = hashCode * 31 + [self.payload hash]; - } - hashCode = hashCode * 31 + [self.unknownFields hash]; - return hashCode; -} -@end - -@interface RMTStreamingOutputCallResponseBuilder() -@property (strong) RMTStreamingOutputCallResponse* resultStreamingOutputCallResponse; -@end - -@implementation RMTStreamingOutputCallResponseBuilder -@synthesize resultStreamingOutputCallResponse; -- (instancetype) init { - if ((self = [super init])) { - self.resultStreamingOutputCallResponse = [[RMTStreamingOutputCallResponse alloc] init]; - } - return self; -} -- (PBGeneratedMessage*) internalGetResult { - return resultStreamingOutputCallResponse; -} -- (RMTStreamingOutputCallResponseBuilder*) clear { - self.resultStreamingOutputCallResponse = [[RMTStreamingOutputCallResponse alloc] init]; - return self; -} -- (RMTStreamingOutputCallResponseBuilder*) clone { - return [RMTStreamingOutputCallResponse builderWithPrototype:resultStreamingOutputCallResponse]; -} -- (RMTStreamingOutputCallResponse*) defaultInstance { - return [RMTStreamingOutputCallResponse defaultInstance]; -} -- (RMTStreamingOutputCallResponse*) build { - [self checkInitialized]; - return [self buildPartial]; -} -- (RMTStreamingOutputCallResponse*) buildPartial { - RMTStreamingOutputCallResponse* returnMe = resultStreamingOutputCallResponse; - self.resultStreamingOutputCallResponse = nil; - return returnMe; -} -- (RMTStreamingOutputCallResponseBuilder*) mergeFrom:(RMTStreamingOutputCallResponse*) other { - if (other == [RMTStreamingOutputCallResponse defaultInstance]) { - return self; - } - if (other.hasPayload) { - [self mergePayload:other.payload]; - } - [self mergeUnknownFields:other.unknownFields]; - return self; -} -- (RMTStreamingOutputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { - return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; -} -- (RMTStreamingOutputCallResponseBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; - while (YES) { - SInt32 tag = [input readTag]; - switch (tag) { - case 0: - [self setUnknownFields:[unknownFields build]]; - return self; - default: { - if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { - [self setUnknownFields:[unknownFields build]]; - return self; - } - break; - } - case 10: { - RMTPayloadBuilder* subBuilder = [RMTPayload builder]; - if (self.hasPayload) { - [subBuilder mergeFrom:self.payload]; - } - [input readMessage:subBuilder extensionRegistry:extensionRegistry]; - [self setPayload:[subBuilder buildPartial]]; - break; - } - } - } -} -- (BOOL) hasPayload { - return resultStreamingOutputCallResponse.hasPayload; -} -- (RMTPayload*) payload { - return resultStreamingOutputCallResponse.payload; -} -- (RMTStreamingOutputCallResponseBuilder*) setPayload:(RMTPayload*) value { - resultStreamingOutputCallResponse.hasPayload = YES; - resultStreamingOutputCallResponse.payload = value; - return self; -} -- (RMTStreamingOutputCallResponseBuilder*) setPayloadBuilder:(RMTPayloadBuilder*) builderForValue { - return [self setPayload:[builderForValue build]]; -} -- (RMTStreamingOutputCallResponseBuilder*) mergePayload:(RMTPayload*) value { - if (resultStreamingOutputCallResponse.hasPayload && - resultStreamingOutputCallResponse.payload != [RMTPayload defaultInstance]) { - resultStreamingOutputCallResponse.payload = - [[[RMTPayload builderWithPrototype:resultStreamingOutputCallResponse.payload] mergeFrom:value] buildPartial]; - } else { - resultStreamingOutputCallResponse.payload = value; - } - resultStreamingOutputCallResponse.hasPayload = YES; - return self; -} -- (RMTStreamingOutputCallResponseBuilder*) clearPayload { - resultStreamingOutputCallResponse.hasPayload = NO; - resultStreamingOutputCallResponse.payload = [RMTPayload defaultInstance]; - return self; -} -@end - - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.h b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.h new file mode 100644 index 0000000000..5f32314175 --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.h @@ -0,0 +1,221 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: messages.proto + +#import "GPBProtocolBuffers.h" + +#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 +#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. +#endif + +CF_EXTERN_C_BEGIN + +@class RMTPayload; +@class RMTResponseParameters; +@class RMTSimpleRequest; +@class RMTSimpleResponse; +@class RMTStreamingInputCallRequest; +@class RMTStreamingInputCallResponse; +@class RMTStreamingOutputCallRequest; +@class RMTStreamingOutputCallResponse; + +#pragma mark - Enum RMTPayloadType + +// The type of payload that should be returned. +typedef GPB_ENUM(RMTPayloadType) { + RMTPayloadType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + // Compressable text format. + RMTPayloadType_Compressable = 0, + + // Uncompressable binary format. + RMTPayloadType_Uncompressable = 1, + + // Randomly chosen from all other formats defined in this enum. + RMTPayloadType_Random = 2, +}; + +GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void); + +BOOL RMTPayloadType_IsValidValue(int32_t value); + + +#pragma mark - RMTMessagesRoot + +@interface RMTMessagesRoot : GPBRootObject +@end + +#pragma mark - RMTPayload + +typedef GPB_ENUM(RMTPayload_FieldNumber) { + RMTPayload_FieldNumber_Type = 1, + RMTPayload_FieldNumber_Body = 2, +}; + +// A block of data, to simply increase gRPC message size. +@interface RMTPayload : GPBMessage + +// The type of data in body. +@property(nonatomic, readwrite) RMTPayloadType type; + +// Primary contents of payload. +@property(nonatomic, readwrite, copy) NSData *body; + +@end + +int32_t RMTPayload_Type_RawValue(RMTPayload *message); +void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value); + +#pragma mark - RMTSimpleRequest + +typedef GPB_ENUM(RMTSimpleRequest_FieldNumber) { + RMTSimpleRequest_FieldNumber_ResponseType = 1, + RMTSimpleRequest_FieldNumber_ResponseSize = 2, + RMTSimpleRequest_FieldNumber_Payload = 3, + RMTSimpleRequest_FieldNumber_FillUsername = 4, + RMTSimpleRequest_FieldNumber_FillOauthScope = 5, +}; + +// Unary request. +@interface RMTSimpleRequest : GPBMessage + +// Desired payload type in the response from the server. +// If response_type is RANDOM, server randomly chooses one from other formats. +@property(nonatomic, readwrite) RMTPayloadType responseType; + +// Desired payload size in the response from the server. +// If response_type is COMPRESSABLE, this denotes the size before compression. +@property(nonatomic, readwrite) int32_t responseSize; + +// Optional input payload sent along with the request. +@property(nonatomic, readwrite) BOOL hasPayload; +@property(nonatomic, readwrite, strong) RMTPayload *payload; + +// Whether SimpleResponse should include username. +@property(nonatomic, readwrite) BOOL fillUsername; + +// Whether SimpleResponse should include OAuth scope. +@property(nonatomic, readwrite) BOOL fillOauthScope; + +@end + +int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message); +void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value); + +#pragma mark - RMTSimpleResponse + +typedef GPB_ENUM(RMTSimpleResponse_FieldNumber) { + RMTSimpleResponse_FieldNumber_Payload = 1, + RMTSimpleResponse_FieldNumber_Username = 2, + RMTSimpleResponse_FieldNumber_OauthScope = 3, +}; + +// Unary response, as configured by the request. +@interface RMTSimpleResponse : GPBMessage + +// Payload to increase message size. +@property(nonatomic, readwrite) BOOL hasPayload; +@property(nonatomic, readwrite, strong) RMTPayload *payload; + +// The user the request came from, for verifying authentication was +// successful when the client expected it. +@property(nonatomic, readwrite, copy) NSString *username; + +// OAuth scope. +@property(nonatomic, readwrite, copy) NSString *oauthScope; + +@end + +#pragma mark - RMTStreamingInputCallRequest + +typedef GPB_ENUM(RMTStreamingInputCallRequest_FieldNumber) { + RMTStreamingInputCallRequest_FieldNumber_Payload = 1, +}; + +// Client-streaming request. +@interface RMTStreamingInputCallRequest : GPBMessage + +// Optional input payload sent along with the request. +@property(nonatomic, readwrite) BOOL hasPayload; +@property(nonatomic, readwrite, strong) RMTPayload *payload; + +@end + +#pragma mark - RMTStreamingInputCallResponse + +typedef GPB_ENUM(RMTStreamingInputCallResponse_FieldNumber) { + RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize = 1, +}; + +// Client-streaming response. +@interface RMTStreamingInputCallResponse : GPBMessage + +// Aggregated size of payloads received from the client. +@property(nonatomic, readwrite) int32_t aggregatedPayloadSize; + +@end + +#pragma mark - RMTResponseParameters + +typedef GPB_ENUM(RMTResponseParameters_FieldNumber) { + RMTResponseParameters_FieldNumber_Size = 1, + RMTResponseParameters_FieldNumber_IntervalUs = 2, +}; + +// Configuration for a particular response. +@interface RMTResponseParameters : GPBMessage + +// Desired payload sizes in responses from the server. +// If response_type is COMPRESSABLE, this denotes the size before compression. +@property(nonatomic, readwrite) int32_t size; + +// Desired interval between consecutive responses in the response stream in +// microseconds. +@property(nonatomic, readwrite) int32_t intervalUs; + +@end + +#pragma mark - RMTStreamingOutputCallRequest + +typedef GPB_ENUM(RMTStreamingOutputCallRequest_FieldNumber) { + RMTStreamingOutputCallRequest_FieldNumber_ResponseType = 1, + RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray = 2, + RMTStreamingOutputCallRequest_FieldNumber_Payload = 3, +}; + +// Server-streaming request. +@interface RMTStreamingOutputCallRequest : GPBMessage + +// Desired payload type in the response from the server. +// If response_type is RANDOM, the payload from each response in the stream +// might be of different types. This is to simulate a mixed type of payload +// stream. +@property(nonatomic, readwrite) RMTPayloadType responseType; + +// Configuration for each expected response message. +// |responseParametersArray| contains |RMTResponseParameters| +@property(nonatomic, readwrite, strong) NSMutableArray *responseParametersArray; + +// Optional input payload sent along with the request. +@property(nonatomic, readwrite) BOOL hasPayload; +@property(nonatomic, readwrite, strong) RMTPayload *payload; + +@end + +int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message); +void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value); + +#pragma mark - RMTStreamingOutputCallResponse + +typedef GPB_ENUM(RMTStreamingOutputCallResponse_FieldNumber) { + RMTStreamingOutputCallResponse_FieldNumber_Payload = 1, +}; + +// Server-streaming response, as configured by the request and parameters. +@interface RMTStreamingOutputCallResponse : GPBMessage + +// Payload to increase response size. +@property(nonatomic, readwrite) BOOL hasPayload; +@property(nonatomic, readwrite, strong) RMTPayload *payload; + +@end + +CF_EXTERN_C_END diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.m b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.m new file mode 100644 index 0000000000..98eb1dc87c --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.m @@ -0,0 +1,603 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: messages.proto + +#import "GPBProtocolBuffers_RuntimeSupport.h" + +#import "Messages.pbobjc.h" + +#pragma mark - RMTMessagesRoot + +@implementation RMTMessagesRoot + +@end + +static GPBFileDescriptor *RMTMessagesRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - Enum RMTPayloadType + +GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageEnumValueDescription values[] = { + { .name = "Compressable", .number = RMTPayloadType_Compressable }, + { .name = "Uncompressable", .number = RMTPayloadType_Uncompressable }, + { .name = "Random", .number = RMTPayloadType_Random }, + }; + descriptor = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(RMTPayloadType) + values:values + valueCount:sizeof(values) / sizeof(GPBMessageEnumValueDescription) + enumVerifier:RMTPayloadType_IsValidValue]; + } + return descriptor; +} + +BOOL RMTPayloadType_IsValidValue(int32_t value__) { + switch (value__) { + case RMTPayloadType_Compressable: + case RMTPayloadType_Uncompressable: + case RMTPayloadType_Random: + return YES; + default: + return NO; + } +} + +#pragma mark - RMTPayload + +@implementation RMTPayload + +@dynamic type; +@dynamic body; + +typedef struct RMTPayload_Storage { + uint32_t _has_storage_[1]; + RMTPayloadType type; + NSData *body; +} RMTPayload_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "type", + .number = RMTPayload_FieldNumber_Type, + .hasIndex = 0, + .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, + .type = GPBTypeEnum, + .offset = offsetof(RMTPayload_Storage, type), + .defaultValue.valueEnum = RMTPayloadType_Compressable, + .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, + .fieldOptions = NULL, + }, + { + .name = "body", + .number = RMTPayload_FieldNumber_Body, + .hasIndex = 1, + .flags = GPBFieldOptional, + .type = GPBTypeData, + .offset = offsetof(RMTPayload_Storage, body), + .defaultValue.valueData = nil, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTPayload class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTPayload_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +int32_t RMTPayload_Type_RawValue(RMTPayload *message) { + GPBDescriptor *descriptor = [RMTPayload descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type]; + return GPBGetInt32IvarWithField(message, field); +} + +void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value) { + GPBDescriptor *descriptor = [RMTPayload descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - RMTSimpleRequest + +@implementation RMTSimpleRequest + +@dynamic responseType; +@dynamic responseSize; +@dynamic hasPayload, payload; +@dynamic fillUsername; +@dynamic fillOauthScope; + +typedef struct RMTSimpleRequest_Storage { + uint32_t _has_storage_[1]; + BOOL fillUsername; + BOOL fillOauthScope; + RMTPayloadType responseType; + int32_t responseSize; + RMTPayload *payload; +} RMTSimpleRequest_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "responseType", + .number = RMTSimpleRequest_FieldNumber_ResponseType, + .hasIndex = 0, + .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, + .type = GPBTypeEnum, + .offset = offsetof(RMTSimpleRequest_Storage, responseType), + .defaultValue.valueEnum = RMTPayloadType_Compressable, + .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, + .fieldOptions = NULL, + }, + { + .name = "responseSize", + .number = RMTSimpleRequest_FieldNumber_ResponseSize, + .hasIndex = 1, + .flags = GPBFieldOptional, + .type = GPBTypeInt32, + .offset = offsetof(RMTSimpleRequest_Storage, responseSize), + .defaultValue.valueInt32 = 0, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "payload", + .number = RMTSimpleRequest_FieldNumber_Payload, + .hasIndex = 2, + .flags = GPBFieldOptional, + .type = GPBTypeMessage, + .offset = offsetof(RMTSimpleRequest_Storage, payload), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTPayload), + .fieldOptions = NULL, + }, + { + .name = "fillUsername", + .number = RMTSimpleRequest_FieldNumber_FillUsername, + .hasIndex = 3, + .flags = GPBFieldOptional, + .type = GPBTypeBool, + .offset = offsetof(RMTSimpleRequest_Storage, fillUsername), + .defaultValue.valueBool = NO, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "fillOauthScope", + .number = RMTSimpleRequest_FieldNumber_FillOauthScope, + .hasIndex = 4, + .flags = GPBFieldOptional, + .type = GPBTypeBool, + .offset = offsetof(RMTSimpleRequest_Storage, fillOauthScope), + .defaultValue.valueBool = NO, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleRequest class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTSimpleRequest_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message) { + GPBDescriptor *descriptor = [RMTSimpleRequest descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType]; + return GPBGetInt32IvarWithField(message, field); +} + +void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value) { + GPBDescriptor *descriptor = [RMTSimpleRequest descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - RMTSimpleResponse + +@implementation RMTSimpleResponse + +@dynamic hasPayload, payload; +@dynamic username; +@dynamic oauthScope; + +typedef struct RMTSimpleResponse_Storage { + uint32_t _has_storage_[1]; + RMTPayload *payload; + NSString *username; + NSString *oauthScope; +} RMTSimpleResponse_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "payload", + .number = RMTSimpleResponse_FieldNumber_Payload, + .hasIndex = 0, + .flags = GPBFieldOptional, + .type = GPBTypeMessage, + .offset = offsetof(RMTSimpleResponse_Storage, payload), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTPayload), + .fieldOptions = NULL, + }, + { + .name = "username", + .number = RMTSimpleResponse_FieldNumber_Username, + .hasIndex = 1, + .flags = GPBFieldOptional, + .type = GPBTypeString, + .offset = offsetof(RMTSimpleResponse_Storage, username), + .defaultValue.valueString = nil, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "oauthScope", + .number = RMTSimpleResponse_FieldNumber_OauthScope, + .hasIndex = 2, + .flags = GPBFieldOptional, + .type = GPBTypeString, + .offset = offsetof(RMTSimpleResponse_Storage, oauthScope), + .defaultValue.valueString = nil, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleResponse class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTSimpleResponse_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +#pragma mark - RMTStreamingInputCallRequest + +@implementation RMTStreamingInputCallRequest + +@dynamic hasPayload, payload; + +typedef struct RMTStreamingInputCallRequest_Storage { + uint32_t _has_storage_[1]; + RMTPayload *payload; +} RMTStreamingInputCallRequest_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "payload", + .number = RMTStreamingInputCallRequest_FieldNumber_Payload, + .hasIndex = 0, + .flags = GPBFieldOptional, + .type = GPBTypeMessage, + .offset = offsetof(RMTStreamingInputCallRequest_Storage, payload), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTPayload), + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallRequest class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTStreamingInputCallRequest_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +#pragma mark - RMTStreamingInputCallResponse + +@implementation RMTStreamingInputCallResponse + +@dynamic aggregatedPayloadSize; + +typedef struct RMTStreamingInputCallResponse_Storage { + uint32_t _has_storage_[1]; + int32_t aggregatedPayloadSize; +} RMTStreamingInputCallResponse_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "aggregatedPayloadSize", + .number = RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize, + .hasIndex = 0, + .flags = GPBFieldOptional, + .type = GPBTypeInt32, + .offset = offsetof(RMTStreamingInputCallResponse_Storage, aggregatedPayloadSize), + .defaultValue.valueInt32 = 0, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallResponse class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTStreamingInputCallResponse_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +#pragma mark - RMTResponseParameters + +@implementation RMTResponseParameters + +@dynamic size; +@dynamic intervalUs; + +typedef struct RMTResponseParameters_Storage { + uint32_t _has_storage_[1]; + int32_t size; + int32_t intervalUs; +} RMTResponseParameters_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "size", + .number = RMTResponseParameters_FieldNumber_Size, + .hasIndex = 0, + .flags = GPBFieldOptional, + .type = GPBTypeInt32, + .offset = offsetof(RMTResponseParameters_Storage, size), + .defaultValue.valueInt32 = 0, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "intervalUs", + .number = RMTResponseParameters_FieldNumber_IntervalUs, + .hasIndex = 1, + .flags = GPBFieldOptional, + .type = GPBTypeInt32, + .offset = offsetof(RMTResponseParameters_Storage, intervalUs), + .defaultValue.valueInt32 = 0, + .typeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTResponseParameters class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTResponseParameters_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +#pragma mark - RMTStreamingOutputCallRequest + +@implementation RMTStreamingOutputCallRequest + +@dynamic responseType; +@dynamic responseParametersArray; +@dynamic hasPayload, payload; + +typedef struct RMTStreamingOutputCallRequest_Storage { + uint32_t _has_storage_[1]; + RMTPayloadType responseType; + NSMutableArray *responseParametersArray; + RMTPayload *payload; +} RMTStreamingOutputCallRequest_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "responseType", + .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseType, + .hasIndex = 0, + .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, + .type = GPBTypeEnum, + .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseType), + .defaultValue.valueEnum = RMTPayloadType_Compressable, + .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, + .fieldOptions = NULL, + }, + { + .name = "responseParametersArray", + .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray, + .hasIndex = GPBNoHasBit, + .flags = GPBFieldRepeated, + .type = GPBTypeMessage, + .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseParametersArray), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTResponseParameters), + .fieldOptions = NULL, + }, + { + .name = "payload", + .number = RMTStreamingOutputCallRequest_FieldNumber_Payload, + .hasIndex = 2, + .flags = GPBFieldOptional, + .type = GPBTypeMessage, + .offset = offsetof(RMTStreamingOutputCallRequest_Storage, payload), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTPayload), + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallRequest class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTStreamingOutputCallRequest_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + +int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message) { + GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType]; + return GPBGetInt32IvarWithField(message, field); +} + +void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value) { + GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - RMTStreamingOutputCallResponse + +@implementation RMTStreamingOutputCallResponse + +@dynamic hasPayload, payload; + +typedef struct RMTStreamingOutputCallResponse_Storage { + uint32_t _has_storage_[1]; + RMTPayload *payload; +} RMTStreamingOutputCallResponse_Storage; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = NULL; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "payload", + .number = RMTStreamingOutputCallResponse_FieldNumber_Payload, + .hasIndex = 0, + .flags = GPBFieldOptional, + .type = GPBTypeMessage, + .offset = offsetof(RMTStreamingOutputCallResponse_Storage, payload), + .defaultValue.valueMessage = nil, + .typeSpecific.className = GPBStringifySymbol(RMTPayload), + .fieldOptions = NULL, + }, + }; + descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallResponse class] + rootClass:[RMTMessagesRoot class] + file:RMTMessagesRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(RMTStreamingOutputCallResponse_Storage) + wireFormat:NO]; + } + return descriptor; +} + +@end + diff --git a/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec index 7b025ce252..36c2b509e8 100644 --- a/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec @@ -6,13 +6,19 @@ Pod::Spec.new do |s| s.license = 'New BSD' s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } - s.source_files = '*.pb.{h,m}' - s.public_header_files = '*.pb.h' - - s.platform = :ios s.ios.deployment_target = '6.0' - s.requires_arc = true + s.osx.deployment_target = '10.8' + + s.subspec 'Messages' do |ms| + ms.source_files = '*.pbobjc.{h,m}' + ms.requires_arc = false + ms.dependency 'Protobuf', '~> 3.0' + end - s.dependency 'ProtocolBuffers', '~> 1.9' - s.dependency 'gRPC', '~> 0.0' + s.subspec 'Services' do |ss| + ss.source_files = '*.pbrpc.{h,m}' + ss.requires_arc = true + ss.dependency 'gRPC', '~> 0.0' + ss.dependency 'RemoteTest/Messages' + end end diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.h b/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.h deleted file mode 100644 index b6111b15b8..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.h +++ /dev/null @@ -1,167 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import <ProtocolBuffers/ProtocolBuffers.h> - -#import "Empty.pb.h" -#import "Messages.pb.h" -#import <gRPC/ProtoService.h> -// @@protoc_insertion_point(imports) - -@class ObjectiveCFileOptions; -@class ObjectiveCFileOptionsBuilder; -@class PBDescriptorProto; -@class PBDescriptorProtoBuilder; -@class PBDescriptorProtoExtensionRange; -@class PBDescriptorProtoExtensionRangeBuilder; -@class PBEnumDescriptorProto; -@class PBEnumDescriptorProtoBuilder; -@class PBEnumOptions; -@class PBEnumOptionsBuilder; -@class PBEnumValueDescriptorProto; -@class PBEnumValueDescriptorProtoBuilder; -@class PBEnumValueOptions; -@class PBEnumValueOptionsBuilder; -@class PBFieldDescriptorProto; -@class PBFieldDescriptorProtoBuilder; -@class PBFieldOptions; -@class PBFieldOptionsBuilder; -@class PBFileDescriptorProto; -@class PBFileDescriptorProtoBuilder; -@class PBFileDescriptorSet; -@class PBFileDescriptorSetBuilder; -@class PBFileOptions; -@class PBFileOptionsBuilder; -@class PBMessageOptions; -@class PBMessageOptionsBuilder; -@class PBMethodDescriptorProto; -@class PBMethodDescriptorProtoBuilder; -@class PBMethodOptions; -@class PBMethodOptionsBuilder; -@class PBOneofDescriptorProto; -@class PBOneofDescriptorProtoBuilder; -@class PBServiceDescriptorProto; -@class PBServiceDescriptorProtoBuilder; -@class PBServiceOptions; -@class PBServiceOptionsBuilder; -@class PBSourceCodeInfo; -@class PBSourceCodeInfoBuilder; -@class PBSourceCodeInfoLocation; -@class PBSourceCodeInfoLocationBuilder; -@class PBUninterpretedOption; -@class PBUninterpretedOptionBuilder; -@class PBUninterpretedOptionNamePart; -@class PBUninterpretedOptionNamePartBuilder; -@class RMTEmpty; -@class RMTEmptyBuilder; -@class RMTPayload; -@class RMTPayloadBuilder; -@class RMTResponseParameters; -@class RMTResponseParametersBuilder; -@class RMTSimpleRequest; -@class RMTSimpleRequestBuilder; -@class RMTSimpleResponse; -@class RMTSimpleResponseBuilder; -@class RMTStreamingInputCallRequest; -@class RMTStreamingInputCallRequestBuilder; -@class RMTStreamingInputCallResponse; -@class RMTStreamingInputCallResponseBuilder; -@class RMTStreamingOutputCallRequest; -@class RMTStreamingOutputCallRequestBuilder; -@class RMTStreamingOutputCallResponse; -@class RMTStreamingOutputCallResponseBuilder; - - - -@interface RMTTestRoot : NSObject { -} -+ (PBExtensionRegistry*) extensionRegistry; -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; -@end - - - -@protocol GRXWriteable; -@protocol GRXWriter; - -@protocol RMTTestService <NSObject> - -#pragma mark EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty) - -// One empty request followed by one empty response. -- (void)emptyCallWithRequest:(RMTEmpty *)request - handler:(void(^)(RMTEmpty *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request - handler:(void(^)(RMTEmpty *response, NSError *error))handler; - - -#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) - -// One request followed by one response. -- (void)unaryCallWithRequest:(RMTSimpleRequest *)request - handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request - handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; - - -#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// One request followed by a sequence of responses (streamed download). -// The server returns the payload with client desired type and sizes. -- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - - -#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) - -// A sequence of requests followed by one response (streamed upload). -// The server returns the aggregated size of client payload as the result. -- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; - - -#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// A sequence of requests with each request served by the server immediately. -// As one request could lead to multiple responses, this interface -// demonstrates the idea of full duplexing. -- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - - -#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// A sequence of requests followed by a sequence of responses. -// The server buffers all the client requests and then serves them in order. A -// stream of responses are returned to the client when the server starts with -// first request. -- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -@end - -// Basic service implementation, over gRPC, that only does marshalling and parsing. -@interface RMTTestService : ProtoService<RMTTestService> -- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER; -@end - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.m b/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.m deleted file mode 100644 index 31a3ba3a61..0000000000 --- a/src/objective-c/examples/Sample/RemoteTestClient/Test.pb.m +++ /dev/null @@ -1,163 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#import "Test.pb.h" - -#import <gRPC/GRXWriteable.h> -#import <gRPC/GRXWriter+Immediate.h> -#import <gRPC/ProtoRPC.h> -// @@protoc_insertion_point(imports) - -@implementation RMTTestRoot -static PBExtensionRegistry* extensionRegistry = nil; -+ (PBExtensionRegistry*) extensionRegistry { - return extensionRegistry; -} - -+ (void) initialize { - if (self == [RMTTestRoot class]) { - PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; - [self registerAllExtensions:registry]; - [RMTEmptyRoot registerAllExtensions:registry]; - [RMTMessagesRoot registerAllExtensions:registry]; - [ObjectivecDescriptorRoot registerAllExtensions:registry]; - extensionRegistry = registry; - } -} -+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry { -} -@end - - -static NSString *const kPackageName = @"grpc.testing"; -static NSString *const kServiceName = @"TestService"; - -@implementation RMTTestService - -// Designated initializer -- (instancetype)initWithHost:(NSString *)host { - return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]); -} - -- (instancetype)initWithHost:(NSString *)host - packageName:(NSString *)packageName - serviceName:(NSString *)serviceName { - return [self initWithHost:host]; -} - -#pragma mark EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty) - -// One empty request followed by one empty response. -- (void)emptyCallWithRequest:(RMTEmpty *)request - handler:(void(^)(RMTEmpty *response, NSError *error))handler { - [[self RPCToEmptyCallWithRequest:request handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request - handler:(void(^)(RMTEmpty *response, NSError *error))handler { - return [self RPCToMethod:@"EmptyCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTEmpty class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} - - -#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) - -// One request followed by one response. -- (void)unaryCallWithRequest:(RMTSimpleRequest *)request - handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler { - [[self RPCToUnaryCallWithRequest:request handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request - handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler { - return [self RPCToMethod:@"UnaryCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTSimpleResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} - - -#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// One request followed by a sequence of responses (streamed download). -// The server returns the payload with client desired type and sizes. -- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - [[self RPCToStreamingOutputCallWithRequest:request handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - return [self RPCToMethod:@"StreamingOutputCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} - - -#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) - -// A sequence of requests followed by one response (streamed upload). -// The server returns the aggregated size of client payload as the result. -- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler { - [[self RPCToStreamingInputCallWithRequestsWriter:requestsWriter handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler { - return [self RPCToMethod:@"StreamingInputCall" - requestsWriter:requestsWriter - responseClass:[RMTStreamingInputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} - - -#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// A sequence of requests with each request served by the server immediately. -// As one request could lead to multiple responses, this interface -// demonstrates the idea of full duplexing. -- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - [[self RPCToFullDuplexCallWithRequestsWriter:requestsWriter handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - return [self RPCToMethod:@"FullDuplexCall" - requestsWriter:requestsWriter - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} - - -#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -// A sequence of requests followed by a sequence of responses. -// The server buffers all the client requests and then serves them in order. A -// stream of responses are returned to the client when the server starts with -// first request. -- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - [[self RPCToHalfDuplexCallWithRequestsWriter:requestsWriter handler:handler] start]; -} - -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)requestsWriter - handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler { - return [self RPCToMethod:@"HalfDuplexCall" - requestsWriter:requestsWriter - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} - -@end - -// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.h b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.h new file mode 100644 index 0000000000..aaa0b6ce2d --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.h @@ -0,0 +1,12 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test.proto + +#import "GPBProtocolBuffers.h" + +#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 +#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. +#endif + +CF_EXTERN_C_BEGIN + +CF_EXTERN_C_END diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.m b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.m new file mode 100644 index 0000000000..08562b828a --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.m @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test.proto + +// File empty because all messages, extensions and enum have been filtered. + + +// Dummy symbol that will be stripped but will avoid linker warnings about +// no symbols in the .o form compiling this file. +static int RMTTestRoot_dummy __attribute__((unused,used)) = 0; diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.h b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.h new file mode 100644 index 0000000000..f799c4fc92 --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.h @@ -0,0 +1,59 @@ +#import "Test.pbobjc.h" +#import <gRPC/ProtoService.h> + +#import "Empty.pbobjc.h" +#import "Messages.pbobjc.h" + +@protocol GRXWriteable; +@protocol GRXWriter; + +@protocol RMTTestService <NSObject> + +#pragma mark EmptyCall(Empty) returns (Empty) + +- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler; + +- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler; + + +#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) + +- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; + +- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; + + +#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + +- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + + +#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) + +- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; + +- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; + + +#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + +- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + + +#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + +- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; + + +@end + +// Basic service implementation, over gRPC, that only does marshalling and parsing. +@interface RMTTestService : ProtoService<RMTTestService> +- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER; +@end diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.m b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.m new file mode 100644 index 0000000000..faba07769e --- /dev/null +++ b/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.m @@ -0,0 +1,96 @@ +#import "Test.pbrpc.h" +#import <gRPC/GRXWriteable.h> +#import <gRPC/GRXWriter+Immediate.h> +#import <gRPC/ProtoRPC.h> + +static NSString *const kPackageName = @"grpc.testing"; +static NSString *const kServiceName = @"TestService"; + +@implementation RMTTestService + +// Designated initializer +- (instancetype)initWithHost:(NSString *)host { + return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]); +} + +// Override superclass initializer to disallow different package and service names. +- (instancetype)initWithHost:(NSString *)host + packageName:(NSString *)packageName + serviceName:(NSString *)serviceName { + return [self initWithHost:host]; +} + + +#pragma mark EmptyCall(Empty) returns (Empty) + +- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{ + [[self RPCToEmptyCallWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{ + return [self RPCToMethod:@"EmptyCall" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[RMTEmpty class] + responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; +} +#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) + +- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{ + [[self RPCToUnaryCallWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{ + return [self RPCToMethod:@"UnaryCall" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[RMTSimpleResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; +} +#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + [[self RPCToStreamingOutputCallWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + return [self RPCToMethod:@"StreamingOutputCall" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[RMTStreamingOutputCallResponse class] + responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; +} +#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) + +- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{ + [[self RPCToStreamingInputCallWithRequestsWriter:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{ + return [self RPCToMethod:@"StreamingInputCall" + requestsWriter:request + responseClass:[RMTStreamingInputCallResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; +} +#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + [[self RPCToFullDuplexCallWithRequestsWriter:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + return [self RPCToMethod:@"FullDuplexCall" + requestsWriter:request + responseClass:[RMTStreamingOutputCallResponse class] + responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; +} +#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) + +- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + [[self RPCToHalfDuplexCallWithRequestsWriter:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ + return [self RPCToMethod:@"HalfDuplexCall" + requestsWriter:request + responseClass:[RMTStreamingOutputCallResponse class] + responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; +} +@end diff --git a/src/objective-c/examples/Sample/RemoteTestClient/empty.proto b/src/objective-c/examples/Sample/RemoteTestClient/empty.proto index 3b626ab131..a678048289 100644 --- a/src/objective-c/examples/Sample/RemoteTestClient/empty.proto +++ b/src/objective-c/examples/Sample/RemoteTestClient/empty.proto @@ -27,13 +27,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -syntax = "proto2"; - -import "google/protobuf/objectivec-descriptor.proto"; +syntax = "proto3"; package grpc.testing; -option (google.protobuf.objectivec_file_options).class_prefix = "RMT"; +option objc_class_prefix = "RMT"; // An empty message that you can re-use to avoid defining duplicated empty // messages in your project. A typical example is to use it as argument or the diff --git a/src/objective-c/examples/Sample/RemoteTestClient/messages.proto b/src/objective-c/examples/Sample/RemoteTestClient/messages.proto index ab8577401f..85d93c2ff9 100644 --- a/src/objective-c/examples/Sample/RemoteTestClient/messages.proto +++ b/src/objective-c/examples/Sample/RemoteTestClient/messages.proto @@ -29,13 +29,11 @@ // Message definitions to be used by integration test service definitions. -syntax = "proto2"; - -import "google/protobuf/objectivec-descriptor.proto"; +syntax = "proto3"; package grpc.testing; -option (google.protobuf.objectivec_file_options).class_prefix = "RMT"; +option objc_class_prefix = "RMT"; // The type of payload that should be returned. enum PayloadType { @@ -52,46 +50,46 @@ enum PayloadType { // A block of data, to simply increase gRPC message size. message Payload { // The type of data in body. - optional PayloadType type = 1; + PayloadType type = 1; // Primary contents of payload. - optional bytes body = 2; + bytes body = 2; } // Unary request. message SimpleRequest { // Desired payload type in the response from the server. // If response_type is RANDOM, server randomly chooses one from other formats. - optional PayloadType response_type = 1; + PayloadType response_type = 1; // Desired payload size in the response from the server. // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 response_size = 2; + int32 response_size = 2; // Optional input payload sent along with the request. - optional Payload payload = 3; + Payload payload = 3; // Whether SimpleResponse should include username. - optional bool fill_username = 4; + bool fill_username = 4; // Whether SimpleResponse should include OAuth scope. - optional bool fill_oauth_scope = 5; + bool fill_oauth_scope = 5; } // Unary response, as configured by the request. message SimpleResponse { // Payload to increase message size. - optional Payload payload = 1; + Payload payload = 1; // The user the request came from, for verifying authentication was // successful when the client expected it. - optional string username = 2; + string username = 2; // OAuth scope. - optional string oauth_scope = 3; + string oauth_scope = 3; } // Client-streaming request. message StreamingInputCallRequest { // Optional input payload sent along with the request. - optional Payload payload = 1; + Payload payload = 1; // Not expecting any payload from the response. } @@ -99,18 +97,18 @@ message StreamingInputCallRequest { // Client-streaming response. message StreamingInputCallResponse { // Aggregated size of payloads received from the client. - optional int32 aggregated_payload_size = 1; + int32 aggregated_payload_size = 1; } // Configuration for a particular response. message ResponseParameters { // Desired payload sizes in responses from the server. // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 size = 1; + int32 size = 1; // Desired interval between consecutive responses in the response stream in // microseconds. - optional int32 interval_us = 2; + int32 interval_us = 2; } // Server-streaming request. @@ -119,17 +117,17 @@ message StreamingOutputCallRequest { // If response_type is RANDOM, the payload from each response in the stream // might be of different types. This is to simulate a mixed type of payload // stream. - optional PayloadType response_type = 1; + PayloadType response_type = 1; // Configuration for each expected response message. repeated ResponseParameters response_parameters = 2; // Optional input payload sent along with the request. - optional Payload payload = 3; + Payload payload = 3; } // Server-streaming response, as configured by the request and parameters. message StreamingOutputCallResponse { // Payload to increase response size. - optional Payload payload = 1; + Payload payload = 1; } diff --git a/src/objective-c/examples/Sample/RemoteTestClient/test.proto b/src/objective-c/examples/Sample/RemoteTestClient/test.proto index 4b08220599..2f5a5489b3 100644 --- a/src/objective-c/examples/Sample/RemoteTestClient/test.proto +++ b/src/objective-c/examples/Sample/RemoteTestClient/test.proto @@ -29,15 +29,14 @@ // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. -syntax = "proto2"; +syntax = "proto3"; import "empty.proto"; import "messages.proto"; -import "google/protobuf/objectivec-descriptor.proto"; package grpc.testing; -option (google.protobuf.objectivec_file_options).class_prefix = "RMT"; +option objc_class_prefix = "RMT"; // A simple service to test the various types of RPCs and experiment with // performance with various types of payload. @@ -51,24 +50,24 @@ service TestService { // One request followed by a sequence of responses (streamed download). // The server returns the payload with client desired type and sizes. -// rpc StreamingOutputCall(StreamingOutputCallRequest) -// returns (stream StreamingOutputCallResponse); + rpc StreamingOutputCall(StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); // A sequence of requests followed by one response (streamed upload). // The server returns the aggregated size of client payload as the result. -// rpc StreamingInputCall(stream StreamingInputCallRequest) -// returns (StreamingInputCallResponse); + rpc StreamingInputCall(stream StreamingInputCallRequest) + returns (StreamingInputCallResponse); // A sequence of requests with each request served by the server immediately. // As one request could lead to multiple responses, this interface // demonstrates the idea of full duplexing. -// rpc FullDuplexCall(stream StreamingOutputCallRequest) -// returns (stream StreamingOutputCallResponse); + rpc FullDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); // A sequence of requests followed by a sequence of responses. // The server buffers all the client requests and then serves them in order. A // stream of responses are returned to the client when the server starts with // first request. -// rpc HalfDuplexCall(stream StreamingOutputCallRequest) -// returns (stream StreamingOutputCallResponse); + rpc HalfDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); } |