Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fetch a specific Sync Document Permission.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document Permission resource to fetch </param>
        /// <param name="pathDocumentSid"> The SID of the Sync Document with the Document Permission resource to fetch </param>
        /// <param name="pathIdentity"> The application-defined string that uniquely identifies the User's Document Permission
        ///                    resource to fetch </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));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch a specific Sync Document Permission.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document Permission resource to fetch </param>
        /// <param name="pathDocumentSid"> The SID of the Sync Document with the Document Permission resource to fetch </param>
        /// <param name="pathIdentity"> The application-defined string that uniquely identifies the User's Document Permission
        ///                    resource to fetch </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));
        }
Ejemplo n.º 4
0
 private static Request BuildFetchRequest(FetchDocumentPermissionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Documents/" + options.PathDocumentSid + "/Permissions/" + options.PathIdentity + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <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));
        }