{-# 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.ServiceCatalogAppRegistry.CreateAttributeGroup
-- 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 attribute group as a container for user-defined
-- attributes. This feature enables users to have full control over their
-- cloud application\'s metadata in a rich machine-readable format to
-- facilitate integration with automated workflows and third-party tools.
module Amazonka.ServiceCatalogAppRegistry.CreateAttributeGroup
  ( -- * Creating a Request
    CreateAttributeGroup (..),
    newCreateAttributeGroup,

    -- * Request Lenses
    createAttributeGroup_description,
    createAttributeGroup_tags,
    createAttributeGroup_name,
    createAttributeGroup_attributes,
    createAttributeGroup_clientToken,

    -- * Destructuring the Response
    CreateAttributeGroupResponse (..),
    newCreateAttributeGroupResponse,

    -- * Response Lenses
    createAttributeGroupResponse_attributeGroup,
    createAttributeGroupResponse_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.ServiceCatalogAppRegistry.Types

-- | /See:/ 'newCreateAttributeGroup' smart constructor.
data CreateAttributeGroup = CreateAttributeGroup'
  { -- | The description of the attribute group that the user provides.
    CreateAttributeGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Key-value pairs you can use to associate with the attribute group.
    CreateAttributeGroup -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the attribute group.
    CreateAttributeGroup -> Text
name :: Prelude.Text,
    -- | A JSON string in the form of nested key-value pairs that represent the
    -- attributes in the group and describes an application and its components.
    CreateAttributeGroup -> Text
attributes :: Prelude.Text,
    -- | A unique identifier that you provide to ensure idempotency. If you retry
    -- a request that completed successfully using the same client token and
    -- the same parameters, the retry succeeds without performing any further
    -- actions. If you retry a successful request using the same client token,
    -- but one or more of the parameters are different, the retry fails.
    CreateAttributeGroup -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateAttributeGroup -> CreateAttributeGroup -> Bool
(CreateAttributeGroup -> CreateAttributeGroup -> Bool)
-> (CreateAttributeGroup -> CreateAttributeGroup -> Bool)
-> Eq CreateAttributeGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAttributeGroup -> CreateAttributeGroup -> Bool
$c/= :: CreateAttributeGroup -> CreateAttributeGroup -> Bool
== :: CreateAttributeGroup -> CreateAttributeGroup -> Bool
$c== :: CreateAttributeGroup -> CreateAttributeGroup -> Bool
Prelude.Eq, ReadPrec [CreateAttributeGroup]
ReadPrec CreateAttributeGroup
Int -> ReadS CreateAttributeGroup
ReadS [CreateAttributeGroup]
(Int -> ReadS CreateAttributeGroup)
-> ReadS [CreateAttributeGroup]
-> ReadPrec CreateAttributeGroup
-> ReadPrec [CreateAttributeGroup]
-> Read CreateAttributeGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAttributeGroup]
$creadListPrec :: ReadPrec [CreateAttributeGroup]
readPrec :: ReadPrec CreateAttributeGroup
$creadPrec :: ReadPrec CreateAttributeGroup
readList :: ReadS [CreateAttributeGroup]
$creadList :: ReadS [CreateAttributeGroup]
readsPrec :: Int -> ReadS CreateAttributeGroup
$creadsPrec :: Int -> ReadS CreateAttributeGroup
Prelude.Read, Int -> CreateAttributeGroup -> ShowS
[CreateAttributeGroup] -> ShowS
CreateAttributeGroup -> String
(Int -> CreateAttributeGroup -> ShowS)
-> (CreateAttributeGroup -> String)
-> ([CreateAttributeGroup] -> ShowS)
-> Show CreateAttributeGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAttributeGroup] -> ShowS
$cshowList :: [CreateAttributeGroup] -> ShowS
show :: CreateAttributeGroup -> String
$cshow :: CreateAttributeGroup -> String
showsPrec :: Int -> CreateAttributeGroup -> ShowS
$cshowsPrec :: Int -> CreateAttributeGroup -> ShowS
Prelude.Show, (forall x. CreateAttributeGroup -> Rep CreateAttributeGroup x)
-> (forall x. Rep CreateAttributeGroup x -> CreateAttributeGroup)
-> Generic CreateAttributeGroup
forall x. Rep CreateAttributeGroup x -> CreateAttributeGroup
forall x. CreateAttributeGroup -> Rep CreateAttributeGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAttributeGroup x -> CreateAttributeGroup
$cfrom :: forall x. CreateAttributeGroup -> Rep CreateAttributeGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateAttributeGroup' 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:
--
-- 'description', 'createAttributeGroup_description' - The description of the attribute group that the user provides.
--
-- 'tags', 'createAttributeGroup_tags' - Key-value pairs you can use to associate with the attribute group.
--
-- 'name', 'createAttributeGroup_name' - The name of the attribute group.
--
-- 'attributes', 'createAttributeGroup_attributes' - A JSON string in the form of nested key-value pairs that represent the
-- attributes in the group and describes an application and its components.
--
-- 'clientToken', 'createAttributeGroup_clientToken' - A unique identifier that you provide to ensure idempotency. If you retry
-- a request that completed successfully using the same client token and
-- the same parameters, the retry succeeds without performing any further
-- actions. If you retry a successful request using the same client token,
-- but one or more of the parameters are different, the retry fails.
newCreateAttributeGroup ::
  -- | 'name'
  Prelude.Text ->
  -- | 'attributes'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateAttributeGroup
newCreateAttributeGroup :: Text -> Text -> Text -> CreateAttributeGroup
newCreateAttributeGroup
  Text
pName_
  Text
pAttributes_
  Text
pClientToken_ =
    CreateAttributeGroup' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> CreateAttributeGroup
CreateAttributeGroup'
      { $sel:description:CreateAttributeGroup' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAttributeGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateAttributeGroup' :: Text
name = Text
pName_,
        $sel:attributes:CreateAttributeGroup' :: Text
attributes = Text
pAttributes_,
        $sel:clientToken:CreateAttributeGroup' :: Text
clientToken = Text
pClientToken_
      }

-- | The description of the attribute group that the user provides.
createAttributeGroup_description :: Lens.Lens' CreateAttributeGroup (Prelude.Maybe Prelude.Text)
createAttributeGroup_description :: (Maybe Text -> f (Maybe Text))
-> CreateAttributeGroup -> f CreateAttributeGroup
createAttributeGroup_description = (CreateAttributeGroup -> Maybe Text)
-> (CreateAttributeGroup -> Maybe Text -> CreateAttributeGroup)
-> Lens
     CreateAttributeGroup CreateAttributeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttributeGroup' {Maybe Text
description :: Maybe Text
$sel:description:CreateAttributeGroup' :: CreateAttributeGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateAttributeGroup
s@CreateAttributeGroup' {} Maybe Text
a -> CreateAttributeGroup
s {$sel:description:CreateAttributeGroup' :: Maybe Text
description = Maybe Text
a} :: CreateAttributeGroup)

