{-# 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.MediaConnect.GrantFlowEntitlements
-- 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)
--
-- Grants entitlements to an existing flow.
module Amazonka.MediaConnect.GrantFlowEntitlements
  ( -- * Creating a Request
    GrantFlowEntitlements (..),
    newGrantFlowEntitlements,

    -- * Request Lenses
    grantFlowEntitlements_flowArn,
    grantFlowEntitlements_entitlements,

    -- * Destructuring the Response
    GrantFlowEntitlementsResponse (..),
    newGrantFlowEntitlementsResponse,

    -- * Response Lenses
    grantFlowEntitlementsResponse_flowArn,
    grantFlowEntitlementsResponse_entitlements,
    grantFlowEntitlementsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | A request to grant entitlements on a flow.
--
-- /See:/ 'newGrantFlowEntitlements' smart constructor.
data GrantFlowEntitlements = GrantFlowEntitlements'
  { -- | The flow that you want to grant entitlements on.
    GrantFlowEntitlements -> Text
flowArn :: Prelude.Text,
    -- | The list of entitlements that you want to grant.
    GrantFlowEntitlements -> [GrantEntitlementRequest]
entitlements :: [GrantEntitlementRequest]
  }
  deriving (GrantFlowEntitlements -> GrantFlowEntitlements -> Bool
(GrantFlowEntitlements -> GrantFlowEntitlements -> Bool)
-> (GrantFlowEntitlements -> GrantFlowEntitlements -> Bool)
-> Eq GrantFlowEntitlements
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GrantFlowEntitlements -> GrantFlowEntitlements -> Bool
$c/= :: GrantFlowEntitlements -> GrantFlowEntitlements -> Bool
== :: GrantFlowEntitlements -> GrantFlowEntitlements -> Bool
$c== :: GrantFlowEntitlements -> GrantFlowEntitlements -> Bool
Prelude.Eq, ReadPrec [GrantFlowEntitlements]
ReadPrec GrantFlowEntitlements
Int -> ReadS GrantFlowEntitlements
ReadS [GrantFlowEntitlements]
(Int -> ReadS GrantFlowEntitlements)
-> ReadS [GrantFlowEntitlements]
-> ReadPrec GrantFlowEntitlements
-> ReadPrec [GrantFlowEntitlements]
-> Read GrantFlowEntitlements
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GrantFlowEntitlements]
$creadListPrec :: ReadPrec [GrantFlowEntitlements]
readPrec :: ReadPrec GrantFlowEntitlements
$creadPrec :: ReadPrec GrantFlowEntitlements
readList :: ReadS [GrantFlowEntitlements]
$creadList :: ReadS [GrantFlowEntitlements]
readsPrec :: Int -> ReadS GrantFlowEntitlements
$creadsPrec :: Int -> ReadS GrantFlowEntitlements
Prelude.Read, Int -> GrantFlowEntitlements -> ShowS
[GrantFlowEntitlements] -> ShowS
GrantFlowEntitlements -> String
(Int -> GrantFlowEntitlements -> ShowS)
-> (GrantFlowEntitlements -> String)
-> ([GrantFlowEntitlements] -> ShowS)
-> Show GrantFlowEntitlements
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GrantFlowEntitlements] -> ShowS
$cshowList :: [GrantFlowEntitlements] -> ShowS
show :: GrantFlowEntitlements -> String
$cshow :: GrantFlowEntitlements -> String
showsPrec :: Int -> GrantFlowEntitlements -> ShowS
$cshowsPrec :: Int -> GrantFlowEntitlements -> ShowS
Prelude.Show, (forall x. GrantFlowEntitlements -> Rep GrantFlowEntitlements x)
-> (forall x. Rep GrantFlowEntitlements x -> GrantFlowEntitlements)
-> Generic GrantFlowEntitlements
forall x. Rep GrantFlowEntitlements x -> GrantFlowEntitlements
forall x. GrantFlowEntitlements -> Rep GrantFlowEntitlements x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GrantFlowEntitlements x -> GrantFlowEntitlements
$cfrom :: forall x. GrantFlowEntitlements -> Rep GrantFlowEntitlements x
Prelude.Generic)

-- |
-- Create a value of 'GrantFlowEntitlements' 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:
--
-- 'flowArn', 'grantFlowEntitlements_flowArn' - The flow that you want to grant entitlements on.
--
-- 'entitlements', 'grantFlowEntitlements_entitlements' - The list of entitlements that you want to grant.
newGrantFlowEntitlements ::
  -- | 'flowArn'
  Prelude.Text ->
  GrantFlowEntitlements
newGrantFlowEntitlements :: Text -> GrantFlowEntitlements
newGrantFlowEntitlements Text
pFlowArn_ =
  GrantFlowEntitlements' :: Text -> [GrantEntitlementRequest] -> GrantFlowEntitlements
GrantFlowEntitlements'
    { $sel:flowArn:GrantFlowEntitlements' :: Text
flowArn = Text
pFlowArn_,
      $sel:entitlements:GrantFlowEntitlements' :: [GrantEntitlementRequest]
entitlements = [GrantEntitlementRequest]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The flow that you want to grant entitlements on.
grantFlowEntitlements_flowArn :: Lens.Lens' GrantFlowEntitlements Prelude.Text
grantFlowEntitlements_flowArn :: (Text -> f Text)
-> GrantFlowEntitlements -> f GrantFlowEntitlements
grantFlowEntitlements_flowArn = (GrantFlowEntitlements -> Text)
-> (GrantFlowEntitlements -> Text -> GrantFlowEntitlements)
-> Lens GrantFlowEntitlements GrantFlowEntitlements Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantFlowEntitlements' {Text
flowArn :: Text
$sel:flowArn:GrantFlowEntitlements' :: GrantFlowEntitlements -> Text
flowArn} -> Text
flowArn) (\s :: GrantFlowEntitlements
s@GrantFlowEntitlements' {} Text
a -> GrantFlowEntitlements
s {$sel:flowArn:GrantFlowEntitlements' :: Text
flowArn = Text
a} :: GrantFlowEntitlements)

-- | The list of entitlements that you want to grant.
grantFlowEntitlements_entitlements :: Lens.Lens' GrantFlowEntitlements [GrantEntitlementRequest]
grantFlowEntitlements_entitlements :: ([GrantEntitlementRequest] -> f [GrantEntitlementRequest])
-> GrantFlowEntitlements -> f GrantFlowEntitlements
grantFlowEntitlements_entitlements = (GrantFlowEntitlements -> [GrantEntitlementRequest])
-> (GrantFlowEntitlements
    -> [GrantEntitlementRequest] -> GrantFlowEntitlements)
-> Lens
     GrantFlowEntitlements
     GrantFlowEntitlements
     [GrantEntitlementRequest]
     [GrantEntitlementRequest]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantFlowEntitlements' {[GrantEntitlementRequest]
entitlements :: [GrantEntitlementRequest]
$sel:entitlements:GrantFlowEntitlements' :: GrantFlowEntitlements -> [GrantEntitlementRequest]
entitlements} -> [GrantEntitlementRequest]
entitlements) (\s :: GrantFlowEntitlements
s@GrantFlowEntitlements' {} [GrantEntitlementRequest]
a -> GrantFlowEntitlements
s {$sel:entitlements:GrantFlowEntitlements' :: [GrantEntitlementRequest]
entitlements = [GrantEntitlementRequest]
a} :: GrantFlowEntitlements) (([GrantEntitlementRequest] -> f [GrantEntitlementRequest])
 -> GrantFlowEntitlements -> f GrantFlowEntitlements)
-> (([GrantEntitlementRequest] -> f [GrantEntitlementRequest])
    -> [GrantEntitlementRequest] -> f [GrantEntitlementRequest])
-> ([GrantEntitlementRequest] -> f [GrantEntitlementRequest])
-> GrantFlowEntitlements
-> f GrantFlowEntitlements
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GrantEntitlementRequest] -> f [GrantEntitlementRequest])
-> [GrantEntitlementRequest] -> f [GrantEntitlementRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GrantFlowEntitlements

instance Core.ToHeaders GrantFlowEntitlements where
  toHeaders :: GrantFlowEntitlements -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GrantFlowEntitlements -> 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 GrantFlowEntitlements where
  toJSON :: GrantFlowEntitlements -> Value
toJSON GrantFlowEntitlements' {[GrantEntitlementRequest]
Text
entitlements :: [GrantEntitlementRequest]
flowArn :: Text
$sel:entitlements:GrantFlowEntitlements' :: GrantFlowEntitlements -> [GrantEntitlementRequest]
$sel:flowArn:GrantFlowEntitlements' :: GrantFlowEntitlements -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"entitlements" Text -> [GrantEntitlementRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [GrantEntitlementRequest]
entitlements)]
      )

instance Core.ToPath GrantFlowEntitlements where
  toPath :: GrantFlowEntitlements -> ByteString
