Class: SoftLayer::NetworkMessageDelivery

Inherits:
ModelBase
  • Object
show all
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

#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

#createdObject

:attr_reader: created The date this username/password pair was created. DEPRECATION WARNING: This attribute is deprecated in favor of created_at and will be removed in the next major release.



29
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 29

sl_attr :created,  'createDate'

#created_atObject

:attr_reader: created_at The date this username/password pair was created.



22
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 22

sl_attr :created_at,  'createDate'

#descriptionObject

Retrieve the message delivery type description of a network message delivery account. :call-seq:

description(force_update=false)


57
58
59
60
61
62
63
64
65
66
67
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 57

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

#modifiedObject

:attr_reader: modified The date of the last modification to this username/password pair. DEPRECATION WARNING: This attribute is deprecated in favor of modified_at and will be removed in the next major release.



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

sl_attr :modified, 'modifyDate'

#modified_atObject

:attr_reader: modified_at The date of the last modification to this username/password pair.



34
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 34

sl_attr :modified_at, 'modifyDate'

#nameObject

Retrieve the message delivery type name of a network message delivery account. :call-seq:

name(force_update=false)


73
74
75
76
77
78
79
80
81
82
83
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 73

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

#passwordObject

:attr_reader: The password part of the username/password pair.



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

sl_attr :password

#password=(password) ⇒ Object

Updates the password for the current account password.

Raises:

  • (ArgumentError)


104
105
106
107
108
109
110
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 104

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

#serviceObject

Returns the service for interacting with the network message delivery instance through the network API



116
117
118
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 116

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.



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 124

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

#usernameObject

:attr_reader: The username part of the username/password pair.



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

sl_attr :username

#vendorObject

Retrieve the vendor name for a network message delivery account. :call-seq:

vendor(force_update=false)


89
90
91
92
93
94
95
96
97
98
99
# File 'lib/softlayer/NetworkMessageDelivery.rb', line 89

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