=begin #DocuSign REST API #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module DocuSign_eSign class DeleteOptions # attr_accessor :delete def self.default @@default ||= DeleteOptions.new end end class GetContactByIdOptions # attr_accessor :cloud_provider def self.default @@default ||= GetContactByIdOptions.new end end class GetInformationOptions # When set to **true**, the full list of user information is returned for each user in the account. attr_accessor :additional_info # attr_accessor :email def self.default @@default ||= GetInformationOptions.new end end class GetProfileImageOptions # attr_accessor :encoding def self.default @@default ||= GetProfileImageOptions.new end end class GetSignatureImageOptions # attr_accessor :include_chrome def self.default @@default ||= GetSignatureImageOptions.new end end class ListOptions # When set to **true**, the full list of user information is returned for each user in the account. attr_accessor :additional_info # Number of records to return. The number must be greater than 0 and less than or equal to 100. attr_accessor :count # attr_accessor :email # Filters the returned user records by the email address or a sub-string of email address. attr_accessor :email_substring # Filters user records returned by one or more group Id's. attr_accessor :group_id # attr_accessor :include_usersettings_for_csv # attr_accessor :login_status # attr_accessor :not_group_id # Starting value for the list. attr_accessor :start_position # attr_accessor :status # Filters the user records returned by the user name or a sub-string of user name. attr_accessor :user_name_substring def self.default @@default ||= ListOptions.new end end class ListSignaturesOptions # attr_accessor :stamp_type def self.default @@default ||= ListSignaturesOptions.new end end class UpdateSettingsOptions # attr_accessor :allow_all_languages def self.default @@default ||= UpdateSettingsOptions.new end end class UpdateSignatureOptions # When set to **true**, closes the current signature. attr_accessor :close_existing_signature def self.default @@default ||= UpdateSignatureOptions.new end end class UpdateSignatureImageOptions # attr_accessor :transparent_png def self.default @@default ||= UpdateSignatureImageOptions.new end end class UpdateUserOptions # attr_accessor :allow_all_languages def self.default @@default ||= UpdateUserOptions.new end end class UpdateUsersOptions # attr_accessor :allow_all_languages def self.default @@default ||= UpdateUsersOptions.new end end class UsersApi attr_accessor :api_client def initialize(api_client = UsersApi.default) @api_client = api_client end # Adds news user to the specified account. # Adds new users to your account. Set the `userSettings` property in the request to specify the actions the users can perform on the account. # @param account_id The external account number (int) or account ID Guid. # @param new_users_definition (optional parameter) # @return [NewUsersSummary] def create(account_id, new_users_definition) data, _status_code, _headers = create_with_http_info(account_id, new_users_definition) return data end # Adds news user to the specified account. # Adds new users to your account. Set the `userSettings` property in the request to specify the actions the users can perform on the account. # @param account_id The external account number (int) or account ID Guid. # @param new_users_definition (optional parameter) # @return [Array<(NewUsersSummary, Fixnum, Hash)>] NewUsersSummary data, response status code and response headers def create_with_http_info(account_id, new_users_definition) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.create ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.create" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users".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']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(new_users_definition) 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 => 'NewUsersSummary') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds user Signature and initials images to a Signature. # Adds a user signature image and/or user initials image to the specified user. The userId property specified in the endpoint must match the authenticated user's userId and the user must be a member of the account. The rules and processes associated with this are: * If Content-Type is set to application/json, then the default behavior for creating a default signature image, based on the name and a DocuSign font, is used. * If Content-Type is set to multipart/form-data, then the request must contain a first part with the user signature information, followed by parts that contain the images. For each Image part, the Content-Disposition header has a \"filename\" value that is used to map to the `signatureName` and/or `signatureInitials` properties in the JSON to the image. For example: `Content-Disposition: file; filename=\"Ron Test20121127083900\"` If no matching image (by filename value) is found, then the image is not set. One, both, or neither of the signature and initials images can be set with this call. The Content-Transfer-Encoding: base64 header, set in the header for the part containing the image, can be set to indicate that the images are formatted as base64 instead of as binary. If successful, 200-OK is returned, and a JSON structure containing the signature information is provided, note that the signatureId can change with each API POST, PUT, or DELETE since the changes to the signature structure cause the current signature to be closed, and a new signature record to be created. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signatures_information (optional parameter) # @return [UserSignaturesInformation] def create_signatures(account_id, user_id, user_signatures_information) data, _status_code, _headers = create_signatures_with_http_info(account_id, user_id, user_signatures_information) return data end # Adds user Signature and initials images to a Signature. # Adds a user signature image and/or user initials image to the specified user. The userId property specified in the endpoint must match the authenticated user's userId and the user must be a member of the account. The rules and processes associated with this are: * If Content-Type is set to application/json, then the default behavior for creating a default signature image, based on the name and a DocuSign font, is used. * If Content-Type is set to multipart/form-data, then the request must contain a first part with the user signature information, followed by parts that contain the images. For each Image part, the Content-Disposition header has a \"filename\" value that is used to map to the `signatureName` and/or `signatureInitials` properties in the JSON to the image. For example: `Content-Disposition: file; filename=\"Ron Test20121127083900\"` If no matching image (by filename value) is found, then the image is not set. One, both, or neither of the signature and initials images can be set with this call. The Content-Transfer-Encoding: base64 header, set in the header for the part containing the image, can be set to indicate that the images are formatted as base64 instead of as binary. If successful, 200-OK is returned, and a JSON structure containing the signature information is provided, note that the signatureId can change with each API POST, PUT, or DELETE since the changes to the signature structure cause the current signature to be closed, and a new signature record to be created. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signatures_information (optional parameter) # @return [Array<(UserSignaturesInformation, Fixnum, Hash)>] UserSignaturesInformation data, response status code and response headers def create_signatures_with_http_info(account_id, user_id, user_signatures_information) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.create_signatures ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.create_signatures" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.create_signatures" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 = @api_client.object_to_http_body(user_signatures_information) 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 => 'UserSignaturesInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#create_signatures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Removes users account privileges. # This closes one or more user records in the account. Users are never deleted from an account, but closing a user prevents them from using account functions. The response returns whether the API execution was successful (200 - OK) or if it failed. The response contains a user structure similar to the request and includes the user changes. If an error occurred during the DELETE operation for any of the users, the response for that user contains an `errorDetails` node with `errorCode` and `message` properties. # @param account_id The external account number (int) or account ID Guid. # @param user_info_list (optional parameter) # @param DocuSign_eSign::DeleteOptions Options for modifying the behavior of the function. # @return [UsersResponse] def delete(account_id, user_info_list, options = DocuSign_eSign::DeleteOptions.default) data, _status_code, _headers = delete_with_http_info(account_id, user_info_list, options) return data end # Removes users account privileges. # This closes one or more user records in the account. Users are never deleted from an account, but closing a user prevents them from using account functions. The response returns whether the API execution was successful (200 - OK) or if it failed. The response contains a user structure similar to the request and includes the user changes. If an error occurred during the DELETE operation for any of the users, the response for that user contains an `errorDetails` node with `errorCode` and `message` properties. # @param account_id The external account number (int) or account ID Guid. # @param user_info_list (optional parameter) # @param DocuSign_eSign::DeleteOptions Options for modifying the behavior of the function. # @return [Array<(UsersResponse, Fixnum, Hash)>] UsersResponse data, response status code and response headers def delete_with_http_info(account_id, user_info_list, options = DocuSign_eSign::DeleteOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'delete'] = options.delete if !options.delete.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 = @api_client.object_to_http_body(user_info_list) 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, :return_type => 'UsersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Replaces a particular contact associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_id The unique identifier of a person in the contacts address book. # @return [ContactUpdateResponse] def delete_contact_with_id(account_id, contact_id) data, _status_code, _headers = delete_contact_with_id_with_http_info(account_id, contact_id) return data end # Replaces a particular contact associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_id The unique identifier of a person in the contacts address book. # @return [Array<(ContactUpdateResponse, Fixnum, Hash)>] ContactUpdateResponse data, response status code and response headers def delete_contact_with_id_with_http_info(account_id, contact_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_contact_with_id ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_contact_with_id" if account_id.nil? # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling UsersApi.delete_contact_with_id" if contact_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/contacts/{contactId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'contactId' + '}', contact_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, :return_type => 'ContactUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_contact_with_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete contacts associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [ContactUpdateResponse] def delete_contacts(account_id, contact_mod_request) data, _status_code, _headers = delete_contacts_with_http_info(account_id, contact_mod_request) return data end # Delete contacts associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [Array<(ContactUpdateResponse, Fixnum, Hash)>] ContactUpdateResponse data, response status code and response headers def delete_contacts_with_http_info(account_id, contact_mod_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_contacts ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_contacts" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/contacts".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']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(contact_mod_request) 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, :return_type => 'ContactUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes custom user settings for a specified user. # Deletes the specified custom user settings for a single user. ###Deleting Grouped Custom User Settings### If the custom user settings you want to delete are grouped, you must include the following information in the header, after Content-Type, in the request: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. If the extra header information is not included, only the custom user settings that were added without a group are deleted. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param custom_settings_information (optional parameter) # @return [CustomSettingsInformation] def delete_custom_settings(account_id, user_id, custom_settings_information) data, _status_code, _headers = delete_custom_settings_with_http_info(account_id, user_id, custom_settings_information) return data end # Deletes custom user settings for a specified user. # Deletes the specified custom user settings for a single user. ###Deleting Grouped Custom User Settings### If the custom user settings you want to delete are grouped, you must include the following information in the header, after Content-Type, in the request: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. If the extra header information is not included, only the custom user settings that were added without a group are deleted. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param custom_settings_information (optional parameter) # @return [Array<(CustomSettingsInformation, Fixnum, Hash)>] CustomSettingsInformation data, response status code and response headers def delete_custom_settings_with_http_info(account_id, user_id, custom_settings_information) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_custom_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_custom_settings" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_custom_settings" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/custom_settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 = @api_client.object_to_http_body(custom_settings_information) 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, :return_type => 'CustomSettingsInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_custom_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the user profile image for the specified user. # Deletes the user profile image from the specified user's profile. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [nil] def delete_profile_image(account_id, user_id) delete_profile_image_with_http_info(account_id, user_id) return nil end # Deletes the user profile image for the specified user. # Deletes the user profile image from the specified user's profile. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_profile_image_with_http_info(account_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_profile_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_profile_image" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_profile_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/profile/image".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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: UsersApi#delete_profile_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Removes removes signature information for the specified user. # Removes the signature information for the user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [nil] def delete_signature(account_id, signature_id, user_id) delete_signature_with_http_info(account_id, signature_id, user_id) return nil end # Removes removes signature information for the specified user. # Removes the signature information for the user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_signature_with_http_info(account_id, signature_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_signature ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_signature" if account_id.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.delete_signature" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_signature" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_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: UsersApi#delete_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the user initials image or the user signature image for the specified user. # Deletes the specified initials image or signature image for the specified user. The function deletes one or the other of the image types, to delete both the initials image and signature image you must call the endpoint twice. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [UserSignature] def delete_signature_image(account_id, image_type, signature_id, user_id) data, _status_code, _headers = delete_signature_image_with_http_info(account_id, image_type, signature_id, user_id) return data end # Deletes the user initials image or the user signature image for the specified user. # Deletes the specified initials image or signature image for the specified user. The function deletes one or the other of the image types, to delete both the initials image and signature image you must call the endpoint twice. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(UserSignature, Fixnum, Hash)>] UserSignature data, response status code and response headers def delete_signature_image_with_http_info(account_id, image_type, signature_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_signature_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.delete_signature_image" if account_id.nil? # verify the required parameter 'image_type' is set fail ArgumentError, "Missing the required parameter 'image_type' when calling UsersApi.delete_signature_image" if image_type.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.delete_signature_image" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_signature_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'imageType' + '}', image_type.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_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, :return_type => 'UserSignature') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_signature_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets a particular contact associated with the user's account. # # @param account_id The external account number (int) or account ID Guid. # @param contact_id The unique identifier of a person in the contacts address book. # @param DocuSign_eSign::GetContactByIdOptions Options for modifying the behavior of the function. # @return [ContactGetResponse] def get_contact_by_id(account_id, contact_id, options = DocuSign_eSign::GetContactByIdOptions.default) data, _status_code, _headers = get_contact_by_id_with_http_info(account_id, contact_id, options) return data end # Gets a particular contact associated with the user's account. # # @param account_id The external account number (int) or account ID Guid. # @param contact_id The unique identifier of a person in the contacts address book. # @param DocuSign_eSign::GetContactByIdOptions Options for modifying the behavior of the function. # @return [Array<(ContactGetResponse, Fixnum, Hash)>] ContactGetResponse data, response status code and response headers def get_contact_by_id_with_http_info(account_id, contact_id, options = DocuSign_eSign::GetContactByIdOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_contact_by_id ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_contact_by_id" if account_id.nil? # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling UsersApi.get_contact_by_id" if contact_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/contacts/{contactId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} query_params[:'cloud_provider'] = options.cloud_provider if !options.cloud_provider.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 => 'ContactGetResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_contact_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the user information for a specified user. # Retrieves the user information for the specified user. To return additional user information that details the last login date, login status, and the user's password expiration date, set the optional `additional_info` query string parameter to **true**. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetInformationOptions Options for modifying the behavior of the function. # @return [UserInformation] def get_information(account_id, user_id, options = DocuSign_eSign::GetInformationOptions.default) data, _status_code, _headers = get_information_with_http_info(account_id, user_id, options) return data end # Gets the user information for a specified user. # Retrieves the user information for the specified user. To return additional user information that details the last login date, login status, and the user's password expiration date, set the optional `additional_info` query string parameter to **true**. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetInformationOptions Options for modifying the behavior of the function. # @return [Array<(UserInformation, Fixnum, Hash)>] UserInformation data, response status code and response headers def get_information_with_http_info(account_id, user_id, options = DocuSign_eSign::GetInformationOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_information ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_information" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_information" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'additional_info'] = options.additional_info if !options.additional_info.nil? query_params[:'email'] = options.email if !options.email.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 => 'UserInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_information\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the user profile for a specified user. # Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [UserProfile] def get_profile(account_id, user_id) data, _status_code, _headers = get_profile_with_http_info(account_id, user_id) return data end # Retrieves the user profile for a specified user. # Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(UserProfile, Fixnum, Hash)>] UserProfile data, response status code and response headers def get_profile_with_http_info(account_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_profile ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_profile" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_profile" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/profile".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 => 'UserProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the user profile image for the specified user. # Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. If successful, the response returns a 200 - OK and the user profile image. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetProfileImageOptions Options for modifying the behavior of the function. # @return [File] def get_profile_image(account_id, user_id, options = DocuSign_eSign::GetProfileImageOptions.default) data, _status_code, _headers = get_profile_image_with_http_info(account_id, user_id, options) return data end # Retrieves the user profile image for the specified user. # Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account. If successful, the response returns a 200 - OK and the user profile image. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetProfileImageOptions Options for modifying the behavior of the function. # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def get_profile_image_with_http_info(account_id, user_id, options = DocuSign_eSign::GetProfileImageOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_profile_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_profile_image" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_profile_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/profile/image".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'encoding'] = options.encoding if !options.encoding.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['image/gif']) # 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_profile_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the user account settings for a specified user. # Retrieves a list of the account settings and email notification information for the specified user. The response returns the account setting name/value information and the email notification settings for the specified user. For more information about the different user settings, see the [ML:userSettings list]. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [UserSettingsInformation] def get_settings(account_id, user_id) data, _status_code, _headers = get_settings_with_http_info(account_id, user_id) return data end # Gets the user account settings for a specified user. # Retrieves a list of the account settings and email notification information for the specified user. The response returns the account setting name/value information and the email notification settings for the specified user. For more information about the different user settings, see the [ML:userSettings list]. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(UserSettingsInformation, Fixnum, Hash)>] UserSettingsInformation data, response status code and response headers def get_settings_with_http_info(account_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_settings" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_settings" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 => 'UserSettingsInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the user signature information for the specified user. # Retrieves the structure of a single signature with a known signature name. The userId specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [UserSignature] def get_signature(account_id, signature_id, user_id) data, _status_code, _headers = get_signature_with_http_info(account_id, signature_id, user_id) return data end # Gets the user signature information for the specified user. # Retrieves the structure of a single signature with a known signature name. The userId specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(UserSignature, Fixnum, Hash)>] UserSignature data, response status code and response headers def get_signature_with_http_info(account_id, signature_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_signature ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_signature" if account_id.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.get_signature" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_signature" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_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 => 'UserSignature') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the user initials image or the user signature image for the specified user. # Retrieves the specified initials image or signature image for the specified user. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". ###### Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image. # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetSignatureImageOptions Options for modifying the behavior of the function. # @return [File] def get_signature_image(account_id, image_type, signature_id, user_id, options = DocuSign_eSign::GetSignatureImageOptions.default) data, _status_code, _headers = get_signature_image_with_http_info(account_id, image_type, signature_id, user_id, options) return data end # Retrieves the user initials image or the user signature image for the specified user. # Retrieves the specified initials image or signature image for the specified user. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". ###### Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image. # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::GetSignatureImageOptions Options for modifying the behavior of the function. # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def get_signature_image_with_http_info(account_id, image_type, signature_id, user_id, options = DocuSign_eSign::GetSignatureImageOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_signature_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_signature_image" if account_id.nil? # verify the required parameter 'image_type' is set fail ArgumentError, "Missing the required parameter 'image_type' when calling UsersApi.get_signature_image" if image_type.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.get_signature_image" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_signature_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'imageType' + '}', image_type.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'include_chrome'] = options.include_chrome if !options.include_chrome.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['image/gif']) # 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_signature_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the list of users for the specified account. # Retrieves the list of users for the specified account. The response returns the list of users for the account along with the information about the result set. If the `additional_info` query was added to the endpoint and set to **true**, the full user information is returned for each user # @param account_id The external account number (int) or account ID Guid. # @param DocuSign_eSign::ListOptions Options for modifying the behavior of the function. # @return [UserInformationList] def list(account_id, options = DocuSign_eSign::ListOptions.default) data, _status_code, _headers = list_with_http_info(account_id, options) return data end # Retrieves the list of users for the specified account. # Retrieves the list of users for the specified account. The response returns the list of users for the account along with the information about the result set. If the `additional_info` query was added to the endpoint and set to **true**, the full user information is returned for each user # @param account_id The external account number (int) or account ID Guid. # @param DocuSign_eSign::ListOptions Options for modifying the behavior of the function. # @return [Array<(UserInformationList, Fixnum, Hash)>] UserInformationList data, response status code and response headers def list_with_http_info(account_id, options = DocuSign_eSign::ListOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.list ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.list" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'additional_info'] = options.additional_info if !options.additional_info.nil? query_params[:'count'] = options.count if !options.count.nil? query_params[:'email'] = options.email if !options.email.nil? query_params[:'email_substring'] = options.email_substring if !options.email_substring.nil? query_params[:'group_id'] = options.group_id if !options.group_id.nil? query_params[:'include_usersettings_for_csv'] = options.include_usersettings_for_csv if !options.include_usersettings_for_csv.nil? query_params[:'login_status'] = options.login_status if !options.login_status.nil? query_params[:'not_group_id'] = options.not_group_id if !options.not_group_id.nil? query_params[:'start_position'] = options.start_position if !options.start_position.nil? query_params[:'status'] = options.status if !options.status.nil? query_params[:'user_name_substring'] = options.user_name_substring if !options.user_name_substring.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 => 'UserInformationList') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves the custom user settings for a specified user. # Retrieves a list of custom user settings for a single user. Custom settings provide a flexible way to store and retrieve custom user information that can be used in your own system. ###### Note: Custom user settings are not the same as user account settings. ###Getting Grouped Custom User Settings### If the custom user settings you want to retrieve are grouped, you must include the following information in the header, after Content-Type, in the request: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. If the extra header information is not included, only the custom user settings that were added without a group are retrieved. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [CustomSettingsInformation] def list_custom_settings(account_id, user_id) data, _status_code, _headers = list_custom_settings_with_http_info(account_id, user_id) return data end # Retrieves the custom user settings for a specified user. # Retrieves a list of custom user settings for a single user. Custom settings provide a flexible way to store and retrieve custom user information that can be used in your own system. ###### Note: Custom user settings are not the same as user account settings. ###Getting Grouped Custom User Settings### If the custom user settings you want to retrieve are grouped, you must include the following information in the header, after Content-Type, in the request: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. If the extra header information is not included, only the custom user settings that were added without a group are retrieved. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(CustomSettingsInformation, Fixnum, Hash)>] CustomSettingsInformation data, response status code and response headers def list_custom_settings_with_http_info(account_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.list_custom_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.list_custom_settings" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.list_custom_settings" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/custom_settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 => 'CustomSettingsInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#list_custom_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves a list of user signature definitions for a specified user. # Retrieves the signature definitions for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::ListSignaturesOptions Options for modifying the behavior of the function. # @return [UserSignaturesInformation] def list_signatures(account_id, user_id, options = DocuSign_eSign::ListSignaturesOptions.default) data, _status_code, _headers = list_signatures_with_http_info(account_id, user_id, options) return data end # Retrieves a list of user signature definitions for a specified user. # Retrieves the signature definitions for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::ListSignaturesOptions Options for modifying the behavior of the function. # @return [Array<(UserSignaturesInformation, Fixnum, Hash)>] UserSignaturesInformation data, response status code and response headers def list_signatures_with_http_info(account_id, user_id, options = DocuSign_eSign::ListSignaturesOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.list_signatures ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.list_signatures" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.list_signatures" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'stamp_type'] = options.stamp_type if !options.stamp_type.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 => 'UserSignaturesInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#list_signatures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type). # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [ContactUpdateResponse] def post_contacts(account_id, contact_mod_request) data, _status_code, _headers = post_contacts_with_http_info(account_id, contact_mod_request) return data end # Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type). # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [Array<(ContactUpdateResponse, Fixnum, Hash)>] ContactUpdateResponse data, response status code and response headers def post_contacts_with_http_info(account_id, contact_mod_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_contacts ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.post_contacts" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/contacts".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']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(contact_mod_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 => 'ContactUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Replaces contacts associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [ContactUpdateResponse] def put_contacts(account_id, contact_mod_request) data, _status_code, _headers = put_contacts_with_http_info(account_id, contact_mod_request) return data end # Replaces contacts associated with an account for the DocuSign service. # # @param account_id The external account number (int) or account ID Guid. # @param contact_mod_request (optional parameter) # @return [Array<(ContactUpdateResponse, Fixnum, Hash)>] ContactUpdateResponse data, response status code and response headers def put_contacts_with_http_info(account_id, contact_mod_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_contacts ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.put_contacts" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/contacts".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']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(contact_mod_request) 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 => 'ContactUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds or updates custom user settings for the specified user. # Adds or updates custom user settings for the specified user. ###### Note: Custom user settings are not the same as user account settings. Custom settings provide a flexible way to store and retrieve custom user information that you can use in your own system. **Important**: There is a limit on the size for all the custom user settings for a single user. The limit is 4,000 characters, which includes the XML and JSON structure for the settings. ### Grouping Custom User Settings ### You can group custom user settings when adding them. Grouping allows you to retrieve settings that are in a specific group, instead of retrieving all the user custom settings. To group custom user settings, add the following information in the header, after Content-Type: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. Grouping is shown in the Example Request Body below. When getting or deleting grouped custom user settings, you must include the extra header information. Grouping custom user settings is not required and if the extra header information is not included, the custom user settings are added normally and can be retrieved or deleted without including the additional header. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param custom_settings_information (optional parameter) # @return [CustomSettingsInformation] def update_custom_settings(account_id, user_id, custom_settings_information) data, _status_code, _headers = update_custom_settings_with_http_info(account_id, user_id, custom_settings_information) return data end # Adds or updates custom user settings for the specified user. # Adds or updates custom user settings for the specified user. ###### Note: Custom user settings are not the same as user account settings. Custom settings provide a flexible way to store and retrieve custom user information that you can use in your own system. **Important**: There is a limit on the size for all the custom user settings for a single user. The limit is 4,000 characters, which includes the XML and JSON structure for the settings. ### Grouping Custom User Settings ### You can group custom user settings when adding them. Grouping allows you to retrieve settings that are in a specific group, instead of retrieving all the user custom settings. To group custom user settings, add the following information in the header, after Content-Type: `X-DocuSign-User-Settings-Key:group_name` Where the `group_name` is your designated name for the group of customer user settings. Grouping is shown in the Example Request Body below. When getting or deleting grouped custom user settings, you must include the extra header information. Grouping custom user settings is not required and if the extra header information is not included, the custom user settings are added normally and can be retrieved or deleted without including the additional header. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param custom_settings_information (optional parameter) # @return [Array<(CustomSettingsInformation, Fixnum, Hash)>] CustomSettingsInformation data, response status code and response headers def update_custom_settings_with_http_info(account_id, user_id, custom_settings_information) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_custom_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_custom_settings" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_custom_settings" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/custom_settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 = @api_client.object_to_http_body(custom_settings_information) 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 => 'CustomSettingsInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_custom_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the user profile information for the specified user. # Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card. You can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_profile (optional parameter) # @return [nil] def update_profile(account_id, user_id, user_profile) update_profile_with_http_info(account_id, user_id, user_profile) return nil end # Updates the user profile information for the specified user. # Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card. You can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_profile (optional parameter) # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_profile_with_http_info(account_id, user_id, user_profile) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_profile ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_profile" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_profile" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/profile".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 = @api_client.object_to_http_body(user_profile) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the user profile image for a specified user. # Updates the user profile image by uploading an image to the user profile. The supported image formats are: gif, png, jpeg, and bmp. The file must be less than 200K. For best viewing results, DocuSign recommends that the image is no more than 79 pixels wide and high. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [nil] def update_profile_image(account_id, user_id) update_profile_image_with_http_info(account_id, user_id) return nil end # Updates the user profile image for a specified user. # Updates the user profile image by uploading an image to the user profile. The supported image formats are: gif, png, jpeg, and bmp. The file must be less than 200K. For best viewing results, DocuSign recommends that the image is no more than 79 pixels wide and high. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_profile_image_with_http_info(account_id, user_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_profile_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_profile_image" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_profile_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/profile/image".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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(['image/gif']) # 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_profile_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the user account settings for a specified user. # Updates the account settings list and email notification types for the specified user. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_settings_information (optional parameter) # @param DocuSign_eSign::UpdateSettingsOptions Options for modifying the behavior of the function. # @return [nil] def update_settings(account_id, user_id, user_settings_information, options = DocuSign_eSign::UpdateSettingsOptions.default) update_settings_with_http_info(account_id, user_id, user_settings_information, options) return nil end # Updates the user account settings for a specified user. # Updates the account settings list and email notification types for the specified user. # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_settings_information (optional parameter) # @param DocuSign_eSign::UpdateSettingsOptions Options for modifying the behavior of the function. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_settings_with_http_info(account_id, user_id, user_settings_information, options = DocuSign_eSign::UpdateSettingsOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_settings" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_settings" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'allow_all_languages'] = options.allow_all_languages if !options.allow_all_languages.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 = @api_client.object_to_http_body(user_settings_information) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the user signature for a specified user. # Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature. ###### Note: This will also create a default signature for the user when one does not exist. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signature_definition (optional parameter) # @param DocuSign_eSign::UpdateSignatureOptions Options for modifying the behavior of the function. # @return [UserSignature] def update_signature(account_id, signature_id, user_id, user_signature_definition, options = DocuSign_eSign::UpdateSignatureOptions.default) data, _status_code, _headers = update_signature_with_http_info(account_id, signature_id, user_id, user_signature_definition, options) return data end # Updates the user signature for a specified user. # Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature. ###### Note: This will also create a default signature for the user when one does not exist. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signature_definition (optional parameter) # @param DocuSign_eSign::UpdateSignatureOptions Options for modifying the behavior of the function. # @return [Array<(UserSignature, Fixnum, Hash)>] UserSignature data, response status code and response headers def update_signature_with_http_info(account_id, signature_id, user_id, user_signature_definition, options = DocuSign_eSign::UpdateSignatureOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_signature ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_signature" if account_id.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.update_signature" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_signature" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'close_existing_signature'] = options.close_existing_signature if !options.close_existing_signature.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 = @api_client.object_to_http_body(user_signature_definition) 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 => 'UserSignature') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the user signature image or user initials image for the specified user. # Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::UpdateSignatureImageOptions Options for modifying the behavior of the function. # @return [UserSignature] def update_signature_image(account_id, image_type, signature_id, user_id, options = DocuSign_eSign::UpdateSignatureImageOptions.default) data, _status_code, _headers = update_signature_image_with_http_info(account_id, image_type, signature_id, user_id, options) return data end # Updates the user signature image or user initials image for the specified user. # Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K. The userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. For example encode \"Bob Smith\" as \"Bob%20Smith\". # @param account_id The external account number (int) or account ID Guid. # @param image_type One of **signature_image** or **initials_image**. # @param signature_id The ID of the signature being accessed. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param DocuSign_eSign::UpdateSignatureImageOptions Options for modifying the behavior of the function. # @return [Array<(UserSignature, Fixnum, Hash)>] UserSignature data, response status code and response headers def update_signature_image_with_http_info(account_id, image_type, signature_id, user_id, options = DocuSign_eSign::UpdateSignatureImageOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_signature_image ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_signature_image" if account_id.nil? # verify the required parameter 'image_type' is set fail ArgumentError, "Missing the required parameter 'image_type' when calling UsersApi.update_signature_image" if image_type.nil? # verify the required parameter 'signature_id' is set fail ArgumentError, "Missing the required parameter 'signature_id' when calling UsersApi.update_signature_image" if signature_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_signature_image" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'imageType' + '}', image_type.to_s).sub('{' + 'signatureId' + '}', signature_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'transparent_png'] = options.transparent_png if !options.transparent_png.nil? # 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(['image/gif']) # 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 => 'UserSignature') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_signature_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds/updates a user signature. # # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signatures_information (optional parameter) # @return [UserSignaturesInformation] def update_signatures(account_id, user_id, user_signatures_information) data, _status_code, _headers = update_signatures_with_http_info(account_id, user_id, user_signatures_information) return data end # Adds/updates a user signature. # # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_signatures_information (optional parameter) # @return [Array<(UserSignaturesInformation, Fixnum, Hash)>] UserSignaturesInformation data, response status code and response headers def update_signatures_with_http_info(account_id, user_id, user_signatures_information) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_signatures ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_signatures" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_signatures" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}/signatures".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_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 = @api_client.object_to_http_body(user_signatures_information) 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 => 'UserSignaturesInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_signatures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the specified user information. # # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_information (optional parameter) # @param DocuSign_eSign::UpdateUserOptions Options for modifying the behavior of the function. # @return [UserInformation] def update_user(account_id, user_id, user_information, options = DocuSign_eSign::UpdateUserOptions.default) data, _status_code, _headers = update_user_with_http_info(account_id, user_id, user_information, options) return data end # Updates the specified user information. # # @param account_id The external account number (int) or account ID Guid. # @param user_id The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. # @param user_information (optional parameter) # @param DocuSign_eSign::UpdateUserOptions Options for modifying the behavior of the function. # @return [Array<(UserInformation, Fixnum, Hash)>] UserInformation data, response status code and response headers def update_user_with_http_info(account_id, user_id, user_information, options = DocuSign_eSign::UpdateUserOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_user ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_user" if account_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_user" if user_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users/{userId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'allow_all_languages'] = options.allow_all_languages if !options.allow_all_languages.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 = @api_client.object_to_http_body(user_information) 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 => 'UserInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Change one or more user in the specified account. # # @param account_id The external account number (int) or account ID Guid. # @param user_information_list (optional parameter) # @param DocuSign_eSign::UpdateUsersOptions Options for modifying the behavior of the function. # @return [UserInformationList] def update_users(account_id, user_information_list, options = DocuSign_eSign::UpdateUsersOptions.default) data, _status_code, _headers = update_users_with_http_info(account_id, user_information_list, options) return data end # Change one or more user in the specified account. # # @param account_id The external account number (int) or account ID Guid. # @param user_information_list (optional parameter) # @param DocuSign_eSign::UpdateUsersOptions Options for modifying the behavior of the function. # @return [Array<(UserInformationList, Fixnum, Hash)>] UserInformationList data, response status code and response headers def update_users_with_http_info(account_id, user_information_list, options = DocuSign_eSign::UpdateUsersOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.update_users ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_users" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/users".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'allow_all_languages'] = options.allow_all_languages if !options.allow_all_languages.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 = @api_client.object_to_http_body(user_information_list) 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 => 'UserInformationList') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end