Ejemplo n.º 1
0
        /// <summary>
        /// Fetch a Fleet instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Fleet </returns>
        public static async System.Threading.Tasks.Task <FleetResource> FetchAsync(string pathSid,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new FetchFleetOptions(pathSid);

            return(await FetchAsync(options, client));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fetch a Fleet instance from your account.
        /// </summary>
        /// <param name="options"> Fetch Fleet parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Fleet </returns>
        public static FleetResource Fetch(FetchFleetOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch a Fleet instance from your account.
        /// </summary>
        /// <param name="options"> Fetch Fleet parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Fleet </returns>
        public static async System.Threading.Tasks.Task <FleetResource> FetchAsync(FetchFleetOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 4
0
 private static Request BuildFetchRequest(FetchFleetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Supersim,
                "/v1/Fleets/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Fetch a Fleet instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Fleet </returns>
        public static FleetResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchFleetOptions(pathSid);

            return(Fetch(options, client));
        }