Beispiel #1
0
        /// <summary>
        /// Delete a specific Sync Document Permission.
        /// </summary>
        ///
        /// <param name="options"> Delete 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 <bool> DeleteAsync(DeleteDocumentPermissionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Beispiel #2
0
        /// <summary>
        /// Delete a specific Sync Document Permission.
        /// </summary>
        /// <param name="options"> Delete DocumentPermission parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of DocumentPermission </returns>
        public static bool Delete(DeleteDocumentPermissionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Beispiel #3
0
        /// <summary>
        /// Delete 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 <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathDocumentSid,
                                                                           string pathIdentity,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity);

            return(await DeleteAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Delete 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 bool Delete(string pathServiceSid,
                                  string pathDocumentSid,
                                  string pathIdentity,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity);

            return(Delete(options, client));
        }
 private static Request BuildDeleteRequest(DeleteDocumentPermissionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Documents/" + options.PathDocumentSid + "/Permissions/" + options.PathIdentity + "",
                queryParams: options.GetParams()
                ));
 }