Esempio n. 1
0
        /// <summary>
        /// Create a new Asset Version.
        /// </summary>
        /// <param name="options"> Create AssetVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssetVersion </returns>
        public static AssetVersionResource Create(CreateAssetVersionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new Asset Version.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathAssetSid"> Asset Sid. </param>
        /// <param name="path"> The URL-friendly string by which this Asset Version can be referenced. </param>
        /// <param name="visibility"> The access control which determines how the Asset Version can be accessed. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AssetVersion </returns>
        public static async System.Threading.Tasks.Task <AssetVersionResource> CreateAsync(string pathServiceSid,
                                                                                           string pathAssetSid,
                                                                                           string path,
                                                                                           AssetVersionResource.VisibilityEnum visibility,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new CreateAssetVersionOptions(pathServiceSid, pathAssetSid, path, visibility);

            return(await CreateAsync(options, client));
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new Asset Version.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathAssetSid"> Asset Sid. </param>
        /// <param name="path"> The URL-friendly string by which this Asset Version can be referenced. </param>
        /// <param name="visibility"> The access control which determines how the Asset Version can be accessed. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssetVersion </returns>
        public static AssetVersionResource Create(string pathServiceSid,
                                                  string pathAssetSid,
                                                  string path,
                                                  AssetVersionResource.VisibilityEnum visibility,
                                                  ITwilioRestClient client = null)
        {
            var options = new CreateAssetVersionOptions(pathServiceSid, pathAssetSid, path, visibility);

            return(Create(options, client));
        }
Esempio n. 4
0
 private static Request BuildCreateRequest(CreateAssetVersionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Assets/" + options.PathAssetSid + "/Versions",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Esempio n. 5
0
        /// <summary>
        /// Create a new Asset Version.
        /// </summary>
        /// <param name="options"> Create AssetVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AssetVersion </returns>
        public static async System.Threading.Tasks.Task <AssetVersionResource> CreateAsync(CreateAssetVersionOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }