コード例 #1
0
        /// <summary>
        /// Update a specific Asset.
        /// </summary>
        /// <param name="options"> Update Asset parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Asset </returns>
        public static AssetResource Update(UpdateAssetOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// Update a specific Asset.
        /// </summary>
        /// <param name="options"> Update Asset parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Asset </returns>
        public static async System.Threading.Tasks.Task <AssetResource> UpdateAsync(UpdateAssetOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #3
0
        /// <summary>
        /// Update a specific Asset.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> Asset Sid. </param>
        /// <param name="friendlyName"> A human-readable description of this Asset. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Asset </returns>
        public static async System.Threading.Tasks.Task <AssetResource> UpdateAsync(string pathServiceSid,
                                                                                    string pathSid,
                                                                                    string friendlyName,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new UpdateAssetOptions(pathServiceSid, pathSid, friendlyName);

            return(await UpdateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Update a specific Asset.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> Asset Sid. </param>
        /// <param name="friendlyName"> A human-readable description of this Asset. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Asset </returns>
        public static AssetResource Update(string pathServiceSid,
                                           string pathSid,
                                           string friendlyName,
                                           ITwilioRestClient client = null)
        {
            var options = new UpdateAssetOptions(pathServiceSid, pathSid, friendlyName);

            return(Update(options, client));
        }
コード例 #5
0
 private static Request BuildUpdateRequest(UpdateAssetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Assets/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }