{-# 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.CognitoIdentityProvider.CreateGroup
-- 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 group in the specified user pool.
--
-- Calling this action requires developer credentials.
module Amazonka.CognitoIdentityProvider.CreateGroup
  ( -- * Creating a Request
    CreateGroup (..),
    newCreateGroup,

    -- * Request Lenses
    createGroup_precedence,
    createGroup_description,
    createGroup_roleArn,
    createGroup_groupName,
    createGroup_userPoolId,

    -- * Destructuring the Response
    CreateGroupResponse (..),
    newCreateGroupResponse,

    -- * Response Lenses
    createGroupResponse_group,
    createGroupResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentityProvider.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:/ 'newCreateGroup' smart constructor.
data CreateGroup = CreateGroup'
  { -- | A nonnegative integer value that specifies the precedence of this group
    -- relative to the other groups that a user can belong to in the user pool.
    -- Zero is the highest precedence value. Groups with lower @Precedence@
    -- values take precedence over groups with higher or null @Precedence@
    -- values. If a user belongs to two or more groups, it is the group with
    -- the lowest precedence value whose role ARN will be used in the
    -- @cognito:roles@ and @cognito:preferred_role@ claims in the user\'s
    -- tokens.
    --
    -- Two groups can have the same @Precedence@ value. If this happens,
    -- neither group takes precedence over the other. If two groups with the
    -- same @Precedence@ have the same role ARN, that role is used in the
    -- @cognito:preferred_role@ claim in tokens for users in each group. If the
    -- two groups have different role ARNs, the @cognito:preferred_role@ claim
    -- is not set in users\' tokens.
    --
    -- The default @Precedence@ value is null.
    CreateGroup -> Maybe Natural
precedence :: Prelude.Maybe Prelude.Natural,
    -- | A string containing the description of the group.
    CreateGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The role ARN for the group.
    CreateGroup -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the group. Must be unique.
    CreateGroup -> Text
groupName :: Prelude.Text,
    -- | The user pool ID for the user pool.
    CreateGroup -> Text
userPoolId :: Prelude.Text
  }
  deriving (CreateGroup -> CreateGroup -> Bool
(CreateGroup -> CreateGroup -> Bool)
-> (CreateGroup -> CreateGroup -> Bool) -> Eq CreateGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGroup -> CreateGroup -> Bool
$c/= :: CreateGroup -> CreateGroup -> Bool
== :: CreateGroup -> CreateGroup -> Bool
$c== :: CreateGroup -> CreateGroup -> Bool
Prelude.Eq, ReadPrec [CreateGroup]
ReadPrec CreateGroup
Int -> ReadS CreateGroup
ReadS [CreateGroup]
(Int -> ReadS CreateGroup)
-> ReadS [CreateGroup]
-> ReadPrec CreateGroup
-> ReadPrec [CreateGroup]
-> Read CreateGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGroup]
$creadListPrec :: ReadPrec [CreateGroup]
readPrec :: ReadPrec CreateGroup
$creadPrec :: ReadPrec CreateGroup
readList :: ReadS [CreateGroup]
$creadList :: ReadS [CreateGroup]
readsPrec :: Int -> ReadS CreateGroup
$creadsPrec :: Int -> ReadS CreateGroup
Prelude.Read, Int -> CreateGroup -> ShowS
[CreateGroup] -> ShowS
CreateGroup -> String
(Int -> CreateGroup -> ShowS)
-> (CreateGroup -> String)
-> ([CreateGroup] -> ShowS)
-> Show CreateGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGroup] -> ShowS
$cshowList :: [CreateGroup] -> ShowS
show :: CreateGroup -> String
$cshow :: CreateGroup -> String
showsPrec :: Int -> CreateGroup -> ShowS
$cshowsPrec :: Int -> CreateGroup -> ShowS
Prelude.Show, (forall x. CreateGroup -> Rep CreateGroup x)
-> (forall x. Rep CreateGroup x -> CreateGroup)
-> Generic CreateGroup
forall x. Rep CreateGroup x -> CreateGroup
forall x. CreateGroup -> Rep CreateGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateGroup x -> CreateGroup
$cfrom :: forall x. CreateGroup -> Rep CreateGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateGroup' 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:
--
-- 'precedence', 'createGroup_precedence' - A nonnegative integer value that specifies the precedence of this group
-- relative to the other groups that a user can belong to in the user pool.
-- Zero is the highest precedence value. Groups with lower @Precedence@
-- values take precedence over groups with higher or null @Precedence@
-- values. If a user belongs to two or more groups, it is the group with
-- the lowest precedence value whose role ARN will be used in the
-- @cognito:roles@ and @cognito:preferred_role@ claims in the user\'s
-- tokens.
--
-- Two groups can have the same @Precedence@ value. If this happens,
-- neither group takes precedence over the other. If two groups with the
-- same @Precedence@ have the same role ARN, that role is used in the
-- @cognito:preferred_role@ claim in tokens for users in each group. If the
-- two groups have different role ARNs, the @cognito:preferred_role@ claim
-- is not set in users\' tokens.
--
-- The default @Precedence@ value is null.
--
-- 'description', 'createGroup_description' - A string containing the description of the group.
--
-- 'roleArn', 'createGroup_roleArn' - The role ARN for the group.
--
-- 'groupName', 'createGroup_groupName' - The name of the group. Must be unique.
--
-- 'userPoolId', 'createGroup_userPoolId' - The user pool ID for the user pool.
newCreateGroup ::
  -- | 'groupName'
  Prelude.Text ->
  -- | 'userPoolId'
  Prelude.Text ->
  CreateGroup
newCreateGroup :: Text -> Text -> CreateGroup
newCreateGroup Text
pGroupName_ Text
pUserPoolId_ =
  CreateGroup' :: Maybe Natural
-> Maybe Text -> Maybe Text -> Text -> Text -> CreateGroup
CreateGroup'
    { $sel:precedence:CreateGroup' :: Maybe Natural
precedence = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:CreateGroup' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:CreateGroup' :: Text
groupName = Text
pGroupName_,
      $sel:userPoolId:CreateGroup' :: Text
userPoolId = Text
pUserPoolId_
    }

-- | A nonnegative integer value that specifies the precedence of this group
-- relative to the other groups that a user can belong to in the user pool.
-- Zero is the highest precedence value. Groups with lower @Precedence@
-- values take precedence over groups with higher or null @Precedence@
-- values. If a user belongs to two or more groups, it is the group with
-- the lowest precedence value whose role ARN will be used in the
-- @cognito:roles@ and @cognito:preferred_role@ claims in the user\'s
-- tokens.
--
-- Two groups can have the same @Precedence@ value. If this happens,
-- neither group takes precedence over the other. If two groups with the
-- same @Precedence@ have the same role ARN, that role is used in the
-- @cognito:preferred_role@ claim in tokens for users in each group. If the
-- two groups have different role ARNs, the @cognito:preferred_role@ claim
-- is not set in users\' tokens.
--
-- The default @Precedence@ value is null.
createGroup_precedence :: Lens.Lens' CreateGroup (Prelude.Maybe Prelude.Natural)
createGroup_precedence :: (Maybe Natural -> f (Maybe Natural))
-> CreateGroup -> f CreateGroup
createGroup_precedence = (CreateGroup -> Maybe Natural)
-> (CreateGroup -> Maybe Natural -> CreateGroup)
-> Lens CreateGroup CreateGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroup' {Maybe Natural
precedence :: Maybe Natural
$sel:precedence:CreateGroup' :: CreateGroup -> Maybe Natural
precedence} -> Maybe Natural
precedence) (\s :: CreateGroup
s@CreateGroup' {} Maybe Natural
a -> CreateGroup
s {$sel:precedence:CreateGroup' :: Maybe Natural
precedence = Maybe Natural
a} :: CreateGroup)

-- | A string containing the description of the group.
createGroup_description :: Lens.Lens' CreateGroup (Prelude.Maybe Prelude.Text)
createGroup_description :: (Maybe Text -> f (Maybe Text)) -> CreateGroup -> f CreateGroup
createGroup_description = (CreateGroup -> Maybe Text)
-> (CreateGroup -> Maybe Text -> CreateGroup)
-> Lens CreateGroup CreateGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroup' {Maybe Text
description :: Maybe Text
$sel:description:CreateGroup' :: CreateGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateGroup
s@CreateGroup' {} Maybe Text
a -> CreateGroup
s {$sel:description:CreateGroup' :: Maybe Text
description = Maybe Text
a} :: CreateGroup)

-- | The role ARN for the group.
createGroup_roleArn :: Lens.Lens' CreateGroup (Prelude.Maybe Prelude.Text)
createGroup_roleArn :: (Maybe Text -> f (Maybe Text)) -> CreateGroup -> f CreateGroup
createGroup_roleArn = (CreateGroup -> Maybe Text)
-> (CreateGroup -> Maybe Text -> CreateGroup)
-> Lens CreateGroup CreateGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroup' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CreateGroup' :: CreateGroup -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CreateGroup
s@CreateGroup' {} Maybe Text
a -> CreateGroup
s {$sel:roleArn:CreateGroup' :: Maybe Text
roleArn = Maybe Text
a} :: CreateGroup)

-- | The name of the group. Must be unique.
createGroup_groupName :: Lens.Lens' CreateGroup Prelude.Text
createGroup_groupName :: (Text -> f Text) -> CreateGroup -> f CreateGroup
createGroup_groupName = (CreateGroup -> Text)
-> (CreateGroup -> Text -> CreateGroup)
-> Lens CreateGroup CreateGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroup' {Text
groupName :: Text
$sel:groupName:CreateGroup' :: CreateGroup -> Text
groupName} -> Text
groupName) (\s :: CreateGroup
s@CreateGroup' {} Text
a -> CreateGroup
s {$sel:groupName:CreateGroup' :: Text
groupName = Text
a} :: CreateGroup)

-- | The user pool ID for the user pool.
createGroup_userPoolId :: Lens.Lens' CreateGroup Prelude.Text
createGroup_userPoolId :: (Text -> f Text) -> CreateGroup -> f CreateGroup
createGroup_userPoolId = (CreateGroup -> Text)
-> (CreateGroup -> Text -> CreateGroup)
-> Lens CreateGroup CreateGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroup' {Text
userPoolId :: Text
$sel:userPoolId:CreateGroup' :: CreateGroup -> Text
userPoolId} -> Text
userPoolId) (\s :: CreateGroup
s@CreateGroup' {} Text
a -> CreateGroup
s {$sel:userPoolId:CreateGroup' :: Text
userPoolId = Text
a} :: CreateGroup)

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

instance Prelude.NFData CreateGroup

instance Core.ToHeaders CreateGroup where
  toHeaders :: CreateGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.CreateGroup" ::
                          Prelude.ByteString
                      ),
            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 CreateGroup where
  toJSON :: CreateGroup -> Value
toJSON CreateGroup' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
groupName :: Text
roleArn :: Maybe Text
description :: Maybe Text
precedence :: Maybe Natural
$sel:userPoolId:CreateGroup' :: CreateGroup -> Text
$sel:groupName:CreateGroup' :: CreateGroup -> Text
$sel:roleArn:CreateGroup' :: CreateGroup -> Maybe Text
$sel:description:CreateGroup' :: CreateGroup -> Maybe Text
$sel:precedence:CreateGroup' :: CreateGroup -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Precedence" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
precedence,
            (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
"RoleArn" 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
roleArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
groupName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateGroupResponse' 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:
--
-- 'group'', 'createGroupResponse_group' - The group object for the group.
--
-- 'httpStatus', 'createGroupResponse_httpStatus' - The response's http status code.
newCreateGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateGroupResponse
newCreateGroupResponse :: Int -> CreateGroupResponse
newCreateGroupResponse Int
pHttpStatus_ =
  CreateGroupResponse' :: Maybe GroupType -> Int -> CreateGroupResponse
CreateGroupResponse'
    { $sel:group':CreateGroupResponse' :: Maybe GroupType
group' = Maybe GroupType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The group object for the group.
createGroupResponse_group :: Lens.Lens' CreateGroupResponse (Prelude.Maybe GroupType)
createGroupResponse_group :: (Maybe GroupType -> f (Maybe GroupType))
-> CreateGroupResponse -> f CreateGroupResponse
createGroupResponse_group = (CreateGroupResponse -> Maybe GroupType)
-> (CreateGroupResponse -> Maybe GroupType -> CreateGroupResponse)
-> Lens
     CreateGroupResponse
     CreateGroupResponse
     (Maybe GroupType)
     (Maybe GroupType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGroupResponse' {Maybe GroupType
group' :: Maybe GroupType
$sel:group':CreateGroupResponse' :: CreateGroupResponse -> Maybe GroupType
group'} -> Maybe GroupType
group') (\s :: CreateGroupResponse
s@CreateGroupResponse' {} Maybe GroupType
a -> CreateGroupResponse
s {$sel:group':CreateGroupResponse' :: Maybe GroupType
group' = Maybe GroupType
a} :: CreateGroupResponse)

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

instance Prelude.NFData CreateGroupResponse