示例#1
0
        public GroupMember InviteMember(GroupId groupId, GroupMember groupMember)
        {
            string path = template.UrlFor(UrlTemplate.GROUPS_MEMBER_PATH)
                          .Replace("{groupId}", groupId.Id)
                          .Build();

            Silanis.ESL.API.GroupMember apiGroupMember = new GroupMemberConverter(groupMember).ToAPIGroupMember();
            try {
                string json     = JsonConvert.SerializeObject(apiGroupMember, settings);
                string response = restClient.Post(path, json);
                Silanis.ESL.API.GroupMember apiResponse = JsonConvert.DeserializeObject <Silanis.ESL.API.GroupMember> (response);
                return(new GroupMemberConverter(apiResponse).ToSDKGroupMember());
            } catch (Exception e) {
                throw new EslException("Could not create a new package." + " Exception: " + e.Message);
            }
        }
        public Silanis.ESL.API.GroupMember ToAPIGroupMember() {
            if (apiMember != null)
            {
                return apiMember;
            }
            else
            {
                Silanis.ESL.API.GroupMember result = new Silanis.ESL.API.GroupMember();

                result.Email = sdkMember.Email;
                result.FirstName = sdkMember.FirstName;
                result.LastName = sdkMember.LastName;
                result.MemberType = new GroupMemberTypeConverter(sdkMember.GroupMemberType).ToAPIMemberType();

                return result;
            }
        }
示例#3
0
        public Silanis.ESL.API.GroupMember ToAPIGroupMember()
        {
            if (apiMember != null)
            {
                return(apiMember);
            }
            else
            {
                Silanis.ESL.API.GroupMember result = new Silanis.ESL.API.GroupMember();

                result.Email      = sdkMember.Email;
                result.FirstName  = sdkMember.FirstName;
                result.LastName   = sdkMember.LastName;
                result.MemberType = new GroupMemberTypeConverter(sdkMember.GroupMemberType).ToAPIMemberType();

                return(result);
            }
        }
示例#4
0
        public Silanis.ESL.API.GroupMember AddMember(string groupId, Silanis.ESL.API.GroupMember apiGroupMember)
        {
            string path = template.UrlFor(UrlTemplate.GROUPS_MEMBER_PATH)
                          .Replace("{groupId}", groupId)
                          .Build();

            try {
                string json     = JsonConvert.SerializeObject(apiGroupMember, settings);
                string response = restClient.Post(path, json);
                Silanis.ESL.API.GroupMember apiResponse = JsonConvert.DeserializeObject <Silanis.ESL.API.GroupMember> (response);
                return(apiResponse);
            }
            catch (EslServerException e) {
                throw new EslServerException("Failed to add new member." + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Failed to add new member." + " Exception: " + e.Message, e);
            }
        }
示例#5
0
 public GroupMember AddMember(GroupId groupId, GroupMember groupMember)
 {
     Silanis.ESL.API.GroupMember apiGroupMember = new GroupMemberConverter(groupMember).ToAPIGroupMember();
     Silanis.ESL.API.GroupMember apiResponse    = apiClient.AddMember(groupId.Id, apiGroupMember);
     return(new GroupMemberConverter(apiResponse).ToSDKGroupMember());
 }
 public GroupMemberConverter( GroupMember sdkMember ) {
     this.sdkMember = sdkMember;
     this.apiMember = null;
 }
 public GroupMemberConverter( Silanis.ESL.API.GroupMember apiMember ) {
     this.apiMember = apiMember;
     this.sdkMember = null;
 }
示例#8
0
 public GroupMemberConverter(GroupMember sdkMember)
 {
     this.sdkMember = sdkMember;
     this.apiMember = null;
 }
示例#9
0
 public GroupMemberConverter(Silanis.ESL.API.GroupMember apiMember)
 {
     this.apiMember = apiMember;
     this.sdkMember = null;
 }