Class: Files::User
- Inherits:
-
Object
- Object
- Files::User
- Defined in:
- lib/files.com/models/user.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: avatar_file - file - An image file for your user avatar.
-
.delete(id, params = {}, options = {}) ⇒ Object
Parameters: new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - User ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
-
.resend_welcome_email(id, params = {}, options = {}) ⇒ Object
Resend user welcome email.
-
.unlock(id, params = {}, options = {}) ⇒ Object
Unlock user who has been locked out due to failed logins.
-
.update(id, params = {}, options = {}) ⇒ Object
Parameters: avatar_file - file - An image file for your user avatar.
-
.user_2fa_reset(id, params = {}, options = {}) ⇒ Object
Trigger 2FA Reset process for user who has lost access to their existing 2FA methods.
Instance Method Summary collapse
-
#active_2fa ⇒ Object
boolean - Is 2fa active for the user?.
- #active_2fa=(value) ⇒ Object
-
#admin_group_ids ⇒ Object
array(int64) - List of group IDs of which this user is an administrator.
- #admin_group_ids=(value) ⇒ Object
-
#allowed_ips ⇒ Object
string - A list of allowed IPs if applicable.
- #allowed_ips=(value) ⇒ Object
-
#announcements_read ⇒ Object
boolean - Signifies that the user has read all the announcements in the UI.
- #announcements_read=(value) ⇒ Object
-
#api_keys_count ⇒ Object
int64 - Number of API keys associated with this user.
- #api_keys_count=(value) ⇒ Object
-
#attachments_permission ⇒ Object
boolean - If ‘true`, the user can user create Bundles (aka Share Links).
- #attachments_permission=(value) ⇒ Object
-
#authenticate_until ⇒ Object
date-time - Scheduled Date/Time at which user will be deactivated.
- #authenticate_until=(value) ⇒ Object
-
#authentication_method ⇒ Object
string - How is this user authenticated?.
- #authentication_method=(value) ⇒ Object
-
#avatar_delete ⇒ Object
boolean - If true, the avatar will be deleted.
- #avatar_delete=(value) ⇒ Object
-
#avatar_file ⇒ Object
file - An image file for your user avatar.
- #avatar_file=(value) ⇒ Object
-
#avatar_url ⇒ Object
string - URL holding the user’s avatar.
- #avatar_url=(value) ⇒ Object
-
#billable ⇒ Object
boolean - Is this a billable user record?.
- #billable=(value) ⇒ Object
-
#billing_permission ⇒ Object
boolean - Allow this user to perform operations on the account, payments, and invoices?.
- #billing_permission=(value) ⇒ Object
-
#bypass_site_allowed_ips ⇒ Object
boolean - Allow this user to skip site-wide IP blacklists?.
- #bypass_site_allowed_ips=(value) ⇒ Object
-
#bypass_user_lifecycle_rules ⇒ Object
boolean - Exempt this user from user lifecycle rules?.
- #bypass_user_lifecycle_rules=(value) ⇒ Object
-
#change_password ⇒ Object
string - Used for changing a password on an existing user.
- #change_password=(value) ⇒ Object
-
#change_password_confirmation ⇒ Object
string - Optional, but if provided, we will ensure that it matches the value sent in ‘change_password`.
- #change_password_confirmation=(value) ⇒ Object
-
#clear_2fa ⇒ Object
boolean - If true when changing authentication_method from ‘password` to `sso`, remove all two-factor methods.
- #clear_2fa=(value) ⇒ Object
-
#company ⇒ Object
string - User’s company.
- #company=(value) ⇒ Object
-
#convert_to_partner_user ⇒ Object
boolean - If true, convert this user to a partner user by assigning the partner_id provided.
- #convert_to_partner_user=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - When this user was created.
-
#dav_permission ⇒ Object
boolean - Can the user connect with WebDAV?.
- #dav_permission=(value) ⇒ Object
-
#days_remaining_until_password_expire ⇒ Object
int64 - Number of days remaining until password expires.
- #days_remaining_until_password_expire=(value) ⇒ Object
-
#delete(params = {}) ⇒ Object
Parameters: new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
- #destroy(params = {}) ⇒ Object
-
#disabled ⇒ Object
boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes.
- #disabled=(value) ⇒ Object
-
#disabled_expired_or_inactive ⇒ Object
boolean - Computed property that returns true if user disabled or expired or inactive.
- #disabled_expired_or_inactive=(value) ⇒ Object
-
#email ⇒ Object
email - User email address.
- #email=(value) ⇒ Object
-
#externally_managed ⇒ Object
boolean - Is this user managed by a SsoStrategy?.
- #externally_managed=(value) ⇒ Object
-
#filesystem_layout ⇒ Object
string - File system layout.
- #filesystem_layout=(value) ⇒ Object
-
#first_login_at ⇒ Object
date-time - User’s first login time.
- #first_login_at=(value) ⇒ Object
-
#ftp_permission ⇒ Object
boolean - Can the user access with FTP/FTPS?.
- #ftp_permission=(value) ⇒ Object
-
#grant_permission ⇒ Object
string - Permission to grant on the User Root upon user creation.
- #grant_permission=(value) ⇒ Object
-
#group_id ⇒ Object
int64 - Group ID to associate this user with.
- #group_id=(value) ⇒ Object
-
#group_ids ⇒ Object
string - Comma-separated list of group IDs of which this user is a member.
- #group_ids=(value) ⇒ Object
-
#header_text ⇒ Object
string - Text to display to the user in the header of the UI.
- #header_text=(value) ⇒ Object
-
#id ⇒ Object
int64 - User ID.
- #id=(value) ⇒ Object
-
#imported_password_hash ⇒ Object
string - Pre-calculated hash of the user’s password.
- #imported_password_hash=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ User
constructor
A new instance of User.
-
#language ⇒ Object
string - Preferred language.
- #language=(value) ⇒ Object
-
#last_active_at ⇒ Object
date-time - User’s most recent activity time, which is the latest of most recent login, most recent API use, enablement, or creation.
- #last_active_at=(value) ⇒ Object
-
#last_api_use_at ⇒ Object
date-time - User’s most recent API use time.
- #last_api_use_at=(value) ⇒ Object
-
#last_dav_login_at ⇒ Object
date-time - User’s most recent login time via WebDAV.
- #last_dav_login_at=(value) ⇒ Object
-
#last_desktop_login_at ⇒ Object
date-time - User’s most recent login time via Desktop app.
- #last_desktop_login_at=(value) ⇒ Object
-
#last_ftp_login_at ⇒ Object
date-time - User’s most recent login time via FTP.
- #last_ftp_login_at=(value) ⇒ Object
-
#last_login_at ⇒ Object
date-time - User’s most recent login time via any protocol.
- #last_login_at=(value) ⇒ Object
-
#last_protocol_cipher ⇒ Object
string - The most recent protocol and cipher used.
- #last_protocol_cipher=(value) ⇒ Object
-
#last_restapi_login_at ⇒ Object
date-time - User’s most recent login time via Rest API.
- #last_restapi_login_at=(value) ⇒ Object
-
#last_sftp_login_at ⇒ Object
date-time - User’s most recent login time via SFTP.
- #last_sftp_login_at=(value) ⇒ Object
-
#last_web_login_at ⇒ Object
date-time - User’s most recent login time via web.
- #last_web_login_at=(value) ⇒ Object
-
#lockout_expires ⇒ Object
date-time - Time in the future that the user will no longer be locked out if applicable.
- #lockout_expires=(value) ⇒ Object
-
#name ⇒ Object
string - User’s full name.
- #name=(value) ⇒ Object
-
#notes ⇒ Object
string - Any internal notes on the user.
- #notes=(value) ⇒ Object
-
#notification_daily_send_time ⇒ Object
int64 - Hour of the day at which daily notifications should be sent.
- #notification_daily_send_time=(value) ⇒ Object
-
#office_integration_enabled ⇒ Object
boolean - Enable integration with Office for the web?.
- #office_integration_enabled=(value) ⇒ Object
-
#partner_admin ⇒ Object
boolean - Is this user a Partner administrator?.
- #partner_admin=(value) ⇒ Object
-
#partner_id ⇒ Object
int64 - Partner ID if this user belongs to a Partner.
- #partner_id=(value) ⇒ Object
-
#partner_name ⇒ Object
string - Name of the Partner if this user belongs to a Partner.
- #partner_name=(value) ⇒ Object
-
#password ⇒ Object
string - User password.
- #password=(value) ⇒ Object
-
#password_confirmation ⇒ Object
string - Optional, but if provided, we will ensure that it matches the value sent in ‘password`.
- #password_confirmation=(value) ⇒ Object
-
#password_expire_at ⇒ Object
date-time - Password expiration datetime.
- #password_expire_at=(value) ⇒ Object
-
#password_expired ⇒ Object
boolean - Is user’s password expired?.
- #password_expired=(value) ⇒ Object
-
#password_set_at ⇒ Object
date-time - Last time the user’s password was set.
- #password_set_at=(value) ⇒ Object
-
#password_validity_days ⇒ Object
int64 - Number of days to allow user to use the same password.
- #password_validity_days=(value) ⇒ Object
-
#public_keys_count ⇒ Object
int64 - Number of public keys associated with this user.
- #public_keys_count=(value) ⇒ Object
-
#readonly_site_admin ⇒ Object
boolean - Is the user an allowed to view all (non-billing) site configuration for this site?.
- #readonly_site_admin=(value) ⇒ Object
-
#receive_admin_alerts ⇒ Object
boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?.
- #receive_admin_alerts=(value) ⇒ Object
-
#require_2fa ⇒ Object
string - 2FA required setting.
- #require_2fa=(value) ⇒ Object
-
#require_login_by ⇒ Object
date-time - Require user to login by specified date otherwise it will be disabled.
- #require_login_by=(value) ⇒ Object
-
#require_password_change ⇒ Object
boolean - Is a password change required upon next user login?.
- #require_password_change=(value) ⇒ Object
-
#resend_welcome_email(params = {}) ⇒ Object
Resend user welcome email.
-
#restapi_permission ⇒ Object
boolean - Can this user access the Web app, Desktop app, SDKs, or REST API? (All of these tools use the API internally, so this is one unified permission set.).
- #restapi_permission=(value) ⇒ Object
- #save ⇒ Object
-
#self_managed ⇒ Object
boolean - Does this user manage it’s own credentials or is it a shared/bot user?.
- #self_managed=(value) ⇒ Object
-
#sftp_permission ⇒ Object
boolean - Can the user access with SFTP?.
- #sftp_permission=(value) ⇒ Object
-
#site_admin ⇒ Object
boolean - Is the user an administrator for this site?.
- #site_admin=(value) ⇒ Object
-
#site_id ⇒ Object
int64 - Site ID.
- #site_id=(value) ⇒ Object
-
#skip_welcome_screen ⇒ Object
boolean - Skip Welcome page in the UI?.
- #skip_welcome_screen=(value) ⇒ Object
-
#ssl_required ⇒ Object
string - SSL required setting.
- #ssl_required=(value) ⇒ Object
-
#sso_strategy_id ⇒ Object
int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
- #sso_strategy_id=(value) ⇒ Object
-
#subscribe_to_newsletter ⇒ Object
boolean - Is the user subscribed to the newsletter?.
- #subscribe_to_newsletter=(value) ⇒ Object
-
#tags ⇒ Object
string - Comma-separated list of Tags for this user.
- #tags=(value) ⇒ Object
-
#time_zone ⇒ Object
string - User time zone.
- #time_zone=(value) ⇒ Object
-
#type_of_2fa ⇒ Object
string - Type(s) of 2FA methods in use, for programmatic use.
- #type_of_2fa=(value) ⇒ Object
-
#type_of_2fa_for_display ⇒ Object
string - Type(s) of 2FA methods in use, formatted for displaying in the UI.
- #type_of_2fa_for_display=(value) ⇒ Object
-
#unlock(params = {}) ⇒ Object
Unlock user who has been locked out due to failed logins.
-
#update(params = {}) ⇒ Object
Parameters: avatar_file - file - An image file for your user avatar.
-
#user_2fa_reset(params = {}) ⇒ Object
Trigger 2FA Reset process for user who has lost access to their existing 2FA methods.
-
#user_home ⇒ Object
string - Home folder for FTP/SFTP.
- #user_home=(value) ⇒ Object
-
#user_root ⇒ Object
string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set).
- #user_root=(value) ⇒ Object
-
#username ⇒ Object
string - User’s username.
- #username=(value) ⇒ Object
-
#workspace_admin ⇒ Object
boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
- #workspace_admin=(value) ⇒ Object
-
#workspace_id ⇒ Object
int64 - Workspace ID.
- #workspace_id=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ User
Returns a new instance of User.
7 8 9 10 |
# File 'lib/files.com/models/user.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/user.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/user.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
961 962 963 |
# File 'lib/files.com/models/user.rb', line 961 def self.all(params = {}, = {}) list(params, ) end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
avatar_file - file - An image file for your user avatar.
avatar_delete - boolean - If true, the avatar will be deleted.
change_password - string - Used for changing a password on an existing user.
change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
email - string - User's email.
grant_permission - string - Permission to grant on the User Root upon user creation. Can be blank or `full`, `read`, `write`, `list`, `read+write`, or `list+write`
group_id - int64 - Group ID to associate this user with.
group_ids - string - A list of group ids to associate this user with. Comma delimited.
imported_password_hash - string - Pre-calculated hash of the user's password. If supplied, this will be used to authenticate the user on first login. Supported hash methods are MD5, SHA1, and SHA256.
password - string - User password.
password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `password`.
announcements_read - boolean - Signifies that the user has read all the announcements in the UI.
allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
attachments_permission - boolean - DEPRECATED: If `true`, the user can user create Bundles (aka Share Links). Use the bundle permission instead.
authenticate_until - string - Scheduled Date/Time at which user will be deactivated
authentication_method - string - How is this user authenticated?
billing_permission - boolean - Allow this user to perform operations on the account, payments, and invoices?
bypass_user_lifecycle_rules - boolean - Exempt this user from user lifecycle rules?
bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
dav_permission - boolean - Can the user connect with WebDAV?
disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
filesystem_layout - string - File system layout
ftp_permission - boolean - Can the user access with FTP/FTPS?
header_text - string - Text to display to the user in the header of the UI
language - string - Preferred language
notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
name - string - User's full name
company - string - User's company
notes - string - Any internal notes on the user
office_integration_enabled - boolean - Enable integration with Office for the web?
partner_admin - boolean - Is this user a Partner administrator?
partner_id - int64 - Partner ID if this user belongs to a Partner
password_validity_days - int64 - Number of days to allow user to use the same password
readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_login_by - string - Require user to login by specified date otherwise it will be disabled.
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the Web app, Desktop app, SDKs, or REST API? (All of these tools use the API internally, so this is one unified permission set.)
self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
sftp_permission - boolean - Can the user access with SFTP?
site_admin - boolean - Is the user an administrator for this site?
skip_welcome_screen - boolean - Skip Welcome page in the UI?
ssl_required - string - SSL required setting
sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
require_2fa - string - 2FA required setting
tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
time_zone - string - User time zone
user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
username (required) - string - User's username
workspace_id - int64 - Workspace ID
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 |
# File 'lib/files.com/models/user.rb', line 1035 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params[:change_password] and !params[:change_password].is_a?(String) raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params[:change_password_confirmation] and !params[:change_password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String) raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params[:grant_permission] and !params[:grant_permission].is_a?(String) raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params[:group_ids] and !params[:group_ids].is_a?(String) raise InvalidParameterError.new("Bad parameter: imported_password_hash must be an String") if params[:imported_password_hash] and !params[:imported_password_hash].is_a?(String) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params[:password_confirmation] and !params[:password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params[:allowed_ips] and !params[:allowed_ips].is_a?(String) raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params[:authenticate_until] and !params[:authenticate_until].is_a?(String) raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String) raise InvalidParameterError.new("Bad parameter: filesystem_layout must be an String") if params[:filesystem_layout] and !params[:filesystem_layout].is_a?(String) raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params[:header_text] and !params[:header_text].is_a?(String) raise InvalidParameterError.new("Bad parameter: language must be an String") if params[:language] and !params[:language].is_a?(String) raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params[:notification_daily_send_time] and !params[:notification_daily_send_time].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String) raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String) raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String) raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String) raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params[:sso_strategy_id] and !params[:sso_strategy_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params[:require_2fa] and !params[:require_2fa].is_a?(String) raise InvalidParameterError.new("Bad parameter: tags must be an String") if params[:tags] and !params[:tags].is_a?(String) raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params[:time_zone] and !params[:time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params[:user_root] and !params[:user_root].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_home must be an String") if params[:user_home] and !params[:user_home].is_a?(String) raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String) raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: username") unless params[:username] response, = Api.send_request("/users", :post, params, ) User.new(response.data, ) end |
.delete(id, params = {}, options = {}) ⇒ Object
Parameters:
new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
# File 'lib/files.com/models/user.rb', line 1203 def self.delete(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: new_owner_id must be an Integer") if params[:new_owner_id] and !params[:new_owner_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{params[:id]}", :delete, params, ) nil end |
.destroy(id, params = {}, options = {}) ⇒ Object
1214 1215 1216 1217 |
# File 'lib/files.com/models/user.rb', line 1214 def self.destroy(id, params = {}, = {}) delete(id, params, ) nil end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - User ID.
967 968 969 970 971 972 973 974 975 |
# File 'lib/files.com/models/user.rb', line 967 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/users/#{params[:id]}", :get, params, ) User.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
977 978 979 |
# File 'lib/files.com/models/user.rb', line 977 def self.get(id, params = {}, = {}) find(id, params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id`, `company`, `name`, `disabled`, `authenticate_until`, `username`, `email`, `last_desktop_login_at`, `last_login_at`, `site_admin`, `password_validity_days` or `ssl_required`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[ company, name ]`, `[ workspace_id, name ]`, `[ workspace_id, email ]`, `[ workspace_id, company ]`, `[ workspace_id, disabled ]`, `[ workspace_id, disabled, username ]` or `[ workspace_id, company, name ]`.
filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`. Valid field combinations are `[ company, name ]`.
filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
ids - string - comma-separated list of User IDs
include_parent_site_users - boolean - Include users from the parent site.
search - string - Searches for partial matches of name, username, or email.
943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 |
# File 'lib/files.com/models/user.rb', line 943 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: ids must be an String") if params[:ids] and !params[:ids].is_a?(String) raise InvalidParameterError.new("Bad parameter: search must be an String") if params[:search] and !params[:search].is_a?(String) List.new(User, params) do Api.send_request("/users", :get, params, ) end end |
.resend_welcome_email(id, params = {}, options = {}) ⇒ Object
Resend user welcome email
1085 1086 1087 1088 1089 1090 1091 1092 1093 |
# File 'lib/files.com/models/user.rb', line 1085 def self.resend_welcome_email(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{params[:id]}/resend_welcome_email", :post, params, ) nil end |
.unlock(id, params = {}, options = {}) ⇒ Object
Unlock user who has been locked out due to failed logins
1074 1075 1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/files.com/models/user.rb', line 1074 def self.unlock(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{params[:id]}/unlock", :post, params, ) nil end |
.update(id, params = {}, options = {}) ⇒ Object
Parameters:
avatar_file - file - An image file for your user avatar.
avatar_delete - boolean - If true, the avatar will be deleted.
change_password - string - Used for changing a password on an existing user.
change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
email - string - User's email.
grant_permission - string - Permission to grant on the User Root upon user creation. Can be blank or `full`, `read`, `write`, `list`, `read+write`, or `list+write`
group_id - int64 - Group ID to associate this user with.
group_ids - string - A list of group ids to associate this user with. Comma delimited.
imported_password_hash - string - Pre-calculated hash of the user's password. If supplied, this will be used to authenticate the user on first login. Supported hash methods are MD5, SHA1, and SHA256.
password - string - User password.
password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `password`.
announcements_read - boolean - Signifies that the user has read all the announcements in the UI.
allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
attachments_permission - boolean - DEPRECATED: If `true`, the user can user create Bundles (aka Share Links). Use the bundle permission instead.
authenticate_until - string - Scheduled Date/Time at which user will be deactivated
authentication_method - string - How is this user authenticated?
billing_permission - boolean - Allow this user to perform operations on the account, payments, and invoices?
bypass_user_lifecycle_rules - boolean - Exempt this user from user lifecycle rules?
bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
dav_permission - boolean - Can the user connect with WebDAV?
disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
filesystem_layout - string - File system layout
ftp_permission - boolean - Can the user access with FTP/FTPS?
header_text - string - Text to display to the user in the header of the UI
language - string - Preferred language
notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
name - string - User's full name
company - string - User's company
notes - string - Any internal notes on the user
office_integration_enabled - boolean - Enable integration with Office for the web?
partner_admin - boolean - Is this user a Partner administrator?
partner_id - int64 - Partner ID if this user belongs to a Partner
password_validity_days - int64 - Number of days to allow user to use the same password
readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_login_by - string - Require user to login by specified date otherwise it will be disabled.
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the Web app, Desktop app, SDKs, or REST API? (All of these tools use the API internally, so this is one unified permission set.)
self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
sftp_permission - boolean - Can the user access with SFTP?
site_admin - boolean - Is the user an administrator for this site?
skip_welcome_screen - boolean - Skip Welcome page in the UI?
ssl_required - string - SSL required setting
sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
require_2fa - string - 2FA required setting
tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
time_zone - string - User time zone
user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
username - string - User's username
clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 |
# File 'lib/files.com/models/user.rb', line 1161 def self.update(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params[:change_password] and !params[:change_password].is_a?(String) raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params[:change_password_confirmation] and !params[:change_password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String) raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params[:grant_permission] and !params[:grant_permission].is_a?(String) raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params[:group_ids] and !params[:group_ids].is_a?(String) raise InvalidParameterError.new("Bad parameter: imported_password_hash must be an String") if params[:imported_password_hash] and !params[:imported_password_hash].is_a?(String) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params[:password_confirmation] and !params[:password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params[:allowed_ips] and !params[:allowed_ips].is_a?(String) raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params[:authenticate_until] and !params[:authenticate_until].is_a?(String) raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String) raise InvalidParameterError.new("Bad parameter: filesystem_layout must be an String") if params[:filesystem_layout] and !params[:filesystem_layout].is_a?(String) raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params[:header_text] and !params[:header_text].is_a?(String) raise InvalidParameterError.new("Bad parameter: language must be an String") if params[:language] and !params[:language].is_a?(String) raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params[:notification_daily_send_time] and !params[:notification_daily_send_time].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String) raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String) raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String) raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String) raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params[:sso_strategy_id] and !params[:sso_strategy_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params[:require_2fa] and !params[:require_2fa].is_a?(String) raise InvalidParameterError.new("Bad parameter: tags must be an String") if params[:tags] and !params[:tags].is_a?(String) raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params[:time_zone] and !params[:time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params[:user_root] and !params[:user_root].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_home must be an String") if params[:user_home] and !params[:user_home].is_a?(String) raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/users/#{params[:id]}", :patch, params, ) User.new(response.data, ) end |
.user_2fa_reset(id, params = {}, options = {}) ⇒ Object
Trigger 2FA Reset process for user who has lost access to their existing 2FA methods
1096 1097 1098 1099 1100 1101 1102 1103 1104 |
# File 'lib/files.com/models/user.rb', line 1096 def self.user_2fa_reset(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{params[:id]}/2fa/reset", :post, params, ) nil end |
Instance Method Details
#active_2fa ⇒ Object
boolean - Is 2fa active for the user?
450 451 452 |
# File 'lib/files.com/models/user.rb', line 450 def active_2fa @attributes[:active_2fa] end |
#active_2fa=(value) ⇒ Object
454 455 456 |
# File 'lib/files.com/models/user.rb', line 454 def active_2fa=(value) @attributes[:active_2fa] = value end |
#admin_group_ids ⇒ Object
array(int64) - List of group IDs of which this user is an administrator
31 32 33 |
# File 'lib/files.com/models/user.rb', line 31 def admin_group_ids @attributes[:admin_group_ids] end |
#admin_group_ids=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/user.rb', line 35 def admin_group_ids=(value) @attributes[:admin_group_ids] = value end |
#allowed_ips ⇒ Object
string - A list of allowed IPs if applicable. Newline delimited
40 41 42 |
# File 'lib/files.com/models/user.rb', line 40 def allowed_ips @attributes[:allowed_ips] end |
#allowed_ips=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/user.rb', line 44 def allowed_ips=(value) @attributes[:allowed_ips] = value end |
#announcements_read ⇒ Object
boolean - Signifies that the user has read all the announcements in the UI.
747 748 749 |
# File 'lib/files.com/models/user.rb', line 747 def announcements_read @attributes[:announcements_read] end |
#announcements_read=(value) ⇒ Object
751 752 753 |
# File 'lib/files.com/models/user.rb', line 751 def announcements_read=(value) @attributes[:announcements_read] = value end |
#api_keys_count ⇒ Object
int64 - Number of API keys associated with this user
58 59 60 |
# File 'lib/files.com/models/user.rb', line 58 def api_keys_count @attributes[:api_keys_count] end |
#api_keys_count=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/user.rb', line 62 def api_keys_count=(value) @attributes[:api_keys_count] = value end |
#attachments_permission ⇒ Object
boolean - If ‘true`, the user can user create Bundles (aka Share Links). Use the bundle permission instead.
49 50 51 |
# File 'lib/files.com/models/user.rb', line 49 def @attributes[:attachments_permission] end |
#attachments_permission=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/user.rb', line 53 def (value) @attributes[:attachments_permission] = value end |
#authenticate_until ⇒ Object
date-time - Scheduled Date/Time at which user will be deactivated
67 68 69 |
# File 'lib/files.com/models/user.rb', line 67 def authenticate_until @attributes[:authenticate_until] end |
#authenticate_until=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/user.rb', line 71 def authenticate_until=(value) @attributes[:authenticate_until] = value end |
#authentication_method ⇒ Object
string - How is this user authenticated?
76 77 78 |
# File 'lib/files.com/models/user.rb', line 76 def authentication_method @attributes[:authentication_method] end |
#authentication_method=(value) ⇒ Object
80 81 82 |
# File 'lib/files.com/models/user.rb', line 80 def authentication_method=(value) @attributes[:authentication_method] = value end |
#avatar_delete ⇒ Object
boolean - If true, the avatar will be deleted.
675 676 677 |
# File 'lib/files.com/models/user.rb', line 675 def avatar_delete @attributes[:avatar_delete] end |
#avatar_delete=(value) ⇒ Object
679 680 681 |
# File 'lib/files.com/models/user.rb', line 679 def avatar_delete=(value) @attributes[:avatar_delete] = value end |
#avatar_file ⇒ Object
file - An image file for your user avatar.
666 667 668 |
# File 'lib/files.com/models/user.rb', line 666 def avatar_file @attributes[:avatar_file] end |
#avatar_file=(value) ⇒ Object
670 671 672 |
# File 'lib/files.com/models/user.rb', line 670 def avatar_file=(value) @attributes[:avatar_file] = value end |
#avatar_url ⇒ Object
string - URL holding the user’s avatar
85 86 87 |
# File 'lib/files.com/models/user.rb', line 85 def avatar_url @attributes[:avatar_url] end |
#avatar_url=(value) ⇒ Object
89 90 91 |
# File 'lib/files.com/models/user.rb', line 89 def avatar_url=(value) @attributes[:avatar_url] = value end |
#billable ⇒ Object
boolean - Is this a billable user record?
94 95 96 |
# File 'lib/files.com/models/user.rb', line 94 def billable @attributes[:billable] end |
#billable=(value) ⇒ Object
98 99 100 |
# File 'lib/files.com/models/user.rb', line 98 def billable=(value) @attributes[:billable] = value end |
#billing_permission ⇒ Object
boolean - Allow this user to perform operations on the account, payments, and invoices?
103 104 105 |
# File 'lib/files.com/models/user.rb', line 103 def @attributes[:billing_permission] end |
#billing_permission=(value) ⇒ Object
107 108 109 |
# File 'lib/files.com/models/user.rb', line 107 def (value) @attributes[:billing_permission] = value end |
#bypass_site_allowed_ips ⇒ Object
boolean - Allow this user to skip site-wide IP blacklists?
112 113 114 |
# File 'lib/files.com/models/user.rb', line 112 def bypass_site_allowed_ips @attributes[:bypass_site_allowed_ips] end |
#bypass_site_allowed_ips=(value) ⇒ Object
116 117 118 |
# File 'lib/files.com/models/user.rb', line 116 def bypass_site_allowed_ips=(value) @attributes[:bypass_site_allowed_ips] = value end |
#bypass_user_lifecycle_rules ⇒ Object
boolean - Exempt this user from user lifecycle rules?
121 122 123 |
# File 'lib/files.com/models/user.rb', line 121 def bypass_user_lifecycle_rules @attributes[:bypass_user_lifecycle_rules] end |
#bypass_user_lifecycle_rules=(value) ⇒ Object
125 126 127 |
# File 'lib/files.com/models/user.rb', line 125 def bypass_user_lifecycle_rules=(value) @attributes[:bypass_user_lifecycle_rules] = value end |
#change_password ⇒ Object
string - Used for changing a password on an existing user.
684 685 686 |
# File 'lib/files.com/models/user.rb', line 684 def change_password @attributes[:change_password] end |
#change_password=(value) ⇒ Object
688 689 690 |
# File 'lib/files.com/models/user.rb', line 688 def change_password=(value) @attributes[:change_password] = value end |
#change_password_confirmation ⇒ Object
string - Optional, but if provided, we will ensure that it matches the value sent in ‘change_password`.
693 694 695 |
# File 'lib/files.com/models/user.rb', line 693 def change_password_confirmation @attributes[:change_password_confirmation] end |
#change_password_confirmation=(value) ⇒ Object
697 698 699 |
# File 'lib/files.com/models/user.rb', line 697 def change_password_confirmation=(value) @attributes[:change_password_confirmation] = value end |
#clear_2fa ⇒ Object
boolean - If true when changing authentication_method from ‘password` to `sso`, remove all two-factor methods. Ignored in all other cases.
756 757 758 |
# File 'lib/files.com/models/user.rb', line 756 def clear_2fa @attributes[:clear_2fa] end |
#clear_2fa=(value) ⇒ Object
760 761 762 |
# File 'lib/files.com/models/user.rb', line 760 def clear_2fa=(value) @attributes[:clear_2fa] = value end |
#company ⇒ Object
string - User’s company
333 334 335 |
# File 'lib/files.com/models/user.rb', line 333 def company @attributes[:company] end |
#company=(value) ⇒ Object
337 338 339 |
# File 'lib/files.com/models/user.rb', line 337 def company=(value) @attributes[:company] = value end |
#convert_to_partner_user ⇒ Object
boolean - If true, convert this user to a partner user by assigning the partner_id provided.
765 766 767 |
# File 'lib/files.com/models/user.rb', line 765 def convert_to_partner_user @attributes[:convert_to_partner_user] end |
#convert_to_partner_user=(value) ⇒ Object
769 770 771 |
# File 'lib/files.com/models/user.rb', line 769 def convert_to_partner_user=(value) @attributes[:convert_to_partner_user] = value end |
#created_at ⇒ Object
date-time - When this user was created
130 131 132 |
# File 'lib/files.com/models/user.rb', line 130 def created_at @attributes[:created_at] end |
#dav_permission ⇒ Object
boolean - Can the user connect with WebDAV?
135 136 137 |
# File 'lib/files.com/models/user.rb', line 135 def @attributes[:dav_permission] end |
#dav_permission=(value) ⇒ Object
139 140 141 |
# File 'lib/files.com/models/user.rb', line 139 def (value) @attributes[:dav_permission] = value end |
#days_remaining_until_password_expire ⇒ Object
int64 - Number of days remaining until password expires
648 649 650 |
# File 'lib/files.com/models/user.rb', line 648 def days_remaining_until_password_expire @attributes[:days_remaining_until_password_expire] end |
#days_remaining_until_password_expire=(value) ⇒ Object
652 653 654 |
# File 'lib/files.com/models/user.rb', line 652 def days_remaining_until_password_expire=(value) @attributes[:days_remaining_until_password_expire] = value end |
#delete(params = {}) ⇒ Object
Parameters:
new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
903 904 905 906 907 908 909 910 911 912 |
# File 'lib/files.com/models/user.rb', line 903 def delete(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: new_owner_id must be an Integer") if params[:new_owner_id] and !params[:new_owner_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{@attributes[:id]}", :delete, params, @options) end |
#destroy(params = {}) ⇒ Object
914 915 916 917 |
# File 'lib/files.com/models/user.rb', line 914 def destroy(params = {}) delete(params) nil end |
#disabled ⇒ Object
boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
144 145 146 |
# File 'lib/files.com/models/user.rb', line 144 def disabled @attributes[:disabled] end |
#disabled=(value) ⇒ Object
148 149 150 |
# File 'lib/files.com/models/user.rb', line 148 def disabled=(value) @attributes[:disabled] = value end |
#disabled_expired_or_inactive ⇒ Object
boolean - Computed property that returns true if user disabled or expired or inactive.
153 154 155 |
# File 'lib/files.com/models/user.rb', line 153 def disabled_expired_or_inactive @attributes[:disabled_expired_or_inactive] end |
#disabled_expired_or_inactive=(value) ⇒ Object
157 158 159 |
# File 'lib/files.com/models/user.rb', line 157 def disabled_expired_or_inactive=(value) @attributes[:disabled_expired_or_inactive] = value end |
#email ⇒ Object
email - User email address
162 163 164 |
# File 'lib/files.com/models/user.rb', line 162 def email @attributes[:email] end |
#email=(value) ⇒ Object
166 167 168 |
# File 'lib/files.com/models/user.rb', line 166 def email=(value) @attributes[:email] = value end |
#externally_managed ⇒ Object
boolean - Is this user managed by a SsoStrategy?
585 586 587 |
# File 'lib/files.com/models/user.rb', line 585 def externally_managed @attributes[:externally_managed] end |
#externally_managed=(value) ⇒ Object
589 590 591 |
# File 'lib/files.com/models/user.rb', line 589 def externally_managed=(value) @attributes[:externally_managed] = value end |
#filesystem_layout ⇒ Object
string - File system layout
171 172 173 |
# File 'lib/files.com/models/user.rb', line 171 def filesystem_layout @attributes[:filesystem_layout] end |
#filesystem_layout=(value) ⇒ Object
175 176 177 |
# File 'lib/files.com/models/user.rb', line 175 def filesystem_layout=(value) @attributes[:filesystem_layout] = value end |
#first_login_at ⇒ Object
date-time - User’s first login time
180 181 182 |
# File 'lib/files.com/models/user.rb', line 180 def first_login_at @attributes[:first_login_at] end |
#first_login_at=(value) ⇒ Object
184 185 186 |
# File 'lib/files.com/models/user.rb', line 184 def first_login_at=(value) @attributes[:first_login_at] = value end |
#ftp_permission ⇒ Object
boolean - Can the user access with FTP/FTPS?
189 190 191 |
# File 'lib/files.com/models/user.rb', line 189 def @attributes[:ftp_permission] end |
#ftp_permission=(value) ⇒ Object
193 194 195 |
# File 'lib/files.com/models/user.rb', line 193 def (value) @attributes[:ftp_permission] = value end |
#grant_permission ⇒ Object
string - Permission to grant on the User Root upon user creation. Can be blank or ‘full`, `read`, `write`, `list`, `read+write`, or `list+write`
702 703 704 |
# File 'lib/files.com/models/user.rb', line 702 def @attributes[:grant_permission] end |
#grant_permission=(value) ⇒ Object
706 707 708 |
# File 'lib/files.com/models/user.rb', line 706 def (value) @attributes[:grant_permission] = value end |
#group_id ⇒ Object
int64 - Group ID to associate this user with.
711 712 713 |
# File 'lib/files.com/models/user.rb', line 711 def group_id @attributes[:group_id] end |
#group_id=(value) ⇒ Object
715 716 717 |
# File 'lib/files.com/models/user.rb', line 715 def group_id=(value) @attributes[:group_id] = value end |
#group_ids ⇒ Object
string - Comma-separated list of group IDs of which this user is a member
198 199 200 |
# File 'lib/files.com/models/user.rb', line 198 def group_ids @attributes[:group_ids] end |
#group_ids=(value) ⇒ Object
202 203 204 |
# File 'lib/files.com/models/user.rb', line 202 def group_ids=(value) @attributes[:group_ids] = value end |
#header_text ⇒ Object
string - Text to display to the user in the header of the UI
207 208 209 |
# File 'lib/files.com/models/user.rb', line 207 def header_text @attributes[:header_text] end |
#header_text=(value) ⇒ Object
211 212 213 |
# File 'lib/files.com/models/user.rb', line 211 def header_text=(value) @attributes[:header_text] = value end |
#id ⇒ Object
int64 - User ID
13 14 15 |
# File 'lib/files.com/models/user.rb', line 13 def id @attributes[:id] end |
#id=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/user.rb', line 17 def id=(value) @attributes[:id] = value end |
#imported_password_hash ⇒ Object
string - Pre-calculated hash of the user’s password. If supplied, this will be used to authenticate the user on first login. Supported hash methods are MD5, SHA1, and SHA256.
720 721 722 |
# File 'lib/files.com/models/user.rb', line 720 def imported_password_hash @attributes[:imported_password_hash] end |
#imported_password_hash=(value) ⇒ Object
724 725 726 |
# File 'lib/files.com/models/user.rb', line 724 def imported_password_hash=(value) @attributes[:imported_password_hash] = value end |
#language ⇒ Object
string - Preferred language
216 217 218 |
# File 'lib/files.com/models/user.rb', line 216 def language @attributes[:language] end |
#language=(value) ⇒ Object
220 221 222 |
# File 'lib/files.com/models/user.rb', line 220 def language=(value) @attributes[:language] = value end |
#last_active_at ⇒ Object
date-time - User’s most recent activity time, which is the latest of most recent login, most recent API use, enablement, or creation
297 298 299 |
# File 'lib/files.com/models/user.rb', line 297 def last_active_at @attributes[:last_active_at] end |
#last_active_at=(value) ⇒ Object
301 302 303 |
# File 'lib/files.com/models/user.rb', line 301 def last_active_at=(value) @attributes[:last_active_at] = value end |
#last_api_use_at ⇒ Object
date-time - User’s most recent API use time
288 289 290 |
# File 'lib/files.com/models/user.rb', line 288 def last_api_use_at @attributes[:last_api_use_at] end |
#last_api_use_at=(value) ⇒ Object
292 293 294 |
# File 'lib/files.com/models/user.rb', line 292 def last_api_use_at=(value) @attributes[:last_api_use_at] = value end |
#last_dav_login_at ⇒ Object
date-time - User’s most recent login time via WebDAV
261 262 263 |
# File 'lib/files.com/models/user.rb', line 261 def last_dav_login_at @attributes[:last_dav_login_at] end |
#last_dav_login_at=(value) ⇒ Object
265 266 267 |
# File 'lib/files.com/models/user.rb', line 265 def last_dav_login_at=(value) @attributes[:last_dav_login_at] = value end |
#last_desktop_login_at ⇒ Object
date-time - User’s most recent login time via Desktop app
270 271 272 |
# File 'lib/files.com/models/user.rb', line 270 def last_desktop_login_at @attributes[:last_desktop_login_at] end |
#last_desktop_login_at=(value) ⇒ Object
274 275 276 |
# File 'lib/files.com/models/user.rb', line 274 def last_desktop_login_at=(value) @attributes[:last_desktop_login_at] = value end |
#last_ftp_login_at ⇒ Object
date-time - User’s most recent login time via FTP
243 244 245 |
# File 'lib/files.com/models/user.rb', line 243 def last_ftp_login_at @attributes[:last_ftp_login_at] end |
#last_ftp_login_at=(value) ⇒ Object
247 248 249 |
# File 'lib/files.com/models/user.rb', line 247 def last_ftp_login_at=(value) @attributes[:last_ftp_login_at] = value end |
#last_login_at ⇒ Object
date-time - User’s most recent login time via any protocol
225 226 227 |
# File 'lib/files.com/models/user.rb', line 225 def last_login_at @attributes[:last_login_at] end |
#last_login_at=(value) ⇒ Object
229 230 231 |
# File 'lib/files.com/models/user.rb', line 229 def last_login_at=(value) @attributes[:last_login_at] = value end |
#last_protocol_cipher ⇒ Object
string - The most recent protocol and cipher used
306 307 308 |
# File 'lib/files.com/models/user.rb', line 306 def last_protocol_cipher @attributes[:last_protocol_cipher] end |
#last_protocol_cipher=(value) ⇒ Object
310 311 312 |
# File 'lib/files.com/models/user.rb', line 310 def last_protocol_cipher=(value) @attributes[:last_protocol_cipher] = value end |
#last_restapi_login_at ⇒ Object
date-time - User’s most recent login time via Rest API
279 280 281 |
# File 'lib/files.com/models/user.rb', line 279 def last_restapi_login_at @attributes[:last_restapi_login_at] end |
#last_restapi_login_at=(value) ⇒ Object
283 284 285 |
# File 'lib/files.com/models/user.rb', line 283 def last_restapi_login_at=(value) @attributes[:last_restapi_login_at] = value end |
#last_sftp_login_at ⇒ Object
date-time - User’s most recent login time via SFTP
252 253 254 |
# File 'lib/files.com/models/user.rb', line 252 def last_sftp_login_at @attributes[:last_sftp_login_at] end |
#last_sftp_login_at=(value) ⇒ Object
256 257 258 |
# File 'lib/files.com/models/user.rb', line 256 def last_sftp_login_at=(value) @attributes[:last_sftp_login_at] = value end |
#last_web_login_at ⇒ Object
date-time - User’s most recent login time via web
234 235 236 |
# File 'lib/files.com/models/user.rb', line 234 def last_web_login_at @attributes[:last_web_login_at] end |
#last_web_login_at=(value) ⇒ Object
238 239 240 |
# File 'lib/files.com/models/user.rb', line 238 def last_web_login_at=(value) @attributes[:last_web_login_at] = value end |
#lockout_expires ⇒ Object
date-time - Time in the future that the user will no longer be locked out if applicable
315 316 317 |
# File 'lib/files.com/models/user.rb', line 315 def lockout_expires @attributes[:lockout_expires] end |
#lockout_expires=(value) ⇒ Object
319 320 321 |
# File 'lib/files.com/models/user.rb', line 319 def lockout_expires=(value) @attributes[:lockout_expires] = value end |
#name ⇒ Object
string - User’s full name
324 325 326 |
# File 'lib/files.com/models/user.rb', line 324 def name @attributes[:name] end |
#name=(value) ⇒ Object
328 329 330 |
# File 'lib/files.com/models/user.rb', line 328 def name=(value) @attributes[:name] = value end |
#notes ⇒ Object
string - Any internal notes on the user
342 343 344 |
# File 'lib/files.com/models/user.rb', line 342 def notes @attributes[:notes] end |
#notes=(value) ⇒ Object
346 347 348 |
# File 'lib/files.com/models/user.rb', line 346 def notes=(value) @attributes[:notes] = value end |
#notification_daily_send_time ⇒ Object
int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
351 352 353 |
# File 'lib/files.com/models/user.rb', line 351 def notification_daily_send_time @attributes[:notification_daily_send_time] end |
#notification_daily_send_time=(value) ⇒ Object
355 356 357 |
# File 'lib/files.com/models/user.rb', line 355 def notification_daily_send_time=(value) @attributes[:notification_daily_send_time] = value end |
#office_integration_enabled ⇒ Object
boolean - Enable integration with Office for the web?
360 361 362 |
# File 'lib/files.com/models/user.rb', line 360 def office_integration_enabled @attributes[:office_integration_enabled] end |
#office_integration_enabled=(value) ⇒ Object
364 365 366 |
# File 'lib/files.com/models/user.rb', line 364 def office_integration_enabled=(value) @attributes[:office_integration_enabled] = value end |
#partner_admin ⇒ Object
boolean - Is this user a Partner administrator?
369 370 371 |
# File 'lib/files.com/models/user.rb', line 369 def partner_admin @attributes[:partner_admin] end |
#partner_admin=(value) ⇒ Object
373 374 375 |
# File 'lib/files.com/models/user.rb', line 373 def partner_admin=(value) @attributes[:partner_admin] = value end |
#partner_id ⇒ Object
int64 - Partner ID if this user belongs to a Partner
378 379 380 |
# File 'lib/files.com/models/user.rb', line 378 def partner_id @attributes[:partner_id] end |
#partner_id=(value) ⇒ Object
382 383 384 |
# File 'lib/files.com/models/user.rb', line 382 def partner_id=(value) @attributes[:partner_id] = value end |
#partner_name ⇒ Object
string - Name of the Partner if this user belongs to a Partner
387 388 389 |
# File 'lib/files.com/models/user.rb', line 387 def partner_name @attributes[:partner_name] end |
#partner_name=(value) ⇒ Object
391 392 393 |
# File 'lib/files.com/models/user.rb', line 391 def partner_name=(value) @attributes[:partner_name] = value end |
#password ⇒ Object
string - User password.
729 730 731 |
# File 'lib/files.com/models/user.rb', line 729 def password @attributes[:password] end |
#password=(value) ⇒ Object
733 734 735 |
# File 'lib/files.com/models/user.rb', line 733 def password=(value) @attributes[:password] = value end |
#password_confirmation ⇒ Object
string - Optional, but if provided, we will ensure that it matches the value sent in ‘password`.
738 739 740 |
# File 'lib/files.com/models/user.rb', line 738 def password_confirmation @attributes[:password_confirmation] end |
#password_confirmation=(value) ⇒ Object
742 743 744 |
# File 'lib/files.com/models/user.rb', line 742 def password_confirmation=(value) @attributes[:password_confirmation] = value end |
#password_expire_at ⇒ Object
date-time - Password expiration datetime
657 658 659 |
# File 'lib/files.com/models/user.rb', line 657 def password_expire_at @attributes[:password_expire_at] end |
#password_expire_at=(value) ⇒ Object
661 662 663 |
# File 'lib/files.com/models/user.rb', line 661 def password_expire_at=(value) @attributes[:password_expire_at] = value end |
#password_expired ⇒ Object
boolean - Is user’s password expired?
468 469 470 |
# File 'lib/files.com/models/user.rb', line 468 def password_expired @attributes[:password_expired] end |
#password_expired=(value) ⇒ Object
472 473 474 |
# File 'lib/files.com/models/user.rb', line 472 def password_expired=(value) @attributes[:password_expired] = value end |
#password_set_at ⇒ Object
date-time - Last time the user’s password was set
396 397 398 |
# File 'lib/files.com/models/user.rb', line 396 def password_set_at @attributes[:password_set_at] end |
#password_set_at=(value) ⇒ Object
400 401 402 |
# File 'lib/files.com/models/user.rb', line 400 def password_set_at=(value) @attributes[:password_set_at] = value end |
#password_validity_days ⇒ Object
int64 - Number of days to allow user to use the same password
405 406 407 |
# File 'lib/files.com/models/user.rb', line 405 def password_validity_days @attributes[:password_validity_days] end |
#password_validity_days=(value) ⇒ Object
409 410 411 |
# File 'lib/files.com/models/user.rb', line 409 def password_validity_days=(value) @attributes[:password_validity_days] = value end |
#public_keys_count ⇒ Object
int64 - Number of public keys associated with this user
414 415 416 |
# File 'lib/files.com/models/user.rb', line 414 def public_keys_count @attributes[:public_keys_count] end |
#public_keys_count=(value) ⇒ Object
418 419 420 |
# File 'lib/files.com/models/user.rb', line 418 def public_keys_count=(value) @attributes[:public_keys_count] = value end |
#readonly_site_admin ⇒ Object
boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
477 478 479 |
# File 'lib/files.com/models/user.rb', line 477 def readonly_site_admin @attributes[:readonly_site_admin] end |
#readonly_site_admin=(value) ⇒ Object
481 482 483 |
# File 'lib/files.com/models/user.rb', line 481 def readonly_site_admin=(value) @attributes[:readonly_site_admin] = value end |
#receive_admin_alerts ⇒ Object
boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
423 424 425 |
# File 'lib/files.com/models/user.rb', line 423 def receive_admin_alerts @attributes[:receive_admin_alerts] end |
#receive_admin_alerts=(value) ⇒ Object
427 428 429 |
# File 'lib/files.com/models/user.rb', line 427 def receive_admin_alerts=(value) @attributes[:receive_admin_alerts] = value end |
#require_2fa ⇒ Object
string - 2FA required setting
432 433 434 |
# File 'lib/files.com/models/user.rb', line 432 def require_2fa @attributes[:require_2fa] end |
#require_2fa=(value) ⇒ Object
436 437 438 |
# File 'lib/files.com/models/user.rb', line 436 def require_2fa=(value) @attributes[:require_2fa] = value end |
#require_login_by ⇒ Object
date-time - Require user to login by specified date otherwise it will be disabled.
441 442 443 |
# File 'lib/files.com/models/user.rb', line 441 def require_login_by @attributes[:require_login_by] end |
#require_login_by=(value) ⇒ Object
445 446 447 |
# File 'lib/files.com/models/user.rb', line 445 def require_login_by=(value) @attributes[:require_login_by] = value end |
#require_password_change ⇒ Object
boolean - Is a password change required upon next user login?
459 460 461 |
# File 'lib/files.com/models/user.rb', line 459 def require_password_change @attributes[:require_password_change] end |
#require_password_change=(value) ⇒ Object
463 464 465 |
# File 'lib/files.com/models/user.rb', line 463 def require_password_change=(value) @attributes[:require_password_change] = value end |
#resend_welcome_email(params = {}) ⇒ Object
Resend user welcome email
785 786 787 788 789 790 791 792 793 |
# File 'lib/files.com/models/user.rb', line 785 def resend_welcome_email(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{@attributes[:id]}/resend_welcome_email", :post, params, @options) end |
#restapi_permission ⇒ Object
boolean - Can this user access the Web app, Desktop app, SDKs, or REST API? (All of these tools use the API internally, so this is one unified permission set.)
486 487 488 |
# File 'lib/files.com/models/user.rb', line 486 def @attributes[:restapi_permission] end |
#restapi_permission=(value) ⇒ Object
490 491 492 |
# File 'lib/files.com/models/user.rb', line 490 def (value) @attributes[:restapi_permission] = value end |
#save ⇒ Object
919 920 921 922 923 924 925 926 927 928 |
# File 'lib/files.com/models/user.rb', line 919 def save if @attributes[:id] new_obj = update(@attributes) else new_obj = User.create(@attributes, @options) end @attributes = new_obj.attributes true end |
#self_managed ⇒ Object
boolean - Does this user manage it’s own credentials or is it a shared/bot user?
495 496 497 |
# File 'lib/files.com/models/user.rb', line 495 def self_managed @attributes[:self_managed] end |
#self_managed=(value) ⇒ Object
499 500 501 |
# File 'lib/files.com/models/user.rb', line 499 def self_managed=(value) @attributes[:self_managed] = value end |
#sftp_permission ⇒ Object
boolean - Can the user access with SFTP?
504 505 506 |
# File 'lib/files.com/models/user.rb', line 504 def @attributes[:sftp_permission] end |
#sftp_permission=(value) ⇒ Object
508 509 510 |
# File 'lib/files.com/models/user.rb', line 508 def (value) @attributes[:sftp_permission] = value end |
#site_admin ⇒ Object
boolean - Is the user an administrator for this site?
513 514 515 |
# File 'lib/files.com/models/user.rb', line 513 def site_admin @attributes[:site_admin] end |
#site_admin=(value) ⇒ Object
517 518 519 |
# File 'lib/files.com/models/user.rb', line 517 def site_admin=(value) @attributes[:site_admin] = value end |
#site_id ⇒ Object
int64 - Site ID
531 532 533 |
# File 'lib/files.com/models/user.rb', line 531 def site_id @attributes[:site_id] end |
#site_id=(value) ⇒ Object
535 536 537 |
# File 'lib/files.com/models/user.rb', line 535 def site_id=(value) @attributes[:site_id] = value end |
#skip_welcome_screen ⇒ Object
boolean - Skip Welcome page in the UI?
549 550 551 |
# File 'lib/files.com/models/user.rb', line 549 def skip_welcome_screen @attributes[:skip_welcome_screen] end |
#skip_welcome_screen=(value) ⇒ Object
553 554 555 |
# File 'lib/files.com/models/user.rb', line 553 def skip_welcome_screen=(value) @attributes[:skip_welcome_screen] = value end |
#ssl_required ⇒ Object
string - SSL required setting
558 559 560 |
# File 'lib/files.com/models/user.rb', line 558 def ssl_required @attributes[:ssl_required] end |
#ssl_required=(value) ⇒ Object
562 563 564 |
# File 'lib/files.com/models/user.rb', line 562 def ssl_required=(value) @attributes[:ssl_required] = value end |
#sso_strategy_id ⇒ Object
int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
567 568 569 |
# File 'lib/files.com/models/user.rb', line 567 def sso_strategy_id @attributes[:sso_strategy_id] end |
#sso_strategy_id=(value) ⇒ Object
571 572 573 |
# File 'lib/files.com/models/user.rb', line 571 def sso_strategy_id=(value) @attributes[:sso_strategy_id] = value end |
#subscribe_to_newsletter ⇒ Object
boolean - Is the user subscribed to the newsletter?
576 577 578 |
# File 'lib/files.com/models/user.rb', line 576 def @attributes[:subscribe_to_newsletter] end |
#subscribe_to_newsletter=(value) ⇒ Object
580 581 582 |
# File 'lib/files.com/models/user.rb', line 580 def (value) @attributes[:subscribe_to_newsletter] = value end |
#tags ⇒ Object
string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
594 595 596 |
# File 'lib/files.com/models/user.rb', line 594 def @attributes[:tags] end |
#tags=(value) ⇒ Object
598 599 600 |
# File 'lib/files.com/models/user.rb', line 598 def (value) @attributes[:tags] = value end |
#time_zone ⇒ Object
string - User time zone
603 604 605 |
# File 'lib/files.com/models/user.rb', line 603 def time_zone @attributes[:time_zone] end |
#time_zone=(value) ⇒ Object
607 608 609 |
# File 'lib/files.com/models/user.rb', line 607 def time_zone=(value) @attributes[:time_zone] = value end |
#type_of_2fa ⇒ Object
string - Type(s) of 2FA methods in use, for programmatic use. Will be either ‘sms`, `totp`, `webauthn`, `yubi`, `email`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
612 613 614 |
# File 'lib/files.com/models/user.rb', line 612 def type_of_2fa @attributes[:type_of_2fa] end |
#type_of_2fa=(value) ⇒ Object
616 617 618 |
# File 'lib/files.com/models/user.rb', line 616 def type_of_2fa=(value) @attributes[:type_of_2fa] = value end |
#type_of_2fa_for_display ⇒ Object
string - Type(s) of 2FA methods in use, formatted for displaying in the UI. Unlike ‘type_of_2fa`, this value will make clear when a user has more than 1 of the same type of method.
621 622 623 |
# File 'lib/files.com/models/user.rb', line 621 def type_of_2fa_for_display @attributes[:type_of_2fa_for_display] end |
#type_of_2fa_for_display=(value) ⇒ Object
625 626 627 |
# File 'lib/files.com/models/user.rb', line 625 def type_of_2fa_for_display=(value) @attributes[:type_of_2fa_for_display] = value end |
#unlock(params = {}) ⇒ Object
Unlock user who has been locked out due to failed logins
774 775 776 777 778 779 780 781 782 |
# File 'lib/files.com/models/user.rb', line 774 def unlock(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{@attributes[:id]}/unlock", :post, params, @options) end |
#update(params = {}) ⇒ Object
Parameters:
avatar_file - file - An image file for your user avatar.
avatar_delete - boolean - If true, the avatar will be deleted.
change_password - string - Used for changing a password on an existing user.
change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
email - string - User's email.
grant_permission - string - Permission to grant on the User Root upon user creation. Can be blank or `full`, `read`, `write`, `list`, `read+write`, or `list+write`
group_id - int64 - Group ID to associate this user with.
group_ids - string - A list of group ids to associate this user with. Comma delimited.
imported_password_hash - string - Pre-calculated hash of the user's password. If supplied, this will be used to authenticate the user on first login. Supported hash methods are MD5, SHA1, and SHA256.
password - string - User password.
password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `password`.
announcements_read - boolean - Signifies that the user has read all the announcements in the UI.
allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
attachments_permission - boolean - DEPRECATED: If `true`, the user can user create Bundles (aka Share Links). Use the bundle permission instead.
authenticate_until - string - Scheduled Date/Time at which user will be deactivated
authentication_method - string - How is this user authenticated?
billing_permission - boolean - Allow this user to perform operations on the account, payments, and invoices?
bypass_user_lifecycle_rules - boolean - Exempt this user from user lifecycle rules?
bypass_site_allowed_ips - boolean - Allow this user to skip site-wide IP blacklists?
dav_permission - boolean - Can the user connect with WebDAV?
disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting or schedule to be deactivated after specific date.
filesystem_layout - string - File system layout
ftp_permission - boolean - Can the user access with FTP/FTPS?
header_text - string - Text to display to the user in the header of the UI
language - string - Preferred language
notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
name - string - User's full name
company - string - User's company
notes - string - Any internal notes on the user
office_integration_enabled - boolean - Enable integration with Office for the web?
partner_admin - boolean - Is this user a Partner administrator?
partner_id - int64 - Partner ID if this user belongs to a Partner
password_validity_days - int64 - Number of days to allow user to use the same password
readonly_site_admin - boolean - Is the user an allowed to view all (non-billing) site configuration for this site?
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_login_by - string - Require user to login by specified date otherwise it will be disabled.
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the Web app, Desktop app, SDKs, or REST API? (All of these tools use the API internally, so this is one unified permission set.)
self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
sftp_permission - boolean - Can the user access with SFTP?
site_admin - boolean - Is the user an administrator for this site?
skip_welcome_screen - boolean - Skip Welcome page in the UI?
ssl_required - string - SSL required setting
sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
require_2fa - string - 2FA required setting
tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
time_zone - string - User time zone
user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
workspace_admin - boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
username - string - User's username
clear_2fa - boolean - If true when changing authentication_method from `password` to `sso`, remove all two-factor methods. Ignored in all other cases.
convert_to_partner_user - boolean - If true, convert this user to a partner user by assigning the partner_id provided.
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/files.com/models/user.rb', line 861 def update(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params[:change_password] and !params[:change_password].is_a?(String) raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params[:change_password_confirmation] and !params[:change_password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String) raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params[:grant_permission] and !params[:grant_permission].is_a?(String) raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params[:group_ids] and !params[:group_ids].is_a?(String) raise InvalidParameterError.new("Bad parameter: imported_password_hash must be an String") if params[:imported_password_hash] and !params[:imported_password_hash].is_a?(String) raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String) raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params[:password_confirmation] and !params[:password_confirmation].is_a?(String) raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params[:allowed_ips] and !params[:allowed_ips].is_a?(String) raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params[:authenticate_until] and !params[:authenticate_until].is_a?(String) raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params[:authentication_method] and !params[:authentication_method].is_a?(String) raise InvalidParameterError.new("Bad parameter: filesystem_layout must be an String") if params[:filesystem_layout] and !params[:filesystem_layout].is_a?(String) raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params[:header_text] and !params[:header_text].is_a?(String) raise InvalidParameterError.new("Bad parameter: language must be an String") if params[:language] and !params[:language].is_a?(String) raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params[:notification_daily_send_time] and !params[:notification_daily_send_time].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String) raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String) raise InvalidParameterError.new("Bad parameter: partner_id must be an Integer") if params[:partner_id] and !params[:partner_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params[:password_validity_days] and !params[:password_validity_days].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_login_by must be an String") if params[:require_login_by] and !params[:require_login_by].is_a?(String) raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params[:ssl_required] and !params[:ssl_required].is_a?(String) raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params[:sso_strategy_id] and !params[:sso_strategy_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params[:require_2fa] and !params[:require_2fa].is_a?(String) raise InvalidParameterError.new("Bad parameter: tags must be an String") if params[:tags] and !params[:tags].is_a?(String) raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params[:time_zone] and !params[:time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params[:user_root] and !params[:user_root].is_a?(String) raise InvalidParameterError.new("Bad parameter: user_home must be an String") if params[:user_home] and !params[:user_home].is_a?(String) raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{@attributes[:id]}", :patch, params, @options) end |
#user_2fa_reset(params = {}) ⇒ Object
Trigger 2FA Reset process for user who has lost access to their existing 2FA methods
796 797 798 799 800 801 802 803 804 |
# File 'lib/files.com/models/user.rb', line 796 def user_2fa_reset(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/users/#{@attributes[:id]}/2fa/reset", :post, params, @options) end |
#user_home ⇒ Object
string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
639 640 641 |
# File 'lib/files.com/models/user.rb', line 639 def user_home @attributes[:user_home] end |
#user_home=(value) ⇒ Object
643 644 645 |
# File 'lib/files.com/models/user.rb', line 643 def user_home=(value) @attributes[:user_home] = value end |
#user_root ⇒ Object
string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
630 631 632 |
# File 'lib/files.com/models/user.rb', line 630 def user_root @attributes[:user_root] end |
#user_root=(value) ⇒ Object
634 635 636 |
# File 'lib/files.com/models/user.rb', line 634 def user_root=(value) @attributes[:user_root] = value end |
#username ⇒ Object
string - User’s username
22 23 24 |
# File 'lib/files.com/models/user.rb', line 22 def username @attributes[:username] end |
#username=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/user.rb', line 26 def username=(value) @attributes[:username] = value end |
#workspace_admin ⇒ Object
boolean - Is the user a Workspace administrator? Applicable only to the workspace ID related to this user, if one is set.
522 523 524 |
# File 'lib/files.com/models/user.rb', line 522 def workspace_admin @attributes[:workspace_admin] end |
#workspace_admin=(value) ⇒ Object
526 527 528 |
# File 'lib/files.com/models/user.rb', line 526 def workspace_admin=(value) @attributes[:workspace_admin] = value end |
#workspace_id ⇒ Object
int64 - Workspace ID
540 541 542 |
# File 'lib/files.com/models/user.rb', line 540 def workspace_id @attributes[:workspace_id] end |
#workspace_id=(value) ⇒ Object
544 545 546 |
# File 'lib/files.com/models/user.rb', line 544 def workspace_id=(value) @attributes[:workspace_id] = value end |