Class: Files::User

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/user.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/user.rb', line 5

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



683
684
685
# File 'lib/files.com/models/user.rb', line 683

def self.all(params = {}, options = {})
  list(params, options)
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.  Can be blank or `full`, `read`, `write`, `list`, or `history`.
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.
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 - Can the user create Bundles (aka Share Links)?  This field will be aliased or renamed in the future to `bundles_permission`.
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_inactive_disable - boolean - Exempt this user from being disabled based on inactivity?
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.
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?
password_validity_days - int64 - Number of days to allow user to use the same password
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the REST API?
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
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.
username - string - User's username


747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
# File 'lib/files.com/models/user.rb', line 747

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params.dig(:change_password) and !params.dig(:change_password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params.dig(:change_password_confirmation) and !params.dig(:change_password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params.dig(:grant_permission) and !params.dig(:grant_permission).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params.dig(:password_confirmation) and !params.dig(:password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params.dig(:sso_strategy_id) and !params.dig(:sso_strategy_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params.dig(:require_2fa) and !params.dig(:require_2fa).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params.dig(:time_zone) and !params.dig(:time_zone).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params.dig(:user_root) and !params.dig(:user_root).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)

  response, options = Api.send_request("/users", :post, params, options)
  User.new(response.data, options)
end

.delete(id, params = {}, options = {}) ⇒ Object



888
889
890
891
892
893
894
895
896
# File 'lib/files.com/models/user.rb', line 888

def self.delete(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, _options = Api.send_request("/users/#{params[:id]}", :delete, params, options)
  response.data
end

.destroy(id, params = {}, options = {}) ⇒ Object



898
899
900
# File 'lib/files.com/models/user.rb', line 898

def self.destroy(id, params = {}, options = {})
  delete(id, params, options)
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - User ID.


689
690
691
692
693
694
695
696
697
# File 'lib/files.com/models/user.rb', line 689

def self.find(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, options = Api.send_request("/users/#{params[:id]}", :get, params, options)
  User.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



699
700
701
# File 'lib/files.com/models/user.rb', line 699

def self.get(id, params = {}, options = {})
  find(id, params, options)
end

.list(params = {}, options = {}) ⇒ Object

Parameters:

cursor - string - Used for pagination.  Send a cursor value to resume an existing list from the point at which you left off.  Get a cursor from an existing list via the X-Files-Cursor-Next header.
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 (e.g. sort_by[last_login_at]=desc). Valid fields are `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `company`, `name`, `site_admin`, `receive_admin_alerts`, `password_validity_days`, `ssl_required` or `not_site_admin`.
filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
ids - string - comma-separated list of User IDs
q[username] - string - List users matching username.
q[email] - string - List users matching email.
q[notes] - string - List users matching notes field.
q[admin] - string - If `true`, list only admin users.
q[allowed_ips] - string - If set, list only users with overridden allowed IP setting.
q[password_validity_days] - string - If set, list only users with overridden password validity days setting.
q[ssl_required] - string - If set, list only users with overridden SSL required setting.
search - string - Searches for partial matches of name, username, or email.


665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/files.com/models/user.rb', line 665

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: ids must be an String") if params.dig(:ids) and !params.dig(:ids).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)

  List.new(User, params) do
    Api.send_request("/users", :get, params, options)
  end
end

.resend_welcome_email(id, params = {}, options = {}) ⇒ Object

Resend user welcome email



789
790
791
792
793
794
795
796
797
# File 'lib/files.com/models/user.rb', line 789

def self.resend_welcome_email(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, _options = Api.send_request("/users/#{params[:id]}/resend_welcome_email", :post, params, options)
  response.data
end

.unlock(id, params = {}, options = {}) ⇒ Object

Unlock user who has been locked out due to failed logins



778
779
780
781
782
783
784
785
786
# File 'lib/files.com/models/user.rb', line 778

def self.unlock(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, _options = Api.send_request("/users/#{params[:id]}/unlock", :post, params, options)
  response.data
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.  Can be blank or `full`, `read`, `write`, `list`, or `history`.
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.
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 - Can the user create Bundles (aka Share Links)?  This field will be aliased or renamed in the future to `bundles_permission`.
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_inactive_disable - boolean - Exempt this user from being disabled based on inactivity?
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.
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?
password_validity_days - int64 - Number of days to allow user to use the same password
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the REST API?
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
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.
username - string - User's username


854
855
856
857
858
859
860
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
# File 'lib/files.com/models/user.rb', line 854

def self.update(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params.dig(:change_password) and !params.dig(:change_password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params.dig(:change_password_confirmation) and !params.dig(:change_password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params.dig(:grant_permission) and !params.dig(:grant_permission).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params.dig(:password_confirmation) and !params.dig(:password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params.dig(:sso_strategy_id) and !params.dig(:sso_strategy_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params.dig(:require_2fa) and !params.dig(:require_2fa).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params.dig(:time_zone) and !params.dig(:time_zone).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params.dig(:user_root) and !params.dig(:user_root).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, options = Api.send_request("/users/#{params[:id]}", :patch, params, options)
  User.new(response.data, options)
end

.user_2fa_reset(id, params = {}, options = {}) ⇒ Object

Trigger 2FA Reset process for user who has lost access to their existing 2FA methods



800
801
802
803
804
805
806
807
808
# File 'lib/files.com/models/user.rb', line 800

def self.user_2fa_reset(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, _options = Api.send_request("/users/#{params[:id]}/2fa/reset", :post, params, options)
  response.data
end

Instance Method Details

#active_2faObject

boolean - Is 2fa active for the user?



306
307
308
# File 'lib/files.com/models/user.rb', line 306

def active_2fa
  @attributes[:active_2fa]
end

#active_2fa=(value) ⇒ Object



310
311
312
# File 'lib/files.com/models/user.rb', line 310

def active_2fa=(value)
  @attributes[:active_2fa] = value
end

#admin_group_idsObject

array - 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_ipsObject

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_readObject

boolean - Signifies that the user has read all the announcements in the UI.



504
505
506
# File 'lib/files.com/models/user.rb', line 504

def announcements_read
  @attributes[:announcements_read]
end

#announcements_read=(value) ⇒ Object



508
509
510
# File 'lib/files.com/models/user.rb', line 508

def announcements_read=(value)
  @attributes[:announcements_read] = value
end

#api_keys_countObject

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_permissionObject

boolean - Can the user create Bundles (aka Share Links)? This field will be aliased or renamed in the future to ‘bundles_permission`.



49
50
51
# File 'lib/files.com/models/user.rb', line 49

def attachments_permission
  @attributes[:attachments_permission]
end

#attachments_permission=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/user.rb', line 53

def attachments_permission=(value)
  @attributes[:attachments_permission] = value
end

#authenticate_untilObject

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_methodObject

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_deleteObject

boolean - If true, the avatar will be deleted.



441
442
443
# File 'lib/files.com/models/user.rb', line 441

def avatar_delete
  @attributes[:avatar_delete]
end

#avatar_delete=(value) ⇒ Object



445
446
447
# File 'lib/files.com/models/user.rb', line 445

def avatar_delete=(value)
  @attributes[:avatar_delete] = value
end

#avatar_fileObject

file - An image file for your user avatar.



432
433
434
# File 'lib/files.com/models/user.rb', line 432

def avatar_file
  @attributes[:avatar_file]
end

#avatar_file=(value) ⇒ Object



436
437
438
# File 'lib/files.com/models/user.rb', line 436

def avatar_file=(value)
  @attributes[:avatar_file] = value
end

#avatar_urlObject

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

#billing_permissionObject

boolean - Allow this user to perform operations on the account, payments, and invoices?



94
95
96
# File 'lib/files.com/models/user.rb', line 94

def billing_permission
  @attributes[:billing_permission]
end

#billing_permission=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/user.rb', line 98

def billing_permission=(value)
  @attributes[:billing_permission] = value
end

#bypass_inactive_disableObject

boolean - Exempt this user from being disabled based on inactivity?



112
113
114
# File 'lib/files.com/models/user.rb', line 112

def bypass_inactive_disable
  @attributes[:bypass_inactive_disable]
end

#bypass_inactive_disable=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/user.rb', line 116

def bypass_inactive_disable=(value)
  @attributes[:bypass_inactive_disable] = value
end

#bypass_site_allowed_ipsObject

boolean - Allow this user to skip site-wide IP blacklists?



103
104
105
# File 'lib/files.com/models/user.rb', line 103

def bypass_site_allowed_ips
  @attributes[:bypass_site_allowed_ips]
end

#bypass_site_allowed_ips=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/user.rb', line 107

def bypass_site_allowed_ips=(value)
  @attributes[:bypass_site_allowed_ips] = value
end

#change_passwordObject

string - Used for changing a password on an existing user.



450
451
452
# File 'lib/files.com/models/user.rb', line 450

def change_password
  @attributes[:change_password]
end

#change_password=(value) ⇒ Object



454
455
456
# File 'lib/files.com/models/user.rb', line 454

def change_password=(value)
  @attributes[:change_password] = value
end

#change_password_confirmationObject

string - Optional, but if provided, we will ensure that it matches the value sent in ‘change_password`.



459
460
461
# File 'lib/files.com/models/user.rb', line 459

def change_password_confirmation
  @attributes[:change_password_confirmation]
end

#change_password_confirmation=(value) ⇒ Object



463
464
465
# File 'lib/files.com/models/user.rb', line 463

def change_password_confirmation=(value)
  @attributes[:change_password_confirmation] = value
end

#companyObject

string - User’s company



225
226
227
# File 'lib/files.com/models/user.rb', line 225

def company
  @attributes[:company]
end

#company=(value) ⇒ Object



229
230
231
# File 'lib/files.com/models/user.rb', line 229

def company=(value)
  @attributes[:company] = value
end

#created_atObject

date-time - When this user was created



121
122
123
# File 'lib/files.com/models/user.rb', line 121

def created_at
  @attributes[:created_at]
end

#dav_permissionObject

boolean - Can the user connect with WebDAV?



126
127
128
# File 'lib/files.com/models/user.rb', line 126

def dav_permission
  @attributes[:dav_permission]
end

#dav_permission=(value) ⇒ Object



130
131
132
# File 'lib/files.com/models/user.rb', line 130

def dav_permission=(value)
  @attributes[:dav_permission] = value
end

#delete(params = {}) ⇒ Object



623
624
625
626
627
628
629
630
631
# File 'lib/files.com/models/user.rb', line 623

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.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  Api.send_request("/users/#{@attributes[:id]}", :delete, params, @options)
end

#destroy(params = {}) ⇒ Object



633
634
635
# File 'lib/files.com/models/user.rb', line 633

def destroy(params = {})
  delete(params)
end

#disabledObject

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.



135
136
137
# File 'lib/files.com/models/user.rb', line 135

def disabled
  @attributes[:disabled]
end

#disabled=(value) ⇒ Object



139
140
141
# File 'lib/files.com/models/user.rb', line 139

def disabled=(value)
  @attributes[:disabled] = value
end

#emailObject

email - User email address



144
145
146
# File 'lib/files.com/models/user.rb', line 144

def email
  @attributes[:email]
end

#email=(value) ⇒ Object



148
149
150
# File 'lib/files.com/models/user.rb', line 148

def email=(value)
  @attributes[:email] = value
end

#externally_managedObject

boolean - Is this user managed by a SsoStrategy?



396
397
398
# File 'lib/files.com/models/user.rb', line 396

def externally_managed
  @attributes[:externally_managed]
end

#externally_managed=(value) ⇒ Object



400
401
402
# File 'lib/files.com/models/user.rb', line 400

def externally_managed=(value)
  @attributes[:externally_managed] = value
end

#ftp_permissionObject

boolean - Can the user access with FTP/FTPS?



153
154
155
# File 'lib/files.com/models/user.rb', line 153

def ftp_permission
  @attributes[:ftp_permission]
end

#ftp_permission=(value) ⇒ Object



157
158
159
# File 'lib/files.com/models/user.rb', line 157

def ftp_permission=(value)
  @attributes[:ftp_permission] = value
end

#grant_permissionObject

string - Permission to grant on the user root. Can be blank or ‘full`, `read`, `write`, `list`, or `history`.



468
469
470
# File 'lib/files.com/models/user.rb', line 468

def grant_permission
  @attributes[:grant_permission]
end

#grant_permission=(value) ⇒ Object



472
473
474
# File 'lib/files.com/models/user.rb', line 472

def grant_permission=(value)
  @attributes[:grant_permission] = value
end

#group_idObject

int64 - Group ID to associate this user with.



477
478
479
# File 'lib/files.com/models/user.rb', line 477

def group_id
  @attributes[:group_id]
end

#group_id=(value) ⇒ Object



481
482
483
# File 'lib/files.com/models/user.rb', line 481

def group_id=(value)
  @attributes[:group_id] = value
end

#group_idsObject

string - Comma-separated list of group IDs of which this user is a member



162
163
164
# File 'lib/files.com/models/user.rb', line 162

def group_ids
  @attributes[:group_ids]
end

#group_ids=(value) ⇒ Object



166
167
168
# File 'lib/files.com/models/user.rb', line 166

def group_ids=(value)
  @attributes[:group_ids] = value
end

#header_textObject

string - Text to display to the user in the header of the UI



171
172
173
# File 'lib/files.com/models/user.rb', line 171

def header_text
  @attributes[:header_text]
end

#header_text=(value) ⇒ Object



175
176
177
# File 'lib/files.com/models/user.rb', line 175

def header_text=(value)
  @attributes[:header_text] = value
end

#idObject

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

#languageObject

string - Preferred language



180
181
182
# File 'lib/files.com/models/user.rb', line 180

def language
  @attributes[:language]
end

#language=(value) ⇒ Object



184
185
186
# File 'lib/files.com/models/user.rb', line 184

def language=(value)
  @attributes[:language] = value
end

#last_login_atObject

date-time - User’s last login time



189
190
191
# File 'lib/files.com/models/user.rb', line 189

def 
  @attributes[:last_login_at]
end

#last_login_at=(value) ⇒ Object



193
194
195
# File 'lib/files.com/models/user.rb', line 193

def (value)
  @attributes[:last_login_at] = value
end

#last_protocol_cipherObject

string - The last protocol and cipher used



198
199
200
# File 'lib/files.com/models/user.rb', line 198

def last_protocol_cipher
  @attributes[:last_protocol_cipher]
end

#last_protocol_cipher=(value) ⇒ Object



202
203
204
# File 'lib/files.com/models/user.rb', line 202

def last_protocol_cipher=(value)
  @attributes[:last_protocol_cipher] = value
end

#lockout_expiresObject

date-time - Time in the future that the user will no longer be locked out if applicable



207
208
209
# File 'lib/files.com/models/user.rb', line 207

def lockout_expires
  @attributes[:lockout_expires]
end

#lockout_expires=(value) ⇒ Object



211
212
213
# File 'lib/files.com/models/user.rb', line 211

def lockout_expires=(value)
  @attributes[:lockout_expires] = value
end

#nameObject

string - User’s full name



216
217
218
# File 'lib/files.com/models/user.rb', line 216

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



220
221
222
# File 'lib/files.com/models/user.rb', line 220

def name=(value)
  @attributes[:name] = value
end

#notesObject

string - Any internal notes on the user



234
235
236
# File 'lib/files.com/models/user.rb', line 234

def notes
  @attributes[:notes]
end

#notes=(value) ⇒ Object



238
239
240
# File 'lib/files.com/models/user.rb', line 238

def notes=(value)
  @attributes[:notes] = value
end

#notification_daily_send_timeObject

int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23



243
244
245
# File 'lib/files.com/models/user.rb', line 243

def notification_daily_send_time
  @attributes[:notification_daily_send_time]
end

#notification_daily_send_time=(value) ⇒ Object



247
248
249
# File 'lib/files.com/models/user.rb', line 247

def notification_daily_send_time=(value)
  @attributes[:notification_daily_send_time] = value
end

#office_integration_enabledObject

boolean - Enable integration with Office for the web?



252
253
254
# File 'lib/files.com/models/user.rb', line 252

def office_integration_enabled
  @attributes[:office_integration_enabled]
end

#office_integration_enabled=(value) ⇒ Object



256
257
258
# File 'lib/files.com/models/user.rb', line 256

def office_integration_enabled=(value)
  @attributes[:office_integration_enabled] = value
end

#passwordObject

string - User password.



486
487
488
# File 'lib/files.com/models/user.rb', line 486

def password
  @attributes[:password]
end

#password=(value) ⇒ Object



490
491
492
# File 'lib/files.com/models/user.rb', line 490

def password=(value)
  @attributes[:password] = value
end

#password_confirmationObject

string - Optional, but if provided, we will ensure that it matches the value sent in ‘password`.



495
496
497
# File 'lib/files.com/models/user.rb', line 495

def password_confirmation
  @attributes[:password_confirmation]
end

#password_confirmation=(value) ⇒ Object



499
500
501
# File 'lib/files.com/models/user.rb', line 499

def password_confirmation=(value)
  @attributes[:password_confirmation] = value
end

#password_set_atObject

date-time - Last time the user’s password was set



261
262
263
# File 'lib/files.com/models/user.rb', line 261

def password_set_at
  @attributes[:password_set_at]
end

#password_set_at=(value) ⇒ Object



265
266
267
# File 'lib/files.com/models/user.rb', line 265

def password_set_at=(value)
  @attributes[:password_set_at] = value
end

#password_validity_daysObject

int64 - Number of days to allow user to use the same password



270
271
272
# File 'lib/files.com/models/user.rb', line 270

def password_validity_days
  @attributes[:password_validity_days]
end

#password_validity_days=(value) ⇒ Object



274
275
276
# File 'lib/files.com/models/user.rb', line 274

def password_validity_days=(value)
  @attributes[:password_validity_days] = value
end

#public_keys_countObject

int64 - Number of public keys associated with this user



279
280
281
# File 'lib/files.com/models/user.rb', line 279

def public_keys_count
  @attributes[:public_keys_count]
end

#public_keys_count=(value) ⇒ Object



283
284
285
# File 'lib/files.com/models/user.rb', line 283

def public_keys_count=(value)
  @attributes[:public_keys_count] = value
end

#receive_admin_alertsObject

boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?



288
289
290
# File 'lib/files.com/models/user.rb', line 288

def receive_admin_alerts
  @attributes[:receive_admin_alerts]
end

#receive_admin_alerts=(value) ⇒ Object



292
293
294
# File 'lib/files.com/models/user.rb', line 292

def receive_admin_alerts=(value)
  @attributes[:receive_admin_alerts] = value
end

#require_2faObject

string - 2FA required setting



297
298
299
# File 'lib/files.com/models/user.rb', line 297

def require_2fa
  @attributes[:require_2fa]
end

#require_2fa=(value) ⇒ Object



301
302
303
# File 'lib/files.com/models/user.rb', line 301

def require_2fa=(value)
  @attributes[:require_2fa] = value
end

#require_password_changeObject

boolean - Is a password change required upon next user login?



315
316
317
# File 'lib/files.com/models/user.rb', line 315

def require_password_change
  @attributes[:require_password_change]
end

#require_password_change=(value) ⇒ Object



319
320
321
# File 'lib/files.com/models/user.rb', line 319

def require_password_change=(value)
  @attributes[:require_password_change] = value
end

#resend_welcome_email(params = {}) ⇒ Object

Resend user welcome email



524
525
526
527
528
529
530
531
532
# File 'lib/files.com/models/user.rb', line 524

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.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  Api.send_request("/users/#{@attributes[:id]}/resend_welcome_email", :post, params, @options)
end

#restapi_permissionObject

boolean - Can this user access the REST API?



324
325
326
# File 'lib/files.com/models/user.rb', line 324

def restapi_permission
  @attributes[:restapi_permission]
end

#restapi_permission=(value) ⇒ Object



328
329
330
# File 'lib/files.com/models/user.rb', line 328

def restapi_permission=(value)
  @attributes[:restapi_permission] = value
end

#saveObject



637
638
639
640
641
642
643
644
# File 'lib/files.com/models/user.rb', line 637

def save
  if @attributes[:id]
    update(@attributes)
  else
    new_obj = User.create(@attributes, @options)
    @attributes = new_obj.attributes
  end
end

#self_managedObject

boolean - Does this user manage it’s own credentials or is it a shared/bot user?



333
334
335
# File 'lib/files.com/models/user.rb', line 333

def self_managed
  @attributes[:self_managed]
end

#self_managed=(value) ⇒ Object



337
338
339
# File 'lib/files.com/models/user.rb', line 337

def self_managed=(value)
  @attributes[:self_managed] = value
end

#sftp_permissionObject

boolean - Can the user access with SFTP?



342
343
344
# File 'lib/files.com/models/user.rb', line 342

def sftp_permission
  @attributes[:sftp_permission]
end

#sftp_permission=(value) ⇒ Object



346
347
348
# File 'lib/files.com/models/user.rb', line 346

def sftp_permission=(value)
  @attributes[:sftp_permission] = value
end

#site_adminObject

boolean - Is the user an administrator for this site?



351
352
353
# File 'lib/files.com/models/user.rb', line 351

def site_admin
  @attributes[:site_admin]
end

#site_admin=(value) ⇒ Object



355
356
357
# File 'lib/files.com/models/user.rb', line 355

def site_admin=(value)
  @attributes[:site_admin] = value
end

#skip_welcome_screenObject

boolean - Skip Welcome page in the UI?



360
361
362
# File 'lib/files.com/models/user.rb', line 360

def skip_welcome_screen
  @attributes[:skip_welcome_screen]
end

#skip_welcome_screen=(value) ⇒ Object



364
365
366
# File 'lib/files.com/models/user.rb', line 364

def skip_welcome_screen=(value)
  @attributes[:skip_welcome_screen] = value
end

#ssl_requiredObject

string - SSL required setting



369
370
371
# File 'lib/files.com/models/user.rb', line 369

def ssl_required
  @attributes[:ssl_required]
end

#ssl_required=(value) ⇒ Object



373
374
375
# File 'lib/files.com/models/user.rb', line 373

def ssl_required=(value)
  @attributes[:ssl_required] = value
end

#sso_strategy_idObject

int64 - SSO (Single Sign On) strategy ID for the user, if applicable.



378
379
380
# File 'lib/files.com/models/user.rb', line 378

def sso_strategy_id
  @attributes[:sso_strategy_id]
end

#sso_strategy_id=(value) ⇒ Object



382
383
384
# File 'lib/files.com/models/user.rb', line 382

def sso_strategy_id=(value)
  @attributes[:sso_strategy_id] = value
end

#subscribe_to_newsletterObject

boolean - Is the user subscribed to the newsletter?



387
388
389
# File 'lib/files.com/models/user.rb', line 387

def subscribe_to_newsletter
  @attributes[:subscribe_to_newsletter]
end

#subscribe_to_newsletter=(value) ⇒ Object



391
392
393
# File 'lib/files.com/models/user.rb', line 391

def subscribe_to_newsletter=(value)
  @attributes[:subscribe_to_newsletter] = value
end

#time_zoneObject

string - User time zone



405
406
407
# File 'lib/files.com/models/user.rb', line 405

def time_zone
  @attributes[:time_zone]
end

#time_zone=(value) ⇒ Object



409
410
411
# File 'lib/files.com/models/user.rb', line 409

def time_zone=(value)
  @attributes[:time_zone] = value
end

#type_of_2faObject

string - Type(s) of 2FA methods in use. Will be either ‘sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.



414
415
416
# File 'lib/files.com/models/user.rb', line 414

def type_of_2fa
  @attributes[:type_of_2fa]
end

#type_of_2fa=(value) ⇒ Object



418
419
420
# File 'lib/files.com/models/user.rb', line 418

def type_of_2fa=(value)
  @attributes[:type_of_2fa] = value
end

#unlock(params = {}) ⇒ Object

Unlock user who has been locked out due to failed logins



513
514
515
516
517
518
519
520
521
# File 'lib/files.com/models/user.rb', line 513

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.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(: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.  Can be blank or `full`, `read`, `write`, `list`, or `history`.
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.
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 - Can the user create Bundles (aka Share Links)?  This field will be aliased or renamed in the future to `bundles_permission`.
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_inactive_disable - boolean - Exempt this user from being disabled based on inactivity?
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.
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?
password_validity_days - int64 - Number of days to allow user to use the same password
receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
require_password_change - boolean - Is a password change required upon next user login?
restapi_permission - boolean - Can this user access the REST API?
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
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.
username - string - User's username


589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/files.com/models/user.rb', line 589

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.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: change_password must be an String") if params.dig(:change_password) and !params.dig(:change_password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: change_password_confirmation must be an String") if params.dig(:change_password_confirmation) and !params.dig(:change_password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: grant_permission must be an String") if params.dig(:grant_permission) and !params.dig(:grant_permission).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_confirmation must be an String") if params.dig(:password_confirmation) and !params.dig(:password_confirmation).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: sso_strategy_id must be an Integer") if params.dig(:sso_strategy_id) and !params.dig(:sso_strategy_id).is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: require_2fa must be an String") if params.dig(:require_2fa) and !params.dig(:require_2fa).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: time_zone must be an String") if params.dig(:time_zone) and !params.dig(:time_zone).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: user_root must be an String") if params.dig(:user_root) and !params.dig(:user_root).is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(: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



535
536
537
538
539
540
541
542
543
# File 'lib/files.com/models/user.rb', line 535

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.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  Api.send_request("/users/#{@attributes[:id]}/2fa/reset", :post, params, @options)
end

#user_rootObject

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.



423
424
425
# File 'lib/files.com/models/user.rb', line 423

def user_root
  @attributes[:user_root]
end

#user_root=(value) ⇒ Object



427
428
429
# File 'lib/files.com/models/user.rb', line 427

def user_root=(value)
  @attributes[:user_root] = value
end

#usernameObject

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