/// <summary>
        /// Update a specific Export Configuration.
        /// </summary>
        /// <param name="options"> Update ExportConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExportConfiguration </returns>
        public static ExportConfigurationResource Update(UpdateExportConfigurationOptions options,
                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateExportConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Bulkexports,
                "/v1/Exports/" + options.PathResourceType + "/Configuration",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Update a specific Export Configuration.
        /// </summary>
        /// <param name="pathResourceType"> The type of communication – Messages, Calls </param>
        /// <param name="enabled"> Whether files are automatically generated </param>
        /// <param name="webhookUrl"> URL targeted at export </param>
        /// <param name="webhookMethod"> Whether to GET or POST to the webhook url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExportConfiguration </returns>
        public static async System.Threading.Tasks.Task <ExportConfigurationResource> UpdateAsync(string pathResourceType,
                                                                                                  bool?enabled             = null,
                                                                                                  Uri webhookUrl           = null,
                                                                                                  string webhookMethod     = null,
                                                                                                  ITwilioRestClient client = null)
        {
            var options = new UpdateExportConfigurationOptions(pathResourceType)
            {
                Enabled = enabled, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// Update a specific Export Configuration.
        /// </summary>
        /// <param name="pathResourceType"> The type of communication – Messages, Calls </param>
        /// <param name="enabled"> Whether files are automatically generated </param>
        /// <param name="webhookUrl"> URL targeted at export </param>
        /// <param name="webhookMethod"> Whether to GET or POST to the webhook url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExportConfiguration </returns>
        public static ExportConfigurationResource Update(string pathResourceType,
                                                         bool?enabled             = null,
                                                         Uri webhookUrl           = null,
                                                         string webhookMethod     = null,
                                                         ITwilioRestClient client = null)
        {
            var options = new UpdateExportConfigurationOptions(pathResourceType)
            {
                Enabled = enabled, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Update a specific Export Configuration.
        /// </summary>
        /// <param name="options"> Update ExportConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExportConfiguration </returns>
        public static async System.Threading.Tasks.Task <ExportConfigurationResource> UpdateAsync(UpdateExportConfigurationOptions options,
                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }