{-# 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.CreateCacheSubnetGroup
-- 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)
--
-- Creates a new cache subnet group.
--
-- Use this parameter only when you are creating a cluster in an Amazon
-- Virtual Private Cloud (Amazon VPC).
module Amazonka.ElastiCache.CreateCacheSubnetGroup
  ( -- * Creating a Request
    CreateCacheSubnetGroup (..),
    newCreateCacheSubnetGroup,

    -- * Request Lenses
    createCacheSubnetGroup_tags,
    createCacheSubnetGroup_cacheSubnetGroupName,
    createCacheSubnetGroup_cacheSubnetGroupDescription,
    createCacheSubnetGroup_subnetIds,

    -- * Destructuring the Response
    CreateCacheSubnetGroupResponse (..),
    newCreateCacheSubnetGroupResponse,

    -- * Response Lenses
    createCacheSubnetGroupResponse_cacheSubnetGroup,
    createCacheSubnetGroupResponse_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

-- | Represents the input of a @CreateCacheSubnetGroup@ operation.
--
-- /See:/ 'newCreateCacheSubnetGroup' smart constructor.
data CreateCacheSubnetGroup = CreateCacheSubnetGroup'
  { -- | A list of tags to be added to this resource. A tag is a key-value pair.
    -- A tag key must be accompanied by a tag value, although null is accepted.
    CreateCacheSubnetGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A name for the cache subnet group. This value is stored as a lowercase
    -- string.
    --
    -- Constraints: Must contain no more than 255 alphanumeric characters or
    -- hyphens.
    --
    -- Example: @mysubnetgroup@
    CreateCacheSubnetGroup -> Text
cacheSubnetGroupName :: Prelude.Text,
    -- | A description for the cache subnet group.
    CreateCacheSubnetGroup -> Text
cacheSubnetGroupDescription :: Prelude.Text,
    -- | A list of VPC subnet IDs for the cache subnet group.
    CreateCacheSubnetGroup -> [Text]
subnetIds :: [Prelude.Text]
  }
  deriving (CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool
(CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool)
-> (CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool)
-> Eq CreateCacheSubnetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool
$c/= :: CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool
== :: CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool
$c== :: CreateCacheSubnetGroup -> CreateCacheSubnetGroup -> Bool
Prelude.Eq, ReadPrec [CreateCacheSubnetGroup]
ReadPrec CreateCacheSubnetGroup
Int -> ReadS CreateCacheSubnetGroup
ReadS [CreateCacheSubnetGroup]
(Int -> ReadS CreateCacheSubnetGroup)
-> ReadS [CreateCacheSubnetGroup]
-> ReadPrec CreateCacheSubnetGroup
-> ReadPrec [CreateCacheSubnetGroup]
-> Read CreateCacheSubnetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCacheSubnetGroup]
$creadListPrec :: ReadPrec [CreateCacheSubnetGroup]
readPrec :: ReadPrec CreateCacheSubnetGroup
$creadPrec :: ReadPrec CreateCacheSubnetGroup
readList :: ReadS [CreateCacheSubnetGroup]
$creadList :: ReadS [CreateCacheSubnetGroup]
readsPrec :: Int -> ReadS CreateCacheSubnetGroup
$creadsPrec :: Int -> ReadS CreateCacheSubnetGroup
Prelude.Read, Int -> CreateCacheSubnetGroup -> ShowS
[CreateCacheSubnetGroup] -> ShowS
CreateCacheSubnetGroup -> String
(Int -> CreateCacheSubnetGroup -> ShowS)
-> (CreateCacheSubnetGroup -> String)
-> ([CreateCacheSubnetGroup] -> ShowS)
-> Show CreateCacheSubnetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCacheSubnetGroup] -> ShowS
$cshowList :: [CreateCacheSubnetGroup] -> ShowS
show :: CreateCacheSubnetGroup -> String
$cshow :: CreateCacheSubnetGroup -> String
showsPrec :: Int -> CreateCacheSubnetGroup -> ShowS
$cshowsPrec :: Int -> CreateCacheSubnetGroup -> ShowS
Prelude.Show, (forall x. CreateCacheSubnetGroup -> Rep CreateCacheSubnetGroup x)
-> (forall x.
    Rep CreateCacheSubnetGroup x -> CreateCacheSubnetGroup)
-> Generic CreateCacheSubnetGroup
forall x. Rep CreateCacheSubnetGroup x -> CreateCacheSubnetGroup
forall x. CreateCacheSubnetGroup -> Rep CreateCacheSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCacheSubnetGroup x -> CreateCacheSubnetGroup
$cfrom :: forall x. CreateCacheSubnetGroup -> Rep CreateCacheSubnetGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateCacheSubnetGroup' 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:
--
-- 'tags', 'createCacheSubnetGroup_tags' - A list of tags to be added to this resource. A tag is a key-value pair.
-- A tag key must be accompanied by a tag value, although null is accepted.
--
-- 'cacheSubnetGroupName', 'createCacheSubnetGroup_cacheSubnetGroupName' - A name for the cache subnet group. This value is stored as a lowercase
-- string.
--
-- Constraints: Must contain no more than 255 alphanumeric characters or
-- hyphens.
--
-- Example: @mysubnetgroup@
--
-- 'cacheSubnetGroupDescription', 'createCacheSubnetGroup_cacheSubnetGroupDescription' - A description for the cache subnet group.
--
-- 'subnetIds', 'createCacheSubnetGroup_subnetIds' - A list of VPC subnet IDs for the cache subnet group.
newCreateCacheSubnetGroup ::
  -- | 'cacheSubnetGroupName'
  Prelude.Text ->
  -- | 'cacheSubnetGroupDescription'
  Prelude.Text ->
  CreateCacheSubnetGroup
newCreateCacheSubnetGroup :: Text -> Text -> CreateCacheSubnetGroup
newCreateCacheSubnetGroup
  Text
pCacheSubnetGroupName_
  Text
pCacheSubnetGroupDescription_ =
    CreateCacheSubnetGroup' :: Maybe [Tag] -> Text -> Text -> [Text] -> CreateCacheSubnetGroup
CreateCacheSubnetGroup'
      { $sel:tags:CreateCacheSubnetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:cacheSubnetGroupName:CreateCacheSubnetGroup' :: Text
cacheSubnetGroupName = Text
pCacheSubnetGroupName_,
        $sel:cacheSubnetGroupDescription:CreateCacheSubnetGroup' :: Text
cacheSubnetGroupDescription =
          Text
pCacheSubnetGroupDescription_,
        $sel:subnetIds:CreateCacheSubnetGroup' :: [Text]
subnetIds = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | A list of tags to be added to this resource. A tag is a key-value pair.
-- A tag key must be accompanied by a tag value, although null is accepted.
createCacheSubnetGroup_tags :: Lens.Lens' CreateCacheSubnetGroup (Prelude.Maybe [Tag])
createCacheSubnetGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup
createCacheSubnetGroup_tags = (CreateCacheSubnetGroup -> Maybe [Tag])
-> (CreateCacheSubnetGroup
    -> Maybe [Tag] -> CreateCacheSubnetGroup)
-> Lens
     CreateCacheSubnetGroup
     CreateCacheSubnetGroup
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCacheSubnetGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCacheSubnetGroup
s@CreateCacheSubnetGroup' {} Maybe [Tag]
a -> CreateCacheSubnetGroup
s {$sel:tags:CreateCacheSubnetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCacheSubnetGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCacheSubnetGroup
-> f CreateCacheSubnetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A name for the cache subnet group. This value is stored as a lowercase
-- string.
--
-- Constraints: Must contain no more than 255 alphanumeric characters or
-- hyphens.
--
-- Example: @mysubnetgroup@
createCacheSubnetGroup_cacheSubnetGroupName :: Lens.Lens' CreateCacheSubnetGroup Prelude.Text
createCacheSubnetGroup_cacheSubnetGroupName :: (Text -> f Text)
-> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup
createCacheSubnetGroup_cacheSubnetGroupName = (CreateCacheSubnetGroup -> Text)
-> (CreateCacheSubnetGroup -> Text -> CreateCacheSubnetGroup)
-> Lens CreateCacheSubnetGroup CreateCacheSubnetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCacheSubnetGroup' {Text
cacheSubnetGroupName :: Text
$sel:cacheSubnetGroupName:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Text
cacheSubnetGroupName} -> Text
cacheSubnetGroupName) (\s :: CreateCacheSubnetGroup
s@CreateCacheSubnetGroup' {} Text
a -> CreateCacheSubnetGroup
s {$sel:cacheSubnetGroupName:CreateCacheSubnetGroup' :: Text
cacheSubnetGroupName = Text
a} :: CreateCacheSubnetGroup)

-- | A description for the cache subnet group.
createCacheSubnetGroup_cacheSubnetGroupDescription :: Lens.Lens' CreateCacheSubnetGroup Prelude.Text
createCacheSubnetGroup_cacheSubnetGroupDescription :: (Text -> f Text)
-> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup
createCacheSubnetGroup_cacheSubnetGroupDescription = (CreateCacheSubnetGroup -> Text)
-> (CreateCacheSubnetGroup -> Text -> CreateCacheSubnetGroup)
-> Lens CreateCacheSubnetGroup CreateCacheSubnetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCacheSubnetGroup' {Text
cacheSubnetGroupDescription :: Text
$sel:cacheSubnetGroupDescription:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Text
cacheSubnetGroupDescription} -> Text
cacheSubnetGroupDescription) (\s :: CreateCacheSubnetGroup
s@CreateCacheSubnetGroup' {} Text
a -> CreateCacheSubnetGroup
s {$sel:cacheSubnetGroupDescription:CreateCacheSubnetGroup' :: Text
cacheSubnetGroupDescription = Text
a} :: CreateCacheSubnetGroup)

-- | A list of VPC subnet IDs for the cache subnet group.
createCacheSubnetGroup_subnetIds :: Lens.Lens' CreateCacheSubnetGroup [Prelude.Text]
createCacheSubnetGroup_subnetIds :: ([Text] -> f [Text])
-> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup
createCacheSubnetGroup_subnetIds = (CreateCacheSubnetGroup -> [Text])
-> (CreateCacheSubnetGroup -> [Text] -> CreateCacheSubnetGroup)
-> Lens CreateCacheSubnetGroup CreateCacheSubnetGroup [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCacheSubnetGroup' {[Text]
subnetIds :: [Text]
$sel:subnetIds:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> [Text]
subnetIds} -> [Text]
subnetIds) (\s :: CreateCacheSubnetGroup
s@CreateCacheSubnetGroup' {} [Text]
a -> CreateCacheSubnetGroup
s {$sel:subnetIds:CreateCacheSubnetGroup' :: [Text]
subnetIds = [Text]
a} :: CreateCacheSubnetGroup) (([Text] -> f [Text])
 -> CreateCacheSubnetGroup -> f CreateCacheSubnetGroup)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateCacheSubnetGroup
-> f CreateCacheSubnetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateCacheSubnetGroup

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

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

instance Core.ToQuery CreateCacheSubnetGroup where
  toQuery :: CreateCacheSubnetGroup -> QueryString
toQuery CreateCacheSubnetGroup' {[Text]
Maybe [Tag]
Text
subnetIds :: [Text]
cacheSubnetGroupDescription :: Text
cacheSubnetGroupName :: Text
tags :: Maybe [Tag]
$sel:subnetIds:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> [Text]
$sel:cacheSubnetGroupDescription:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Text
$sel:cacheSubnetGroupName:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Text
$sel:tags:CreateCacheSubnetGroup' :: CreateCacheSubnetGroup -> Maybe [Tag]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateCacheSubnetGroup" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"CacheSubnetGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheSubnetGroupName,
        ByteString
"CacheSubnetGroupDescription"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheSubnetGroupDescription,
        ByteString
"SubnetIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"SubnetIdentifier" [Text]
subnetIds
      ]

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

-- |
-- Create a value of 'CreateCacheSubnetGroupResponse' 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:
--
-- 'cacheSubnetGroup', 'createCacheSubnetGroupResponse_cacheSubnetGroup' - Undocumented member.
--
-- 'httpStatus', 'createCacheSubnetGroupResponse_httpStatus' - The response's http status code.
newCreateCacheSubnetGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCacheSubnetGroupResponse
newCreateCacheSubnetGroupResponse :: Int -> CreateCacheSubnetGroupResponse
newCreateCacheSubnetGroupResponse Int
pHttpStatus_ =
  CreateCacheSubnetGroupResponse' :: Maybe CacheSubnetGroup -> Int -> CreateCacheSubnetGroupResponse
CreateCacheSubnetGroupResponse'
    { $sel:cacheSubnetGroup:CreateCacheSubnetGroupResponse' :: Maybe CacheSubnetGroup
cacheSubnetGroup =
        Maybe CacheSubnetGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCacheSubnetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createCacheSubnetGroupResponse_cacheSubnetGroup :: Lens.Lens' CreateCacheSubnetGroupResponse (Prelude.Maybe CacheSubnetGroup)
createCacheSubnetGroupResponse_cacheSubnetGroup :: (Maybe CacheSubnetGroup -> f (Maybe CacheSubnetGroup))
-> CreateCacheSubnetGroupResponse
-> f CreateCacheSubnetGroupResponse
createCacheSubnetGroupResponse_cacheSubnetGroup = (CreateCacheSubnetGroupResponse -> Maybe CacheSubnetGroup)
-> (CreateCacheSubnetGroupResponse
    -> Maybe CacheSubnetGroup -> CreateCacheSubnetGroupResponse)
-> Lens
     CreateCacheSubnetGroupResponse
     CreateCacheSubnetGroupResponse
     (Maybe CacheSubnetGroup)
     (Maybe CacheSubnetGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCacheSubnetGroupResponse' {Maybe CacheSubnetGroup
cacheSubnetGroup :: Maybe CacheSubnetGroup
$sel:cacheSubnetGroup:CreateCacheSubnetGroupResponse' :: CreateCacheSubnetGroupResponse -> Maybe CacheSubnetGroup
cacheSubnetGroup} -> Maybe CacheSubnetGroup
cacheSubnetGroup) (\s :: CreateCacheSubnetGroupResponse
s@CreateCacheSubnetGroupResponse' {} Maybe CacheSubnetGroup
a -> CreateCacheSubnetGroupResponse
s {$sel:cacheSubnetGroup:CreateCacheSubnetGroupResponse' :: Maybe CacheSubnetGroup
cacheSubnetGroup = Maybe CacheSubnetGroup
a} :: CreateCacheSubnetGroupResponse)

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

instance
  Prelude.NFData
    CreateCacheSubnetGroupResponse