mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Added Fog::AWS::SES.verify_domain_identity.
* http://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyDomainIdentity.html * Added Fog::Parsers::AWS::SES::VerifyDomainIdentity.
This commit is contained in:
parent
56a6585282
commit
db434c68ca
4 changed files with 73 additions and 0 deletions
26
lib/fog/aws/parsers/ses/verify_domain_identity.rb
Normal file
26
lib/fog/aws/parsers/ses/verify_domain_identity.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module SES
|
||||
|
||||
class VerifyDomainIdentity < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = { 'ResponseMetadata' => {} }
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'VerificationToken'
|
||||
@response[name] = value
|
||||
when 'RequestId'
|
||||
@response['ResponseMetadata'][name] = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
30
lib/fog/aws/requests/ses/verify_domain_identity.rb
Normal file
30
lib/fog/aws/requests/ses/verify_domain_identity.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class SES
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ses/verify_domain_identity'
|
||||
|
||||
# Verifies a domain. This action returns a verification authorization
|
||||
# token which must be added as a DNS TXT record to the domain.
|
||||
#
|
||||
# ==== Parameters
|
||||
# * domain<~String> - The domain to be verified
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'ResponseMetadata'<~Hash>:
|
||||
# * 'VerificationToken'<~String> - Verification token
|
||||
# * 'RequestId'<~String> - Id of request
|
||||
def verify_domain(domain)
|
||||
request({
|
||||
'Action' => 'VerifyDomainIdentity',
|
||||
'Domain' => domain,
|
||||
:parser => Fog::Parsers::AWS::SES::VerifyDomainIdentity.new
|
||||
})
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,6 +11,7 @@ module Fog
|
|||
request_path 'fog/aws/requests/ses'
|
||||
request :delete_verified_email_address
|
||||
request :verify_email_address
|
||||
request :verify_domain_identity
|
||||
request :get_send_quota
|
||||
request :get_send_statistics
|
||||
request :list_verified_email_addresses
|
||||
|
|
16
tests/aws/requests/ses/verified_domain_identity_tests.rb
Normal file
16
tests/aws/requests/ses/verified_domain_identity_tests.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
Shindo.tests('AWS::SES | verified email address requests', ['aws', 'ses']) do
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests("#verify_domain_identity('example.com')").formats(AWS::SES::Formats::BASIC) do
|
||||
pending if Fog.mocking?
|
||||
Fog::AWS[:ses].verify_email_address('example.com').body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue