class SoftLayer::UserCustomer
Each SoftLayer UserCustomer instance provides information relating to a single SoftLayer customer portal user
This class roughly corresponds to the entity SoftLayer_User_Customer in the API.
Attributes
A portal user's secondary phone number.
The date a portal user's record was created. DEPRECATION WARNING: This attribute is deprecated in favor of #created_at and will be removed in the next major release.
The date a portal user's record was created.
The portal user's display name.
A portal user's email address.
A portal user's first name.
A portal user's last name.
The date a portal user's record was last modified. DEPRECATION WARNING: This attribute is deprecated in favor of #modified_at and will be removed in the next major release.
The date a portal user's record was last modified.
A portal user's office phone number.
The expiration date for the user's password.
The date a portal users record's last status change.
A portal user's username.
Public Class Methods
Retrieve the user customer associated with the specified username
# File lib/softlayer/UserCustomer.rb, line 139 def self.user_customer_with_username(username, client = nil) softlayer_client = client || Client.default_client raise "#{__method__} requires a client but none was given and Client::default_client is not set" if !softlayer_client raise "#{__method__} requires a user customer username but none was given" if !username || username.empty? user_customer_object_filter = ObjectFilter.new() user_customer_object_filter.modify { |filter| filter.accept('users.username').when_it is(username) } account_service = Account.account_for_client(softlayer_client).service account_service = account_service.object_filter(user_customer_object_filter) account_service = account_service.object_mask(UserCustomer.default_object_mask) user_customer_data = account_service.getUsers if user_customer_data.length == 1 UserCustomer.new(softlayer_client, user_customer_data.first) end end
Protected Class Methods
# File lib/softlayer/UserCustomer.rb, line 168 def self.default_object_mask { "mask(SoftLayer_User_Customer)" => [ 'alternatePhone', 'createDate', 'displayName', 'email', 'firstName', 'id', 'lastName', 'modifyDate', 'officePhone', 'passwordExpireDate', 'statusDate', 'username' ] }.to_sl_object_mask end
Public Instance Methods
Retrieve a portal user's additional email addresses. These email addresses are contacted when updates are made to support tickets.
# File lib/softlayer/UserCustomer.rb, line 92 sl_dynamic_attr :additional_emails do |resource| resource.should_update? do #only retrieved once per instance @additional_emails == nil end resource.to_update do additional_emails = self.service.getAdditionalEmails additional_emails.collect { |additional_email| additional_email['email'] } end end
Retrieve a portal user's API Authentication keys. There is a max limit of two API keys per user.
# File lib/softlayer/UserCustomer.rb, line 109 sl_dynamic_attr :api_authentication_keys do |resource| resource.should_update? do #only retrieved once per instance @api_authentication_keys == nil end resource.to_update do self.service.object_mask("mask[authenticationKey,ipAddressRestriction]").getApiAuthenticationKeys end end
Retrieve the external authentication bindings that link an external identifier to a SoftLayer user.
# File lib/softlayer/UserCustomer.rb, line 124 sl_dynamic_attr :external_bindings do |resource| resource.should_update? do #only retrieved once per instance @external_bindings == nil end resource.to_update do external_bindings = self.service.object_mask(UserCustomerExternalBinding.default_object_mask).getExternalBindings external_bindings.collect { |external_binding| UserCustomerExternalBinding.new(softlayer_client, external_binding) } end end
Returns the service for interacting with this user customer through the network API
# File lib/softlayer/UserCustomer.rb, line 162 def service softlayer_client[:User_Customer].object_with_id(self.id) end