{-# 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.EC2.ModifyVpcEndpointServicePermissions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the permissions for your VPC endpoint service. You can add or
-- remove permissions for service consumers (IAM users, IAM roles, and
-- Amazon Web Services accounts) to connect to your endpoint service.
--
-- If you grant permissions to all principals, the service is public. Any
-- users who know the name of a public service can send a request to attach
-- an endpoint. If the service does not require manual approval,
-- attachments are automatically approved.
module Amazonka.EC2.ModifyVpcEndpointServicePermissions
  ( -- * Creating a Request
    ModifyVpcEndpointServicePermissions (..),
    newModifyVpcEndpointServicePermissions,

    -- * Request Lenses
    modifyVpcEndpointServicePermissions_addAllowedPrincipals,
    modifyVpcEndpointServicePermissions_dryRun,
    modifyVpcEndpointServicePermissions_removeAllowedPrincipals,
    modifyVpcEndpointServicePermissions_serviceId,

    -- * Destructuring the Response
    ModifyVpcEndpointServicePermissionsResponse (..),
    newModifyVpcEndpointServicePermissionsResponse,

    -- * Response Lenses
    modifyVpcEndpointServicePermissionsResponse_addedPrincipals,
    modifyVpcEndpointServicePermissionsResponse_returnValue,
    modifyVpcEndpointServicePermissionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newModifyVpcEndpointServicePermissions' smart constructor.
data ModifyVpcEndpointServicePermissions = ModifyVpcEndpointServicePermissions'
  { -- | The Amazon Resource Names (ARN) of one or more principals. Permissions
    -- are granted to the principals in this list. To grant permissions to all
    -- principals, specify an asterisk (*).
    ModifyVpcEndpointServicePermissions -> Maybe [Text]
addAllowedPrincipals :: Prelude.Maybe [Prelude.Text],
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    ModifyVpcEndpointServicePermissions -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Names (ARN) of one or more principals. Permissions
    -- are revoked for principals in this list.
    ModifyVpcEndpointServicePermissions -> Maybe [Text]
removeAllowedPrincipals :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the service.
    ModifyVpcEndpointServicePermissions -> Text
serviceId :: Prelude.Text
  }
  deriving (ModifyVpcEndpointServicePermissions
-> ModifyVpcEndpointServicePermissions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyVpcEndpointServicePermissions
-> ModifyVpcEndpointServicePermissions -> Bool
$c/= :: ModifyVpcEndpointServicePermissions
-> ModifyVpcEndpointServicePermissions -> Bool
== :: ModifyVpcEndpointServicePermissions
-> ModifyVpcEndpointServicePermissions -> Bool
$c== :: ModifyVpcEndpointServicePermissions
-> ModifyVpcEndpointServicePermissions -> Bool
Prelude.Eq, ReadPrec [ModifyVpcEndpointServicePermissions]
ReadPrec ModifyVpcEndpointServicePermissions
Int -> ReadS ModifyVpcEndpointServicePermissions
ReadS [ModifyVpcEndpointServicePermissions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyVpcEndpointServicePermissions]
$creadListPrec :: ReadPrec [ModifyVpcEndpointServicePermissions]
readPrec :: ReadPrec ModifyVpcEndpointServicePermissions
$creadPrec :: ReadPrec ModifyVpcEndpointServicePermissions
readList :: ReadS [ModifyVpcEndpointServicePermissions]
$creadList :: ReadS [ModifyVpcEndpointServicePermissions]
readsPrec :: Int -> ReadS ModifyVpcEndpointServicePermissions
$creadsPrec :: Int -> ReadS ModifyVpcEndpointServicePermissions
Prelude.Read, Int -> ModifyVpcEndpointServicePermissions -> ShowS
[ModifyVpcEndpointServicePermissions] -> ShowS
ModifyVpcEndpointServicePermissions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyVpcEndpointServicePermissions] -> ShowS
$cshowList :: [ModifyVpcEndpointServicePermissions] -> ShowS
show :: ModifyVpcEndpointServicePermissions -> String
$cshow :: ModifyVpcEndpointServicePermissions -> String
showsPrec :: Int -> ModifyVpcEndpointServicePermissions -> ShowS
$cshowsPrec :: Int -> ModifyVpcEndpointServicePermissions -> ShowS
Prelude.Show, forall x.
Rep ModifyVpcEndpointServicePermissions x
-> ModifyVpcEndpointServicePermissions
forall x.
ModifyVpcEndpointServicePermissions
-> Rep ModifyVpcEndpointServicePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyVpcEndpointServicePermissions x
-> ModifyVpcEndpointServicePermissions
$cfrom :: forall x.
ModifyVpcEndpointServicePermissions
-> Rep ModifyVpcEndpointServicePermissions x
Prelude.Generic)

-- |
-- Create a value of 'ModifyVpcEndpointServicePermissions' 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:
--
-- 'addAllowedPrincipals', 'modifyVpcEndpointServicePermissions_addAllowedPrincipals' - The Amazon Resource Names (ARN) of one or more principals. Permissions
-- are granted to the principals in this list. To grant permissions to all
-- principals, specify an asterisk (*).
--
-- 'dryRun', 'modifyVpcEndpointServicePermissions_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'removeAllowedPrincipals', 'modifyVpcEndpointServicePermissions_removeAllowedPrincipals' - The Amazon Resource Names (ARN) of one or more principals. Permissions
-- are revoked for principals in this list.
--
-- 'serviceId', 'modifyVpcEndpointServicePermissions_serviceId' - The ID of the service.
newModifyVpcEndpointServicePermissions ::
  -- | 'serviceId'
  Prelude.Text ->
  ModifyVpcEndpointServicePermissions
newModifyVpcEndpointServicePermissions :: Text -> ModifyVpcEndpointServicePermissions
newModifyVpcEndpointServicePermissions Text
pServiceId_ =
  ModifyVpcEndpointServicePermissions'
    { $sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: Maybe [Text]
addAllowedPrincipals =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:ModifyVpcEndpointServicePermissions' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: Maybe [Text]
removeAllowedPrincipals =
        forall a. Maybe a
Prelude.Nothing,
      $sel:serviceId:ModifyVpcEndpointServicePermissions' :: Text
serviceId = Text
pServiceId_
    }

-- | The Amazon Resource Names (ARN) of one or more principals. Permissions
-- are granted to the principals in this list. To grant permissions to all
-- principals, specify an asterisk (*).
modifyVpcEndpointServicePermissions_addAllowedPrincipals :: Lens.Lens' ModifyVpcEndpointServicePermissions (Prelude.Maybe [Prelude.Text])
modifyVpcEndpointServicePermissions_addAllowedPrincipals :: Lens' ModifyVpcEndpointServicePermissions (Maybe [Text])
modifyVpcEndpointServicePermissions_addAllowedPrincipals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissions' {Maybe [Text]
addAllowedPrincipals :: Maybe [Text]
$sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
addAllowedPrincipals} -> Maybe [Text]
addAllowedPrincipals) (\s :: ModifyVpcEndpointServicePermissions
s@ModifyVpcEndpointServicePermissions' {} Maybe [Text]
a -> ModifyVpcEndpointServicePermissions
s {$sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: Maybe [Text]
addAllowedPrincipals = Maybe [Text]
a} :: ModifyVpcEndpointServicePermissions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
modifyVpcEndpointServicePermissions_dryRun :: Lens.Lens' ModifyVpcEndpointServicePermissions (Prelude.Maybe Prelude.Bool)
modifyVpcEndpointServicePermissions_dryRun :: Lens' ModifyVpcEndpointServicePermissions (Maybe Bool)
modifyVpcEndpointServicePermissions_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissions' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ModifyVpcEndpointServicePermissions
s@ModifyVpcEndpointServicePermissions' {} Maybe Bool
a -> ModifyVpcEndpointServicePermissions
s {$sel:dryRun:ModifyVpcEndpointServicePermissions' :: Maybe Bool
dryRun = Maybe Bool
a} :: ModifyVpcEndpointServicePermissions)

-- | The Amazon Resource Names (ARN) of one or more principals. Permissions
-- are revoked for principals in this list.
modifyVpcEndpointServicePermissions_removeAllowedPrincipals :: Lens.Lens' ModifyVpcEndpointServicePermissions (Prelude.Maybe [Prelude.Text])
modifyVpcEndpointServicePermissions_removeAllowedPrincipals :: Lens' ModifyVpcEndpointServicePermissions (Maybe [Text])
modifyVpcEndpointServicePermissions_removeAllowedPrincipals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissions' {Maybe [Text]
removeAllowedPrincipals :: Maybe [Text]
$sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
removeAllowedPrincipals} -> Maybe [Text]
removeAllowedPrincipals) (\s :: ModifyVpcEndpointServicePermissions
s@ModifyVpcEndpointServicePermissions' {} Maybe [Text]
a -> ModifyVpcEndpointServicePermissions
s {$sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: Maybe [Text]
removeAllowedPrincipals = Maybe [Text]
a} :: ModifyVpcEndpointServicePermissions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the service.
modifyVpcEndpointServicePermissions_serviceId :: Lens.Lens' ModifyVpcEndpointServicePermissions Prelude.Text
modifyVpcEndpointServicePermissions_serviceId :: Lens' ModifyVpcEndpointServicePermissions Text
modifyVpcEndpointServicePermissions_serviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissions' {Text
serviceId :: Text
$sel:serviceId:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Text
serviceId} -> Text
serviceId) (\s :: ModifyVpcEndpointServicePermissions
s@ModifyVpcEndpointServicePermissions' {} Text
a -> ModifyVpcEndpointServicePermissions
s {$sel:serviceId:ModifyVpcEndpointServicePermissions' :: Text
serviceId = Text
a} :: ModifyVpcEndpointServicePermissions)

instance
  Core.AWSRequest
    ModifyVpcEndpointServicePermissions
  where
  type
    AWSResponse ModifyVpcEndpointServicePermissions =
      ModifyVpcEndpointServicePermissionsResponse
  request :: (Service -> Service)
-> ModifyVpcEndpointServicePermissions
-> Request ModifyVpcEndpointServicePermissions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyVpcEndpointServicePermissions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ModifyVpcEndpointServicePermissions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [AddedPrincipal]
-> Maybe Bool -> Int -> ModifyVpcEndpointServicePermissionsResponse
ModifyVpcEndpointServicePermissionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"addedPrincipalSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"return")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ModifyVpcEndpointServicePermissions
  where
  hashWithSalt :: Int -> ModifyVpcEndpointServicePermissions -> Int
hashWithSalt
    Int
_salt
    ModifyVpcEndpointServicePermissions' {Maybe Bool
Maybe [Text]
Text
serviceId :: Text
removeAllowedPrincipals :: Maybe [Text]
dryRun :: Maybe Bool
addAllowedPrincipals :: Maybe [Text]
$sel:serviceId:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Text
$sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
$sel:dryRun:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe Bool
$sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
addAllowedPrincipals
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
removeAllowedPrincipals
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceId

instance
  Prelude.NFData
    ModifyVpcEndpointServicePermissions
  where
  rnf :: ModifyVpcEndpointServicePermissions -> ()
rnf ModifyVpcEndpointServicePermissions' {Maybe Bool
Maybe [Text]
Text
serviceId :: Text
removeAllowedPrincipals :: Maybe [Text]
dryRun :: Maybe Bool
addAllowedPrincipals :: Maybe [Text]
$sel:serviceId:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Text
$sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
$sel:dryRun:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe Bool
$sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
addAllowedPrincipals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
removeAllowedPrincipals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceId

instance
  Data.ToHeaders
    ModifyVpcEndpointServicePermissions
  where
  toHeaders :: ModifyVpcEndpointServicePermissions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance
  Data.ToQuery
    ModifyVpcEndpointServicePermissions
  where
  toQuery :: ModifyVpcEndpointServicePermissions -> QueryString
toQuery ModifyVpcEndpointServicePermissions' {Maybe Bool
Maybe [Text]
Text
serviceId :: Text
removeAllowedPrincipals :: Maybe [Text]
dryRun :: Maybe Bool
addAllowedPrincipals :: Maybe [Text]
$sel:serviceId:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Text
$sel:removeAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
$sel:dryRun:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe Bool
$sel:addAllowedPrincipals:ModifyVpcEndpointServicePermissions' :: ModifyVpcEndpointServicePermissions -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ModifyVpcEndpointServicePermissions" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AddAllowedPrincipals"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
addAllowedPrincipals
          ),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"RemoveAllowedPrincipals"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
