Class: AWS::SimpleEmailService::Identity
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::SimpleEmailService::Identity
- Defined in:
- lib/aws/simple_email_service/identity.rb
Instance Attribute Summary collapse
-
#identity ⇒ String
readonly
Returns the email address or domain name for this identity.
-
#verification_status ⇒ String
readonly
The current value of verification_status.
-
#verification_token ⇒ String?
readonly
The current value of verification_token.
Attributes included from Core::Model
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes the current identity.
-
#domain? ⇒ Boolean
Returns
true
if this Identity represents a domain. -
#email_address? ⇒ Boolean
Returns
true
if this Identity represents an email address. -
#exists? ⇒ Boolean
Returns true if the identity exists.
-
#initialize(email_address_or_domain, options = {}) ⇒ Identity
constructor
A new instance of Identity.
-
#pending? ⇒ Boolean
Returns
true
if verification for this email address/domain is still pending. -
#verified? ⇒ Boolean
Returns
true
if this email address/domain has been verified.
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(email_address_or_domain, options = {}) ⇒ Identity
Returns a new instance of Identity.
24 25 26 27 |
# File 'lib/aws/simple_email_service/identity.rb', line 24 def initialize email_address_or_domain, = {} @identity = email_address_or_domain super end |
Instance Attribute Details
#identity ⇒ String (readonly)
Returns the email address or domain name for this identity.
31 32 33 |
# File 'lib/aws/simple_email_service/identity.rb', line 31 def identity @identity end |
#verification_status ⇒ String (readonly)
Returns the current value of verification_status.
21 22 23 |
# File 'lib/aws/simple_email_service/identity.rb', line 21 def verification_status @verification_status end |
#verification_token ⇒ String? (readonly)
Returns the current value of verification_token.
21 22 23 |
# File 'lib/aws/simple_email_service/identity.rb', line 21 def verification_token @verification_token end |
Instance Method Details
#delete ⇒ nil
Deletes the current identity.
67 68 69 70 |
# File 'lib/aws/simple_email_service/identity.rb', line 67 def delete client.delete_identity(:identity => identity) nil end |
#domain? ⇒ Boolean
Returns true
if this AWS::SimpleEmailService::Identity represents a domain.
49 50 51 |
# File 'lib/aws/simple_email_service/identity.rb', line 49 def domain? !email_address? end |
#email_address? ⇒ Boolean
Returns true
if this AWS::SimpleEmailService::Identity represents an email address.
43 44 45 |
# File 'lib/aws/simple_email_service/identity.rb', line 43 def email_address? identity =~ /@/ ? true : false end |
#exists? ⇒ Boolean
Returns true if the identity exists.
73 74 75 |
# File 'lib/aws/simple_email_service/identity.rb', line 73 def exists? !!get_resource[:verification_attributes][identity] end |
#pending? ⇒ Boolean
Returns true
if verification for this email address/domain is still pending.
61 62 63 |
# File 'lib/aws/simple_email_service/identity.rb', line 61 def pending? verification_status == 'Pending' end |
#verified? ⇒ Boolean
Returns true
if this email address/domain has been verified.
55 56 57 |
# File 'lib/aws/simple_email_service/identity.rb', line 55 def verified? verification_status == 'Success' end |