// This file was automatically generated by protocompiler
// DO NOT EDIT!
// Compiled from MockAKSOptionalParameters.proto

#import "MockAKSOptionalParameters.h"
#import <ProtocolBuffer/PBConstants.h>
#import <ProtocolBuffer/PBHashUtil.h>
#import <ProtocolBuffer/PBDataReader.h>

#if !__has_feature(objc_arc)
# error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
#endif

@implementation MockAKSOptionalParameters

- (BOOL)hasAccessGroups
{
    return _accessGroups != nil;
}
@synthesize accessGroups = _accessGroups;
- (BOOL)hasExternalData
{
    return _externalData != nil;
}
@synthesize externalData = _externalData;
- (BOOL)hasAcmHandle
{
    return _acmHandle != nil;
}
@synthesize acmHandle = _acmHandle;

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
}

- (NSDictionary *)dictionaryRepresentation
{
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    if (self->_accessGroups)
    {
        [dict setObject:self->_accessGroups forKey:@"access_groups"];
    }
    if (self->_externalData)
    {
        [dict setObject:self->_externalData forKey:@"external_data"];
    }
    if (self->_acmHandle)
    {
        [dict setObject:self->_acmHandle forKey:@"acm_handle"];
    }
    return dict;
}

BOOL MockAKSOptionalParametersReadFrom(__unsafe_unretained MockAKSOptionalParameters *self, __unsafe_unretained PBDataReader *reader) {
    while (PBReaderHasMoreData(reader)) {
        uint32_t tag = 0;
        uint8_t aType = 0;

        PBReaderReadTag32AndType(reader, &tag, &aType);

        if (PBReaderHasError(reader))
            break;

        if (aType == TYPE_END_GROUP) {
            break;
        }

        switch (tag) {

            case 1 /* accessGroups */:
            {
                NSData *new_accessGroups = PBReaderReadData(reader);
                self->_accessGroups = new_accessGroups;
            }
            break;
            case 2 /* externalData */:
            {
                NSData *new_externalData = PBReaderReadData(reader);
                self->_externalData = new_externalData;
            }
            break;
            case 3 /* acmHandle */:
            {
                NSData *new_acmHandle = PBReaderReadData(reader);
                self->_acmHandle = new_acmHandle;
            }
            break;
            default:
                if (!PBReaderSkipValueWithTag(reader, tag, aType))
                    return NO;
                break;
        }
    }
    return !PBReaderHasError(reader);
}

- (BOOL)readFrom:(PBDataReader *)reader
{
    return MockAKSOptionalParametersReadFrom(self, reader);
}
- (void)writeTo:(PBDataWriter *)writer
{
    /* accessGroups */
    {
        if (self->_accessGroups)
        {
            PBDataWriterWriteDataField(writer, self->_accessGroups, 1);
        }
    }
    /* externalData */
    {
        if (self->_externalData)
        {
            PBDataWriterWriteDataField(writer, self->_externalData, 2);
        }
    }
    /* acmHandle */
    {
        if (self->_acmHandle)
        {
            PBDataWriterWriteDataField(writer, self->_acmHandle, 3);
        }
    }
}

- (void)copyTo:(MockAKSOptionalParameters *)other
{
    if (_accessGroups)
    {
        other.accessGroups = _accessGroups;
    }
    if (_externalData)
    {
        other.externalData = _externalData;
    }
    if (_acmHandle)
    {
        other.acmHandle = _acmHandle;
    }
}

- (id)copyWithZone:(NSZone *)zone
{
    MockAKSOptionalParameters *copy = [[[self class] allocWithZone:zone] init];
    copy->_accessGroups = [_accessGroups copyWithZone:zone];
    copy->_externalData = [_externalData copyWithZone:zone];
    copy->_acmHandle = [_acmHandle copyWithZone:zone];
    return copy;
}

- (BOOL)isEqual:(id)object
{
    MockAKSOptionalParameters *other = (MockAKSOptionalParameters *)object;
    return [other isMemberOfClass:[self class]]
    &&
    ((!self->_accessGroups && !other->_accessGroups) || [self->_accessGroups isEqual:other->_accessGroups])
    &&
    ((!self->_externalData && !other->_externalData) || [self->_externalData isEqual:other->_externalData])
    &&
    ((!self->_acmHandle && !other->_acmHandle) || [self->_acmHandle isEqual:other->_acmHandle])
    ;
}

- (NSUInteger)hash
{
    return 0
    ^
    [self->_accessGroups hash]
    ^
    [self->_externalData hash]
    ^
    [self->_acmHandle hash]
    ;
}

- (void)mergeFrom:(MockAKSOptionalParameters *)other
{
    if (other->_accessGroups)
    {
        [self setAccessGroups:other->_accessGroups];
    }
    if (other->_externalData)
    {
        [self setExternalData:other->_externalData];
    }
    if (other->_acmHandle)
    {
        [self setAcmHandle:other->_acmHandle];
    }
}

@end

