/// <summary> /// Fetch a specific Sync Document Permission. /// </summary> /// /// <param name="options"> Fetch DocumentPermission parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of DocumentPermission </returns> public static DocumentPermissionResource Fetch(FetchDocumentPermissionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch a specific Sync Document Permission. /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathDocumentSid"> Sync Document SID or unique name. </param> /// <param name="pathIdentity"> Identity of the user to whom the Sync Document Permission applies. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of DocumentPermission </returns> public static async System.Threading.Tasks.Task <DocumentPermissionResource> FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch a specific Sync Document Permission. /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathDocumentSid"> Sync Document SID or unique name. </param> /// <param name="pathIdentity"> Identity of the user to whom the Sync Document Permission applies. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of DocumentPermission </returns> public static DocumentPermissionResource Fetch(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity); return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchDocumentPermissionOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Preview, "/Sync/Services/" + options.PathServiceSid + "/Documents/" + options.PathDocumentSid + "/Permissions/" + options.PathIdentity + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch a specific Sync Document Permission. /// </summary> /// <param name="options"> Fetch DocumentPermission parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of DocumentPermission </returns> public static async System.Threading.Tasks.Task <DocumentPermissionResource> FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }