Search in sources :

Example 6 with ComplexKeyGroupMembership

use of com.linkedin.restli.examples.groups.api.ComplexKeyGroupMembership in project rest.li by linkedin.

the class GroupMembershipsResource3 method fromGroupMembership.

private static ComplexKeyGroupMembership fromGroupMembership(GroupMembership groupMembership) {
    if (groupMembership == null) {
        return null;
    }
    ComplexKeyGroupMembership complexKeyGroupMembership = new ComplexKeyGroupMembership(groupMembership.data());
    GroupMembershipKey groupMembershipKey = new GroupMembershipKey();
    groupMembershipKey.setGroupID(groupMembership.getGroupID());
    groupMembershipKey.setMemberID(groupMembership.getMemberID());
    complexKeyGroupMembership.setId(groupMembershipKey);
    return complexKeyGroupMembership;
}
Also used : GroupMembershipKey(com.linkedin.restli.examples.groups.api.GroupMembershipKey) ComplexKeyGroupMembership(com.linkedin.restli.examples.groups.api.ComplexKeyGroupMembership)

Example 7 with ComplexKeyGroupMembership

use of com.linkedin.restli.examples.groups.api.ComplexKeyGroupMembership in project rest.li by linkedin.

the class TestGroupsClient method buildComplexKeyGroupMembership.

private static ComplexKeyGroupMembership buildComplexKeyGroupMembership(GroupMembershipKey id, String contactEmail, String firstName, String lastName) {
    ComplexKeyGroupMembership groupMembership = new ComplexKeyGroupMembership();
    groupMembership.setId(id);
    groupMembership.setContactEmail(contactEmail);
    groupMembership.setFirstName(firstName);
    groupMembership.setLastName(lastName);
    // These fields must be set when creating a stand-alone group membership,
    // lest the membership be considered incomplete.
    groupMembership.setAllowMessagesFromMembers(true);
    groupMembership.setEmailAnnouncementsFromManagers(true);
    groupMembership.setEmailDigestFrequency(EmailDigestFrequency.WEEKLY);
    groupMembership.setEmailForEveryNewPost(true);
    groupMembership.setIsPublicized(true);
    groupMembership.setMembershipLevel(MembershipLevel.MEMBER);
    groupMembership.setWriteLevel(WriteLevel.DEFAULT);
    return groupMembership;
}
Also used : ComplexKeyGroupMembership(com.linkedin.restli.examples.groups.api.ComplexKeyGroupMembership)

Aggregations

ComplexKeyGroupMembership (com.linkedin.restli.examples.groups.api.ComplexKeyGroupMembership)7 GroupMembershipKey (com.linkedin.restli.examples.groups.api.GroupMembershipKey)5 GroupMembershipParam (com.linkedin.restli.examples.groups.api.GroupMembershipParam)3 ComplexResourceKey (com.linkedin.restli.common.ComplexResourceKey)2 Test (org.testng.annotations.Test)2 DataProcessingException (com.linkedin.data.transform.DataProcessingException)1 RestLiResponseException (com.linkedin.restli.client.RestLiResponseException)1 RestliRequestOptions (com.linkedin.restli.client.RestliRequestOptions)1 BatchKVResponse (com.linkedin.restli.client.response.BatchKVResponse)1 CollectionResponse (com.linkedin.restli.common.CollectionResponse)1 CompoundKey (com.linkedin.restli.common.CompoundKey)1 EmptyRecord (com.linkedin.restli.common.EmptyRecord)1 EntityResponse (com.linkedin.restli.common.EntityResponse)1 GroupMembership (com.linkedin.restli.examples.groups.api.GroupMembership)1 GroupMembershipQueryParam (com.linkedin.restli.examples.groups.api.GroupMembershipQueryParam)1 GroupMembershipQueryParamArray (com.linkedin.restli.examples.groups.api.GroupMembershipQueryParamArray)1 GroupMembershipsComplexRequestBuilders (com.linkedin.restli.examples.groups.client.GroupMembershipsComplexRequestBuilders)1 BatchResult (com.linkedin.restli.server.BatchResult)1 RestLiServiceException (com.linkedin.restli.server.RestLiServiceException)1 UpdateResponse (com.linkedin.restli.server.UpdateResponse)1