Class: SoftLayer::NetworkMessageDelivery
- Includes:
- DynamicAttribute
- Defined in:
- lib/softlayer/NetworkMessageDelivery.rb
Overview
Each SoftLayer NetworkMessageDelivery instance provides information about the username/password combination for a specific Network Message Delivery account.
This class roughly corresponds to the entity SoftLayer_Network_Message_Delivery in the API.
Instance Attribute Summary
Attributes inherited from ModelBase
Instance Method Summary collapse
-
#created ⇒ Object
:attr_reader: The date this username/password pair was created.
-
#description ⇒ Object
The message delivery type description of a network message delivery account.
-
#modified ⇒ Object
:attr_reader: The date of the last modification to this username/password pair.
-
#name ⇒ Object
The message delivery type name of a network message delivery account.
-
#password ⇒ Object
:attr_reader: The password part of the username/password pair.
-
#password=(password) ⇒ Object
Updates the password for the current account password.
-
#service ⇒ Object
Returns the service for interacting with the network message delivery instance through the network API.
-
#softlayer_properties(object_mask = nil) ⇒ Object
Make an API request to SoftLayer and return the latest properties hash for this object.
-
#username ⇒ Object
:attr_reader: The username part of the username/password pair.
-
#vendor ⇒ Object
The vendor name for a network message delivery account.
Methods included from DynamicAttribute
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
#created ⇒ Object
:attr_reader: The date this username/password pair was created.
22 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 22 sl_attr :created, 'createDate' |
#description ⇒ Object
The message delivery type description of a network message delivery account.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 41 sl_dynamic_attr :description do |resource| resource.should_update? do #only retrieved once per instance @description == nil end resource.to_update do type = self.service.getType type['description'] end end |
#modified ⇒ Object
:attr_reader: The date of the last modification to this username/password pair.
27 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 27 sl_attr :modified, 'modifyDate' |
#name ⇒ Object
The message delivery type name of a network message delivery account.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 55 sl_dynamic_attr :name do |resource| resource.should_update? do #only retrieved once per instance @name == nil end resource.to_update do type = self.service.getType type['name'] end end |
#password ⇒ Object
:attr_reader: The password part of the username/password pair.
32 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 32 sl_attr :password |
#password=(password) ⇒ Object
Updates the password for the current account password.
84 85 86 87 88 89 90 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 84 def password=(password) raise ArgumentError, "The new password cannot be nil" unless password raise ArgumentError, "The new password cannot be empty" if password.empty? self.service.editObject({ "password" => password.to_s }) self.refresh_details() end |
#service ⇒ Object
Returns the service for interacting with the network message delivery instance through the network API
96 97 98 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 96 def service softlayer_client[:Network_Message_Delivery].object_with_id(self.id) end |
#softlayer_properties(object_mask = nil) ⇒ Object
Make an API request to SoftLayer and return the latest properties hash for this object.
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 104 def softlayer_properties(object_mask = nil) my_service = self.service if(object_mask) my_service = my_service.object_mask(object_mask) else my_service = my_service.object_mask(self.class.default_object_mask) end my_service.getObject() end |
#username ⇒ Object
:attr_reader: The username part of the username/password pair.
37 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 37 sl_attr :username |
#vendor ⇒ Object
The vendor name for a network message delivery account.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 69 sl_dynamic_attr :vendor do |resource| resource.should_update? do #only retrieved once per instance @vendor == nil end resource.to_update do vendor = self.service.getVendor vendor['name'] end end |