/// <summary> /// Create a new Supporting Document. /// </summary> /// <param name="options"> Create SupportingDocument parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of SupportingDocument </returns> public static SupportingDocumentResource Create(CreateSupportingDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateSupportingDocumentOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Numbers, "/v2/RegulatoryCompliance/SupportingDocuments", postParams: options.GetParams() )); }
/// <summary> /// Create a new Supporting Document. /// </summary> /// <param name="friendlyName"> The string that you assigned to describe the resource </param> /// <param name="type"> The type of the Supporting Document </param> /// <param name="attributes"> The set of parameters that compose the Supporting Documents resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of SupportingDocument </returns> public static SupportingDocumentResource Create(string friendlyName, string type, object attributes = null, ITwilioRestClient client = null) { var options = new CreateSupportingDocumentOptions(friendlyName, type) { Attributes = attributes }; return(Create(options, client)); }
/// <summary> /// Create a new Supporting Document. /// </summary> /// <param name="friendlyName"> The string that you assigned to describe the resource </param> /// <param name="type"> The type of the Supporting Document </param> /// <param name="attributes"> The set of parameters that compose the Supporting Documents resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of SupportingDocument </returns> public static async System.Threading.Tasks.Task <SupportingDocumentResource> CreateAsync(string friendlyName, string type, object attributes = null, ITwilioRestClient client = null) { var options = new CreateSupportingDocumentOptions(friendlyName, type) { Attributes = attributes }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Supporting Document. /// </summary> /// <param name="options"> Create SupportingDocument parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of SupportingDocument </returns> public static async System.Threading.Tasks.Task <SupportingDocumentResource> CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }