/// <summary> /// Fetch an instance of an authorized-connect-app /// </summary> /// /// <param name="options"> Fetch AuthorizedConnectApp parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthorizedConnectApp </returns> public static AuthorizedConnectAppResource Fetch(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch an instance of an authorized-connect-app /// </summary> /// /// <param name="pathConnectAppSid"> The connect_app_sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthorizedConnectApp </returns> public static AuthorizedConnectAppResource Fetch(string pathConnectAppSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthorizedConnectAppOptions(pathConnectAppSid) { PathAccountSid = pathAccountSid }; return(Fetch(options, client)); }
/// <summary> /// Fetch an instance of an authorized-connect-app /// </summary> /// /// <param name="pathConnectAppSid"> The connect_app_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 AuthorizedConnectApp </returns> public static async System.Threading.Tasks.Task <AuthorizedConnectAppResource> FetchAsync(string pathConnectAppSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthorizedConnectAppOptions(pathConnectAppSid) { PathAccountSid = pathAccountSid }; return(await FetchAsync(options, client)); }
private static Request BuildFetchRequest(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/AuthorizedConnectApps/" + options.PathConnectAppSid + ".json", queryParams: options.GetParams() )); }
/// <summary> /// Fetch an instance of an authorized-connect-app /// </summary> /// /// <param name="options"> Fetch AuthorizedConnectApp parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthorizedConnectApp </returns> public static async System.Threading.Tasks.Task <AuthorizedConnectAppResource> FetchAsync(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }