Exemplo n.º 1
0
        /// <summary>
        /// Fetch a specific Sync List Permission.
        /// </summary>
        ///
        /// <param name="options"> Fetch SyncListPermission parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncListPermission </returns>
        public static SyncListPermissionResource Fetch(FetchSyncListPermissionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Fetch a specific Sync List Permission.
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathListSid"> Sync List SID or unique name. </param>
        /// <param name="pathIdentity"> Identity of the user to whom the Sync List Permission applies. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncListPermission </returns>
        public static async System.Threading.Tasks.Task <SyncListPermissionResource> FetchAsync(string pathServiceSid,
                                                                                                string pathListSid,
                                                                                                string pathIdentity,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Fetch a specific Sync List Permission.
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathListSid"> Sync List SID or unique name. </param>
        /// <param name="pathIdentity"> Identity of the user to whom the Sync List Permission applies. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncListPermission </returns>
        public static SyncListPermissionResource Fetch(string pathServiceSid,
                                                       string pathListSid,
                                                       string pathIdentity,
                                                       ITwilioRestClient client = null)
        {
            var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity);

            return(Fetch(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildFetchRequest(FetchSyncListPermissionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Lists/" + options.PathListSid + "/Permissions/" + options.PathIdentity + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Fetch a specific Sync List Permission.
        /// </summary>
        /// <param name="options"> Fetch SyncListPermission parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncListPermission </returns>
        public static async System.Threading.Tasks.Task <SyncListPermissionResource> FetchAsync(FetchSyncListPermissionOptions options,
                                                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }