BuiltUserRoleMapper Class Reference

Inherits from NSObject
Declared in BuiltUserRoleMapper.h

Other Methods

  uid

The uid of the object

@property (nullable, nonatomic, copy) NSString *uid

Discussion

//Assuming ‘mapperObject’ is a BuiltUserRoleMapper instance

 //Obj-C
 NSString *objectUID = mapperObject.uid;

 //Swift
 var objectUID:String = mapperObject.uid

Declared In

BuiltUserRoleMapper.h

  roleUid

The roleUid of the object

@property (nonatomic, copy) NSString *roleUid

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSString *objectUID = mapperObject.roleUid;

 //Swift
 var objectUID:String = mapperObject.roleUid

Declared In

BuiltUserRoleMapper.h

  mapperRole

The role object for role_uid (When object is fetched using includeReference of role uid it returns role object)

@property (nonatomic, strong) BuiltRole *mapperRole

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 BuiltRole *roleObj = mapperObject.role;

 //Swift
 var roleObj:BuiltRole = mapperObject.role

Declared In

BuiltUserRoleMapper.h

  userUid

The userUid of the object

@property (nonatomic, strong) NSString *userUid

Discussion

//Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSString *objectUID = mapperObject.userUid;

 //Swift
 var objectUID:String = mapperObject.userUid

Declared In

BuiltUserRoleMapper.h

  mapperUser

The user object for user_uid (When object is fetched using includeReference of user uid it returns user object)

@property (nonatomic, strong) BuiltUser *mapperUser

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 BuiltUser *userObj = mapperObject.user;

 //Swift
 var userObj:BuiltUser = mapperObject.user

Declared In

BuiltUserRoleMapper.h

  ACL

ACL for the object

@property (nonatomic, strong) BuiltACL *ACL

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 BuiltACL *builtAcl = mapperObject.ACL;

 //Swift
 var builtAcl:BuiltACL = mapperObject.ACL

Declared In

BuiltUserRoleMapper.h

  deleted

Check if the object is deleted or not [Gets used in delta calls].

@property (nonatomic, assign, readonly, getter=isDeleted) BOOL deleted

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 if (mapperObject.isDeleted) {
 //object is deleted
 } else {
 //object is not yet delete
 }

 //Swift
 if (mapperObject.isDeleted()) {
 //object is deleted
 } else {
 //object is not yet delete
 }

Declared In

BuiltUserRoleMapper.h

  createdAt

Created date of object.

@property (nonatomic, readonly) NSDate *createdAt

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSDate *objectCreatedDate = mapperObject.createdAt;

 //Swift
 var objectCreatedDate:Date = mapperObject.createdAt

Declared In

BuiltUserRoleMapper.h

  updatedAt

Last updated date of object.

@property (nonatomic, readonly) NSDate *updatedAt

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSDate *objectUpdatedDate = mapperObject.updatedAt;

 //Swift
 var objectUpdatedDate:Date = mapperObject.updatedAt

Declared In

BuiltUserRoleMapper.h

  deletedAt

Deleted date of object.

@property (nonatomic, readonly) NSDate *deletedAt

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSDate *objectDeletedDate = mapperObject.deletedAt;

 //Swift
 var objectDeletedDate:Date = mapperObject.deletedAt

Declared In

BuiltUserRoleMapper.h

– objectForKey:

Gets the data for given property.

- (BUILT_NULLABLE id)objectForKey:(NSString *)key

Parameters

key

The object’s property

Return Value

The value for the key provided

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 id object = [mapperObject objectForKey:@"key"];

 //Swift
 var object = mapperObject.objectForKey("key")

Declared In

BuiltUserRoleMapper.h

Owner

– hasOwner

Check if object has owner

- (BOOL)hasOwner

Return Value

YES if object has owner else NO

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 if (mapperObject.hasOwner) {
 //Object has a owner
 } else {
 //Object has no owner
 }


 //Swift
 if (mapperObject.hasOwner()) {
 //Object has a owner
 } else {
 //Object has no owner
 }

Declared In

BuiltUserRoleMapper.h

– owner

Returns owner if the object has owner

- (BUILT_NULLABLE id)owner

Return Value

Owner of the object

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 id objectOwner = [mapperObject owner];

 //Swift
 var owner:AnyObject = mapperObject.owner()

Declared In

BuiltUserRoleMapper.h

– ownerUID

Get the UID of the owner of the object

- (BUILT_NULLABLE NSString *)ownerUID

Return Value

UID of the owner

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSString *objectOwnerUID = [mapperObject ownerUID];

 //Swift
 var objectOwnerUID:String = mapperObject.ownerUID()

Declared In

BuiltUserRoleMapper.h

– ownerEmail

Get the email of the owner of the object

- (BUILT_NULLABLE NSString *)ownerEmail

Return Value

email of the owner of the object

Discussion

 //Assuming 'mapperObject' is a BuiltUserRoleMapper instance

 //Obj-C
 NSString *objectOwnerEmail = [mapperObject ownerEmail];

 //Swift
 var objectOwnerEmail:String = mapperObject.ownerEmail()

Declared In

BuiltUserRoleMapper.h

Object fetch

– fetch:

Fetches an object asynchronously provided object UID

- (void)fetch:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject  = [builtApplication userRoleMapperWithUID:@"bltf50esamplefeb"];
 [mapperObject  fetch:^(BuiltResponseType responseType, NSError *error) {

 }];


 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapperObject:BuiltUserRoleMapper = builtApplication.userRoleMapperWithUID("bltf50esamplefeb")
 mapperObject.fetch { (responseType, error!) -> Void in

}

Declared In

BuiltUserRoleMapper.h

Save

– saveAsDraft:

Saves an mapper object as draft asyncronously so that it is not visible unless explicitly called for. see including drafts //Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltUserRoleMapper mapper = [builtApplication userRoleMapper]; mapper.roleUid = @“blt5d4sample2634567j”; mapper.userUid = @“blt345hsamplehg567u”; [mapper saveAsDraft:^(BuiltResponseType responseType, NSError *error) {

- (void)saveAsDraft:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapper:BuiltUserRoleMapper = builtApplication.userRoleMapper()
 mapper.roleUid = "blt5d4sample2634567j"
 mapper.userUid = "blt345hsamplehg567u"
 mapper.saveAsDraft { (responseType, error!) -> Void in

}

Declared In

BuiltUserRoleMapper.h

– save:

Saves an BuiltUserRoleMapper asyncronously to Built.io Backend servers

- (void)save:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapper = [builtApplication userRoleMapper];
 mapper.roleUid = @"blt5d4sample2634567j";
 mapper.userUid = @"blt345hsamplehg567u";
 [mapper save:^(BuiltResponseType responseType, NSError *error) {

}];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapper:BuiltUserRoleMapper = builtApplication.userRoleMapper()
 mapper.roleUid = "blt5d4sample2634567j"
 mapper.userUid = "blt345hsamplehg567u"
 mapper.save { (responseType, error!) -> Void in

}

Declared In

BuiltUserRoleMapper.h

– saveAsDraftEventually:

Saves a mapper object as draft asyncronously so that it is not visible unless explicitly called for. see including drafts

- (void)saveAsDraftEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapper = [builtApplication userRoleMapper];
 mapper.roleUid = @"blt5d4sample2634567j";
 mapper.userUid = @"blt345hsamplehg567u";
 [mapper saveAsDraftEventually:^(BuiltResponseType responseType, NSError *error) {

}];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapper:BuiltUserRoleMapper = builtApplication.userRoleMapper()
 mapper.roleUid = "blt5d4sample2634567j"
 mapper.userUid = "blt345hsamplehg567u"
 mapper.saveAsDraftEventually { (responseType, error!) -> Void in

}

Declared In

BuiltUserRoleMapper.h

– saveEventually:

Saves BuiltUserRoleMapper asyncronously if network is unavailable. Resumes when network becomes available.

- (void)saveEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapper = [builtApplication userRoleMapper];
 mapper.roleUid = @"blt5d4sample2634567j";
 mapper.userUid = @"blt345hsamplehg567u";
 [mapper saveEventually:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapper:BuiltUserRoleMapper = builtApplication.userRoleMapper()
 mapper.roleUid = "blt5d4sample2634567j"
 mapper.userUid = "blt345hsamplehg567u"
 mapper.saveEventually { (responseType, error!) -> Void in

 }

Declared In

BuiltUserRoleMapper.h

Delete

– destroy:

Delete the BuiltUserRoleMapper asyncronously with specified object UID.

- (void)destroy:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject  = [builtApplication userRoleMapperWithUID:@"bltf50esamplefeb"];
 [mapperObject  destroy:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapperObject:BuiltUserRoleMapper = builtApplication.userRoleMapperWithUID("bltf50esamplefeb")
 mapperObject.destroy { (responseType, error!) -> Void in

  }

Declared In

BuiltUserRoleMapper.h

– destroyEventually:

Delete the BuiltUserRoleMapper asyncronously with specified object UID. Drafts the operation if network is unavailable. Resumes after network is back.

- (void)destroyEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, id responseJSON, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject  = [builtApplication userRoleMapperWithUID:@"bltf50esamplefeb"];
 [mapperObject  destroyEventually:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapperObject:BuiltUserRoleMapper = builtApplication.userRoleMapperWithUID("bltf50esamplefeb")
 mapperObject.destroyEventually { (responseType, error!) -> Void in

 }

Declared In

BuiltUserRoleMapper.h

Include Reference

– includeReference:

Include reference objects with given key in response

- (void)includeReference:(NSArray *)key

Parameters

key

Array of reference keys to include in response.

Discussion

 //Obj-C
 [mapperObject includeReference:@[@"role_uid"]];

 //Swift
 mapperObject.includeReference(["role_uid"])

The include parameter accepts the name of a reference field. By default, no reference field is bought along with the object, only the uids are. To include any reference, this parameter must be used. Nested references can be bought by “.” separating the references. This will work for references which are nested inside groups or references which are nested inside other references.

Declared In

BuiltUserRoleMapper.h

– includeReference:onlyFields:

Specifies an array of ‘only’ keys in reference class object that would be included in the response.

- (void)includeReference:(NSString *)key onlyFields:(NSArray *)fieldUIDs

Parameters

key

Key who has reference to some other class object.

fieldUIDs

Array of the ‘only’ reference keys to be included in response.

Discussion

 //Obj-C
 [mapperObject includeReference:@[@"role_uid"] onlyFields:@[@"role_uid"]];

 //Swift
 mapperObject.includeReference(["role_uid"], onlyFields:["role_uid"])

Specifies an array of keys in reference class object that would be included in the response.

Declared In

BuiltUserRoleMapper.h

– includeReference:excludingFields:

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

- (void)includeReference:(NSString *)key excludingFields:(NSArray *)fieldUIDs

Parameters

key

Key who has reference to some other class object.

fieldUIDs

Array of the ‘only’ reference keys to be ‘excluded’ from the response.

Discussion

 //Obj-C
 [mapperObject includeReference:@[@"role_uid"] excludingFields:@[@"user_uid"]];

 //Swift
 mapperObject.includeReference(["role_uid"], excludingFields:["user_uid"])

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

Declared In

BuiltUserRoleMapper.h

Additional Options

– includeOwner

Include the owner’s profile in the objects' data.

- (void)includeOwner

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject  = [builtApplication userRoleMapperWithUID:@"bltf50esamplefeb"];
 [mapperObject includeOwner];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 BuiltUserRoleMapper *mapperObject  = [builtApplication userRoleMapperWithUID:@"bltf50esamplefeb"];
 mapperObject.includeOwner()

The returned objects will also contain a key “_owner”, which will include the owner’s profile in the object’s data.

Declared In

BuiltUserRoleMapper.h

Configure

– configureWithDictionary:

Configure user properties with mapper object info.

- (void)configureWithDictionary:(NSDictionary *)dictionary

Parameters

dictionary

User Info

Discussion

 //Obj-C
 [mapperObject configureWithDictionary:@{@"role_uid":@"MyValue"}];

 //Swift
 mapperObject.configureWithDictionary(["role_uid":"MyValue"])

Declared In

BuiltUserRoleMapper.h

Cancel Network calls

– cancelRequests

Advises the operation object that it should stop executing its task.

 //Obj-C
 [mapperObject cancelRequests];

 //Swift
 mapperObject.cancelRequests()
- (void)cancelRequests

Discussion

This method does not force your operation code to stop. Instead, it updates the object’s internal flags to reflect the change in state. If the operation has already finished executing, this method has no effect. Canceling an operation that is currently in an operation queue, but not yet executing, makes it possible to remove the operation from the queue sooner than usual.

Declared In

BuiltUserRoleMapper.h