{-# 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.WorkSpaces.CreateIpGroup
-- 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 an IP access control group.
--
-- An IP access control group provides you with the ability to control the
-- IP addresses from which users are allowed to access their WorkSpaces. To
-- specify the CIDR address ranges, add rules to your IP access control
-- group and then associate the group with your directory. You can add
-- rules when you create the group or at any time using AuthorizeIpRules.
--
-- There is a default IP access control group associated with your
-- directory. If you don\'t associate an IP access control group with your
-- directory, the default group is used. The default group includes a
-- default rule that allows users to access their WorkSpaces from anywhere.
-- You cannot modify the default IP access control group for your
-- directory.
module Amazonka.WorkSpaces.CreateIpGroup
  ( -- * Creating a Request
    CreateIpGroup (..),
    newCreateIpGroup,

    -- * Request Lenses
    createIpGroup_groupDesc,
    createIpGroup_userRules,
    createIpGroup_tags,
    createIpGroup_groupName,

    -- * Destructuring the Response
    CreateIpGroupResponse (..),
    newCreateIpGroupResponse,

    -- * Response Lenses
    createIpGroupResponse_groupId,
    createIpGroupResponse_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.WorkSpaces.Types

-- | /See:/ 'newCreateIpGroup' smart constructor.
data CreateIpGroup = CreateIpGroup'
  { -- | The description of the group.
    CreateIpGroup -> Maybe Text
groupDesc :: Prelude.Maybe Prelude.Text,
    -- | The rules to add to the group.
    CreateIpGroup -> Maybe [IpRuleItem]
userRules :: Prelude.Maybe [IpRuleItem],
    -- | The tags. Each WorkSpaces resource can have a maximum of 50 tags.
    CreateIpGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the group.
    CreateIpGroup -> Text
groupName :: Prelude.Text
  }
  deriving (CreateIpGroup -> CreateIpGroup -> Bool
(CreateIpGroup -> CreateIpGroup -> Bool)
-> (CreateIpGroup -> CreateIpGroup -> Bool) -> Eq CreateIpGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIpGroup -> CreateIpGroup -> Bool
$c/= :: CreateIpGroup -> CreateIpGroup -> Bool
== :: CreateIpGroup -> CreateIpGroup -> Bool
$c== :: CreateIpGroup -> CreateIpGroup -> Bool
Prelude.Eq, ReadPrec [CreateIpGroup]
ReadPrec CreateIpGroup
Int -> ReadS CreateIpGroup
ReadS [CreateIpGroup]
(Int -> ReadS CreateIpGroup)
-> ReadS [CreateIpGroup]
-> ReadPrec CreateIpGroup
-> ReadPrec [CreateIpGroup]
-> Read CreateIpGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIpGroup]
$creadListPrec :: ReadPrec [CreateIpGroup]
readPrec :: ReadPrec CreateIpGroup
$creadPrec :: ReadPrec CreateIpGroup
readList :: ReadS [CreateIpGroup]
$creadList :: ReadS [CreateIpGroup]
readsPrec :: Int -> ReadS CreateIpGroup
$creadsPrec :: Int -> ReadS CreateIpGroup
Prelude.Read, Int -> CreateIpGroup -> ShowS
[CreateIpGroup] -> ShowS
CreateIpGroup -> String
(Int -> CreateIpGroup -> ShowS)
-> (CreateIpGroup -> String)
-> ([CreateIpGroup] -> ShowS)
-> Show CreateIpGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIpGroup] -> ShowS
$cshowList :: [CreateIpGroup] -> ShowS
show :: CreateIpGroup -> String
$cshow :: CreateIpGroup -> String
showsPrec :: Int -> CreateIpGroup -> ShowS
$cshowsPrec :: Int -> CreateIpGroup -> ShowS
Prelude.Show, (forall x. CreateIpGroup -> Rep CreateIpGroup x)
-> (forall x. Rep CreateIpGroup x -> CreateIpGroup)
-> Generic CreateIpGroup
forall x. Rep CreateIpGroup x -> CreateIpGroup
forall x. CreateIpGroup -> Rep CreateIpGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateIpGroup x -> CreateIpGroup
$cfrom :: forall x. CreateIpGroup -> Rep CreateIpGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateIpGroup' 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:
--
-- 'groupDesc', 'createIpGroup_groupDesc' - The description of the group.
--
-- 'userRules', 'createIpGroup_userRules' - The rules to add to the group.
--
-- 'tags', 'createIpGroup_tags' - The tags. Each WorkSpaces resource can have a maximum of 50 tags.
--
-- 'groupName', 'createIpGroup_groupName' - The name of the group.
newCreateIpGroup ::
  -- | 'groupName'
  Prelude.Text ->
  CreateIpGroup
newCreateIpGroup :: Text -> CreateIpGroup
newCreateIpGroup Text
pGroupName_ =
  CreateIpGroup' :: Maybe Text
-> Maybe [IpRuleItem] -> Maybe [Tag] -> Text -> CreateIpGroup
CreateIpGroup'
    { $sel:groupDesc:CreateIpGroup' :: Maybe Text
groupDesc = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userRules:CreateIpGroup' :: Maybe [IpRuleItem]
userRules = Maybe [IpRuleItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateIpGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:CreateIpGroup' :: Text
groupName = Text
pGroupName_
    }

-- | The description of the group.
createIpGroup_groupDesc :: Lens.Lens' CreateIpGroup (Prelude.Maybe Prelude.Text)
createIpGroup_groupDesc :: (Maybe Text -> f (Maybe Text)) -> CreateIpGroup -> f CreateIpGroup
createIpGroup_groupDesc = (CreateIpGroup -> Maybe Text)
-> (CreateIpGroup -> Maybe Text -> CreateIpGroup)
-> Lens CreateIpGroup CreateIpGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpGroup' {Maybe Text
groupDesc :: Maybe Text
$sel:groupDesc:CreateIpGroup' :: CreateIpGroup -> Maybe Text
groupDesc} -> Maybe Text
groupDesc) (\s :: CreateIpGroup
s@CreateIpGroup' {} Maybe Text
a -> CreateIpGroup
s {$sel:groupDesc:CreateIpGroup' :: Maybe Text
groupDesc = Maybe Text
a} :: CreateIpGroup)

-- | The rules to add to the group.
createIpGroup_userRules :: Lens.Lens' CreateIpGroup (Prelude.Maybe [IpRuleItem])
createIpGroup_userRules :: (Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> CreateIpGroup -> f CreateIpGroup
createIpGroup_userRules = (CreateIpGroup -> Maybe [IpRuleItem])
-> (CreateIpGroup -> Maybe [IpRuleItem] -> CreateIpGroup)
-> Lens
     CreateIpGroup
     CreateIpGroup
     (Maybe [IpRuleItem])
     (Maybe [IpRuleItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpGroup' {Maybe [IpRuleItem]
userRules :: Maybe [IpRuleItem]
$sel:userRules:CreateIpGroup' :: CreateIpGroup -> Maybe [IpRuleItem]
userRules} -> Maybe [IpRuleItem]
userRules) (\s :: CreateIpGroup
s@CreateIpGroup' {} Maybe [IpRuleItem]
a -> CreateIpGroup
s {$sel:userRules:CreateIpGroup' :: Maybe [IpRuleItem]
userRules = Maybe [IpRuleItem]
a} :: CreateIpGroup) ((Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
 -> CreateIpGroup -> f CreateIpGroup)
-> ((Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
    -> Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> (Maybe [IpRuleItem] -> f (Maybe [IpRuleItem]))
-> CreateIpGroup
-> f CreateIpGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IpRuleItem] [IpRuleItem] [IpRuleItem] [IpRuleItem]
-> Iso
     (Maybe [IpRuleItem])
     (Maybe [IpRuleItem])
     (Maybe [IpRuleItem])
     (Maybe [IpRuleItem])
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 [IpRuleItem] [IpRuleItem] [IpRuleItem] [IpRuleItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags. Each WorkSpaces resource can have a maximum of 50 tags.
createIpGroup_tags :: Lens.Lens' CreateIpGroup (Prelude.Maybe [Tag])
createIpGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateIpGroup -> f CreateIpGroup
createIpGroup_tags = (CreateIpGroup -> Maybe [Tag])
-> (CreateIpGroup -> Maybe [Tag] -> CreateIpGroup)
-> Lens CreateIpGroup CreateIpGroup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateIpGroup' :: CreateIpGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateIpGroup
s@CreateIpGroup' {} Maybe [Tag]
a -> CreateIpGroup
s {$sel:tags:CreateIpGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateIpGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateIpGroup -> f CreateIpGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateIpGroup
-> f CreateIpGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData CreateIpGroup

instance Core.ToHeaders CreateIpGroup where
  toHeaders :: CreateIpGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateIpGroup -> 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
"WorkspacesService.CreateIpGroup" ::
                          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 CreateIpGroup where
  toJSON :: CreateIpGroup -> Value
toJSON CreateIpGroup' {Maybe [IpRuleItem]
Maybe [Tag]
Maybe Text
Text
groupName :: Text
tags :: Maybe [Tag]
userRules :: Maybe [IpRuleItem]
groupDesc :: Maybe Text
$sel:groupName:CreateIpGroup' :: CreateIpGroup -> Text
$sel:tags:CreateIpGroup' :: CreateIpGroup -> Maybe [Tag]
$sel:userRules:CreateIpGroup' :: CreateIpGroup -> Maybe [IpRuleItem]
$sel:groupDesc:CreateIpGroup' :: CreateIpGroup -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"GroupDesc" 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
groupDesc,
            (Text
"UserRules" Text -> [IpRuleItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([IpRuleItem] -> Pair) -> Maybe [IpRuleItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IpRuleItem]
userRules,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            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)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateIpGroupResponse' 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:
--
-- 'groupId', 'createIpGroupResponse_groupId' - The identifier of the group.
--
-- 'httpStatus', 'createIpGroupResponse_httpStatus' - The response's http status code.
newCreateIpGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateIpGroupResponse
newCreateIpGroupResponse :: Int -> CreateIpGroupResponse
newCreateIpGroupResponse Int
pHttpStatus_ =
  CreateIpGroupResponse' :: Maybe Text -> Int -> CreateIpGroupResponse
CreateIpGroupResponse'
    { $sel:groupId:CreateIpGroupResponse' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateIpGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of the group.
createIpGroupResponse_groupId :: Lens.Lens' CreateIpGroupResponse (Prelude.Maybe Prelude.Text)
createIpGroupResponse_groupId :: (Maybe Text -> f (Maybe Text))
-> CreateIpGroupResponse -> f CreateIpGroupResponse
createIpGroupResponse_groupId = (CreateIpGroupResponse -> Maybe Text)
-> (CreateIpGroupResponse -> Maybe Text -> CreateIpGroupResponse)
-> Lens
     CreateIpGroupResponse
     CreateIpGroupResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpGroupResponse' {Maybe Text
groupId :: Maybe Text
$sel:groupId:CreateIpGroupResponse' :: CreateIpGroupResponse -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: CreateIpGroupResponse
s@CreateIpGroupResponse' {} Maybe Text
a -> CreateIpGroupResponse
s {$sel:groupId:CreateIpGroupResponse' :: Maybe Text
groupId = Maybe Text
a} :: CreateIpGroupResponse)

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

instance Prelude.NFData CreateIpGroupResponse