/// <summary> /// Create a new Customer-Profile. /// </summary> /// <param name="options"> Create CustomerProfiles parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of CustomerProfiles </returns> public static CustomerProfilesResource Create(CreateCustomerProfilesOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateCustomerProfilesOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Trusthub, "/v1/CustomerProfiles", postParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Create a new Customer-Profile. /// </summary> /// <param name="friendlyName"> The string that you assigned to describe the resource </param> /// <param name="email"> The email address </param> /// <param name="policySid"> The unique string of a policy. </param> /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of CustomerProfiles </returns> public static async System.Threading.Tasks.Task <CustomerProfilesResource> CreateAsync(string friendlyName, string email, string policySid, Uri statusCallback = null, ITwilioRestClient client = null) { var options = new CreateCustomerProfilesOptions(friendlyName, email, policySid) { StatusCallback = statusCallback }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Customer-Profile. /// </summary> /// <param name="friendlyName"> The string that you assigned to describe the resource </param> /// <param name="email"> The email address </param> /// <param name="policySid"> The unique string of a policy. </param> /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of CustomerProfiles </returns> public static CustomerProfilesResource Create(string friendlyName, string email, string policySid, Uri statusCallback = null, ITwilioRestClient client = null) { var options = new CreateCustomerProfilesOptions(friendlyName, email, policySid) { StatusCallback = statusCallback }; return(Create(options, client)); }
/// <summary> /// Create a new Customer-Profile. /// </summary> /// <param name="options"> Create CustomerProfiles parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of CustomerProfiles </returns> public static async System.Threading.Tasks.Task <CustomerProfilesResource> CreateAsync(CreateCustomerProfilesOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }