Exemplo n.º 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Document parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Document </returns>
        public static DocumentResource Create(CreateDocumentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="data"> The data </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Document </returns>
        public static async System.Threading.Tasks.Task <DocumentResource> CreateAsync(string pathServiceSid, string uniqueName = null, object data = null, ITwilioRestClient client = null)
        {
            var options = new CreateDocumentOptions(pathServiceSid)
            {
                UniqueName = uniqueName, Data = data
            };

            return(await CreateAsync(options, client));
        }
Exemplo n.º 3
0
 private static Request BuildCreateRequest(CreateDocumentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Documents",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="data"> The data </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Document </returns>
        public static DocumentResource Create(string pathServiceSid, string uniqueName = null, object data = null, ITwilioRestClient client = null)
        {
            var options = new CreateDocumentOptions(pathServiceSid)
            {
                UniqueName = uniqueName, Data = data
            };

            return(Create(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Document parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Document </returns>
        public static async System.Threading.Tasks.Task <DocumentResource> CreateAsync(CreateDocumentOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }