Esempio n. 1
0
        /// <summary>
        /// Fetch a user role from your account's default service
        /// </summary>
        /// <param name="pathSid"> The SID of the Role resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Role </returns>
        public static async System.Threading.Tasks.Task <RoleResource> FetchAsync(string pathSid,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new FetchRoleOptions(pathSid);

            return(await FetchAsync(options, client));
        }
Esempio n. 2
0
        /// <summary>
        /// Fetch a user role from your account's default service
        /// </summary>
        /// <param name="options"> Fetch Role parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Role </returns>
        public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 3
0
        /// <summary>
        /// Fetch a user role from your account's default service
        /// </summary>
        /// <param name="options"> Fetch Role parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Role </returns>
        public static async System.Threading.Tasks.Task <RoleResource> FetchAsync(FetchRoleOptions options,
                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 4
0
 private static Request BuildFetchRequest(FetchRoleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Roles/" + options.PathSid + "",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Esempio n. 5
0
        /// <summary>
        /// Fetch a user role from your account's default service
        /// </summary>
        /// <param name="pathSid"> The SID of the Role resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Role </returns>
        public static RoleResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchRoleOptions(pathSid);

            return(Fetch(options, client));
        }