toPath GrantFlowEntitlements' {[GrantEntitlementRequest]
Text
entitlements :: [GrantEntitlementRequest]
flowArn :: Text
$sel:entitlements:GrantFlowEntitlements' :: GrantFlowEntitlements -> [GrantEntitlementRequest]
$sel:flowArn:GrantFlowEntitlements' :: GrantFlowEntitlements -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/flows/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
flowArn, ByteString
"/entitlements"]

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

-- | /See:/ 'newGrantFlowEntitlementsResponse' smart constructor.
data GrantFlowEntitlementsResponse = GrantFlowEntitlementsResponse'
  { -- | The ARN of the flow that these entitlements were granted to.
    GrantFlowEntitlementsResponse -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
    -- | The entitlements that were just granted.
    GrantFlowEntitlementsResponse -> Maybe [Entitlement]
entitlements :: Prelude.Maybe [Entitlement],
    -- | The response's http status code.
    GrantFlowEntitlementsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GrantFlowEntitlementsResponse
-> GrantFlowEntitlementsResponse -> Bool
(GrantFlowEntitlementsResponse
 -> GrantFlowEntitlementsResponse -> Bool)
-> (GrantFlowEntitlementsResponse
    -> GrantFlowEntitlementsResponse -> Bool)
-> Eq GrantFlowEntitlementsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GrantFlowEntitlementsResponse
-> GrantFlowEntitlementsResponse -> Bool
$c/= :: GrantFlowEntitlementsResponse
-> GrantFlowEntitlementsResponse -> Bool
== :: GrantFlowEntitlementsResponse
-> GrantFlowEntitlementsResponse -> Bool
$c== :: GrantFlowEntitlementsResponse
-> GrantFlowEntitlementsResponse -> Bool
Prelude.Eq, ReadPrec [GrantFlowEntitlementsResponse]
ReadPrec GrantFlowEntitlementsResponse
Int -> ReadS GrantFlowEntitlementsResponse
ReadS [GrantFlowEntitlementsResponse]
(Int -> ReadS GrantFlowEntitlementsResponse)
-> ReadS [GrantFlowEntitlementsResponse]
-> ReadPrec GrantFlowEntitlementsResponse
-> ReadPrec [GrantFlowEntitlementsResponse]
-> Read GrantFlowEntitlementsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GrantFlowEntitlementsResponse]
$creadListPrec :: ReadPrec [GrantFlowEntitlementsResponse]
readPrec :: ReadPrec GrantFlowEntitlementsResponse
$creadPrec :: ReadPrec GrantFlowEntitlementsResponse
readList :: ReadS [GrantFlowEntitlementsResponse]
$creadList :: ReadS [GrantFlowEntitlementsResponse]
readsPrec :: Int -> ReadS GrantFlowEntitlementsResponse
$creadsPrec :: Int -> ReadS GrantFlowEntitlementsResponse
Prelude.Read, Int -> GrantFlowEntitlementsResponse -> ShowS
[GrantFlowEntitlementsResponse] -> ShowS
GrantFlowEntitlementsResponse -> String
(Int -> GrantFlowEntitlementsResponse -> ShowS)
-> (GrantFlowEntitlementsResponse -> String)
-> ([GrantFlowEntitlementsResponse] -> ShowS)
-> Show GrantFlowEntitlementsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GrantFlowEntitlementsResponse] -> ShowS
$cshowList :: [GrantFlowEntitlementsResponse] -> ShowS
show :: GrantFlowEntitlementsResponse -> String
$cshow :: GrantFlowEntitlementsResponse -> String
showsPrec :: Int -> GrantFlowEntitlementsResponse -> ShowS
$cshowsPrec :: Int -> GrantFlowEntitlementsResponse -> ShowS
Prelude.Show, (forall x.
 GrantFlowEntitlementsResponse
 -> Rep GrantFlowEntitlementsResponse x)
-> (forall x.
    Rep GrantFlowEntitlementsResponse x
    -> GrantFlowEntitlementsResponse)
