Class: AWS::SimpleEmailService::IdentityCollection
- Inherits:
-
Object
- Object
- AWS::SimpleEmailService::IdentityCollection
- Includes:
- Core::Collection::Limitable
- Defined in:
- lib/aws/simple_email_service/identity_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
-
#[](email_or_domain) ⇒ Identity
Returns an Identity with the given email address or domain name.
-
#domains ⇒ IdentityCollection
Returns a collection that only enumerates domains.
-
#email_addresses ⇒ IdentityCollection
Returns a collection that only enumerates email addresses.
-
#initialize(options = {}) ⇒ IdentityCollection
constructor
A new instance of IdentityCollection.
-
#verify(email_or_domain) ⇒ Identity
(also: #create)
Request verification for an email address or a domain.
Methods included from Core::Collection::Limitable
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(options = {}) ⇒ IdentityCollection
Returns a new instance of IdentityCollection.
21 22 23 24 |
# File 'lib/aws/simple_email_service/identity_collection.rb', line 21 def initialize = {} @type = [:type] super end |
Instance Method Details
#[](email_or_domain) ⇒ Identity
Returns an AWS::SimpleEmailService::Identity with the given email address or domain name.
46 47 48 |
# File 'lib/aws/simple_email_service/identity_collection.rb', line 46 def [] email_or_domain Identity.new(email_or_domain, :config => config) end |
#domains ⇒ IdentityCollection
Returns a collection that only enumerates domains.
58 59 60 |
# File 'lib/aws/simple_email_service/identity_collection.rb', line 58 def domains self.class.new(:type => 'Domain', :config => config) end |
#email_addresses ⇒ IdentityCollection
Returns a collection that only enumerates email addresses.
52 53 54 |
# File 'lib/aws/simple_email_service/identity_collection.rb', line 52 def email_addresses self.class.new(:type => 'EmailAddress', :config => config) end |
#verify(email_or_domain) ⇒ Identity Also known as: create
Request verification for an email address or a domain.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aws/simple_email_service/identity_collection.rb', line 30 def verify email_or_domain resp = email_or_domain =~ /@/ ? client.verify_email_identity(:email_address => email_or_domain) : client.verify_domain_identity(:domain => email_or_domain) Identity.new(email_or_domain, :verification_token => resp.data[:verification_token], :config => config) end |