Class: DocuSign_Rooms::DocumentsApi
- Inherits:
-
Object
- Object
- DocuSign_Rooms::DocumentsApi
- Defined in:
- lib/docusign_rooms/api/documents_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_document_user(document_id, account_id, body) ⇒ DocumentUser
Grants access to a document for a user.
-
#create_document_user_with_http_info(document_id, account_id, body) ⇒ Array<(DocumentUser, Fixnum, Hash)>
Grants access to a document for a user.
-
#delete_document(document_id, account_id) ⇒ nil
Deletes a document.
-
#delete_document_with_http_info(document_id, account_id) ⇒ Array<(nil, Fixnum, Hash)>
Deletes a document.
-
#get_document(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) ⇒ Document
Get information about the Document with the given DocumentId.
-
#get_document_with_http_info(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) ⇒ Array<(Document, Fixnum, Hash)>
Get information about the Document with the given DocumentId.
-
#initialize(api_client = DocumentsApi.default) ⇒ DocumentsApi
constructor
A new instance of DocumentsApi.
Constructor Details
#initialize(api_client = DocumentsApi.default) ⇒ DocumentsApi
Returns a new instance of DocumentsApi.
29 30 31 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 29 def initialize(api_client = DocumentsApi.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
27 28 29 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 27 def api_client @api_client end |
Instance Method Details
#create_document_user(document_id, account_id, body) ⇒ DocumentUser
Grants access to a document for a user. Grants a user access to a document. You specify the user’s ‘userId` in the request body. The response is an object that specifies the access the user has.
39 40 41 42 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 39 def create_document_user(document_id, account_id, body) data, _status_code, _headers = create_document_user_with_http_info(document_id, account_id, body) return data end |
#create_document_user_with_http_info(document_id, account_id, body) ⇒ Array<(DocumentUser, Fixnum, Hash)>
Grants access to a document for a user. Grants a user access to a document. You specify the user's `userId` in the request body. The response is an object that specifies the access the user has.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 50 def create_document_user_with_http_info(document_id, account_id, body) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DocumentsApi.create_document_user ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.create_document_user" if document_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.create_document_user" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/documents/{documentId}/users".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json', 'application/xml', 'text/xml', 'application/*+xml']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentUser') if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#create_document_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_document(document_id, account_id) ⇒ nil
Deletes a document. Permanently deletes a document. To find the ‘documentId` of a document that you want to delete, use the Rooms::GetDocuments method.\n\nIf the document is deleted successfully, the HTTP response code is 204 (No Content), so the response body is empty.
95 96 97 98 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 95 def delete_document(document_id, account_id) delete_document_with_http_info(document_id, account_id) return nil end |
#delete_document_with_http_info(document_id, account_id) ⇒ Array<(nil, Fixnum, Hash)>
Deletes a document. Permanently deletes a document. To find the `documentId` of a document that you want to delete, use the Rooms::GetDocuments method.\n\nIf the document is deleted successfully, the HTTP response code is 204 (No Content), so the response body is empty.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 105 def delete_document_with_http_info(document_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DocumentsApi.delete_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.delete_document" if document_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.delete_document" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#delete_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_document(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) ⇒ Document
Get information about the Document with the given DocumentId. Returns information about a document in a room. You can optionally request the contents of the document, which is returned in base64-encoded format.\n\nTo find the ‘documentId` of the document that you want to retrieve, use the Rooms::GetDocuments method.
150 151 152 153 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 150 def get_document(document_id, account_id, = DocuSign_Rooms::GetDocumentOptions.default) data, _status_code, _headers = get_document_with_http_info(document_id, account_id, ) return data end |
#get_document_with_http_info(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) ⇒ Array<(Document, Fixnum, Hash)>
Get information about the Document with the given DocumentId. Returns information about a document in a room. You can optionally request the contents of the document, which is returned in base64-encoded format.\n\nTo find the `documentId` of the document that you want to retrieve, use the Rooms::GetDocuments method.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/docusign_rooms/api/documents_api.rb', line 161 def get_document_with_http_info(document_id, account_id, = DocuSign_Rooms::GetDocumentOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DocumentsApi.get_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document" if document_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.get_document" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'includeContents'] = .include_contents if !.include_contents.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Document') if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentsApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |