

#import "SWGInlineObjectManagedObjectBuilder.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 SWGInlineObjectManagedObjectBuilder

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

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

-(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context {
    SWGInlineObjectManagedObject* newSWGInlineObject = [self createNewSWGInlineObjectManagedObjectInContext:context];
    [self updateSWGInlineObjectManagedObject:newSWGInlineObject withSWGInlineObject:object];
    return newSWGInlineObject;
}

-(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)managedObject withSWGInlineObject:(SWGInlineObject*)object {
    if(!managedObject || !object) {
        return;
    }
    NSManagedObjectContext* context = managedObject.managedObjectContext;
    managedObject.name = [object.name copy];
    managedObject.status = [object.status copy];

}

-(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj {
    if(!obj) {
        return nil;
    }
    SWGInlineObject* newSWGInlineObject = [[SWGInlineObject alloc] init];
    [self updateSWGInlineObject:newSWGInlineObject withSWGInlineObjectManagedObject:obj];
    return newSWGInlineObject;
}

-(void)updateSWGInlineObject:(SWGInlineObject*)newSWGInlineObject withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj {
    newSWGInlineObject.name = [obj.name copy];
    newSWGInlineObject.status = [obj.status copy];
}

@end
