{-# 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.Backup.CreateFramework
-- 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 framework with one or more controls. A framework is a
-- collection of controls that you can use to evaluate your backup
-- practices. By using pre-built customizable controls to define your
-- policies, you can evaluate whether your backup practices comply with
-- your policies and which resources are not yet in compliance.
module Amazonka.Backup.CreateFramework
  ( -- * Creating a Request
    CreateFramework (..),
    newCreateFramework,

    -- * Request Lenses
    createFramework_idempotencyToken,
    createFramework_frameworkDescription,
    createFramework_frameworkTags,
    createFramework_frameworkName,
    createFramework_frameworkControls,

    -- * Destructuring the Response
    CreateFrameworkResponse (..),
    newCreateFrameworkResponse,

    -- * Response Lenses
    createFrameworkResponse_frameworkArn,
    createFrameworkResponse_frameworkName,
    createFrameworkResponse_httpStatus,
  )
where

import Amazonka.Backup.Types
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

-- | /See:/ 'newCreateFramework' smart constructor.
data CreateFramework = CreateFramework'
  { -- | A customer-chosen string that you can use to distinguish between
    -- otherwise identical calls to @CreateFrameworkInput@. Retrying a
    -- successful request with the same idempotency token results in a success
    -- message with no action taken.
    CreateFramework -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
    -- | An optional description of the framework with a maximum of 1,024
    -- characters.
    CreateFramework -> Maybe Text
frameworkDescription :: Prelude.Maybe Prelude.Text,
    -- | Metadata that you can assign to help organize the frameworks that you
    -- create. Each tag is a key-value pair.
    CreateFramework -> Maybe (HashMap Text Text)
frameworkTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name of the framework. The name must be between 1 and 256
    -- characters, starting with a letter, and consisting of letters (a-z,
    -- A-Z), numbers (0-9), and underscores (_).
    CreateFramework -> Text
frameworkName :: Prelude.Text,
    -- | A list of the controls that make up the framework. Each control in the
    -- list has a name, input parameters, and scope.
    CreateFramework -> [FrameworkControl]
frameworkControls :: [FrameworkControl]
  }
  deriving (CreateFramework -> CreateFramework -> Bool
(CreateFramework -> CreateFramework -> Bool)
-> (CreateFramework -> CreateFramework -> Bool)
-> Eq CreateFramework
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFramework -> CreateFramework -> Bool
$c/= :: CreateFramework -> CreateFramework -> Bool
== :: CreateFramework -> CreateFramework -> Bool
$c== :: CreateFramework -> CreateFramework -> Bool
Prelude.Eq, ReadPrec [CreateFramework]
ReadPrec CreateFramework
Int -> ReadS CreateFramework
ReadS [CreateFramework]
(Int -> ReadS CreateFramework)
-> ReadS [CreateFramework]
-> ReadPrec CreateFramework
-> ReadPrec [CreateFramework]
-> Read CreateFramework
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFramework]
$creadListPrec :: ReadPrec [CreateFramework]
readPrec :: ReadPrec CreateFramework
$creadPrec :: ReadPrec CreateFramework
readList :: ReadS [CreateFramework]
$creadList :: ReadS [CreateFramework]
readsPrec :: Int -> ReadS CreateFramework
$creadsPrec :: Int -> ReadS CreateFramework
Prelude.Read, Int -> CreateFramework -> ShowS
[CreateFramework] -> ShowS
CreateFramework -> String
(Int -> CreateFramework -> ShowS)
-> (CreateFramework -> String)
-> ([CreateFramework] -> ShowS)
-> Show CreateFramework
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFramework] -> ShowS
$cshowList :: [CreateFramework] -> ShowS
show :: CreateFramework -> String
$cshow :: CreateFramework -> String
showsPrec :: Int -> CreateFramework -> ShowS
$cshowsPrec :: Int -> CreateFramework -> ShowS
Prelude.Show, (forall x. CreateFramework -> Rep CreateFramework x)
-> (forall x. Rep CreateFramework x -> CreateFramework)
-> Generic CreateFramework
forall x. Rep CreateFramework x -> CreateFramework
forall x. CreateFramework -> Rep CreateFramework x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFramework x -> CreateFramework
$cfrom :: forall x. CreateFramework -> Rep CreateFramework x
Prelude.Generic)

-- |
-- Create a value of 'CreateFramework' 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:
--
-- 'idempotencyToken', 'createFramework_idempotencyToken' - A customer-chosen string that you can use to distinguish between
-- otherwise identical calls to @CreateFrameworkInput@. Retrying a
-- successful request with the same idempotency token results in a success
-- message with no action taken.
--
-- 'frameworkDescription', 'createFramework_frameworkDescription' - An optional description of the framework with a maximum of 1,024
-- characters.
--
-- 'frameworkTags', 'createFramework_frameworkTags' - Metadata that you can assign to help organize the frameworks that you
-- create. Each tag is a key-value pair.
--
-- 'frameworkName', 'createFramework_frameworkName' - The unique name of the framework. The name must be between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
--
-- 'frameworkControls', 'createFramework_frameworkControls' - A list of the controls that make up the framework. Each control in the
-- list has a name, input parameters, and scope.
newCreateFramework ::
  -- | 'frameworkName'
  Prelude.Text ->
  CreateFramework
newCreateFramework :: Text -> CreateFramework
newCreateFramework Text
pFrameworkName_ =
  CreateFramework' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> [FrameworkControl]
-> CreateFramework
CreateFramework'
    { $sel:idempotencyToken:CreateFramework' :: Maybe Text
idempotencyToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkDescription:CreateFramework' :: Maybe Text
frameworkDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkTags:CreateFramework' :: Maybe (HashMap Text Text)
frameworkTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkName:CreateFramework' :: Text
frameworkName = Text
pFrameworkName_,
      $sel:frameworkControls:CreateFramework' :: [FrameworkControl]
frameworkControls = [FrameworkControl]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A customer-chosen string that you can use to distinguish between
-- otherwise identical calls to @CreateFrameworkInput@. Retrying a
-- successful request with the same idempotency token results in a success
-- message with no action taken.
createFramework_idempotencyToken :: Lens.Lens' CreateFramework (Prelude.Maybe Prelude.Text)
createFramework_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> CreateFramework -> f CreateFramework
createFramework_idempotencyToken = (CreateFramework -> Maybe Text)
-> (CreateFramework -> Maybe Text -> CreateFramework)
-> Lens CreateFramework CreateFramework (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFramework' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:CreateFramework' :: CreateFramework -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: CreateFramework
s@CreateFramework' {} Maybe Text
a -> CreateFramework
s {$sel:idempotencyToken:CreateFramework' :: Maybe Text
idempotencyToken = Maybe Text
a} :: CreateFramework)

-- | An optional description of the framework with a maximum of 1,024
-- characters.
createFramework_frameworkDescription :: Lens.Lens' CreateFramework (Prelude.Maybe Prelude.Text)
createFramework_frameworkDescription :: (Maybe Text -> f (Maybe Text))
-> CreateFramework -> f CreateFramework
createFramework_frameworkDescription = (CreateFramework -> Maybe Text)
-> (CreateFramework -> Maybe Text -> CreateFramework)
-> Lens CreateFramework CreateFramework (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFramework' {Maybe Text
frameworkDescription :: Maybe Text
$sel:frameworkDescription:CreateFramework' :: CreateFramework -> Maybe Text
frameworkDescription} -> Maybe Text
frameworkDescription) (\s :: CreateFramework
s@CreateFramework' {} Maybe Text
a -> CreateFramework
s {$sel:frameworkDescription:CreateFramework' :: Maybe Text
frameworkDescription = Maybe Text
a} :: CreateFramework)

-- | Metadata that you can assign to help organize the frameworks that you
-- create. Each tag is a key-value pair.
createFramework_frameworkTags :: Lens.Lens' CreateFramework (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createFramework_frameworkTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateFramework -> f CreateFramework
createFramework_frameworkTags = (CreateFramework -> Maybe (HashMap Text Text))
-> (CreateFramework
    -> Maybe (HashMap Text Text) -> CreateFramework)
-> Lens
     CreateFramework
     CreateFramework
     (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 (\CreateFramework' {Maybe (HashMap Text Text)
frameworkTags :: Maybe (HashMap Text Text)
$sel:frameworkTags:CreateFramework' :: CreateFramework -> Maybe (HashMap Text Text)
frameworkTags} -> Maybe (HashMap Text Text)
frameworkTags) (\s :: CreateFramework
s@CreateFramework' {} Maybe (HashMap Text Text)
a -> CreateFramework
s {$sel:frameworkTags:CreateFramework' :: Maybe (HashMap Text Text)
frameworkTags = Maybe (HashMap Text Text)
a} :: CreateFramework) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateFramework -> f CreateFramework)
-> ((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)))
-> CreateFramework
-> f CreateFramework
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 unique name of the framework. The name must be between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
createFramework_frameworkName :: Lens.Lens' CreateFramework Prelude.Text
createFramework_frameworkName :: (Text -> f Text) -> CreateFramework -> f CreateFramework
createFramework_frameworkName = (CreateFramework -> Text)
-> (CreateFramework -> Text -> CreateFramework)
-> Lens CreateFramework CreateFramework Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFramework' {Text
frameworkName :: Text
$sel:frameworkName:CreateFramework' :: CreateFramework -> Text
frameworkName} -> Text
frameworkName) (\s :: CreateFramework
s@CreateFramework' {} Text
a -> CreateFramework
s {$sel:frameworkName:CreateFramework' :: Text
frameworkName = Text
a} :: CreateFramework)

-- | A list of the controls that make up the framework. Each control in the
-- list has a name, input parameters, and scope.
createFramework_frameworkControls :: Lens.Lens' CreateFramework [FrameworkControl]
createFramework_frameworkControls :: ([FrameworkControl] -> f [FrameworkControl])
-> CreateFramework -> f CreateFramework
createFramework_frameworkControls = (CreateFramework -> [FrameworkControl])
-> (CreateFramework -> [FrameworkControl] -> CreateFramework)
-> Lens
     CreateFramework
     CreateFramework
     [FrameworkControl]
     [FrameworkControl]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFramework' {[FrameworkControl]
frameworkControls :: [FrameworkControl]
$sel:frameworkControls:CreateFramework' :: CreateFramework -> [FrameworkControl]
frameworkControls} -> [FrameworkControl]
frameworkControls) (\s :: CreateFramework
s@CreateFramework' {} [FrameworkControl]
a -> CreateFramework
s {$sel:frameworkControls:CreateFramework' :: [FrameworkControl]
frameworkControls = [FrameworkControl]
a} :: CreateFramework) (([FrameworkControl] -> f [FrameworkControl])
 -> CreateFramework -> f CreateFramework)
-> (([FrameworkControl] -> f [FrameworkControl])
    -> [FrameworkControl] -> f [FrameworkControl])
-> ([FrameworkControl] -> f [FrameworkControl])
-> CreateFramework
-> f CreateFramework
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FrameworkControl] -> f [FrameworkControl])
-> [FrameworkControl] -> f [FrameworkControl]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateFramework where
  type
    AWSResponse CreateFramework =
      CreateFrameworkResponse
  request :: CreateFramework -> Request CreateFramework
request = Service -> CreateFramework -> Request CreateFramework
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFramework
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFramework)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateFramework))
-> Logger
-> Service
-> Proxy CreateFramework
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFramework)))
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 -> CreateFrameworkResponse
CreateFrameworkResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateFrameworkResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateFrameworkResponse)
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
"FrameworkArn")
            Either String (Maybe Text -> Int -> CreateFrameworkResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateFrameworkResponse)
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
"FrameworkName")
            Either String (Int -> CreateFrameworkResponse)
-> Either String Int -> Either String CreateFrameworkResponse
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 CreateFramework

instance Prelude.NFData CreateFramework

instance Core.ToHeaders CreateFramework where
  toHeaders :: CreateFramework -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateFramework -> 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 CreateFramework where
  toJSON :: CreateFramework -> Value
toJSON CreateFramework' {[FrameworkControl]
Maybe Text
Maybe (HashMap Text Text)
Text
frameworkControls :: [FrameworkControl]
frameworkName :: Text
frameworkTags :: Maybe (HashMap Text Text)
frameworkDescription :: Maybe Text
idempotencyToken :: Maybe Text
$sel:frameworkControls:CreateFramework' :: CreateFramework -> [FrameworkControl]
$sel:frameworkName:CreateFramework' :: CreateFramework -> Text
$sel:frameworkTags:CreateFramework' :: CreateFramework -> Maybe (HashMap Text Text)
$sel:frameworkDescription:CreateFramework' :: CreateFramework -> Maybe Text
$sel:idempotencyToken:CreateFramework' :: CreateFramework -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
idempotencyToken,
            (Text
"FrameworkDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
frameworkDescription,
            (Text
"FrameworkTags" 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)
frameworkTags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FrameworkName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
frameworkName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FrameworkControls" Text -> [FrameworkControl] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [FrameworkControl]
frameworkControls)
          ]
      )

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

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

-- | /See:/ 'newCreateFrameworkResponse' smart constructor.
data CreateFrameworkResponse = CreateFrameworkResponse'
  { -- | An Amazon Resource Name (ARN) that uniquely identifies a resource. The
    -- format of the ARN depends on the resource type.
    CreateFrameworkResponse -> Maybe Text
frameworkArn :: Prelude.Maybe Prelude.Text,
    -- | The unique name of the framework. The name must be between 1 and 256
    -- characters, starting with a letter, and consisting of letters (a-z,
    -- A-Z), numbers (0-9), and underscores (_).
    CreateFrameworkResponse -> Maybe Text
frameworkName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateFrameworkResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateFrameworkResponse -> CreateFrameworkResponse -> Bool
(CreateFrameworkResponse -> CreateFrameworkResponse -> Bool)
-> (CreateFrameworkResponse -> CreateFrameworkResponse -> Bool)
-> Eq CreateFrameworkResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFrameworkResponse -> CreateFrameworkResponse -> Bool
$c/= :: CreateFrameworkResponse -> CreateFrameworkResponse -> Bool
== :: CreateFrameworkResponse -> CreateFrameworkResponse -> Bool
$c== :: CreateFrameworkResponse -> CreateFrameworkResponse -> Bool
Prelude.Eq, ReadPrec [CreateFrameworkResponse]
ReadPrec CreateFrameworkResponse
Int -> ReadS CreateFrameworkResponse
ReadS [CreateFrameworkResponse]
(Int -> ReadS CreateFrameworkResponse)
-> ReadS [CreateFrameworkResponse]
-> ReadPrec CreateFrameworkResponse
-> ReadPrec [CreateFrameworkResponse]
-> Read CreateFrameworkResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFrameworkResponse]
$creadListPrec :: ReadPrec [CreateFrameworkResponse]
readPrec :: ReadPrec CreateFrameworkResponse
$creadPrec :: ReadPrec CreateFrameworkResponse
readList :: ReadS [CreateFrameworkResponse]
$creadList :: ReadS [CreateFrameworkResponse]
readsPrec :: Int -> ReadS CreateFrameworkResponse
$creadsPrec :: Int -> ReadS CreateFrameworkResponse
Prelude.Read, Int -> CreateFrameworkResponse -> ShowS
[CreateFrameworkResponse] -> ShowS
CreateFrameworkResponse -> String
(Int -> CreateFrameworkResponse -> ShowS)
-> (CreateFrameworkResponse -> String)
-> ([CreateFrameworkResponse] -> ShowS)
-> Show CreateFrameworkResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFrameworkResponse] -> ShowS
$cshowList :: [CreateFrameworkResponse] -> ShowS
show :: CreateFrameworkResponse -> String
$cshow :: CreateFrameworkResponse -> String
showsPrec :: Int -> CreateFrameworkResponse -> ShowS
$cshowsPrec :: Int -> CreateFrameworkResponse -> ShowS
Prelude.Show, (forall x.
 CreateFrameworkResponse -> Rep CreateFrameworkResponse x)
-> (forall x.
    Rep CreateFrameworkResponse x -> CreateFrameworkResponse)
-> Generic CreateFrameworkResponse
forall x. Rep CreateFrameworkResponse x -> CreateFrameworkResponse
forall x. CreateFrameworkResponse -> Rep CreateFrameworkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFrameworkResponse x -> CreateFrameworkResponse
$cfrom :: forall x. CreateFrameworkResponse -> Rep CreateFrameworkResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateFrameworkResponse' 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:
--
-- 'frameworkArn', 'createFrameworkResponse_frameworkArn' - An Amazon Resource Name (ARN) that uniquely identifies a resource. The
-- format of the ARN depends on the resource type.
--
-- 'frameworkName', 'createFrameworkResponse_frameworkName' - The unique name of the framework. The name must be between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
--
-- 'httpStatus', 'createFrameworkResponse_httpStatus' - The response's http status code.
newCreateFrameworkResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFrameworkResponse
newCreateFrameworkResponse :: Int -> CreateFrameworkResponse
newCreateFrameworkResponse Int
pHttpStatus_ =
  CreateFrameworkResponse' :: Maybe Text -> Maybe Text -> Int -> CreateFrameworkResponse
CreateFrameworkResponse'
    { $sel:frameworkArn:CreateFrameworkResponse' :: Maybe Text
frameworkArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkName:CreateFrameworkResponse' :: Maybe Text
frameworkName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFrameworkResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An Amazon Resource Name (ARN) that uniquely identifies a resource. The
-- format of the ARN depends on the resource type.
createFrameworkResponse_frameworkArn :: Lens.Lens' CreateFrameworkResponse (Prelude.Maybe Prelude.Text)
createFrameworkResponse_frameworkArn :: (Maybe Text -> f (Maybe Text))
-> CreateFrameworkResponse -> f CreateFrameworkResponse
createFrameworkResponse_frameworkArn = (CreateFrameworkResponse -> Maybe Text)
-> (CreateFrameworkResponse
    -> Maybe Text -> CreateFrameworkResponse)
-> Lens
     CreateFrameworkResponse
     CreateFrameworkResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFrameworkResponse' {Maybe Text
frameworkArn :: Maybe Text
$sel:frameworkArn:CreateFrameworkResponse' :: CreateFrameworkResponse -> Maybe Text
frameworkArn} -> Maybe Text
frameworkArn) (\s :: CreateFrameworkResponse
s@CreateFrameworkResponse' {} Maybe Text
a -> CreateFrameworkResponse
s {$sel:frameworkArn:CreateFrameworkResponse' :: Maybe Text
frameworkArn = Maybe Text
a} :: CreateFrameworkResponse)

-- | The unique name of the framework. The name must be between 1 and 256
-- characters, starting with a letter, and consisting of letters (a-z,
-- A-Z), numbers (0-9), and underscores (_).
createFrameworkResponse_frameworkName :: Lens.Lens' CreateFrameworkResponse (Prelude.Maybe Prelude.Text)
createFrameworkResponse_frameworkName :: (Maybe Text -> f (Maybe Text))
-> CreateFrameworkResponse -> f CreateFrameworkResponse
createFrameworkResponse_frameworkName = (CreateFrameworkResponse -> Maybe Text)
-> (CreateFrameworkResponse
    -> Maybe Text -> CreateFrameworkResponse)
-> Lens
     CreateFrameworkResponse
     CreateFrameworkResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFrameworkResponse' {Maybe Text
frameworkName :: Maybe Text
$sel:frameworkName:CreateFrameworkResponse' :: CreateFrameworkResponse -> Maybe Text
frameworkName} -> Maybe Text
frameworkName) (\s :: CreateFrameworkResponse
s@CreateFrameworkResponse' {} Maybe Text
a -> CreateFrameworkResponse
s {$sel:frameworkName:CreateFrameworkResponse' :: Maybe Text
frameworkName = Maybe Text
a} :: CreateFrameworkResponse)

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

instance Prelude.NFData CreateFrameworkResponse