=begin #DocuSign Rooms API - v2 #An API for an integrator to access the features of DocuSign Rooms OpenAPI spec version: v2 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module DocuSign_Rooms class GetAssignableRolesOptions # Optional parameter indicating to only return roles (internal/external) assignable to this user. attr_accessor :assignee_email # attr_accessor :filter # attr_accessor :start_position # attr_accessor :count def self.default @@default ||= GetAssignableRolesOptions.new end end class GetDocumentsOptions # Number of documents to return. Defaults to the maximum which is 100. attr_accessor :count # Position of the first item in the total results. Defaults to 0. attr_accessor :start_position def self.default @@default ||= GetDocumentsOptions.new end end class GetRoomOptions # Indicates if field data (a.k.a., room details) should be included in the response. Defaults to false. attr_accessor :include_field_data def self.default @@default ||= GetRoomOptions.new end end class GetRoomUsersOptions # Number of room users to return. Defaults to the maximum which is 100. attr_accessor :count # Position of the first item in the total results. Defaults to 0. attr_accessor :start_position # Returns room users filtered by Name and Email. attr_accessor :filter # Sorts results. Options are FirstNameAsc, FirstNameDesc, LastNameAsc, LastNameDesc, EmailAsc, EmailDesc. Defaults to LastNameDesc attr_accessor :sort def self.default @@default ||= GetRoomUsersOptions.new end end class GetRoomsOptions # Number of rooms to return. Defaults to the maximum which is 100. attr_accessor :count # Position of the first item in the total results. Defaults to 0. attr_accessor :start_position # Status of the rooms to return. Defaults to \"Active\". attr_accessor :room_status # Only return rooms in this office. attr_accessor :office_id # Fields data changed start datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00. attr_accessor :field_data_changed_start_date # Fields-data changed end DateTime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00. attr_accessor :field_data_changed_end_date # Room closed start datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00. attr_accessor :room_closed_start_date # Room closed end datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00. attr_accessor :room_closed_end_date def self.default @@default ||= GetRoomsOptions.new end end class RoomsApi attr_accessor :api_client def initialize(api_client = RoomsApi.default) @api_client = api_client end # Add a document to a room. # # @param room_id # @param account_id # @param document # @return [RoomDocument] def add_document_to_room(room_id, account_id, document) data, _status_code, _headers = add_document_to_room_with_http_info(room_id, account_id, document) return data end # Add a document to a room. # # @param room_id # @param account_id # @param document # @return [Array<(RoomDocument, Fixnum, Hash)>] RoomDocument data, response status code and response headers def add_document_to_room_with_http_info(room_id, account_id, document) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.add_document_to_room ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.add_document_to_room" if room_id.nil? # verify the required parameter 'document' is set fail ArgumentError, "Missing the required parameter 'document' when calling RoomsApi.add_document_to_room" if document.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.add_document_to_room" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/documents".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(document) 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 => 'RoomDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#add_document_to_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a document to a room via file contents upload. # # @param room_id # @param account_id # @return [RoomDocument] def add_document_to_room_via_file_upload(room_id, account_id) data, _status_code, _headers = add_document_to_room_via_file_upload_with_http_info(room_id, account_id) return data end # Add a document to a room via file contents upload. # # @param room_id # @param account_id # @return [Array<(RoomDocument, Fixnum, Hash)>] RoomDocument data, response status code and response headers def add_document_to_room_via_file_upload_with_http_info(room_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.add_document_to_room_via_file_upload ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.add_document_to_room_via_file_upload" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.add_document_to_room_via_file_upload" if account_id.nil? # verify the required parameter 'file' is set fail ArgumentError, "Missing the required parameter 'file' when calling RoomsApi.add_document_to_room_via_file_upload" if file.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/documents/contents".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/form-data']) # form parameters form_params = {} form_params["file"] = file # http body (model) post_body = nil 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 => 'RoomDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#add_document_to_room_via_file_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds a DocuSign Form to a room # # @param room_id Id of the room to which the DocuSign Form is being added # @param account_id # @param form_for_add Contains information about the form being added # @return [RoomDocument] def add_form_to_room(room_id, account_id, form_for_add) data, _status_code, _headers = add_form_to_room_with_http_info(room_id, account_id, form_for_add) return data end # Adds a DocuSign Form to a room # # @param room_id Id of the room to which the DocuSign Form is being added # @param account_id # @param form_for_add Contains information about the form being added # @return [Array<(RoomDocument, Fixnum, Hash)>] RoomDocument data, response status code and response headers def add_form_to_room_with_http_info(room_id, account_id, form_for_add) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.add_form_to_room ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.add_form_to_room" if room_id.nil? # verify the required parameter 'form_for_add' is set fail ArgumentError, "Missing the required parameter 'form_for_add' when calling RoomsApi.add_form_to_room" if form_for_add.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.add_form_to_room" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/forms".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(form_for_add) 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 => 'RoomDocument') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#add_form_to_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new Room # # @param account_id # @param room_for_create The properties of the new room # @return [Room] def create_room(account_id, room_for_create) data, _status_code, _headers = create_room_with_http_info(account_id, room_for_create) return data end # Creates a new Room # # @param account_id # @param room_for_create The properties of the new room # @return [Array<(Room, Fixnum, Hash)>] Room data, response status code and response headers def create_room_with_http_info(account_id, room_for_create) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.create_room ..." end # verify the required parameter 'room_for_create' is set fail ArgumentError, "Missing the required parameter 'room_for_create' when calling RoomsApi.create_room" if room_for_create.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.create_room" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms".sub('{format}','json').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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(room_for_create) 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 => 'Room') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#create_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the room having the given room ID. # # @param room_id ID of the room to be deleted. # @param account_id # @return [nil] def delete_room(room_id, account_id) delete_room_with_http_info(room_id, account_id) return nil end # Deletes the room having the given room ID. # # @param room_id ID of the room to be deleted. # @param account_id # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_room_with_http_info(room_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.delete_room ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.delete_room" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.delete_room" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['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: RoomsApi#delete_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the roles for which the calling user, based on their role within the room, can assign to invitees. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetAssignableRolesOptions Options for modifying the behavior of the function. # @return [AssignableRoles] def get_assignable_roles(room_id, account_id, options = DocuSign_Rooms::GetAssignableRolesOptions.default) data, _status_code, _headers = get_assignable_roles_with_http_info(room_id, account_id, options) return data end # Returns the roles for which the calling user, based on their role within the room, can assign to invitees. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetAssignableRolesOptions Options for modifying the behavior of the function. # @return [Array<(AssignableRoles, Fixnum, Hash)>] AssignableRoles data, response status code and response headers def get_assignable_roles_with_http_info(room_id, account_id, options = DocuSign_Rooms::GetAssignableRolesOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_assignable_roles ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_assignable_roles" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_assignable_roles" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/assignable_roles".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'assigneeEmail'] = options.assignee_email if !options.assignee_email.nil? query_params[:'filter'] = options.filter if !options.filter.nil? query_params[:'startPosition'] = options.start_position if !options.start_position.nil? query_params[:'count'] = options.count if !options.count.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['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 => 'AssignableRoles') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_assignable_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get documents in the room accessible to the calling user. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetDocumentsOptions Options for modifying the behavior of the function. # @return [RoomDocumentList] def get_documents(room_id, account_id, options = DocuSign_Rooms::GetDocumentsOptions.default) data, _status_code, _headers = get_documents_with_http_info(room_id, account_id, options) return data end # Get documents in the room accessible to the calling user. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetDocumentsOptions Options for modifying the behavior of the function. # @return [Array<(RoomDocumentList, Fixnum, Hash)>] RoomDocumentList data, response status code and response headers def get_documents_with_http_info(room_id, account_id, options = DocuSign_Rooms::GetDocumentsOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_documents ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_documents" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_documents" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/documents".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'count'] = options.count if !options.count.nil? query_params[:'startPosition'] = options.start_position if !options.start_position.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['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 => 'RoomDocumentList') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets information about the given room. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetRoomOptions Options for modifying the behavior of the function. # @return [Room] def get_room(room_id, account_id, options = DocuSign_Rooms::GetRoomOptions.default) data, _status_code, _headers = get_room_with_http_info(room_id, account_id, options) return data end # Gets information about the given room. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetRoomOptions Options for modifying the behavior of the function. # @return [Array<(Room, Fixnum, Hash)>] Room data, response status code and response headers def get_room_with_http_info(room_id, account_id, options = DocuSign_Rooms::GetRoomOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_room ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_room" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_room" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'includeFieldData'] = options.include_field_data if !options.include_field_data.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['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 => 'Room') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the FieldData associated with the provided roomId. # # @param room_id # @param account_id # @return [FieldData] def get_room_field_data(room_id, account_id) data, _status_code, _headers = get_room_field_data_with_http_info(room_id, account_id) return data end # Returns the FieldData associated with the provided roomId. # # @param room_id # @param account_id # @return [Array<(FieldData, Fixnum, Hash)>] FieldData data, response status code and response headers def get_room_field_data_with_http_info(room_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_room_field_data ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_room_field_data" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_room_field_data" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/field_data".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['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 => 'FieldData') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_room_field_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the field set associated with the room. # # @param room_id # @param account_id # @return [FieldSet] def get_room_field_set(room_id, account_id) data, _status_code, _headers = get_room_field_set_with_http_info(room_id, account_id) return data end # Gets the field set associated with the room. # # @param room_id # @param account_id # @return [Array<(FieldSet, Fixnum, Hash)>] FieldSet data, response status code and response headers def get_room_field_set_with_http_info(room_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_room_field_set ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_room_field_set" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_room_field_set" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/field_set".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['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 => 'FieldSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_room_field_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the list of users in the given room. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetRoomUsersOptions Options for modifying the behavior of the function. # @return [RoomUsersResult] def get_room_users(room_id, account_id, options = DocuSign_Rooms::GetRoomUsersOptions.default) data, _status_code, _headers = get_room_users_with_http_info(room_id, account_id, options) return data end # Retrieves the list of users in the given room. # # @param room_id # @param account_id # @param DocuSign_Rooms::GetRoomUsersOptions Options for modifying the behavior of the function. # @return [Array<(RoomUsersResult, Fixnum, Hash)>] RoomUsersResult data, response status code and response headers def get_room_users_with_http_info(room_id, account_id, options = DocuSign_Rooms::GetRoomUsersOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_room_users ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.get_room_users" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_room_users" if account_id.nil? if options.sort && !['FirstNameAsc', 'LastNameAsc', 'EmailAsc', 'FirstNameDesc', 'LastNameDesc', 'EmailDesc'].include?(options.sort) fail ArgumentError, 'invalid value for "sort", must be one of FirstNameAsc, LastNameAsc, EmailAsc, FirstNameDesc, LastNameDesc, EmailDesc' end # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/users".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'count'] = options.count if !options.count.nil? query_params[:'startPosition'] = options.start_position if !options.start_position.nil? query_params[:'filter'] = options.filter if !options.filter.nil? query_params[:'sort'] = options.sort if !options.sort.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['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 => 'RoomUsersResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_room_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets rooms available to the calling user. # # @param account_id # @param DocuSign_Rooms::GetRoomsOptions Options for modifying the behavior of the function. # @return [RoomSummaryList] def get_rooms(account_id, options = DocuSign_Rooms::GetRoomsOptions.default) data, _status_code, _headers = get_rooms_with_http_info(account_id, options) return data end # Gets rooms available to the calling user. # # @param account_id # @param DocuSign_Rooms::GetRoomsOptions Options for modifying the behavior of the function. # @return [Array<(RoomSummaryList, Fixnum, Hash)>] RoomSummaryList data, response status code and response headers def get_rooms_with_http_info(account_id, options = DocuSign_Rooms::GetRoomsOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.get_rooms ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.get_rooms" if account_id.nil? if options.room_status && !['Active', 'Pending', 'Closed', 'Open'].include?(options.room_status) fail ArgumentError, 'invalid value for "room_status", must be one of Active, Pending, Closed, Open' end # resource path local_var_path = "/v2/accounts/{accountId}/rooms".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'count'] = options.count if !options.count.nil? query_params[:'startPosition'] = options.start_position if !options.start_position.nil? query_params[:'roomStatus'] = options.room_status if !options.room_status.nil? query_params[:'officeId'] = options.office_id if !options.office_id.nil? query_params[:'fieldDataChangedStartDate'] = options.field_data_changed_start_date if !options.field_data_changed_start_date.nil? query_params[:'fieldDataChangedEndDate'] = options.field_data_changed_end_date if !options.field_data_changed_end_date.nil? query_params[:'roomClosedStartDate'] = options.room_closed_start_date if !options.room_closed_start_date.nil? query_params[:'roomClosedEndDate'] = options.room_closed_end_date if !options.room_closed_end_date.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['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 => 'RoomSummaryList') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#get_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Invites a user to the room by email address. # # @param room_id # @param account_id # @param room_invite_request # @return [RoomInviteResponse] def invite_user(room_id, account_id, room_invite_request) data, _status_code, _headers = invite_user_with_http_info(room_id, account_id, room_invite_request) return data end # Invites a user to the room by email address. # # @param room_id # @param account_id # @param room_invite_request # @return [Array<(RoomInviteResponse, Fixnum, Hash)>] RoomInviteResponse data, response status code and response headers def invite_user_with_http_info(room_id, account_id, room_invite_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.invite_user ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.invite_user" if room_id.nil? # verify the required parameter 'room_invite_request' is set fail ArgumentError, "Missing the required parameter 'room_invite_request' when calling RoomsApi.invite_user" if room_invite_request.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.invite_user" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/users".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(room_invite_request) 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 => 'RoomInviteResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#invite_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the specified user's role and transaction side. # # @param room_id # @param user_id # @param account_id # @param room_user_for_update # @return [RoomUser] def put_room_user(room_id, user_id, account_id, room_user_for_update) data, _status_code, _headers = put_room_user_with_http_info(room_id, user_id, account_id, room_user_for_update) return data end # Updates the specified user's role and transaction side. # # @param room_id # @param user_id # @param account_id # @param room_user_for_update # @return [Array<(RoomUser, Fixnum, Hash)>] RoomUser data, response status code and response headers def put_room_user_with_http_info(room_id, user_id, account_id, room_user_for_update) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.put_room_user ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.put_room_user" if room_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling RoomsApi.put_room_user" if user_id.nil? # verify the required parameter 'room_user_for_update' is set fail ArgumentError, "Missing the required parameter 'room_user_for_update' when calling RoomsApi.put_room_user" if room_user_for_update.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.put_room_user" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/users/{userId}".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'userId' + '}', user_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(room_user_for_update) auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RoomUser') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#put_room_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Restores the specified user's access to the room. # # @param room_id The room Id to restore access # @param user_id The user Id getting restored to the room # @param account_id # @return [nil] def restore_room_user_access(room_id, user_id, account_id) restore_room_user_access_with_http_info(room_id, user_id, account_id) return nil end # Restores the specified user's access to the room. # # @param room_id The room Id to restore access # @param user_id The user Id getting restored to the room # @param account_id # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def restore_room_user_access_with_http_info(room_id, user_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.restore_room_user_access ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.restore_room_user_access" if room_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling RoomsApi.restore_room_user_access" if user_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.restore_room_user_access" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/users/{userId}/restore_access".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'userId' + '}', user_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(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#restore_room_user_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revokes the specified user's access to the room. # # @param room_id The room Id to revoke access from # @param user_id The user Id getting revoked from the room # @param account_id # @param room_user_removal_detail Contains the date on which the users room access should be revoked (optional parameter) # @return [nil] def revoke_room_user_access(room_id, user_id, account_id, room_user_removal_detail) revoke_room_user_access_with_http_info(room_id, user_id, account_id, room_user_removal_detail) return nil end # Revokes the specified user's access to the room. # # @param room_id The room Id to revoke access from # @param user_id The user Id getting revoked from the room # @param account_id # @param room_user_removal_detail Contains the date on which the users room access should be revoked (optional parameter) # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def revoke_room_user_access_with_http_info(room_id, user_id, account_id, room_user_removal_detail) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.revoke_room_user_access ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.revoke_room_user_access" if room_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling RoomsApi.revoke_room_user_access" if user_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.revoke_room_user_access" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/users/{userId}/revoke_access".sub('{format}','json').sub('{' + 'roomId' + '}', room_id.to_s).sub('{' + 'userId' + '}', user_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(room_user_removal_detail) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#revoke_room_user_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update the picture for a room. # This endpoint supports the following content types, application/json as JSON PictureForUpdate{\"fileName\":\"string\", \"Base64Contents\":\"string\"}, multipart/formdata and any other streamed binary content type (as long as either query parameter fileName or request header ContentDisposition filename is included). # @param room_id ID of the room the picture is for. # @param account_id # @return [RoomPicture] def update_picture(room_id, account_id) data, _status_code, _headers = update_picture_with_http_info(room_id, account_id) return data end # Update the picture for a room. # This endpoint supports the following content types, application/json as JSON PictureForUpdate{\"fileName\":\"string\", \"Base64Contents\":\"string\"}, multipart/formdata and any other streamed binary content type (as long as either query parameter fileName or request header ContentDisposition filename is included). # @param room_id ID of the room the picture is for. # @param account_id # @return [Array<(RoomPicture, Fixnum, Hash)>] RoomPicture data, response status code and response headers def update_picture_with_http_info(room_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.update_picture ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.update_picture" if room_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.update_picture" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/picture".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RoomPicture') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#update_picture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates room field data. # # @param room_id # @param account_id # @param field_data_for_update # @return [FieldData] def update_room_field_data(room_id, account_id, field_data_for_update) data, _status_code, _headers = update_room_field_data_with_http_info(room_id, account_id, field_data_for_update) return data end # Updates room field data. # # @param room_id # @param account_id # @param field_data_for_update # @return [Array<(FieldData, Fixnum, Hash)>] FieldData data, response status code and response headers def update_room_field_data_with_http_info(room_id, account_id, field_data_for_update) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RoomsApi.update_room_field_data ..." end # verify the required parameter 'room_id' is set fail ArgumentError, "Missing the required parameter 'room_id' when calling RoomsApi.update_room_field_data" if room_id.nil? # verify the required parameter 'field_data_for_update' is set fail ArgumentError, "Missing the required parameter 'field_data_for_update' when calling RoomsApi.update_room_field_data" if field_data_for_update.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RoomsApi.update_room_field_data" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/rooms/{roomId}/field_data".sub('{format}','json').sub('{' + 'roomId' + '}', room_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(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(field_data_for_update) auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FieldData') if @api_client.config.debugging @api_client.config.logger.debug "API called: RoomsApi#update_room_field_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end