{-# 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.Route53RecoveryReadiness.CreateResourceSet
-- 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 Resource Set.
module Amazonka.Route53RecoveryReadiness.CreateResourceSet
  ( -- * Creating a Request
    CreateResourceSet (..),
    newCreateResourceSet,

    -- * Request Lenses
    createResourceSet_tags,
    createResourceSet_resourceSetType,
    createResourceSet_resourceSetName,
    createResourceSet_resources,

    -- * Destructuring the Response
    CreateResourceSetResponse (..),
    newCreateResourceSetResponse,

    -- * Response Lenses
    createResourceSetResponse_resourceSetName,
    createResourceSetResponse_resourceSetType,
    createResourceSetResponse_resources,
    createResourceSetResponse_resourceSetArn,
    createResourceSetResponse_tags,
    createResourceSetResponse_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.Route53RecoveryReadiness.Types

-- | The ResourceSet to create
--
-- /See:/ 'newCreateResourceSet' smart constructor.
data CreateResourceSet = CreateResourceSet'
  { CreateResourceSet -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | AWS Resource type of the resources in the ResourceSet
    CreateResourceSet -> Text
resourceSetType :: Prelude.Text,
    -- | The name of the ResourceSet to create
    CreateResourceSet -> Text
resourceSetName :: Prelude.Text,
    -- | A list of Resource objects
    CreateResourceSet -> [Resource]
resources :: [Resource]
  }
  deriving (CreateResourceSet -> CreateResourceSet -> Bool
(CreateResourceSet -> CreateResourceSet -> Bool)
-> (CreateResourceSet -> CreateResourceSet -> Bool)
-> Eq CreateResourceSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateResourceSet -> CreateResourceSet -> Bool
$c/= :: CreateResourceSet -> CreateResourceSet -> Bool
== :: CreateResourceSet -> CreateResourceSet -> Bool
$c== :: CreateResourceSet -> CreateResourceSet -> Bool
Prelude.Eq, ReadPrec [CreateResourceSet]
ReadPrec CreateResourceSet
Int -> ReadS CreateResourceSet
ReadS [CreateResourceSet]
(Int -> ReadS CreateResourceSet)
-> ReadS [CreateResourceSet]
-> ReadPrec CreateResourceSet
-> ReadPrec [CreateResourceSet]
-> Read CreateResourceSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateResourceSet]
$creadListPrec :: ReadPrec [CreateResourceSet]
readPrec :: ReadPrec CreateResourceSet
$creadPrec :: ReadPrec CreateResourceSet
readList :: ReadS [CreateResourceSet]
$creadList :: ReadS [CreateResourceSet]
readsPrec :: Int -> ReadS CreateResourceSet
$creadsPrec :: Int -> ReadS CreateResourceSet
Prelude.Read, Int -> CreateResourceSet -> ShowS
[CreateResourceSet] -> ShowS
CreateResourceSet -> String
(Int -> CreateResourceSet -> ShowS)
-> (CreateResourceSet -> String)
-> ([CreateResourceSet] -> ShowS)
-> Show CreateResourceSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateResourceSet] -> ShowS
$cshowList :: [CreateResourceSet] -> ShowS
show :: CreateResourceSet -> String
$cshow :: CreateResourceSet -> String
showsPrec :: Int -> CreateResourceSet -> ShowS
$cshowsPrec :: Int -> CreateResourceSet -> ShowS
Prelude.Show, (forall x. CreateResourceSet -> Rep CreateResourceSet x)
-> (forall x. Rep CreateResourceSet x -> CreateResourceSet)
-> Generic CreateResourceSet
forall x. Rep CreateResourceSet x -> CreateResourceSet
forall x. CreateResourceSet -> Rep CreateResourceSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateResourceSet x -> CreateResourceSet
$cfrom :: forall x. CreateResourceSet -> Rep CreateResourceSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateResourceSet' 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', 'createResourceSet_tags' - Undocumented member.
--
-- 'resourceSetType', 'createResourceSet_resourceSetType' - AWS Resource type of the resources in the ResourceSet
--
-- 'resourceSetName', 'createResourceSet_resourceSetName' - The name of the ResourceSet to create
--
-- 'resources', 'createResourceSet_resources' - A list of Resource objects
newCreateResourceSet ::
  -- | 'resourceSetType'
  Prelude.Text ->
  -- | 'resourceSetName'
  Prelude.Text ->
  CreateResourceSet
newCreateResourceSet :: Text -> Text -> CreateResourceSet
newCreateResourceSet
  Text
pResourceSetType_
  Text
pResourceSetName_ =
    CreateResourceSet' :: Maybe (HashMap Text Text)
-> Text -> Text -> [Resource] -> CreateResourceSet
CreateResourceSet'
      { $sel:tags:CreateResourceSet' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceSetType:CreateResourceSet' :: Text
resourceSetType = Text
pResourceSetType_,
        $sel:resourceSetName:CreateResourceSet' :: Text
resourceSetName = Text
pResourceSetName_,
        $sel:resources:CreateResourceSet' :: [Resource]
resources = [Resource]
forall a. Monoid a => a
Prelude.mempty
      }

-- | Undocumented member.
createResourceSet_tags :: Lens.Lens' CreateResourceSet (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createResourceSet_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateResourceSet -> f CreateResourceSet
createResourceSet_tags = (CreateResourceSet -> Maybe (HashMap Text Text))
-> (CreateResourceSet
    -> Maybe (HashMap Text Text) -> CreateResourceSet)
-> Lens
     CreateResourceSet
     CreateResourceSet
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSet' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateResourceSet' :: CreateResourceSet -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateResourceSet
s@CreateResourceSet' {} Maybe (HashMap Text Text)
a -> CreateResourceSet
s {$sel:tags:CreateResourceSet' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateResourceSet) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateResourceSet -> f CreateResourceSet)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateResourceSet
-> f CreateResourceSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | AWS Resource type of the resources in the ResourceSet
createResourceSet_resourceSetType :: Lens.Lens' CreateResourceSet Prelude.Text
createResourceSet_resourceSetType :: (Text -> f Text) -> CreateResourceSet -> f CreateResourceSet
createResourceSet_resourceSetType = (CreateResourceSet -> Text)
-> (CreateResourceSet -> Text -> CreateResourceSet)
-> Lens CreateResourceSet CreateResourceSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSet' {Text
resourceSetType :: Text
$sel:resourceSetType:CreateResourceSet' :: CreateResourceSet -> Text
resourceSetType} -> Text
resourceSetType) (\s :: CreateResourceSet
s@CreateResourceSet' {} Text
a -> CreateResourceSet
s {$sel:resourceSetType:CreateResourceSet' :: Text
resourceSetType = Text
a} :: CreateResourceSet)

-- | The name of the ResourceSet to create
createResourceSet_resourceSetName :: Lens.Lens' CreateResourceSet Prelude.Text
createResourceSet_resourceSetName :: (Text -> f Text) -> CreateResourceSet -> f CreateResourceSet
createResourceSet_resourceSetName = (CreateResourceSet -> Text)
-> (CreateResourceSet -> Text -> CreateResourceSet)
-> Lens CreateResourceSet CreateResourceSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSet' {Text
resourceSetName :: Text
$sel:resourceSetName:CreateResourceSet' :: CreateResourceSet -> Text
resourceSetName} -> Text
resourceSetName) (\s :: CreateResourceSet
s@CreateResourceSet' {} Text
a -> CreateResourceSet
s {$sel:resourceSetName:CreateResourceSet' :: Text
resourceSetName = Text
a} :: CreateResourceSet)

-- | A list of Resource objects
createResourceSet_resources :: Lens.Lens' CreateResourceSet [Resource]
createResourceSet_resources :: ([Resource] -> f [Resource])
-> CreateResourceSet -> f CreateResourceSet
createResourceSet_resources = (CreateResourceSet -> [Resource])
-> (CreateResourceSet -> [Resource] -> CreateResourceSet)
-> Lens CreateResourceSet CreateResourceSet [Resource] [Resource]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSet' {[Resource]
resources :: [Resource]
$sel:resources:CreateResourceSet' :: CreateResourceSet -> [Resource]
resources} -> [Resource]
resources) (\s :: CreateResourceSet
s@CreateResourceSet' {} [Resource]
a -> CreateResourceSet
s {$sel:resources:CreateResourceSet' :: [Resource]
resources = [Resource]
a} :: CreateResourceSet) (([Resource] -> f [Resource])
 -> CreateResourceSet -> f CreateResourceSet)
-> (([Resource] -> f [Resource]) -> [Resource] -> f [Resource])
-> ([Resource] -> f [Resource])
-> CreateResourceSet
-> f CreateResourceSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Resource] -> f [Resource]) -> [Resource] -> f [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateResourceSet where
  type
    AWSResponse CreateResourceSet =
      CreateResourceSetResponse
  request :: CreateResourceSet -> Request CreateResourceSet
request = Service -> CreateResourceSet -> Request CreateResourceSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateResourceSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateResourceSet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateResourceSet))
-> Logger
-> Service
-> Proxy CreateResourceSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateResourceSet)))
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
-> Maybe [Resource]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateResourceSetResponse
CreateResourceSetResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Resource]
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateResourceSetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateResourceSetResponse)
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
"resourceSetName")
            Either
  String
  (Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateResourceSetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Resource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateResourceSetResponse)
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
"resourceSetType")
            Either
  String
  (Maybe [Resource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateResourceSetResponse)
-> Either String (Maybe [Resource])
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> CreateResourceSetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Resource]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resources" Either String (Maybe (Maybe [Resource]))
-> Maybe [Resource] -> Either String (Maybe [Resource])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Resource]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> CreateResourceSetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text) -> Int -> CreateResourceSetResponse)
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
"resourceSetArn")
            Either
  String
  (Maybe (HashMap Text Text) -> Int -> CreateResourceSetResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateResourceSetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateResourceSetResponse)
-> Either String Int -> Either String CreateResourceSetResponse
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 CreateResourceSet

instance Prelude.NFData CreateResourceSet

instance Core.ToHeaders CreateResourceSet where
  toHeaders :: CreateResourceSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateResourceSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateResourceSet where
  toJSON :: CreateResourceSet -> Value
toJSON CreateResourceSet' {[Resource]
Maybe (HashMap Text Text)
Text
resources :: [Resource]
resourceSetName :: Text
resourceSetType :: Text
tags :: Maybe (HashMap Text Text)
$sel:resources:CreateResourceSet' :: CreateResourceSet -> [Resource]
$sel:resourceSetName:CreateResourceSet' :: CreateResourceSet -> Text
$sel:resourceSetType:CreateResourceSet' :: CreateResourceSet -> Text
$sel:tags:CreateResourceSet' :: CreateResourceSet -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"resourceSetType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceSetType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"resourceSetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceSetName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resources" Text -> [Resource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Resource]
resources)
          ]
      )

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

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

-- | /See:/ 'newCreateResourceSetResponse' smart constructor.
data CreateResourceSetResponse = CreateResourceSetResponse'
  { -- | The name of the ResourceSet
    CreateResourceSetResponse -> Maybe Text
resourceSetName :: Prelude.Maybe Prelude.Text,
    -- | AWS Resource Type of the resources in the ResourceSet
    CreateResourceSetResponse -> Maybe Text
resourceSetType :: Prelude.Maybe Prelude.Text,
    -- | A list of Resource objects
    CreateResourceSetResponse -> Maybe [Resource]
resources :: Prelude.Maybe [Resource],
    -- | The arn for the ResourceSet
    CreateResourceSetResponse -> Maybe Text
resourceSetArn :: Prelude.Maybe Prelude.Text,
    CreateResourceSetResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateResourceSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateResourceSetResponse -> CreateResourceSetResponse -> Bool
(CreateResourceSetResponse -> CreateResourceSetResponse -> Bool)
-> (CreateResourceSetResponse -> CreateResourceSetResponse -> Bool)
-> Eq CreateResourceSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateResourceSetResponse -> CreateResourceSetResponse -> Bool
$c/= :: CreateResourceSetResponse -> CreateResourceSetResponse -> Bool
== :: CreateResourceSetResponse -> CreateResourceSetResponse -> Bool
$c== :: CreateResourceSetResponse -> CreateResourceSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateResourceSetResponse]
ReadPrec CreateResourceSetResponse
Int -> ReadS CreateResourceSetResponse
ReadS [CreateResourceSetResponse]
(Int -> ReadS CreateResourceSetResponse)
-> ReadS [CreateResourceSetResponse]
-> ReadPrec CreateResourceSetResponse
-> ReadPrec [CreateResourceSetResponse]
-> Read CreateResourceSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateResourceSetResponse]
$creadListPrec :: ReadPrec [CreateResourceSetResponse]
readPrec :: ReadPrec CreateResourceSetResponse
$creadPrec :: ReadPrec CreateResourceSetResponse
readList :: ReadS [CreateResourceSetResponse]
$creadList :: ReadS [CreateResourceSetResponse]
readsPrec :: Int -> ReadS CreateResourceSetResponse
$creadsPrec :: Int -> ReadS CreateResourceSetResponse
Prelude.Read, Int -> CreateResourceSetResponse -> ShowS
[CreateResourceSetResponse] -> ShowS
CreateResourceSetResponse -> String
(Int -> CreateResourceSetResponse -> ShowS)
-> (CreateResourceSetResponse -> String)
-> ([CreateResourceSetResponse] -> ShowS)
-> Show CreateResourceSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateResourceSetResponse] -> ShowS
$cshowList :: [CreateResourceSetResponse] -> ShowS
show :: CreateResourceSetResponse -> String
$cshow :: CreateResourceSetResponse -> String
showsPrec :: Int -> CreateResourceSetResponse -> ShowS
$cshowsPrec :: Int -> CreateResourceSetResponse -> ShowS
Prelude.Show, (forall x.
 CreateResourceSetResponse -> Rep CreateResourceSetResponse x)
