Class: AWS::SimpleEmailService::IdentityCollection
- Inherits:
-
Object
- Object
- AWS::SimpleEmailService::IdentityCollection
- Includes:
- Core::Collection::WithLimitAndNextToken
- Defined in:
- lib/aws/simple_email_service/identity_collection.rb
Instance Method Summary collapse
-
#[](email_or_domain) ⇒ DomainIdentity, EmailIdentity
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.
-
#verify(email_or_domain) ⇒ Identity
(also: #create)
Request verification for an email address or a domain.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Instance Method Details
#[](email_or_domain) ⇒ DomainIdentity, EmailIdentity
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 |