removeAllowedPrincipals
          ),
        ByteString
"ServiceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
serviceId
      ]

-- | /See:/ 'newModifyVpcEndpointServicePermissionsResponse' smart constructor.
data ModifyVpcEndpointServicePermissionsResponse = ModifyVpcEndpointServicePermissionsResponse'
  { -- | Information about the added principals.
    ModifyVpcEndpointServicePermissionsResponse
-> Maybe [AddedPrincipal]
addedPrincipals :: Prelude.Maybe [AddedPrincipal],
    -- | Returns @true@ if the request succeeds; otherwise, it returns an error.
    ModifyVpcEndpointServicePermissionsResponse -> Maybe Bool
returnValue :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ModifyVpcEndpointServicePermissionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyVpcEndpointServicePermissionsResponse
-> ModifyVpcEndpointServicePermissionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyVpcEndpointServicePermissionsResponse
-> ModifyVpcEndpointServicePermissionsResponse -> Bool
$c/= :: ModifyVpcEndpointServicePermissionsResponse
-> ModifyVpcEndpointServicePermissionsResponse -> Bool
== :: ModifyVpcEndpointServicePermissionsResponse
-> ModifyVpcEndpointServicePermissionsResponse -> Bool
$c== :: ModifyVpcEndpointServicePermissionsResponse
-> ModifyVpcEndpointServicePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [ModifyVpcEndpointServicePermissionsResponse]
ReadPrec ModifyVpcEndpointServicePermissionsResponse
Int -> ReadS ModifyVpcEndpointServicePermissionsResponse
ReadS [ModifyVpcEndpointServicePermissionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyVpcEndpointServicePermissionsResponse]
$creadListPrec :: ReadPrec [ModifyVpcEndpointServicePermissionsResponse]
readPrec :: ReadPrec ModifyVpcEndpointServicePermissionsResponse
$creadPrec :: ReadPrec ModifyVpcEndpointServicePermissionsResponse
readList :: ReadS [ModifyVpcEndpointServicePermissionsResponse]
$creadList :: ReadS [ModifyVpcEndpointServicePermissionsResponse]
readsPrec :: Int -> ReadS ModifyVpcEndpointServicePermissionsResponse
$creadsPrec :: Int -> ReadS ModifyVpcEndpointServicePermissionsResponse
Prelude.Read, Int -> ModifyVpcEndpointServicePermissionsResponse -> ShowS
[ModifyVpcEndpointServicePermissionsResponse] -> ShowS
ModifyVpcEndpointServicePermissionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyVpcEndpointServicePermissionsResponse] -> ShowS
$cshowList :: [ModifyVpcEndpointServicePermissionsResponse] -> ShowS
show :: ModifyVpcEndpointServicePermissionsResponse -> String
$cshow :: ModifyVpcEndpointServicePermissionsResponse -> String
showsPrec :: Int -> ModifyVpcEndpointServicePermissionsResponse -> ShowS
$cshowsPrec :: Int -> ModifyVpcEndpointServicePermissionsResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyVpcEndpointServicePermissionsResponse x
-> ModifyVpcEndpointServicePermissionsResponse
forall x.
ModifyVpcEndpointServicePermissionsResponse
-> Rep ModifyVpcEndpointServicePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyVpcEndpointServicePermissionsResponse x
-> ModifyVpcEndpointServicePermissionsResponse
$cfrom :: forall x.
ModifyVpcEndpointServicePermissionsResponse
-> Rep ModifyVpcEndpointServicePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyVpcEndpointServicePermissionsResponse' 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:
--
-- 'addedPrincipals', 'modifyVpcEndpointServicePermissionsResponse_addedPrincipals' - Information about the added principals.
--
-- 'returnValue', 'modifyVpcEndpointServicePermissionsResponse_returnValue' - Returns @true@ if the request succeeds; otherwise, it returns an error.
--
-- 'httpStatus', 'modifyVpcEndpointServicePermissionsResponse_httpStatus' - The response's http status code.
newModifyVpcEndpointServicePermissionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyVpcEndpointServicePermissionsResponse
newModifyVpcEndpointServicePermissionsResponse :: Int -> ModifyVpcEndpointServicePermissionsResponse
newModifyVpcEndpointServicePermissionsResponse
  Int
pHttpStatus_ =
    ModifyVpcEndpointServicePermissionsResponse'
      { $sel:addedPrincipals:ModifyVpcEndpointServicePermissionsResponse' :: Maybe [AddedPrincipal]
addedPrincipals =
          forall a. Maybe a
Prelude.Nothing,
        $sel:returnValue:ModifyVpcEndpointServicePermissionsResponse' :: Maybe Bool
returnValue = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ModifyVpcEndpointServicePermissionsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the added principals.
modifyVpcEndpointServicePermissionsResponse_addedPrincipals :: Lens.Lens' ModifyVpcEndpointServicePermissionsResponse (Prelude.Maybe [AddedPrincipal])
modifyVpcEndpointServicePermissionsResponse_addedPrincipals :: Lens'
  ModifyVpcEndpointServicePermissionsResponse
  (Maybe [AddedPrincipal])
modifyVpcEndpointServicePermissionsResponse_addedPrincipals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissionsResponse' {Maybe [AddedPrincipal]
addedPrincipals :: Maybe [AddedPrincipal]
$sel:addedPrincipals:ModifyVpcEndpointServicePermissionsResponse' :: ModifyVpcEndpointServicePermissionsResponse
-> Maybe [AddedPrincipal]
addedPrincipals} -> Maybe [AddedPrincipal]
addedPrincipals) (\s :: ModifyVpcEndpointServicePermissionsResponse
s@ModifyVpcEndpointServicePermissionsResponse' {} Maybe [AddedPrincipal]
a -> ModifyVpcEndpointServicePermissionsResponse
s {$sel:addedPrincipals:ModifyVpcEndpointServicePermissionsResponse' :: Maybe [AddedPrincipal]
addedPrincipals = Maybe [AddedPrincipal]
a} :: ModifyVpcEndpointServicePermissionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Returns @true@ if the request succeeds; otherwise, it returns an error.
modifyVpcEndpointServicePermissionsResponse_returnValue :: Lens.Lens' ModifyVpcEndpointServicePermissionsResponse (Prelude.Maybe Prelude.Bool)
modifyVpcEndpointServicePermissionsResponse_returnValue :: Lens' ModifyVpcEndpointServicePermissionsResponse (Maybe Bool)
modifyVpcEndpointServicePermissionsResponse_returnValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpcEndpointServicePermissionsResponse' {Maybe Bool
returnValue :: Maybe Bool
$sel:returnValue:ModifyVpcEndpointServicePermissionsResponse' :: ModifyVpcEndpointServicePermissionsResponse -> Maybe Bool
returnValue} -> Maybe Bool
returnValue) (\s :: ModifyVpcEndpointServicePermissionsResponse
s@ModifyVpcEndpointServicePermissionsResponse' {} Maybe Bool
a -> ModifyVpcEndpointServicePermissionsResponse
s {$sel:returnValue:ModifyVpcEndpointServicePermissionsResponse' :: Maybe Bool
returnValue = Maybe Bool
a} :: ModifyVpcEndpointServicePermissionsResponse)

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

instance
  Prelude.NFData
    ModifyVpcEndpointServicePermissionsResponse
  where
  rnf :: ModifyVpcEndpointServicePermissionsResponse -> ()
rnf ModifyVpcEndpointServicePermissionsResponse' {Int
Maybe Bool
Maybe [AddedPrincipal]
httpStatus :: Int
returnValue :: Maybe Bool
addedPrincipals :: Maybe [AddedPrincipal]
$sel:httpStatus:ModifyVpcEndpointServicePermissionsResponse' :: ModifyVpcEndpointServicePermissionsResponse -> Int
$sel:returnValue:ModifyVpcEndpointServicePermissionsResponse' :: ModifyVpcEndpointServicePermissionsResponse -> Maybe Bool
$sel:addedPrincipals:ModifyVpcEndpointServicePermissionsResponse' :: ModifyVpcEndpointServicePermissionsResponse
-> Maybe [AddedPrincipal]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AddedPrincipal]
addedPrincipals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
returnValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus