

#import "SWGApiResponseManagedObjectBuilder.h"

/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/

@implementation SWGApiResponseManagedObjectBuilder

-(instancetype)init {
    self = [super init];
    if (self != nil) {
    }
    return self;
}

-(SWGApiResponseManagedObject*)createNewSWGApiResponseManagedObjectInContext:(NSManagedObjectContext*)context {
    SWGApiResponseManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGApiResponseManagedObject class]) inManagedObjectContext:context];
    return managedObject;
}

-(SWGApiResponseManagedObject*)SWGApiResponseManagedObjectFromSWGApiResponse:(SWGApiResponse*)object context:(NSManagedObjectContext*)context {
    SWGApiResponseManagedObject* newSWGApiResponse = [self createNewSWGApiResponseManagedObjectInContext:context];
    [self updateSWGApiResponseManagedObject:newSWGApiResponse withSWGApiResponse:object];
    return newSWGApiResponse;
}

-(void)updateSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)managedObject withSWGApiResponse:(SWGApiResponse*)object {
    if(!managedObject || !object) {
        return;
    }
    NSManagedObjectContext* context = managedObject.managedObjectContext;
    managedObject.code = [object.code copy];
    managedObject.type = [object.type copy];
    managedObject.message = [object.message copy];

}

-(SWGApiResponse*)SWGApiResponseFromSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)obj {
    if(!obj) {
        return nil;
    }
    SWGApiResponse* newSWGApiResponse = [[SWGApiResponse alloc] init];
    [self updateSWGApiResponse:newSWGApiResponse withSWGApiResponseManagedObject:obj];
    return newSWGApiResponse;
}

-(void)updateSWGApiResponse:(SWGApiResponse*)newSWGApiResponse withSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)obj {
    newSWGApiResponse.code = [obj.code copy];
    newSWGApiResponse.type = [obj.type copy];
    newSWGApiResponse.message = [obj.message copy];
}

@end