-> Generic GrantFlowEntitlementsResponse
forall x.
Rep GrantFlowEntitlementsResponse x
-> GrantFlowEntitlementsResponse
forall x.
GrantFlowEntitlementsResponse
-> Rep GrantFlowEntitlementsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GrantFlowEntitlementsResponse x
-> GrantFlowEntitlementsResponse
$cfrom :: forall x.
GrantFlowEntitlementsResponse
-> Rep GrantFlowEntitlementsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GrantFlowEntitlementsResponse' 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:
--
-- 'flowArn', 'grantFlowEntitlementsResponse_flowArn' - The ARN of the flow that these entitlements were granted to.
--
-- 'entitlements', 'grantFlowEntitlementsResponse_entitlements' - The entitlements that were just granted.
--
-- 'httpStatus', 'grantFlowEntitlementsResponse_httpStatus' - The response's http status code.
newGrantFlowEntitlementsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GrantFlowEntitlementsResponse
newGrantFlowEntitlementsResponse :: Int -> GrantFlowEntitlementsResponse
newGrantFlowEntitlementsResponse Int
pHttpStatus_ =
  GrantFlowEntitlementsResponse' :: Maybe Text
-> Maybe [Entitlement] -> Int -> GrantFlowEntitlementsResponse
GrantFlowEntitlementsResponse'
    { $sel:flowArn:GrantFlowEntitlementsResponse' :: Maybe Text
flowArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entitlements:GrantFlowEntitlementsResponse' :: Maybe [Entitlement]
entitlements = Maybe [Entitlement]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GrantFlowEntitlementsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the flow that these entitlements were granted to.
grantFlowEntitlementsResponse_flowArn :: Lens.Lens' GrantFlowEntitlementsResponse (Prelude.Maybe Prelude.Text)
grantFlowEntitlementsResponse_flowArn :: (Maybe Text -> f (Maybe Text))
-> GrantFlowEntitlementsResponse -> f GrantFlowEntitlementsResponse
grantFlowEntitlementsResponse_flowArn = (GrantFlowEntitlementsResponse -> Maybe Text)
-> (GrantFlowEntitlementsResponse
    -> Maybe Text -> GrantFlowEntitlementsResponse)
-> Lens
     GrantFlowEntitlementsResponse
     GrantFlowEntitlementsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantFlowEntitlementsResponse' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:GrantFlowEntitlementsResponse' :: GrantFlowEntitlementsResponse -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: GrantFlowEntitlementsResponse
s@GrantFlowEntitlementsResponse' {} Maybe Text
a -> GrantFlowEntitlementsResponse
s {$sel:flowArn:GrantFlowEntitlementsResponse' :: Maybe Text
flowArn = Maybe Text
a} :: GrantFlowEntitlementsResponse)

-- | The entitlements that were just granted.
grantFlowEntitlementsResponse_entitlements :: Lens.Lens' GrantFlowEntitlementsResponse (Prelude.Maybe [Entitlement])
grantFlowEntitlementsResponse_entitlements :: (Maybe [Entitlement] -> f (Maybe [Entitlement]))
-> GrantFlowEntitlementsResponse -> f GrantFlowEntitlementsResponse
grantFlowEntitlementsResponse_entitlements = (GrantFlowEntitlementsResponse -> Maybe [Entitlement])
-> (GrantFlowEntitlementsResponse
    -> Maybe [Entitlement] -> GrantFlowEntitlementsResponse)
-> Lens
     GrantFlowEntitlementsResponse
     GrantFlowEntitlementsResponse
     (Maybe [Entitlement])
     (Maybe [Entitlement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantFlowEntitlementsResponse' {Maybe [Entitlement]
entitlements :: Maybe [Entitlement]
$sel:entitlements:GrantFlowEntitlementsResponse' :: GrantFlowEntitlementsResponse -> Maybe [Entitlement]
entitlements} -> Maybe [Entitlement]
entitlements) (\s :: GrantFlowEntitlementsResponse
s@GrantFlowEntitlementsResponse' {} Maybe [Entitlement]
a -> GrantFlowEntitlementsResponse
s {$sel:entitlements:GrantFlowEntitlementsResponse' :: Maybe [Entitlement]
entitlements = Maybe [Entitlement]
a} :: GrantFlowEntitlementsResponse) ((Maybe [Entitlement] -> f (Maybe [Entitlement]))
 -> GrantFlowEntitlementsResponse
 -> f GrantFlowEntitlementsResponse)
-> ((Maybe [Entitlement] -> f (Maybe [Entitlement]))
    -> Maybe [Entitlement] -> f (Maybe [Entitlement]))
-> (Maybe [Entitlement] -> f (Maybe [Entitlement]))
-> GrantFlowEntitlementsResponse
-> f GrantFlowEntitlementsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Entitlement] [Entitlement] [Entitlement] [Entitlement]
-> Iso
     (Maybe [Entitlement])
     (Maybe [Entitlement])
     (Maybe [Entitlement])
     (Maybe [Entitlement])
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 [Entitlement] [Entitlement] [Entitlement] [Entitlement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GrantFlowEntitlementsResponse