Ejemplo n.º 1
0
        /// <summary>
        /// Fetch an instance of a conference
        /// </summary>
        /// <param name="options"> Fetch Conference parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Conference </returns>
        public static ConferenceResource Fetch(FetchConferenceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildFetchRequest(FetchConferenceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Conferences/" + options.PathSid + ".json",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch an instance of a conference
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies this resource </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resource(s) to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Conference </returns>
        public static ConferenceResource Fetch(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchConferenceOptions(pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Fetch(options, client));
        }
        /// <summary>
        /// Fetch an instance of a conference
        /// </summary>
        ///
        /// <param name="pathSid"> Fetch by unique conference Sid </param>
        /// <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 Conference </returns>
        public static async System.Threading.Tasks.Task <ConferenceResource> FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchConferenceOptions(pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await FetchAsync(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Fetch an instance of a conference
        /// </summary>
        /// <param name="options"> Fetch Conference parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Conference </returns>
        public static async System.Threading.Tasks.Task <ConferenceResource> FetchAsync(FetchConferenceOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }