// Generated by the protocol buffer compiler.  DO NOT EDIT!

#import "PinpadKeysRequest.pb.h"

@implementation PinpadKeysRequestRoot
static PBExtensionRegistry* extensionRegistry = nil;
+ (PBExtensionRegistry*) extensionRegistry {
  return extensionRegistry;
}

+ (void) initialize {
  if (self == [PinpadKeysRequestRoot class]) {
    PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry];
    [self registerAllExtensions:registry];
    extensionRegistry = [registry retain];
  }
}
+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry {
}
@end

@interface PinpadKeysRequest ()
@property (retain) NSString* serialNo;
@property (retain) NSString* terminalId;
@end

@implementation PinpadKeysRequest

- (BOOL) hasSerialNo {
  return !!hasSerialNo_;
}
- (void) setHasSerialNo:(BOOL) value {
  hasSerialNo_ = !!value;
}
@synthesize serialNo;
- (BOOL) hasTerminalId {
  return !!hasTerminalId_;
}
- (void) setHasTerminalId:(BOOL) value {
  hasTerminalId_ = !!value;
}
@synthesize terminalId;
- (void) dealloc {
  self.serialNo = nil;
  self.terminalId = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.serialNo = @"";
    self.terminalId = @"";
  }
  return self;
}
static PinpadKeysRequest* defaultPinpadKeysRequestInstance = nil;
+ (void) initialize {
  if (self == [PinpadKeysRequest class]) {
    defaultPinpadKeysRequestInstance = [[PinpadKeysRequest alloc] init];
  }
}
+ (PinpadKeysRequest*) defaultInstance {
  return defaultPinpadKeysRequestInstance;
}
- (PinpadKeysRequest*) defaultInstance {
  return defaultPinpadKeysRequestInstance;
}
- (BOOL) isInitialized {
  return YES;
}
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output {
  if (self.hasSerialNo) {
    [output writeString:1 value:self.serialNo];
  }
  if (self.hasTerminalId) {
    [output writeString:2 value:self.terminalId];
  }
  [self.unknownFields writeToCodedOutputStream:output];
}
- (int32_t) serializedSize {
  int32_t size = memoizedSerializedSize;
  if (size != -1) {
    return size;
  }

  size = 0;
  if (self.hasSerialNo) {
    size += computeStringSize(1, self.serialNo);
  }
  if (self.hasTerminalId) {
    size += computeStringSize(2, self.terminalId);
  }
  size += self.unknownFields.serializedSize;
  memoizedSerializedSize = size;
  return size;
}
+ (PinpadKeysRequest*) parseFromData:(NSData*) data {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromData:data] build];
}
+ (PinpadKeysRequest*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromData:data extensionRegistry:extensionRegistry] build];
}
+ (PinpadKeysRequest*) parseFromInputStream:(NSInputStream*) input {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromInputStream:input] build];
}
+ (PinpadKeysRequest*) parseDelimitedFromInputStream:(NSInputStream*) input {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeDelimitedFromInputStream:input] build];
}
+ (PinpadKeysRequest*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PinpadKeysRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromCodedInputStream:input] build];
}
+ (PinpadKeysRequest*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PinpadKeysRequest*)[[[PinpadKeysRequest builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PinpadKeysRequest_Builder*) builder {
  return [[[PinpadKeysRequest_Builder alloc] init] autorelease];
}
+ (PinpadKeysRequest_Builder*) builderWithPrototype:(PinpadKeysRequest*) prototype {
  return [[PinpadKeysRequest builder] mergeFrom:prototype];
}
- (PinpadKeysRequest_Builder*) builder {
  return [PinpadKeysRequest builder];
}
@end

@interface PinpadKeysRequest_Builder()
@property (retain) PinpadKeysRequest* result;
@end

@implementation PinpadKeysRequest_Builder
@synthesize result;
- (void) dealloc {
  self.result = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.result = [[[PinpadKeysRequest alloc] init] autorelease];
  }
  return self;
}
- (PBGeneratedMessage*) internalGetResult {
  return result;
}
- (PinpadKeysRequest_Builder*) clear {
  self.result = [[[PinpadKeysRequest alloc] init] autorelease];
  return self;
}
- (PinpadKeysRequest_Builder*) clone {
  return [PinpadKeysRequest builderWithPrototype:result];
}
- (PinpadKeysRequest*) defaultInstance {
  return [PinpadKeysRequest defaultInstance];
}
- (PinpadKeysRequest*) build {
  [self checkInitialized];
  return [self buildPartial];
}
- (PinpadKeysRequest*) buildPartial {
  PinpadKeysRequest* returnMe = [[result retain] autorelease];
  self.result = nil;
  return returnMe;
}
- (PinpadKeysRequest_Builder*) mergeFrom:(PinpadKeysRequest*) other {
  if (other == [PinpadKeysRequest defaultInstance]) {
    return self;
  }
  if (other.hasSerialNo) {
    [self setSerialNo:other.serialNo];
  }
  if (other.hasTerminalId) {
    [self setTerminalId:other.terminalId];
  }
  [self mergeUnknownFields:other.unknownFields];
  return self;
}
- (PinpadKeysRequest_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input {
  return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]];
}
- (PinpadKeysRequest_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  PBUnknownFieldSet_Builder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields];
  while (YES) {
    int32_t 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: {
        [self setSerialNo:[input readString]];
        break;
      }
      case 18: {
        [self setTerminalId:[input readString]];
        break;
      }
    }
  }
}
- (BOOL) hasSerialNo {
  return result.hasSerialNo;
}
- (NSString*) serialNo {
  return result.serialNo;
}
- (PinpadKeysRequest_Builder*) setSerialNo:(NSString*) value {
  result.hasSerialNo = YES;
  result.serialNo = value;
  return self;
}
- (PinpadKeysRequest_Builder*) clearSerialNo {
  result.hasSerialNo = NO;
  result.serialNo = @"";
  return self;
}
- (BOOL) hasTerminalId {
  return result.hasTerminalId;
}
- (NSString*) terminalId {
  return result.terminalId;
}
- (PinpadKeysRequest_Builder*) setTerminalId:(NSString*) value {
  result.hasTerminalId = YES;
  result.terminalId = value;
  return self;
}
- (PinpadKeysRequest_Builder*) clearTerminalId {
  result.hasTerminalId = NO;
  result.terminalId = @"";
  return self;
}
@end

