Class: SoftLayer::UserCustomer

Inherits:
ModelBase show all
Includes:
DynamicAttribute
Defined in:
lib/softlayer/UserCustomer.rb

Overview

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.

Instance Attribute Summary

Attributes inherited from ModelBase

#softlayer_client

Instance Method Summary collapse

Methods included from DynamicAttribute

included

Methods inherited from ModelBase

#[], #has_sl_property?, #initialize, #refresh_details, sl_attr, #to_ary

Constructor Details

This class inherits a constructor from SoftLayer::ModelBase

Instance Method Details

#additional_emailsObject

A portal user's additional email addresses. These email addresses are contacted when updates are made to support tickets.



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/softlayer/UserCustomer.rb', line 76

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

#alternate_phoneObject

:attr_reader: A portal user's secondary phone number.



21
# File 'lib/softlayer/UserCustomer.rb', line 21

sl_attr :alternate_phone,  'alternatePhone'

#api_authentication_keysObject

A portal user's API Authentication keys. There is a max limit of two API keys per user.



91
92
93
94
95
96
97
98
99
100
# File 'lib/softlayer/UserCustomer.rb', line 91

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

#createdObject

:attr_reader: The date a portal user's record was created.



26
# File 'lib/softlayer/UserCustomer.rb', line 26

sl_attr :created,          'createDate'

#display_nameObject

:attr_reader: The portal user's display name.



31
# File 'lib/softlayer/UserCustomer.rb', line 31

sl_attr :display_name,     'displayName'

#emailObject

:attr_reader: A portal user's email address.



36
# File 'lib/softlayer/UserCustomer.rb', line 36

sl_attr :email

#external_bindingsObject

The external authentication bindings that link an external identifier to a SoftLayer user.



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/softlayer/UserCustomer.rb', line 104

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(soflayer_client, external_binding) }
  end
end

#first_nameObject

:attr_reader: A portal user's first name.



41
# File 'lib/softlayer/UserCustomer.rb', line 41

sl_attr :first_name,       'firstName'

#last_nameObject

:attr_reader: A portal user's last name.



46
# File 'lib/softlayer/UserCustomer.rb', line 46

sl_attr :last_name,        'lastName'

#modifiedObject

:attr_reader: The date a portal user's record was last modified.



51
# File 'lib/softlayer/UserCustomer.rb', line 51

sl_attr :modified,         'modifyDate'

#office_phoneObject

:attr_reader: A portal user's office phone number.



56
# File 'lib/softlayer/UserCustomer.rb', line 56

sl_attr :office_phone,     'officePhone'

#password_expiresObject

:attr_reader: The expiration date for the user's password.



61
# File 'lib/softlayer/UserCustomer.rb', line 61

sl_attr :password_expires, 'passwordExpireDate'

#serviceObject

Returns the service for interacting with this user customer through the network API



119
120
121
# File 'lib/softlayer/UserCustomer.rb', line 119

def service
  softlayer_client[:User_Customer].object_with_id(self.id)
end

#status_changedObject

:attr_reader: The date a portal users record's last status change.



66
# File 'lib/softlayer/UserCustomer.rb', line 66

sl_attr :status_changed,   'statusDate'

#usernameObject

:attr_reader: A portal user's username.



71
# File 'lib/softlayer/UserCustomer.rb', line 71

sl_attr :username