-> (forall x.
    Rep CreateResourceSetResponse x -> CreateResourceSetResponse)
-> Generic CreateResourceSetResponse
forall x.
Rep CreateResourceSetResponse x -> CreateResourceSetResponse
forall x.
CreateResourceSetResponse -> Rep CreateResourceSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateResourceSetResponse x -> CreateResourceSetResponse
$cfrom :: forall x.
CreateResourceSetResponse -> Rep CreateResourceSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateResourceSetResponse' 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:
--
-- 'resourceSetName', 'createResourceSetResponse_resourceSetName' - The name of the ResourceSet
--
-- 'resourceSetType', 'createResourceSetResponse_resourceSetType' - AWS Resource Type of the resources in the ResourceSet
--
-- 'resources', 'createResourceSetResponse_resources' - A list of Resource objects
--
-- 'resourceSetArn', 'createResourceSetResponse_resourceSetArn' - The arn for the ResourceSet
--
-- 'tags', 'createResourceSetResponse_tags' - Undocumented member.
--
-- 'httpStatus', 'createResourceSetResponse_httpStatus' - The response's http status code.
newCreateResourceSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateResourceSetResponse
newCreateResourceSetResponse :: Int -> CreateResourceSetResponse
newCreateResourceSetResponse Int
pHttpStatus_ =
  CreateResourceSetResponse' :: Maybe Text
-> Maybe Text
-> Maybe [Resource]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateResourceSetResponse
CreateResourceSetResponse'
    { $sel:resourceSetName:CreateResourceSetResponse' :: Maybe Text
resourceSetName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSetType:CreateResourceSetResponse' :: Maybe Text
resourceSetType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resources:CreateResourceSetResponse' :: Maybe [Resource]
resources = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSetArn:CreateResourceSetResponse' :: Maybe Text
resourceSetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateResourceSetResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateResourceSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the ResourceSet
createResourceSetResponse_resourceSetName :: Lens.Lens' CreateResourceSetResponse (Prelude.Maybe Prelude.Text)
createResourceSetResponse_resourceSetName :: (Maybe Text -> f (Maybe Text))
-> CreateResourceSetResponse -> f CreateResourceSetResponse
createResourceSetResponse_resourceSetName = (CreateResourceSetResponse -> Maybe Text)
-> (CreateResourceSetResponse
    -> Maybe Text -> CreateResourceSetResponse)
-> Lens
     CreateResourceSetResponse
     CreateResourceSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSetResponse' {Maybe Text
resourceSetName :: Maybe Text
$sel:resourceSetName:CreateResourceSetResponse' :: CreateResourceSetResponse -> Maybe Text
resourceSetName} -> Maybe Text
resourceSetName) (\s :: CreateResourceSetResponse
s@CreateResourceSetResponse' {} Maybe Text
a -> CreateResourceSetResponse
s {$sel:resourceSetName:CreateResourceSetResponse' :: Maybe Text
resourceSetName = Maybe Text
a} :: CreateResourceSetResponse)

-- | AWS Resource Type of the resources in the ResourceSet
createResourceSetResponse_resourceSetType :: Lens.Lens' CreateResourceSetResponse (Prelude.Maybe Prelude.Text)
createResourceSetResponse_resourceSetType :: (Maybe Text -> f (Maybe Text))
-> CreateResourceSetResponse -> f CreateResourceSetResponse
createResourceSetResponse_resourceSetType = (CreateResourceSetResponse -> Maybe Text)
-> (CreateResourceSetResponse
    -> Maybe Text -> CreateResourceSetResponse)
-> Lens
     CreateResourceSetResponse
     CreateResourceSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSetResponse' {Maybe Text
resourceSetType :: Maybe Text
$sel:resourceSetType:CreateResourceSetResponse' :: CreateResourceSetResponse -> Maybe Text
resourceSetType} -> Maybe Text
resourceSetType) (\s :: CreateResourceSetResponse
s@CreateResourceSetResponse' {} Maybe Text
a -> CreateResourceSetResponse
s {$sel:resourceSetType:CreateResourceSetResponse' :: Maybe Text
resourceSetType = Maybe Text
a} :: CreateResourceSetResponse)

-- | A list of Resource objects
createResourceSetResponse_resources :: Lens.Lens' CreateResourceSetResponse (Prelude.Maybe [Resource])
createResourceSetResponse_resources :: (Maybe [Resource] -> f (Maybe [Resource]))
-> CreateResourceSetResponse -> f CreateResourceSetResponse
createResourceSetResponse_resources = (CreateResourceSetResponse -> Maybe [Resource])
-> (CreateResourceSetResponse
    -> Maybe [Resource] -> CreateResourceSetResponse)
-> Lens
     CreateResourceSetResponse
     CreateResourceSetResponse
     (Maybe [Resource])
     (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSetResponse' {Maybe [Resource]
resources :: Maybe [Resource]
$sel:resources:CreateResourceSetResponse' :: CreateResourceSetResponse -> Maybe [Resource]
resources} -> Maybe [Resource]
resources) (\s :: CreateResourceSetResponse
s@CreateResourceSetResponse' {} Maybe [Resource]
a -> CreateResourceSetResponse
s {$sel:resources:CreateResourceSetResponse' :: Maybe [Resource]
resources = Maybe [Resource]
a} :: CreateResourceSetResponse) ((Maybe [Resource] -> f (Maybe [Resource]))
 -> CreateResourceSetResponse -> f CreateResourceSetResponse)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
    -> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> CreateResourceSetResponse
-> f CreateResourceSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The arn for the ResourceSet
createResourceSetResponse_resourceSetArn :: Lens.Lens' CreateResourceSetResponse (Prelude.Maybe Prelude.Text)
createResourceSetResponse_resourceSetArn :: (Maybe Text -> f (Maybe Text))
-> CreateResourceSetResponse -> f CreateResourceSetResponse
createResourceSetResponse_resourceSetArn = (CreateResourceSetResponse -> Maybe Text)
-> (CreateResourceSetResponse
    -> Maybe Text -> CreateResourceSetResponse)
-> Lens
     CreateResourceSetResponse
     CreateResourceSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSetResponse' {Maybe Text
resourceSetArn :: Maybe Text
$sel:resourceSetArn:CreateResourceSetResponse' :: CreateResourceSetResponse -> Maybe Text
resourceSetArn} -> Maybe Text
resourceSetArn) (\s :: CreateResourceSetResponse
s@CreateResourceSetResponse' {} Maybe Text
a -> CreateResourceSetResponse
s {$sel:resourceSetArn:CreateResourceSetResponse' :: Maybe Text
resourceSetArn = Maybe Text
a} :: CreateResourceSetResponse)

-- | Undocumented member.
createResourceSetResponse_tags :: Lens.Lens' CreateResourceSetResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createResourceSetResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateResourceSetResponse -> f CreateResourceSetResponse
createResourceSetResponse_tags = (CreateResourceSetResponse -> Maybe (HashMap Text Text))
-> (CreateResourceSetResponse
    -> Maybe (HashMap Text Text) -> CreateResourceSetResponse)
-> Lens
     CreateResourceSetResponse
     CreateResourceSetResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceSetResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateResourceSetResponse' :: CreateResourceSetResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateResourceSetResponse
s@CreateResourceSetResponse' {} Maybe (HashMap Text Text)
a -> CreateResourceSetResponse
s {$sel:tags:CreateResourceSetResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateResourceSetResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateResourceSetResponse -> f CreateResourceSetResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateResourceSetResponse
-> f CreateResourceSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateResourceSetResponse