protected override void Given() { _newLeadRequest = new CreateLeadRequest() { LeadPersonalInformation = new LeadPersonalInformationDto() { FirstName = "test", Surname = "test", Email = $"{TestHelpers.UniqueName()}[email protected]", CurrentAdvisorId = 1, GenderId = 1, OccupationId = 1 }, }; }
/// <summary> /// 线索回收接口 /// </summary> /// <param name="req"><see cref="CreateLeadRequest"/></param> /// <returns><see cref="CreateLeadResponse"/></returns> public CreateLeadResponse CreateLeadSync(CreateLeadRequest req) { JsonResponseModel <CreateLeadResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateLead"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <CreateLeadResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }
public void GivenANewLead() { _appointmentDateString = DateTime.Now.AddDays(2).ToString("dd-MM-yyyy HH:mm"); _appointmentDate = DateTime.Now.AddDays(2); _request = new CreateLeadRequest() { LeadPersonalInformation = new LeadPersonalInformationDto() { FirstName = _firstName, Surname = _surname, Email = _email, CurrentAdvisorId = 1, GenderId = 1, OccupationId = 1 }, }; }
/// <summary> /// Creates an advertiser lead for the given company ID. /// Documentation https://developers.google.com/partners/v2/reference/leads/create /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated partners service.</param> /// <param name="companyId">The ID of the company to contact.</param> /// <param name="body">A valid partners v2 body.</param> /// <returns>CreateLeadResponseResponse</returns> public static CreateLeadResponse Create(partnersService service, string companyId, CreateLeadRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (companyId == null) { throw new ArgumentNullException(companyId); } // Make the request. return(service.Leads.Create(body, companyId).Execute()); } catch (Exception ex) { throw new Exception("Request Leads.Create failed.", ex); } }
public IApiResponseContextDto <int> Create(CreateLeadRequest request) { var result = ConnectorCalls.Post <CreateLeadRequest, int>(connectorClient, request, @"Lead/Create"); return(result); }
public override async Task <LeadInformation> createLead(CreateLeadRequest request, ServerCallContext context) { await _validator.HandleValidation(request); return(new LeadInformation()); }