Class: AWS::SimpleEmailService::Identity

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/aws/simple_email_service/identity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bounce_topic_arnString

Returns the current value of bounce_topic_arn.

Returns:

  • (String)

    the current value of bounce_topic_arn



29
30
31
# File 'lib/aws/simple_email_service/identity.rb', line 29

def bounce_topic_arn
  @bounce_topic_arn
end

#complaint_topic_arnString

Returns the current value of complaint_topic_arn.

Returns:

  • (String)

    the current value of complaint_topic_arn



29
30
31
# File 'lib/aws/simple_email_service/identity.rb', line 29

def complaint_topic_arn
  @complaint_topic_arn
end

#forwarding_enabledBoolean Also known as: forwarding_enabled?

When false, complaint and bounce notifications will not be forwarded via email. Can only be set to false when there is both a bounce_topic and complaint_topic.

Returns:

  • (Boolean)

    the current value of forwarding_enabled



29
30
31
# File 'lib/aws/simple_email_service/identity.rb', line 29

def forwarding_enabled
  @forwarding_enabled
end

#identityString (readonly)

Returns the email address or domain name for this identity.

Returns:

  • (String)

    Returns the email address or domain name for this identity.



39
40
41
# File 'lib/aws/simple_email_service/identity.rb', line 39

def identity
  @identity
end

#verification_statusString (readonly)

Returns the current value of verification_status.

Returns:

  • (String)

    the current value of verification_status



29
30
31
# File 'lib/aws/simple_email_service/identity.rb', line 29

def verification_status
  @verification_status
end

#verification_tokenString? (readonly)

Returns the current value of verification_token.

Returns:

  • (String, nil)

    the current value of verification_token



29
30
31
# File 'lib/aws/simple_email_service/identity.rb', line 29

def verification_token
  @verification_token
end

Instance Method Details

#bounce_topicSNS::Topic?

Returns:



74
75
76
77
78
# File 'lib/aws/simple_email_service/identity.rb', line 74

def bounce_topic
  if arn = bounce_topic_arn
    SNS::Topic.new(arn, :config => config)
  end
end

#bounce_topic=(topic) ⇒ Object

Parameters:

  • topic (String, SNS::Topic)

    The topic (ARN string or topic object) that bounce notifications should be published to.



68
69
70
71
# File 'lib/aws/simple_email_service/identity.rb', line 68

def bounce_topic= topic
  arn = topic.respond_to?(:arn) ? topic.arn : topic
  self.bounce_topic_arn = arn
end

#complaint_topicSNS::Topic?

Returns:



88
89
90
91
92
# File 'lib/aws/simple_email_service/identity.rb', line 88

def complaint_topic
  if arn = complaint_topic_arn
    SNS::Topic.new(arn, :config => config)
  end
end

#complaint_topic=(topic) ⇒ Object

Parameters:

  • topic (String, SNS::Topic)

    The topic (ARN string or topic object) that complaint notifications should be published to.



82
83
84
85
# File 'lib/aws/simple_email_service/identity.rb', line 82

def complaint_topic= topic
  arn = topic.respond_to?(:arn) ? topic.arn : topic
  self.complaint_topic_arn = arn
end

#deletenil

Deletes the current identity.

Returns:

  • (nil)


120
121
122
123
# File 'lib/aws/simple_email_service/identity.rb', line 120

def delete
  client.delete_identity(:identity => identity)
  nil
end

#domain?Boolean

Returns true if this AWS::SimpleEmailService::Identity represents a domain.

Returns:



102
103
104
# File 'lib/aws/simple_email_service/identity.rb', line 102

def domain?
  !email_address?
end

#email_address?Boolean

Returns true if this AWS::SimpleEmailService::Identity represents an email address.

Returns:



96
97
98
# File 'lib/aws/simple_email_service/identity.rb', line 96

def email_address?
  identity =~ /@/ ? true : false
end

#exists?Boolean

Returns true if the identity exists.

Returns:

  • (Boolean)

    Returns true if the identity exists.



126
127
128
129
130
# File 'lib/aws/simple_email_service/identity.rb', line 126

def exists?
  options = { :identities => [identity] }
  resp = client.get_identity_verification_attributes(options)
  !!resp[:verification_attributes][identity]
end

#pending?Boolean

Returns true if verification for this email address/domain is still pending.

Returns:

  • (Boolean)

    Returns true if verification for this email address/domain is still pending.



114
115
116
# File 'lib/aws/simple_email_service/identity.rb', line 114

def pending?
  verification_status == 'Pending'
end

#verified?Boolean

Returns true if this email address/domain has been verified.

Returns:

  • (Boolean)

    Returns true if this email address/domain has been verified.



108
109
110
# File 'lib/aws/simple_email_service/identity.rb', line 108

def verified?
  verification_status == 'Success'
end