{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53Domains.TransferDomainToAnotherAwsAccount
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Transfers a domain from the current AWS account to another AWS account.
-- Note the following:
--
-- -   The AWS account that you\'re transferring the domain to must accept
--     the transfer. If the other account doesn\'t accept the transfer
--     within 3 days, we cancel the transfer. See
--     <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html AcceptDomainTransferFromAnotherAwsAccount>.
--
-- -   You can cancel the transfer before the other account accepts it. See
--     <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_CancelDomainTransferToAnotherAwsAccount.html CancelDomainTransferToAnotherAwsAccount>.
--
-- -   The other account can reject the transfer. See
--     <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_RejectDomainTransferFromAnotherAwsAccount.html RejectDomainTransferFromAnotherAwsAccount>.
--
-- When you transfer a domain from one AWS account to another, Route 53
-- doesn\'t transfer the hosted zone that is associated with the domain.
-- DNS resolution isn\'t affected if the domain and the hosted zone are
-- owned by separate accounts, so transferring the hosted zone is optional.
-- For information about transferring the hosted zone to another AWS
-- account, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zones-migrating.html Migrating a Hosted Zone to a Different AWS Account>
-- in the /Amazon Route 53 Developer Guide/.
--
-- Use either
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ListOperations.html ListOperations>
-- or
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html GetOperationDetail>
-- to determine whether the operation succeeded.
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html GetOperationDetail>
-- provides additional information, for example,
-- @Domain Transfer from Aws Account 111122223333 has been cancelled@.
module Amazonka.Route53Domains.TransferDomainToAnotherAwsAccount
  ( -- * Creating a Request
    TransferDomainToAnotherAwsAccount (..),
    newTransferDomainToAnotherAwsAccount,

    -- * Request Lenses
    transferDomainToAnotherAwsAccount_domainName,
    transferDomainToAnotherAwsAccount_accountId,

    -- * Destructuring the Response
    TransferDomainToAnotherAwsAccountResponse (..),
    newTransferDomainToAnotherAwsAccountResponse,

    -- * Response Lenses
    transferDomainToAnotherAwsAccountResponse_password,
    transferDomainToAnotherAwsAccountResponse_operationId,
    transferDomainToAnotherAwsAccountResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Domains.Types

-- | The TransferDomainToAnotherAwsAccount request includes the following
-- elements.
--
-- /See:/ 'newTransferDomainToAnotherAwsAccount' smart constructor.
data TransferDomainToAnotherAwsAccount = TransferDomainToAnotherAwsAccount'
  { -- | The name of the domain that you want to transfer from the current AWS
    -- account to another account.
    TransferDomainToAnotherAwsAccount -> Text
domainName :: Prelude.Text,
    -- | The account ID of the AWS account that you want to transfer the domain
    -- to, for example, @111122223333@.
    TransferDomainToAnotherAwsAccount -> Text
accountId :: Prelude.Text
  }
  deriving (TransferDomainToAnotherAwsAccount
-> TransferDomainToAnotherAwsAccount -> Bool
(TransferDomainToAnotherAwsAccount
 -> TransferDomainToAnotherAwsAccount -> Bool)
-> (TransferDomainToAnotherAwsAccount
    -> TransferDomainToAnotherAwsAccount -> Bool)
-> Eq TransferDomainToAnotherAwsAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferDomainToAnotherAwsAccount
-> TransferDomainToAnotherAwsAccount -> Bool
$c/= :: TransferDomainToAnotherAwsAccount
-> TransferDomainToAnotherAwsAccount -> Bool
== :: TransferDomainToAnotherAwsAccount
-> TransferDomainToAnotherAwsAccount -> Bool
$c== :: TransferDomainToAnotherAwsAccount
-> TransferDomainToAnotherAwsAccount -> Bool
Prelude.Eq, ReadPrec [TransferDomainToAnotherAwsAccount]
ReadPrec TransferDomainToAnotherAwsAccount
Int -> ReadS TransferDomainToAnotherAwsAccount
ReadS [TransferDomainToAnotherAwsAccount]
(Int -> ReadS TransferDomainToAnotherAwsAccount)
-> ReadS [TransferDomainToAnotherAwsAccount]
-> ReadPrec TransferDomainToAnotherAwsAccount
-> ReadPrec [TransferDomainToAnotherAwsAccount]
-> Read TransferDomainToAnotherAwsAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferDomainToAnotherAwsAccount]
$creadListPrec :: ReadPrec [TransferDomainToAnotherAwsAccount]
readPrec :: ReadPrec TransferDomainToAnotherAwsAccount
$creadPrec :: ReadPrec TransferDomainToAnotherAwsAccount
readList :: ReadS [TransferDomainToAnotherAwsAccount]
$creadList :: ReadS [TransferDomainToAnotherAwsAccount]
readsPrec :: Int -> ReadS TransferDomainToAnotherAwsAccount
$creadsPrec :: Int -> ReadS TransferDomainToAnotherAwsAccount
Prelude.Read, Int -> TransferDomainToAnotherAwsAccount -> ShowS
[TransferDomainToAnotherAwsAccount] -> ShowS
TransferDomainToAnotherAwsAccount -> String
(Int -> TransferDomainToAnotherAwsAccount -> ShowS)
-> (TransferDomainToAnotherAwsAccount -> String)
-> ([TransferDomainToAnotherAwsAccount] -> ShowS)
-> Show TransferDomainToAnotherAwsAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferDomainToAnotherAwsAccount] -> ShowS
$cshowList :: [TransferDomainToAnotherAwsAccount] -> ShowS
show :: TransferDomainToAnotherAwsAccount -> String
$cshow :: TransferDomainToAnotherAwsAccount -> String
showsPrec :: Int -> TransferDomainToAnotherAwsAccount -> ShowS
$cshowsPrec :: Int -> TransferDomainToAnotherAwsAccount -> ShowS
Prelude.Show, (forall x.
 TransferDomainToAnotherAwsAccount
 -> Rep TransferDomainToAnotherAwsAccount x)
-> (forall x.
    Rep TransferDomainToAnotherAwsAccount x
    -> TransferDomainToAnotherAwsAccount)
-> Generic TransferDomainToAnotherAwsAccount
forall x.
Rep TransferDomainToAnotherAwsAccount x
-> TransferDomainToAnotherAwsAccount
forall x.
TransferDomainToAnotherAwsAccount
-> Rep TransferDomainToAnotherAwsAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransferDomainToAnotherAwsAccount x
-> TransferDomainToAnotherAwsAccount
$cfrom :: forall x.
TransferDomainToAnotherAwsAccount
-> Rep TransferDomainToAnotherAwsAccount x
Prelude.Generic)

-- |
-- Create a value of 'TransferDomainToAnotherAwsAccount' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'domainName', 'transferDomainToAnotherAwsAccount_domainName' - The name of the domain that you want to transfer from the current AWS
-- account to another account.
--
-- 'accountId', 'transferDomainToAnotherAwsAccount_accountId' - The account ID of the AWS account that you want to transfer the domain
-- to, for example, @111122223333@.
newTransferDomainToAnotherAwsAccount ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'accountId'
  Prelude.Text ->
  TransferDomainToAnotherAwsAccount
newTransferDomainToAnotherAwsAccount :: Text -> Text -> TransferDomainToAnotherAwsAccount
newTransferDomainToAnotherAwsAccount
  Text
pDomainName_
  Text
pAccountId_ =
    TransferDomainToAnotherAwsAccount' :: Text -> Text -> TransferDomainToAnotherAwsAccount
TransferDomainToAnotherAwsAccount'
      { $sel:domainName:TransferDomainToAnotherAwsAccount' :: Text
domainName =
          Text
pDomainName_,
        $sel:accountId:TransferDomainToAnotherAwsAccount' :: Text
accountId = Text
pAccountId_
      }

-- | The name of the domain that you want to transfer from the current AWS
-- account to another account.
transferDomainToAnotherAwsAccount_domainName :: Lens.Lens' TransferDomainToAnotherAwsAccount Prelude.Text
transferDomainToAnotherAwsAccount_domainName :: (Text -> f Text)
-> TransferDomainToAnotherAwsAccount
-> f TransferDomainToAnotherAwsAccount
transferDomainToAnotherAwsAccount_domainName = (TransferDomainToAnotherAwsAccount -> Text)
-> (TransferDomainToAnotherAwsAccount
    -> Text -> TransferDomainToAnotherAwsAccount)
-> Lens
     TransferDomainToAnotherAwsAccount
     TransferDomainToAnotherAwsAccount
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferDomainToAnotherAwsAccount' {Text
domainName :: Text
$sel:domainName:TransferDomainToAnotherAwsAccount' :: TransferDomainToAnotherAwsAccount -> Text
domainName} -> Text
domainName) (\s :: TransferDomainToAnotherAwsAccount
s@TransferDomainToAnotherAwsAccount' {} Text
a -> TransferDomainToAnotherAwsAccount
s {$sel:domainName:TransferDomainToAnotherAwsAccount' :: Text
domainName = Text
a} :: TransferDomainToAnotherAwsAccount)

-- | The account ID of the AWS account that you want to transfer the domain
-- to, for example, @111122223333@.
transferDomainToAnotherAwsAccount_accountId :: Lens.Lens' TransferDomainToAnotherAwsAccount Prelude.Text
transferDomainToAnotherAwsAccount_accountId :: (Text -> f Text)
-> TransferDomainToAnotherAwsAccount
-> f TransferDomainToAnotherAwsAccount
transferDomainToAnotherAwsAccount_accountId = (TransferDomainToAnotherAwsAccount -> Text)
-> (TransferDomainToAnotherAwsAccount
    -> Text -> TransferDomainToAnotherAwsAccount)
-> Lens
     TransferDomainToAnotherAwsAccount
     TransferDomainToAnotherAwsAccount
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferDomainToAnotherAwsAccount' {Text
accountId :: Text
$sel:accountId:TransferDomainToAnotherAwsAccount' :: TransferDomainToAnotherAwsAccount -> Text
accountId} -> Text
accountId) (\s :: TransferDomainToAnotherAwsAccount
s@TransferDomainToAnotherAwsAccount' {} Text
a -> TransferDomainToAnotherAwsAccount
s {$sel:accountId:TransferDomainToAnotherAwsAccount' :: Text
accountId = Text
a} :: TransferDomainToAnotherAwsAccount)

instance
  Core.AWSRequest
    TransferDomainToAnotherAwsAccount
  where
  type
    AWSResponse TransferDomainToAnotherAwsAccount =
      TransferDomainToAnotherAwsAccountResponse
  request :: TransferDomainToAnotherAwsAccount
-> Request TransferDomainToAnotherAwsAccount
request = Service
-> TransferDomainToAnotherAwsAccount
-> Request TransferDomainToAnotherAwsAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TransferDomainToAnotherAwsAccount
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse TransferDomainToAnotherAwsAccount)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TransferDomainToAnotherAwsAccount))
-> Logger
-> Service
-> Proxy TransferDomainToAnotherAwsAccount
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse TransferDomainToAnotherAwsAccount)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text -> Int -> TransferDomainToAnotherAwsAccountResponse
TransferDomainToAnotherAwsAccountResponse'
            (Maybe Text
 -> Maybe Text -> Int -> TransferDomainToAnotherAwsAccountResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> TransferDomainToAnotherAwsAccountResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Password")
              Either
  String
  (Maybe Text -> Int -> TransferDomainToAnotherAwsAccountResponse)
-> Either String (Maybe Text)
-> Either String (Int -> TransferDomainToAnotherAwsAccountResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OperationId")
              Either String (Int -> TransferDomainToAnotherAwsAccountResponse)
-> Either String Int
-> Either String TransferDomainToAnotherAwsAccountResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    TransferDomainToAnotherAwsAccount

instance
  Prelude.NFData
    TransferDomainToAnotherAwsAccount

instance
  Core.ToHeaders
    TransferDomainToAnotherAwsAccount
  where
  toHeaders :: TransferDomainToAnotherAwsAccount -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> TransferDomainToAnotherAwsAccount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Route53Domains_v20140515.TransferDomainToAnotherAwsAccount" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    TransferDomainToAnotherAwsAccount
  where
  toJSON :: TransferDomainToAnotherAwsAccount -> Value
toJSON TransferDomainToAnotherAwsAccount' {Text
accountId :: Text
domainName :: Text
$sel:accountId:TransferDomainToAnotherAwsAccount' :: TransferDomainToAnotherAwsAccount -> Text
$sel:domainName:TransferDomainToAnotherAwsAccount' :: TransferDomainToAnotherAwsAccount -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId)
          ]
      )

instance
  Core.ToPath
    TransferDomainToAnotherAwsAccount
  where
  toPath :: TransferDomainToAnotherAwsAccount -> ByteString
toPath = ByteString -> TransferDomainToAnotherAwsAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Core.ToQuery
    TransferDomainToAnotherAwsAccount
  where
  toQuery :: TransferDomainToAnotherAwsAccount -> QueryString
toQuery = QueryString -> TransferDomainToAnotherAwsAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The @TransferDomainToAnotherAwsAccount@ response includes the following
-- elements.
--
-- /See:/ 'newTransferDomainToAnotherAwsAccountResponse' smart constructor.
data TransferDomainToAnotherAwsAccountResponse = TransferDomainToAnotherAwsAccountResponse'
  { -- | To finish transferring a domain to another AWS account, the account that
    -- the domain is being transferred to must submit an
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html AcceptDomainTransferFromAnotherAwsAccount>
    -- request. The request must include the value of the @Password@ element
    -- that was returned in the @TransferDomainToAnotherAwsAccount@ response.
    TransferDomainToAnotherAwsAccountResponse -> Maybe Text
password :: Prelude.Maybe Prelude.Text,
    -- | Identifier for tracking the progress of the request. To query the
    -- operation status, use
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html GetOperationDetail>.
    TransferDomainToAnotherAwsAccountResponse -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    TransferDomainToAnotherAwsAccountResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TransferDomainToAnotherAwsAccountResponse
-> TransferDomainToAnotherAwsAccountResponse -> Bool
(TransferDomainToAnotherAwsAccountResponse
 -> TransferDomainToAnotherAwsAccountResponse -> Bool)
-> (TransferDomainToAnotherAwsAccountResponse
    -> TransferDomainToAnotherAwsAccountResponse -> Bool)
-> Eq TransferDomainToAnotherAwsAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferDomainToAnotherAwsAccountResponse
-> TransferDomainToAnotherAwsAccountResponse -> Bool
$c/= :: TransferDomainToAnotherAwsAccountResponse
-> TransferDomainToAnotherAwsAccountResponse -> Bool
== :: TransferDomainToAnotherAwsAccountResponse
-> TransferDomainToAnotherAwsAccountResponse -> Bool
$c== :: TransferDomainToAnotherAwsAccountResponse
-> TransferDomainToAnotherAwsAccountResponse -> Bool
Prelude.Eq, ReadPrec [TransferDomainToAnotherAwsAccountResponse]
ReadPrec TransferDomainToAnotherAwsAccountResponse
Int -> ReadS TransferDomainToAnotherAwsAccountResponse
ReadS [TransferDomainToAnotherAwsAccountResponse]
(Int -> ReadS TransferDomainToAnotherAwsAccountResponse)
-> ReadS [TransferDomainToAnotherAwsAccountResponse]
-> ReadPrec TransferDomainToAnotherAwsAccountResponse
-> ReadPrec [TransferDomainToAnotherAwsAccountResponse]
-> Read TransferDomainToAnotherAwsAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferDomainToAnotherAwsAccountResponse]
$creadListPrec :: ReadPrec [TransferDomainToAnotherAwsAccountResponse]
readPrec :: ReadPrec TransferDomainToAnotherAwsAccountResponse
$creadPrec :: ReadPrec TransferDomainToAnotherAwsAccountResponse
readList :: ReadS [TransferDomainToAnotherAwsAccountResponse]
$creadList :: ReadS [TransferDomainToAnotherAwsAccountResponse]
readsPrec :: Int -> ReadS TransferDomainToAnotherAwsAccountResponse
$creadsPrec :: Int -> ReadS TransferDomainToAnotherAwsAccountResponse
Prelude.Read, Int -> TransferDomainToAnotherAwsAccountResponse -> ShowS
[TransferDomainToAnotherAwsAccountResponse] -> ShowS
TransferDomainToAnotherAwsAccountResponse -> String
(Int -> TransferDomainToAnotherAwsAccountResponse -> ShowS)
-> (TransferDomainToAnotherAwsAccountResponse -> String)
-> ([TransferDomainToAnotherAwsAccountResponse] -> ShowS)
-> Show TransferDomainToAnotherAwsAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferDomainToAnotherAwsAccountResponse] -> ShowS
$cshowList :: [TransferDomainToAnotherAwsAccountResponse] -> ShowS
show :: TransferDomainToAnotherAwsAccountResponse -> String
$cshow :: TransferDomainToAnotherAwsAccountResponse -> String
showsPrec :: Int -> TransferDomainToAnotherAwsAccountResponse -> ShowS
$cshowsPrec :: Int -> TransferDomainToAnotherAwsAccountResponse -> ShowS
Prelude.Show, (forall x.
 TransferDomainToAnotherAwsAccountResponse
 -> Rep TransferDomainToAnotherAwsAccountResponse x)
-> (forall x.
    Rep TransferDomainToAnotherAwsAccountResponse x
    -> TransferDomainToAnotherAwsAccountResponse)
-> Generic TransferDomainToAnotherAwsAccountResponse
forall x.
Rep TransferDomainToAnotherAwsAccountResponse x
-> TransferDomainToAnotherAwsAccountResponse
forall x.
TransferDomainToAnotherAwsAccountResponse
-> Rep TransferDomainToAnotherAwsAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransferDomainToAnotherAwsAccountResponse x
-> TransferDomainToAnotherAwsAccountResponse
$cfrom :: forall x.
TransferDomainToAnotherAwsAccountResponse
-> Rep TransferDomainToAnotherAwsAccountResponse x
Prelude.Generic)

-- |
-- Create a value of 'TransferDomainToAnotherAwsAccountResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'password', 'transferDomainToAnotherAwsAccountResponse_password' - To finish transferring a domain to another AWS account, the account that
-- the domain is being transferred to must submit an
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html AcceptDomainTransferFromAnotherAwsAccount>
-- request. The request must include the value of the @Password@ element
-- that was returned in the @TransferDomainToAnotherAwsAccount@ response.
--
-- 'operationId', 'transferDomainToAnotherAwsAccountResponse_operationId' - Identifier for tracking the progress of the request. To query the
-- operation status, use
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html GetOperationDetail>.
--
-- 'httpStatus', 'transferDomainToAnotherAwsAccountResponse_httpStatus' - The response's http status code.
newTransferDomainToAnotherAwsAccountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TransferDomainToAnotherAwsAccountResponse
newTransferDomainToAnotherAwsAccountResponse :: Int -> TransferDomainToAnotherAwsAccountResponse
newTransferDomainToAnotherAwsAccountResponse
  Int
pHttpStatus_ =
    TransferDomainToAnotherAwsAccountResponse' :: Maybe Text
-> Maybe Text -> Int -> TransferDomainToAnotherAwsAccountResponse
TransferDomainToAnotherAwsAccountResponse'
      { $sel:password:TransferDomainToAnotherAwsAccountResponse' :: Maybe Text
password =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:operationId:TransferDomainToAnotherAwsAccountResponse' :: Maybe Text
operationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:TransferDomainToAnotherAwsAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | To finish transferring a domain to another AWS account, the account that
-- the domain is being transferred to must submit an
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_AcceptDomainTransferFromAnotherAwsAccount.html AcceptDomainTransferFromAnotherAwsAccount>
-- request. The request must include the value of the @Password@ element
-- that was returned in the @TransferDomainToAnotherAwsAccount@ response.
transferDomainToAnotherAwsAccountResponse_password :: Lens.Lens' TransferDomainToAnotherAwsAccountResponse (Prelude.Maybe Prelude.Text)
transferDomainToAnotherAwsAccountResponse_password :: (Maybe Text -> f (Maybe Text))
-> TransferDomainToAnotherAwsAccountResponse
-> f TransferDomainToAnotherAwsAccountResponse
transferDomainToAnotherAwsAccountResponse_password = (TransferDomainToAnotherAwsAccountResponse -> Maybe Text)
-> (TransferDomainToAnotherAwsAccountResponse
    -> Maybe Text -> TransferDomainToAnotherAwsAccountResponse)
-> Lens
     TransferDomainToAnotherAwsAccountResponse
     TransferDomainToAnotherAwsAccountResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferDomainToAnotherAwsAccountResponse' {Maybe Text
password :: Maybe Text
$sel:password:TransferDomainToAnotherAwsAccountResponse' :: TransferDomainToAnotherAwsAccountResponse -> Maybe Text
password} -> Maybe Text
password) (\s :: TransferDomainToAnotherAwsAccountResponse
s@TransferDomainToAnotherAwsAccountResponse' {} Maybe Text
a -> TransferDomainToAnotherAwsAccountResponse
s {$sel:password:TransferDomainToAnotherAwsAccountResponse' :: Maybe Text
password = Maybe Text
a} :: TransferDomainToAnotherAwsAccountResponse)

-- | Identifier for tracking the progress of the request. To query the
-- operation status, use
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html GetOperationDetail>.
transferDomainToAnotherAwsAccountResponse_operationId :: Lens.Lens' TransferDomainToAnotherAwsAccountResponse (Prelude.Maybe Prelude.Text)
transferDomainToAnotherAwsAccountResponse_operationId :: (Maybe Text -> f (Maybe Text))
-> TransferDomainToAnotherAwsAccountResponse
-> f TransferDomainToAnotherAwsAccountResponse
transferDomainToAnotherAwsAccountResponse_operationId = (TransferDomainToAnotherAwsAccountResponse -> Maybe Text)
-> (TransferDomainToAnotherAwsAccountResponse
    -> Maybe Text -> TransferDomainToAnotherAwsAccountResponse)
-> Lens
     TransferDomainToAnotherAwsAccountResponse
     TransferDomainToAnotherAwsAccountResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferDomainToAnotherAwsAccountResponse' {Maybe Text
operationId :: Maybe Text
$sel:operationId:TransferDomainToAnotherAwsAccountResponse' :: TransferDomainToAnotherAwsAccountResponse -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: TransferDomainToAnotherAwsAccountResponse
s@TransferDomainToAnotherAwsAccountResponse' {} Maybe Text
a -> TransferDomainToAnotherAwsAccountResponse
s {$sel:operationId:TransferDomainToAnotherAwsAccountResponse' :: Maybe Text
operationId = Maybe Text
a} :: TransferDomainToAnotherAwsAccountResponse)

-- | The response's http status code.
transferDomainToAnotherAwsAccountResponse_httpStatus :: Lens.Lens' TransferDomainToAnotherAwsAccountResponse Prelude.Int
transferDomainToAnotherAwsAccountResponse_httpStatus :: (Int -> f Int)
-> TransferDomainToAnotherAwsAccountResponse
-> f TransferDomainToAnotherAwsAccountResponse
transferDomainToAnotherAwsAccountResponse_httpStatus = (TransferDomainToAnotherAwsAccountResponse -> Int)
-> (TransferDomainToAnotherAwsAccountResponse
    -> Int -> TransferDomainToAnotherAwsAccountResponse)
-> Lens
     TransferDomainToAnotherAwsAccountResponse
     TransferDomainToAnotherAwsAccountResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferDomainToAnotherAwsAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:TransferDomainToAnotherAwsAccountResponse' :: TransferDomainToAnotherAwsAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TransferDomainToAnotherAwsAccountResponse
s@TransferDomainToAnotherAwsAccountResponse' {} Int
a -> TransferDomainToAnotherAwsAccountResponse
s {$sel:httpStatus:TransferDomainToAnotherAwsAccountResponse' :: Int
httpStatus = Int
a} :: TransferDomainToAnotherAwsAccountResponse)

instance
  Prelude.NFData
    TransferDomainToAnotherAwsAccountResponse