

#import "SWGTagManagedObjectBuilder.h"

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

@implementation SWGTagManagedObjectBuilder

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

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

-(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)object context:(NSManagedObjectContext*)context {
    SWGTagManagedObject* newSWGTag = [self createNewSWGTagManagedObjectInContext:context];
    [self updateSWGTagManagedObject:newSWGTag withSWGTag:object];
    return newSWGTag;
}

-(void)updateSWGTagManagedObject:(SWGTagManagedObject*)managedObject withSWGTag:(SWGTag*)object {
    if(!managedObject || !object) {
        return;
    }
    NSManagedObjectContext* context = managedObject.managedObjectContext;
    managedObject._id = [object._id copy];
    managedObject.name = [object.name copy];

}

-(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj {
    if(!obj) {
        return nil;
    }
    SWGTag* newSWGTag = [[SWGTag alloc] init];
    [self updateSWGTag:newSWGTag withSWGTagManagedObject:obj];
    return newSWGTag;
}

-(void)updateSWGTag:(SWGTag*)newSWGTag withSWGTagManagedObject:(SWGTagManagedObject*)obj {
    newSWGTag._id = [obj._id copy];
    newSWGTag.name = [obj.name copy];
}

@end