-- | Key-value pairs you can use to associate with the attribute group.
createAttributeGroup_tags :: Lens.Lens' CreateAttributeGroup (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAttributeGroup_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAttributeGroup -> f CreateAttributeGroup
createAttributeGroup_tags = (CreateAttributeGroup -> Maybe (HashMap Text Text))
-> (CreateAttributeGroup
    -> Maybe (HashMap Text Text) -> CreateAttributeGroup)
-> Lens
     CreateAttributeGroup
     CreateAttributeGroup
     (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 (\CreateAttributeGroup' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAttributeGroup' :: CreateAttributeGroup -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAttributeGroup
s@CreateAttributeGroup' {} Maybe (HashMap Text Text)
a -> CreateAttributeGroup
s {$sel:tags:CreateAttributeGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAttributeGroup) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAttributeGroup -> f CreateAttributeGroup)
-> ((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)))
-> CreateAttributeGroup
-> f CreateAttributeGroup
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 name of the attribute group.
createAttributeGroup_name :: Lens.Lens' CreateAttributeGroup Prelude.Text
createAttributeGroup_name :: (Text -> f Text) -> CreateAttributeGroup -> f CreateAttributeGroup
createAttributeGroup_name = (CreateAttributeGroup -> Text)
-> (CreateAttributeGroup -> Text -> CreateAttributeGroup)
-> Lens CreateAttributeGroup CreateAttributeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttributeGroup' {Text
name :: Text
$sel:name:CreateAttributeGroup' :: CreateAttributeGroup -> Text
name} -> Text
name) (\s :: CreateAttributeGroup
s@CreateAttributeGroup' {} Text
a -> CreateAttributeGroup
s {$sel:name:CreateAttributeGroup' :: Text
name = Text
a} :: CreateAttributeGroup)

-- | A JSON string in the form of nested key-value pairs that represent the
-- attributes in the group and describes an application and its components.
createAttributeGroup_attributes :: Lens.Lens' CreateAttributeGroup Prelude.Text
createAttributeGroup_attributes :: (Text -> f Text) -> CreateAttributeGroup -> f CreateAttributeGroup
createAttributeGroup_attributes = (CreateAttributeGroup -> Text)
-> (CreateAttributeGroup -> Text -> CreateAttributeGroup)
-> Lens CreateAttributeGroup CreateAttributeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttributeGroup' {Text
attributes :: Text
$sel:attributes:CreateAttributeGroup' :: CreateAttributeGroup -> Text
attributes} -> Text
attributes) (\s :: CreateAttributeGroup
s@CreateAttributeGroup' {} Text
a -> CreateAttributeGroup
s {$sel:attributes:CreateAttributeGroup' :: Text
attributes = Text
a} :: CreateAttributeGroup)

-- | A unique identifier that you provide to ensure idempotency. If you retry
-- a request that completed successfully using the same client token and
-- the same parameters, the retry succeeds without performing any further
-- actions. If you retry a successful request using the same client token,
-- but one or more of the parameters are different, the retry fails.
createAttributeGroup_clientToken :: Lens.Lens' CreateAttributeGroup Prelude.Text
createAttributeGroup_clientToken :: (Text -> f Text) -> CreateAttributeGroup -> f CreateAttributeGroup
createAttributeGroup_clientToken = (CreateAttributeGroup -> Text)
-> (CreateAttributeGroup -> Text -> CreateAttributeGroup)
-> Lens CreateAttributeGroup CreateAttributeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttributeGroup' {Text
clientToken :: Text
$sel:clientToken:CreateAttributeGroup' :: CreateAttributeGroup -> Text
clientToken} -> Text
clientToken) (\s :: CreateAttributeGroup
s@CreateAttributeGroup' {} Text
a -> CreateAttributeGroup
s {$sel:clientToken:CreateAttributeGroup' :: Text
clientToken = Text
a} :: CreateAttributeGroup)

instance Core.AWSRequest CreateAttributeGroup where
  type
    AWSResponse CreateAttributeGroup =
      CreateAttributeGroupResponse
  request :: CreateAttributeGroup -> Request CreateAttributeGroup
request = Service -> CreateAttributeGroup -> Request CreateAttributeGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAttributeGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAttributeGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAttributeGroup))
-> Logger
-> Service
-> Proxy CreateAttributeGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAttributeGroup)))
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 AttributeGroup -> Int -> CreateAttributeGroupResponse
CreateAttributeGroupResponse'
            (Maybe AttributeGroup -> Int -> CreateAttributeGroupResponse)
-> Either String (Maybe AttributeGroup)
-> Either String (Int -> CreateAttributeGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AttributeGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"attributeGroup")
            Either String (Int -> CreateAttributeGroupResponse)
-> Either String Int -> Either String CreateAttributeGroupResponse
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 CreateAttributeGroup

instance Prelude.NFData CreateAttributeGroup

instance Core.ToHeaders CreateAttributeGroup where
  toHeaders :: CreateAttributeGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAttributeGroup -> 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 CreateAttributeGroup where
  toJSON :: CreateAttributeGroup -> Value
toJSON CreateAttributeGroup' {Maybe Text
Maybe (HashMap Text Text)
Text
clientToken :: Text
attributes :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:clientToken:CreateAttributeGroup' :: CreateAttributeGroup -> Text
$sel:attributes:CreateAttributeGroup' :: CreateAttributeGroup -> Text
$sel:name:CreateAttributeGroup' :: CreateAttributeGroup -> Text
$sel:tags:CreateAttributeGroup' :: CreateAttributeGroup -> Maybe (HashMap Text Text)
$sel:description:CreateAttributeGroup' :: CreateAttributeGroup -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" 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
description,
            (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
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"attributes" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
attributes),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAttributeGroupResponse' 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:
--
-- 'attributeGroup', 'createAttributeGroupResponse_attributeGroup' - Information about the attribute group.
--
-- 'httpStatus', 'createAttributeGroupResponse_httpStatus' - The response's http status code.
newCreateAttributeGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAttributeGroupResponse
newCreateAttributeGroupResponse :: Int -> CreateAttributeGroupResponse
newCreateAttributeGroupResponse Int
pHttpStatus_ =
  CreateAttributeGroupResponse' :: Maybe AttributeGroup -> Int -> CreateAttributeGroupResponse
CreateAttributeGroupResponse'
    { $sel:attributeGroup:CreateAttributeGroupResponse' :: Maybe AttributeGroup
attributeGroup =
        Maybe AttributeGroup
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAttributeGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the attribute group.
createAttributeGroupResponse_attributeGroup :: Lens.Lens' CreateAttributeGroupResponse (Prelude.Maybe AttributeGroup)
createAttributeGroupResponse_attributeGroup :: (Maybe AttributeGroup -> f (Maybe AttributeGroup))
-> CreateAttributeGroupResponse -> f CreateAttributeGroupResponse
createAttributeGroupResponse_attributeGroup = (CreateAttributeGroupResponse -> Maybe AttributeGroup)
-> (CreateAttributeGroupResponse
    -> Maybe AttributeGroup -> CreateAttributeGroupResponse)
-> Lens
     CreateAttributeGroupResponse
     CreateAttributeGroupResponse
     (Maybe AttributeGroup)
     (Maybe AttributeGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttributeGroupResponse' {Maybe AttributeGroup
attributeGroup :: Maybe AttributeGroup
$sel:attributeGroup:CreateAttributeGroupResponse' :: CreateAttributeGroupResponse -> Maybe AttributeGroup
attributeGroup} -> Maybe AttributeGroup
attributeGroup) (\s :: CreateAttributeGroupResponse
s@CreateAttributeGroupResponse' {} Maybe AttributeGroup
a -> CreateAttributeGroupResponse
s {$sel:attributeGroup:CreateAttributeGroupResponse' :: Maybe AttributeGroup
attributeGroup = Maybe AttributeGroup
a} :: CreateAttributeGroupResponse)

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

instance Prelude.NFData CreateAttributeGroupResponse