{-# 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.ElastiCache.CreateGlobalReplicationGroup
-- 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)
--
-- Global Datastore for Redis offers fully managed, fast, reliable and
-- secure cross-region replication. Using Global Datastore for Redis, you
-- can create cross-region read replica clusters for ElastiCache for Redis
-- to enable low-latency reads and disaster recovery across regions. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastore.html Replication Across Regions Using Global Datastore>.
--
-- -   The __GlobalReplicationGroupIdSuffix__ is the name of the Global
--     datastore.
--
-- -   The __PrimaryReplicationGroupId__ represents the name of the primary
--     cluster that accepts writes and will replicate updates to the
--     secondary cluster.
module Amazonka.ElastiCache.CreateGlobalReplicationGroup
  ( -- * Creating a Request
    CreateGlobalReplicationGroup (..),
    newCreateGlobalReplicationGroup,

    -- * Request Lenses
    createGlobalReplicationGroup_globalReplicationGroupDescription,
    createGlobalReplicationGroup_globalReplicationGroupIdSuffix,
    createGlobalReplicationGroup_primaryReplicationGroupId,

    -- * Destructuring the Response
    CreateGlobalReplicationGroupResponse (..),
    newCreateGlobalReplicationGroupResponse,

    -- * Response Lenses
    createGlobalReplicationGroupResponse_globalReplicationGroup,
    createGlobalReplicationGroupResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateGlobalReplicationGroup' smart constructor.
data CreateGlobalReplicationGroup = CreateGlobalReplicationGroup'
  { -- | Provides details of the Global datastore
    CreateGlobalReplicationGroup -> Maybe Text
globalReplicationGroupDescription :: Prelude.Maybe Prelude.Text,
    -- | The suffix name of a Global datastore. Amazon ElastiCache automatically
    -- applies a prefix to the Global datastore ID when it is created. Each
    -- Amazon Region has its own prefix. For instance, a Global datastore ID
    -- created in the US-West-1 region will begin with \"dsdfu\" along with the
    -- suffix name you provide. The suffix, combined with the auto-generated
    -- prefix, guarantees uniqueness of the Global datastore name across
    -- multiple regions.
    --
    -- For a full list of Amazon Regions and their respective Global datastore
    -- iD prefixes, see
    -- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastores-CLI.html Using the Amazon CLI with Global datastores>
    -- .
    CreateGlobalReplicationGroup -> Text
globalReplicationGroupIdSuffix :: Prelude.Text,
    -- | The name of the primary cluster that accepts writes and will replicate
    -- updates to the secondary cluster.
    CreateGlobalReplicationGroup -> Text
primaryReplicationGroupId :: Prelude.Text
  }
  deriving (CreateGlobalReplicationGroup
-> CreateGlobalReplicationGroup -> Bool
(CreateGlobalReplicationGroup
 -> CreateGlobalReplicationGroup -> Bool)
-> (CreateGlobalReplicationGroup
    -> CreateGlobalReplicationGroup -> Bool)
-> Eq CreateGlobalReplicationGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGlobalReplicationGroup
-> CreateGlobalReplicationGroup -> Bool
$c/= :: CreateGlobalReplicationGroup
-> CreateGlobalReplicationGroup -> Bool
== :: CreateGlobalReplicationGroup
-> CreateGlobalReplicationGroup -> Bool
$c== :: CreateGlobalReplicationGroup
-> CreateGlobalReplicationGroup -> Bool
Prelude.Eq, ReadPrec [CreateGlobalReplicationGroup]
ReadPrec CreateGlobalReplicationGroup
Int -> ReadS CreateGlobalReplicationGroup
ReadS [CreateGlobalReplicationGroup]
(Int -> ReadS CreateGlobalReplicationGroup)
-> ReadS [CreateGlobalReplicationGroup]
-> ReadPrec CreateGlobalReplicationGroup
-> ReadPrec [CreateGlobalReplicationGroup]
-> Read CreateGlobalReplicationGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGlobalReplicationGroup]
$creadListPrec :: ReadPrec [CreateGlobalReplicationGroup]
readPrec :: ReadPrec CreateGlobalReplicationGroup
$creadPrec :: ReadPrec CreateGlobalReplicationGroup
readList :: ReadS [CreateGlobalReplicationGroup]
$creadList :: ReadS [CreateGlobalReplicationGroup]
readsPrec :: Int -> ReadS CreateGlobalReplicationGroup
$creadsPrec :: Int -> ReadS CreateGlobalReplicationGroup
Prelude.Read, Int -> CreateGlobalReplicationGroup -> ShowS
[CreateGlobalReplicationGroup] -> ShowS
CreateGlobalReplicationGroup -> String
(Int -> CreateGlobalReplicationGroup -> ShowS)
-> (CreateGlobalReplicationGroup -> String)
-> ([CreateGlobalReplicationGroup] -> ShowS)
-> Show CreateGlobalReplicationGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGlobalReplicationGroup] -> ShowS
$cshowList :: [CreateGlobalReplicationGroup] -> ShowS
show :: CreateGlobalReplicationGroup -> String
$cshow :: CreateGlobalReplicationGroup -> String
showsPrec :: Int -> CreateGlobalReplicationGroup -> ShowS
$cshowsPrec :: Int -> CreateGlobalReplicationGroup -> ShowS
Prelude.Show, (forall x.
 CreateGlobalReplicationGroup -> Rep CreateGlobalReplicationGroup x)
-> (forall x.
    Rep CreateGlobalReplicationGroup x -> CreateGlobalReplicationGroup)
-> Generic CreateGlobalReplicationGroup
forall x.
Rep CreateGlobalReplicationGroup x -> CreateGlobalReplicationGroup
forall x.
CreateGlobalReplicationGroup -> Rep CreateGlobalReplicationGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGlobalReplicationGroup x -> CreateGlobalReplicationGroup
$cfrom :: forall x.
CreateGlobalReplicationGroup -> Rep CreateGlobalReplicationGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateGlobalReplicationGroup' 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:
--
-- 'globalReplicationGroupDescription', 'createGlobalReplicationGroup_globalReplicationGroupDescription' - Provides details of the Global datastore
--
-- 'globalReplicationGroupIdSuffix', 'createGlobalReplicationGroup_globalReplicationGroupIdSuffix' - The suffix name of a Global datastore. Amazon ElastiCache automatically
-- applies a prefix to the Global datastore ID when it is created. Each
-- Amazon Region has its own prefix. For instance, a Global datastore ID
-- created in the US-West-1 region will begin with \"dsdfu\" along with the
-- suffix name you provide. The suffix, combined with the auto-generated
-- prefix, guarantees uniqueness of the Global datastore name across
-- multiple regions.
--
-- For a full list of Amazon Regions and their respective Global datastore
-- iD prefixes, see
-- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastores-CLI.html Using the Amazon CLI with Global datastores>
-- .
--
-- 'primaryReplicationGroupId', 'createGlobalReplicationGroup_primaryReplicationGroupId' - The name of the primary cluster that accepts writes and will replicate
-- updates to the secondary cluster.
newCreateGlobalReplicationGroup ::
  -- | 'globalReplicationGroupIdSuffix'
  Prelude.Text ->
  -- | 'primaryReplicationGroupId'
  Prelude.Text ->
  CreateGlobalReplicationGroup
newCreateGlobalReplicationGroup :: Text -> Text -> CreateGlobalReplicationGroup
newCreateGlobalReplicationGroup
  Text
pGlobalReplicationGroupIdSuffix_
  Text
pPrimaryReplicationGroupId_ =
    CreateGlobalReplicationGroup' :: Maybe Text -> Text -> Text -> CreateGlobalReplicationGroup
CreateGlobalReplicationGroup'
      { $sel:globalReplicationGroupDescription:CreateGlobalReplicationGroup' :: Maybe Text
globalReplicationGroupDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:globalReplicationGroupIdSuffix:CreateGlobalReplicationGroup' :: Text
globalReplicationGroupIdSuffix =
          Text
pGlobalReplicationGroupIdSuffix_,
        $sel:primaryReplicationGroupId:CreateGlobalReplicationGroup' :: Text
primaryReplicationGroupId =
          Text
pPrimaryReplicationGroupId_
      }

-- | Provides details of the Global datastore
createGlobalReplicationGroup_globalReplicationGroupDescription :: Lens.Lens' CreateGlobalReplicationGroup (Prelude.Maybe Prelude.Text)
createGlobalReplicationGroup_globalReplicationGroupDescription :: (Maybe Text -> f (Maybe Text))
-> CreateGlobalReplicationGroup -> f CreateGlobalReplicationGroup
createGlobalReplicationGroup_globalReplicationGroupDescription = (CreateGlobalReplicationGroup -> Maybe Text)
-> (CreateGlobalReplicationGroup
    -> Maybe Text -> CreateGlobalReplicationGroup)
-> Lens
     CreateGlobalReplicationGroup
     CreateGlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGlobalReplicationGroup' {Maybe Text
globalReplicationGroupDescription :: Maybe Text
$sel:globalReplicationGroupDescription:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Maybe Text
globalReplicationGroupDescription} -> Maybe Text
globalReplicationGroupDescription) (\s :: CreateGlobalReplicationGroup
s@CreateGlobalReplicationGroup' {} Maybe Text
a -> CreateGlobalReplicationGroup
s {$sel:globalReplicationGroupDescription:CreateGlobalReplicationGroup' :: Maybe Text
globalReplicationGroupDescription = Maybe Text
a} :: CreateGlobalReplicationGroup)

-- | The suffix name of a Global datastore. Amazon ElastiCache automatically
-- applies a prefix to the Global datastore ID when it is created. Each
-- Amazon Region has its own prefix. For instance, a Global datastore ID
-- created in the US-West-1 region will begin with \"dsdfu\" along with the
-- suffix name you provide. The suffix, combined with the auto-generated
-- prefix, guarantees uniqueness of the Global datastore name across
-- multiple regions.
--
-- For a full list of Amazon Regions and their respective Global datastore
-- iD prefixes, see
-- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastores-CLI.html Using the Amazon CLI with Global datastores>
-- .
createGlobalReplicationGroup_globalReplicationGroupIdSuffix :: Lens.Lens' CreateGlobalReplicationGroup Prelude.Text
createGlobalReplicationGroup_globalReplicationGroupIdSuffix :: (Text -> f Text)
-> CreateGlobalReplicationGroup -> f CreateGlobalReplicationGroup
createGlobalReplicationGroup_globalReplicationGroupIdSuffix = (CreateGlobalReplicationGroup -> Text)
-> (CreateGlobalReplicationGroup
    -> Text -> CreateGlobalReplicationGroup)
-> Lens
     CreateGlobalReplicationGroup CreateGlobalReplicationGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGlobalReplicationGroup' {Text
globalReplicationGroupIdSuffix :: Text
$sel:globalReplicationGroupIdSuffix:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Text
globalReplicationGroupIdSuffix} -> Text
globalReplicationGroupIdSuffix) (\s :: CreateGlobalReplicationGroup
s@CreateGlobalReplicationGroup' {} Text
a -> CreateGlobalReplicationGroup
s {$sel:globalReplicationGroupIdSuffix:CreateGlobalReplicationGroup' :: Text
globalReplicationGroupIdSuffix = Text
a} :: CreateGlobalReplicationGroup)

-- | The name of the primary cluster that accepts writes and will replicate
-- updates to the secondary cluster.
createGlobalReplicationGroup_primaryReplicationGroupId :: Lens.Lens' CreateGlobalReplicationGroup Prelude.Text
createGlobalReplicationGroup_primaryReplicationGroupId :: (Text -> f Text)
-> CreateGlobalReplicationGroup -> f CreateGlobalReplicationGroup
createGlobalReplicationGroup_primaryReplicationGroupId = (CreateGlobalReplicationGroup -> Text)
-> (CreateGlobalReplicationGroup
    -> Text -> CreateGlobalReplicationGroup)
-> Lens
     CreateGlobalReplicationGroup CreateGlobalReplicationGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGlobalReplicationGroup' {Text
primaryReplicationGroupId :: Text
$sel:primaryReplicationGroupId:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Text
primaryReplicationGroupId} -> Text
primaryReplicationGroupId) (\s :: CreateGlobalReplicationGroup
s@CreateGlobalReplicationGroup' {} Text
a -> CreateGlobalReplicationGroup
s {$sel:primaryReplicationGroupId:CreateGlobalReplicationGroup' :: Text
primaryReplicationGroupId = Text
a} :: CreateGlobalReplicationGroup)

instance Core.AWSRequest CreateGlobalReplicationGroup where
  type
    AWSResponse CreateGlobalReplicationGroup =
      CreateGlobalReplicationGroupResponse
  request :: CreateGlobalReplicationGroup
-> Request CreateGlobalReplicationGroup
request = Service
-> CreateGlobalReplicationGroup
-> Request CreateGlobalReplicationGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateGlobalReplicationGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateGlobalReplicationGroup)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateGlobalReplicationGroup))
-> Logger
-> Service
-> Proxy CreateGlobalReplicationGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateGlobalReplicationGroup)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateGlobalReplicationGroupResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe GlobalReplicationGroup
-> Int -> CreateGlobalReplicationGroupResponse
CreateGlobalReplicationGroupResponse'
            (Maybe GlobalReplicationGroup
 -> Int -> CreateGlobalReplicationGroupResponse)
-> Either String (Maybe GlobalReplicationGroup)
-> Either String (Int -> CreateGlobalReplicationGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe GlobalReplicationGroup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalReplicationGroup")
            Either String (Int -> CreateGlobalReplicationGroupResponse)
-> Either String Int
-> Either String CreateGlobalReplicationGroupResponse
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
    CreateGlobalReplicationGroup

instance Prelude.NFData CreateGlobalReplicationGroup

instance Core.ToHeaders CreateGlobalReplicationGroup where
  toHeaders :: CreateGlobalReplicationGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateGlobalReplicationGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery CreateGlobalReplicationGroup where
  toQuery :: CreateGlobalReplicationGroup -> QueryString
toQuery CreateGlobalReplicationGroup' {Maybe Text
Text
primaryReplicationGroupId :: Text
globalReplicationGroupIdSuffix :: Text
globalReplicationGroupDescription :: Maybe Text
$sel:primaryReplicationGroupId:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Text
$sel:globalReplicationGroupIdSuffix:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Text
$sel:globalReplicationGroupDescription:CreateGlobalReplicationGroup' :: CreateGlobalReplicationGroup -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CreateGlobalReplicationGroup" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"GlobalReplicationGroupDescription"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
globalReplicationGroupDescription,
        ByteString
"GlobalReplicationGroupIdSuffix"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
globalReplicationGroupIdSuffix,
        ByteString
"PrimaryReplicationGroupId"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
primaryReplicationGroupId
      ]

-- | /See:/ 'newCreateGlobalReplicationGroupResponse' smart constructor.
data CreateGlobalReplicationGroupResponse = CreateGlobalReplicationGroupResponse'
  { CreateGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup :: Prelude.Maybe GlobalReplicationGroup,
    -- | The response's http status code.
    CreateGlobalReplicationGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateGlobalReplicationGroupResponse
-> CreateGlobalReplicationGroupResponse -> Bool
(CreateGlobalReplicationGroupResponse
 -> CreateGlobalReplicationGroupResponse -> Bool)
-> (CreateGlobalReplicationGroupResponse
    -> CreateGlobalReplicationGroupResponse -> Bool)
-> Eq CreateGlobalReplicationGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGlobalReplicationGroupResponse
-> CreateGlobalReplicationGroupResponse -> Bool
$c/= :: CreateGlobalReplicationGroupResponse
-> CreateGlobalReplicationGroupResponse -> Bool
== :: CreateGlobalReplicationGroupResponse
-> CreateGlobalReplicationGroupResponse -> Bool
$c== :: CreateGlobalReplicationGroupResponse
-> CreateGlobalReplicationGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateGlobalReplicationGroupResponse]
ReadPrec CreateGlobalReplicationGroupResponse
Int -> ReadS CreateGlobalReplicationGroupResponse
ReadS [CreateGlobalReplicationGroupResponse]
(Int -> ReadS CreateGlobalReplicationGroupResponse)
-> ReadS [CreateGlobalReplicationGroupResponse]
-> ReadPrec CreateGlobalReplicationGroupResponse
-> ReadPrec [CreateGlobalReplicationGroupResponse]
-> Read CreateGlobalReplicationGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGlobalReplicationGroupResponse]
$creadListPrec :: ReadPrec [CreateGlobalReplicationGroupResponse]
readPrec :: ReadPrec CreateGlobalReplicationGroupResponse
$creadPrec :: ReadPrec CreateGlobalReplicationGroupResponse
readList :: ReadS [CreateGlobalReplicationGroupResponse]
$creadList :: ReadS [CreateGlobalReplicationGroupResponse]
readsPrec :: Int -> ReadS CreateGlobalReplicationGroupResponse
$creadsPrec :: Int -> ReadS CreateGlobalReplicationGroupResponse
Prelude.Read, Int -> CreateGlobalReplicationGroupResponse -> ShowS
[CreateGlobalReplicationGroupResponse] -> ShowS
CreateGlobalReplicationGroupResponse -> String
(Int -> CreateGlobalReplicationGroupResponse -> ShowS)
-> (CreateGlobalReplicationGroupResponse -> String)
-> ([CreateGlobalReplicationGroupResponse] -> ShowS)
-> Show CreateGlobalReplicationGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGlobalReplicationGroupResponse] -> ShowS
$cshowList :: [CreateGlobalReplicationGroupResponse] -> ShowS
show :: CreateGlobalReplicationGroupResponse -> String
$cshow :: CreateGlobalReplicationGroupResponse -> String
showsPrec :: Int -> CreateGlobalReplicationGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateGlobalReplicationGroupResponse -> ShowS
Prelude.Show, (forall x.
 CreateGlobalReplicationGroupResponse
 -> Rep CreateGlobalReplicationGroupResponse x)
-> (forall x.
    Rep CreateGlobalReplicationGroupResponse x
    -> CreateGlobalReplicationGroupResponse)
-> Generic CreateGlobalReplicationGroupResponse
forall x.
Rep CreateGlobalReplicationGroupResponse x
-> CreateGlobalReplicationGroupResponse
forall x.
CreateGlobalReplicationGroupResponse
-> Rep CreateGlobalReplicationGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGlobalReplicationGroupResponse x
-> CreateGlobalReplicationGroupResponse
$cfrom :: forall x.
CreateGlobalReplicationGroupResponse
-> Rep CreateGlobalReplicationGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateGlobalReplicationGroupResponse' 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:
--
-- 'globalReplicationGroup', 'createGlobalReplicationGroupResponse_globalReplicationGroup' - Undocumented member.
--
-- 'httpStatus', 'createGlobalReplicationGroupResponse_httpStatus' - The response's http status code.
newCreateGlobalReplicationGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateGlobalReplicationGroupResponse
newCreateGlobalReplicationGroupResponse :: Int -> CreateGlobalReplicationGroupResponse
newCreateGlobalReplicationGroupResponse Int
pHttpStatus_ =
  CreateGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
-> Int -> CreateGlobalReplicationGroupResponse
CreateGlobalReplicationGroupResponse'
    { $sel:globalReplicationGroup:CreateGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup =
        Maybe GlobalReplicationGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateGlobalReplicationGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createGlobalReplicationGroupResponse_globalReplicationGroup :: Lens.Lens' CreateGlobalReplicationGroupResponse (Prelude.Maybe GlobalReplicationGroup)
createGlobalReplicationGroupResponse_globalReplicationGroup :: (Maybe GlobalReplicationGroup -> f (Maybe GlobalReplicationGroup))
-> CreateGlobalReplicationGroupResponse
-> f CreateGlobalReplicationGroupResponse
createGlobalReplicationGroupResponse_globalReplicationGroup = (CreateGlobalReplicationGroupResponse
 -> Maybe GlobalReplicationGroup)
-> (CreateGlobalReplicationGroupResponse
    -> Maybe GlobalReplicationGroup
    -> CreateGlobalReplicationGroupResponse)
-> Lens
     CreateGlobalReplicationGroupResponse
     CreateGlobalReplicationGroupResponse
     (Maybe GlobalReplicationGroup)
     (Maybe GlobalReplicationGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGlobalReplicationGroupResponse' {Maybe GlobalReplicationGroup
globalReplicationGroup :: Maybe GlobalReplicationGroup
$sel:globalReplicationGroup:CreateGlobalReplicationGroupResponse' :: CreateGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup} -> Maybe GlobalReplicationGroup
globalReplicationGroup) (\s :: CreateGlobalReplicationGroupResponse
s@CreateGlobalReplicationGroupResponse' {} Maybe GlobalReplicationGroup
a -> CreateGlobalReplicationGroupResponse
s {$sel:globalReplicationGroup:CreateGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup = Maybe GlobalReplicationGroup
a} :: CreateGlobalReplicationGroupResponse)

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

instance
  Prelude.NFData
    CreateGlobalReplicationGroupResponse