/// <summary>
        /// Returns the Assistant exported as a JSON Object.
        /// </summary>
        /// <param name="options"> Fetch ExportAssistant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExportAssistant </returns>
        public static ExportAssistantResource Fetch(FetchExportAssistantOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Returns the Assistant exported as a JSON Object.
        /// </summary>
        /// <param name="pathAssistantSid"> The SID of the Assistant to export. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExportAssistant </returns>
        public static async System.Threading.Tasks.Task <ExportAssistantResource> FetchAsync(string pathAssistantSid,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new FetchExportAssistantOptions(pathAssistantSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchExportAssistantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Autopilot,
                "/v1/Assistants/" + options.PathAssistantSid + "/Export",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Returns the Assistant exported as a JSON Object.
        /// </summary>
        /// <param name="pathAssistantSid"> The SID of the Assistant to export. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExportAssistant </returns>
        public static ExportAssistantResource Fetch(string pathAssistantSid, ITwilioRestClient client = null)
        {
            var options = new FetchExportAssistantOptions(pathAssistantSid);

            return(Fetch(options, client));
        }
        /// <summary>
        /// Returns the Assistant exported as a JSON Object.
        /// </summary>
        /// <param name="options"> Fetch ExportAssistant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExportAssistant </returns>
        public static async System.Threading.Tasks.Task <ExportAssistantResource> FetchAsync(FetchExportAssistantOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }