/// <summary> /// Creates a new token member. /// </summary> /// <param name="memberId">the member ID</param> /// <param name="operations">the operations to apply</param> /// <param name="metadata">the metadata of the operations</param> /// <param name="signer">the signer used to sign the request</param> /// <returns>the created member</returns> public Task <ProtoMember> CreateMember( string memberId, IList <MemberOperation> operations, IList <MemberOperationMetadata> metadata, ISigner signer) { var update = new MemberUpdate { MemberId = memberId, Operations = { operations } }; var request = new UpdateMemberRequest { Update = update, UpdateSignature = new Signature { MemberId = memberId, KeyId = signer.GetKeyId(), Signature_ = signer.Sign(update) }, Metadata = { metadata } }; return(gateway.UpdateMemberAsync(request) .ToTask(response => response.Member)); }
public void Update_Buyer() { long memberId = 1; var request = new UpdateMemberRequest { Email = "*****@*****.**", PhoneNumber = "905551111111", Name = "Haluk Demir", IdentityNumber = "11111111110", Address = "Suadiye Mah. Örnek Cd. No:23, 34740 Kadıköy/İstanbul", ContactName = "Haluk", ContactSurname = "Demir", NegativeWalletAmountLimit = -50 }; var response = _craftgateClient.Onboarding().UpdateMember(memberId, request); Assert.True(response.IsBuyer); Assert.AreEqual(memberId, response.Id); Assert.AreEqual(request.Email, response.Email); Assert.AreEqual(request.PhoneNumber, response.PhoneNumber); Assert.AreEqual(request.Name, response.Name); Assert.AreEqual(request.IdentityNumber, response.IdentityNumber); Assert.AreEqual(request.NegativeWalletAmountLimit, response.NegativeWalletAmountLimit); }
public async Task <ApiResponse <UpdateMemberResponse> > UpdateMember(UpdateMemberRequest request) { await SetHeader(); var updateResponse = await _httpClient.PutJsonAsync <ApiResponse <UpdateMemberResponse> >(Constants.URI.Members.UpdateMember, request); return(updateResponse); }
public Task <MemberResponse> UpdateMemberAsync(long id, UpdateMemberRequest updateMemberRequest) { var path = "/onboarding/v1/members/" + id; return(AsyncRestClient.Put <MemberResponse>(RequestOptions.BaseUrl + path, CreateHeaders(updateMemberRequest, path, RequestOptions), updateMemberRequest)); }
public async Task <MemberResponse> UpdateMember(int memberId, UpdateMemberRequest request, string accessToken = null) { var url = ClientSettings.Origin + MembersEndpoint + $"/{memberId}"; Token = accessToken ?? Token; var response = await this.RunQuery <MemberResponse>(() => RequestHelper.PutRequest(this, url, request, Token)); return(response); }
/// <summary> /// 更新后端服务器 /// </summary> public UpdateMemberResponse UpdateMember(UpdateMemberRequest updateMemberRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("member_id", updateMemberRequest.MemberId.ToString()); urlParam.Add("pool_id", updateMemberRequest.PoolId.ToString()); string urlPath = HttpUtils.AddUrlPath("/v3/{project_id}/elb/pools/{pool_id}/members/{member_id}", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", updateMemberRequest); HttpResponseMessage response = DoHttpRequestSync("PUT", request); return(JsonUtils.DeSerialize <UpdateMemberResponse>(response)); }
public object Any(UpdateMemberRequest request) { AutoMapper.Mapper.CreateMap<UpdateMemberRequest, UpdateMemberRequestModel>(); var requestModel = AutoMapper.Mapper.Map<UpdateMemberRequestModel>(request); var repo = new MemberRepository().UpdateMember(requestModel); AutoMapper.Mapper.CreateMap<MemberEditResponseModel, MemberEditResponse>(); return AutoMapper.Mapper.Map<MemberEditResponse>(repo); }
public BaseResponse UpdateMemberProfile(string memberid, string salutation, string firstname, string middleinitial, string lastname, string suffix, string professionaltitle, string email, bool optin, string businessname, string address1, string address2, string address3, string city, string state, string postalcode, string country, string phone, string fax, string altcity, bool debug) { methodName = "UpdateMemberProfile"; LogMethodEntry(methodName); try { #region set member data Member memberData = new Member(); memberData.MemberId = memberid; memberData.Salutation = salutation; memberData.FirstName = firstname; memberData.MiddleInitial = middleinitial; memberData.LastName = lastname; memberData.Suffix = suffix; memberData.ProfessionalTitle = professionaltitle; memberData.OptIn = optin; memberData.Email = email; memberData.Address = new Address(); memberData.Address.BusinessName = businessname; memberData.Address.Address1 = address1; memberData.Address.Address2 = address2; memberData.Address.Address3 = address3; memberData.Address.City = city; memberData.Address.State = state; memberData.Address.PostalCode = postalcode; memberData.Address.Country = country; memberData.Address.Phone = phone; memberData.Address.Fax = fax; memberData.Address.AltCity = altcity; #endregion UpdateMemberRequest request = new UpdateMemberRequest(memberData, debug); baseResponse = CustomerUpdate.UpdateMember(request); } catch (InvalidInputException) { //need to add and handle input validation errors } catch (Exception ex) { LogMethodError(methodName, ex); } LogMethodExit(methodName); return(baseResponse); }
public async Task <IActionResult> UpdateMember(UpdateMemberRequest request) { try { return(Ok(new Success(await Mediator.Send(request), "Update Member's Profile Successfully"))); } catch (NotFoundException notFoundException) { return(Ok(new NotFoundError(notFoundException))); } catch (Exception exception) { return(Ok(new InternalServerError(exception))); } }
public async Task <IActionResult> UpdateMember([FromRoute] int id, [FromBody] UpdateMemberRequest member) { _logger.LogDebug($"Updating Member Id={id}."); return(Ok(MapToResponse(await _memberService.UpdateMember(new Member { Id = id, Name = member.Name, Mail = member.Mail, Phone = member.Phone, Active = member.Active, DateOfBirth = member.DateOfBirth, FirstRegistered = member.FirstRegistered })))); }
public async Task Edit(bool?isMuted = null, bool?isDeafened = null, Channel voiceChannel = null, IEnumerable <Role> roles = null, string nickname = "") { if (Server == null) { throw new InvalidOperationException("Unable to edit users in a private channel"); } //Modify the roles collection and filter out the everyone role var roleIds = (roles ?? Roles) .Where(x => !x.IsEveryone) .Select(x => x.Id) .Distinct() .ToArray(); bool isCurrentUser = Id == Server.CurrentUser.Id; if (isCurrentUser && nickname != "") { var request = new UpdateOwnNick(Server.Id, nickname ?? ""); await Client.ClientAPI.Send(request).ConfigureAwait(false); nickname = ""; } if (!isCurrentUser || isMuted != null || isDeafened != null || voiceChannel != null || roles != null) { //Swap "" and null. Our libs meanings and the API's are flipped. if (nickname == null) { nickname = ""; } else if (nickname == "") { nickname = null; } var request = new UpdateMemberRequest(Server.Id, Id) { IsMuted = isMuted ?? IsServerMuted, IsDeafened = isDeafened ?? IsServerDeafened, VoiceChannelId = voiceChannel?.Id, RoleIds = roleIds, Nickname = nickname }; await Client.ClientAPI.Send(request).ConfigureAwait(false); } }
public void Update_Sub_Merchant() { var memberId = 1L; var request = new UpdateMemberRequest { IsBuyer = false, IsSubMerchant = true, ContactName = "Haluk", ContactSurname = "Demir", Email = "*****@*****.**", PhoneNumber = "905551111111", IdentityNumber = "11111111110", LegalCompanyTitle = "Dem Zeytinyağı Üretim Ltd. Şti.", MemberType = MemberType.LIMITED_OR_JOINT_STOCK_COMPANY, Name = "Dem Zeytinyağı Üretim Ltd. Şti.", TaxNumber = "1111111114", TaxOffice = "Erenköy", Iban = "TR930006701000000001111111", SettlementEarningsDestination = SettlementEarningsDestination.IBAN, Address = "Suadiye Mah. Örnek Cd. No:23, 34740 Kadıköy/İstanbul" }; var response = _craftgateClient.Onboarding().UpdateMember(memberId, request); Assert.AreEqual(memberId, response.Id); Assert.AreEqual(request.ContactName, response.ContactName); Assert.AreEqual(request.ContactSurname, response.ContactSurname); Assert.AreEqual(request.Email, response.Email); Assert.AreEqual(request.PhoneNumber, response.PhoneNumber); Assert.AreEqual(request.Iban, response.Iban); Assert.AreEqual(request.IdentityNumber, response.IdentityNumber); Assert.AreEqual(request.LegalCompanyTitle, response.LegalCompanyTitle); Assert.AreEqual(request.Name, response.Name); Assert.AreEqual(request.TaxNumber, response.TaxNumber); Assert.AreEqual(request.TaxOffice, response.TaxOffice); Assert.AreEqual(request.Address, response.Address); }
public Task Edit(bool?isMuted = null, bool?isDeafened = null, Channel voiceChannel = null, IEnumerable <Role> roles = null, string nickname = null) { if (Server == null) { throw new InvalidOperationException("Unable to edit users in a private channel"); } //Modify the roles collection and filter out the everyone role var roleIds = (roles ?? Roles) .Where(x => !x.IsEveryone) .Select(x => x.Id) .Distinct() .ToArray(); var tasks = new List <Task>(); if (nickname != null && this == Server.CurrentUser) { var task = Client.ClientAPI.Send(new UpdateOwnNick(Server.Id, nickname)); if (isMuted == null && isDeafened == null && voiceChannel == null && roles == null) { return(task); } tasks.Add(task); nickname = null; } var request = new UpdateMemberRequest(Server.Id, Id) { IsMuted = isMuted ?? IsServerMuted, IsDeafened = isDeafened ?? IsServerDeafened, VoiceChannelId = voiceChannel?.Id, RoleIds = roleIds, Nickname = nickname ?? Nickname }; tasks.Add(Client.ClientAPI.Send(request)); return(Task.WhenAll(tasks)); }
public Task Edit(bool?isMuted = null, bool?isDeafened = null, Channel voiceChannel = null, IEnumerable <Role> roles = null) { if (Server == null) { throw new InvalidOperationException("Unable to edit users in a private channel"); } //Modify the roles collection and filter out the everyone role var roleIds = (roles ?? Roles) .Where(x => !x.IsEveryone) .Select(x => x.Id) .Distinct() .ToArray(); var request = new UpdateMemberRequest(Server.Id, Id) { IsMuted = isMuted ?? IsServerMuted, IsDeafened = isDeafened ?? IsServerDeafened, VoiceChannelId = voiceChannel?.Id, RoleIds = roleIds }; return(Client.ClientAPI.Send(request)); }
public BaseResponse UpdateMember(string memberid, string salutation, string firstname, string lastname, string suffix, string professionaltitle, string email, bool optin, string businessname, string address1, string address2, string address3, string city, string state, string postalcode, string country, string phone, string screenname, bool debug) { methodName = "UpdateMember"; try { #region set member data Member memberData = new Member(); memberData.MemberId = memberid; memberData.Salutation = salutation; memberData.FirstName = firstname; memberData.LastName = lastname; memberData.Suffix = suffix; memberData.ProfessionalTitle = professionaltitle; memberData.OptIn = optin; memberData.Email = email; memberData.Address = new Address(); memberData.Address.BusinessName = businessname; memberData.Address.Address1 = address1; memberData.Address.Address2 = address2; memberData.Address.Address3 = address3; memberData.Address.City = city; memberData.Address.State = state; memberData.Address.PostalCode = postalcode; memberData.Address.Country = country; memberData.Address.Phone = phone; #endregion //TODO : Error handling for dupe email or screenname #region update ah db here using (HarperACL.ACLDataDataContext context = new ACLDataDataContext(ConfigurationManager.ConnectionStrings["AHT_MainConnectionString"].ConnectionString)) { HarperACL.Customer customer = (from a in context.Customers join b in context.SFG_CustomerNumbers on a.cusID equals b.cusID where b.SFGCustNum == memberid select a).Single(); int existing = (from a in context.Customers where (a.cusEmail == email || a.cusDisplayName == screenname) && a.cusID != customer.cusID select a).Count(); if (existing > 0) { throw new Exception("Unable to update member data, screen name or email already in use."); } customer.cusPrefix = salutation; customer.cusFirstName = firstname; customer.cusLastName = lastname; customer.cusSuffix = suffix; customer.cusTitle = professionaltitle; customer.cusEmail = email; customer.cusCompany = businessname; customer.cusPhone1 = phone; customer.cusDateUpdated = DateTime.Now; customer.cusDisplayName = screenname; HarperACL.AddressCustomer address = (from a in context.AddressCustomers where a.addID == customer.addID select a).Single(); address.addAddress1 = address1; address.addAddress2 = address2; address.addAddress3 = address3; address.addCity = city; address.addCountry = country; address.addDateUpdated = DateTime.Now; address.addPostalCode = postalcode; address.addRegion = state; context.SubmitChanges(); } #endregion //update at SFG UpdateMemberRequest request = new UpdateMemberRequest(memberData, debug); baseResponse = CustomerUpdate.UpdateMember(request); } catch (Exception ex) { LogMethodError(methodName, ex); } return(baseResponse); }
public UpdateMemberRequestBuilder(int memberId) { MemberId = memberId; _request = new UpdateMemberRequest(); }