Profile services

Profile

Get profile:

[client.services.profile getProfileForProfileID:@"<PROFILE-ID>" completion:^(CMPResult<CMPProfile *> * result) {
    if (result.error) {
        // error occurred
    } else {
        // success
    }
}];
client.services.profile.getProfile(profileID: "") { (result) in
    if let err = result.error {
        // error occurred
    } else if let obj = result.object {
        // success
    }
}

Query profiles with query builder:

[client.services.profile queryProfilesWithQueryElements:@[] completion:^(CMPResult<NSArray<CMPProfile *> *> * result) {
    if (result.error) {
        // error occurred
    } else {
        // success
    }
}];
client.services.profile.queryProfiles(queryElements: [.init(key: "email", element: .contains, value: "new")]) { (result) in
    if let err = result.error {
        // error occurred
    } else if let obj = result.object {
        // success
    }
}

Patch profile:

[client.services.profile patchProfileForProfileID:@"<PROFILE-ID>" attributes:@{@"email" : @"[email protected]"} eTag:nil completion:^(CMPResult<CMPProfile *> * result) {
    if (result.error) {
        // error occurred
    } else {
        // success
    }
}];
client.services.profile.patchProfile(profileID: "profileId", attributes: ["email" : "[email protected]"], eTag: nil) { (result) in
    if let err = result.error {
        // error occurred
    } else if let obj = result.object {
        // success
    }
}

Update profile:

[client.services.profile updateProfileForProfileID:@"<PROFILE-ID>" attributes:@{@"email" : @"[email protected]"} eTag:nil completion:^(CMPResult<CMPProfile *> * result) {
    if (result.error) {
        // error occurred
    } else {
        // success
    }
}];
client.services.profile.updateProfile(profileID: "profileId", attributes: ["email" : "[email protected]"], eTag: nil) { (result) in
    if let err = result.error {
        // error occurred
    } else if let obj = result.object {
        // success
    }
}