/// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch Sandbox parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sandbox </returns>
        public static SandboxResource Fetch(FetchSandboxOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch Sandbox parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sandbox </returns>
        public static async System.Threading.Tasks.Task <SandboxResource> FetchAsync(FetchSandboxOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sandbox </returns>
        public static async System.Threading.Tasks.Task <SandboxResource> FetchAsync(string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchSandboxOptions {
                PathAccountSid = pathAccountSid
            };

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sandbox </returns>
        public static SandboxResource Fetch(string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchSandboxOptions {
                PathAccountSid = pathAccountSid
            };

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchSandboxOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Sandbox.json",
                client.Region,
                queryParams: options.GetParams()
                ));
 }