예제 #1
0
        /// <summary>
        /// Update an identity's access to a specific Sync Document.
        /// </summary>
        ///
        /// <param name="options"> Update DocumentPermission parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of DocumentPermission </returns>
        public static DocumentPermissionResource Update(UpdateDocumentPermissionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
 private static Request BuildUpdateRequest(UpdateDocumentPermissionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Documents/" + options.PathDocumentSid + "/Permissions/" + options.PathIdentity + "",
                postParams: options.GetParams()
                ));
 }
예제 #3
0
        /// <summary>
        /// Update an identity's access to a specific Sync Document.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document Permission resource to update </param>
        /// <param name="pathDocumentSid"> The SID of the Sync Document with the Document Permission resource to update </param>
        /// <param name="pathIdentity"> The application-defined string that uniquely identifies the User's Document Permission
        ///                    resource to update </param>
        /// <param name="read"> Read access </param>
        /// <param name="write"> Write access </param>
        /// <param name="manage"> Manage access </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> UpdateAsync(string pathServiceSid,
                                                                                                 string pathDocumentSid,
                                                                                                 string pathIdentity,
                                                                                                 bool?read,
                                                                                                 bool?write,
                                                                                                 bool?manage,
                                                                                                 ITwilioRestClient client = null)
        {
            var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage);

            return(await UpdateAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// Update an identity's access to a specific Sync Document.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document Permission resource to update </param>
        /// <param name="pathDocumentSid"> The SID of the Sync Document with the Document Permission resource to update </param>
        /// <param name="pathIdentity"> The application-defined string that uniquely identifies the User's Document Permission
        ///                    resource to update </param>
        /// <param name="read"> Read access </param>
        /// <param name="write"> Write access </param>
        /// <param name="manage"> Manage access </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of DocumentPermission </returns>
        public static DocumentPermissionResource Update(string pathServiceSid,
                                                        string pathDocumentSid,
                                                        string pathIdentity,
                                                        bool?read,
                                                        bool?write,
                                                        bool?manage,
                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage);

            return(Update(options, client));
        }
예제 #5
0
        /// <summary>
        /// Update an identity's access to a specific Sync Document.
        /// </summary>
        /// <param name="options"> Update 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> UpdateAsync(UpdateDocumentPermissionOptions options,
                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }