Class: AWS::SimpleEmailService::IdentityCollection

Inherits:
Object
  • Object
show all
Includes:
Core::Collection::WithLimitAndNextToken
Defined in:
lib/aws/simple_email_service/identity_collection.rb

Instance Method Summary collapse

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.

Parameters:

  • email_or_domain (String)

Returns:



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

#domainsIdentityCollection

Returns a collection that only enumerates domains.

Returns:



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_addressesIdentityCollection

Returns a collection that only enumerates email addresses.

Returns:



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.

Parameters:

  • email_or_domain (String)

Returns:



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