{-# 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.AppStream.DescribeImagePermissions
-- 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)
--
-- Retrieves a list that describes the permissions for shared AWS account
-- IDs on a private image that you own.
module Amazonka.AppStream.DescribeImagePermissions
  ( -- * Creating a Request
    DescribeImagePermissions (..),
    newDescribeImagePermissions,

    -- * Request Lenses
    describeImagePermissions_nextToken,
    describeImagePermissions_sharedAwsAccountIds,
    describeImagePermissions_maxResults,
    describeImagePermissions_name,

    -- * Destructuring the Response
    DescribeImagePermissionsResponse (..),
    newDescribeImagePermissionsResponse,

    -- * Response Lenses
    describeImagePermissionsResponse_sharedImagePermissionsList,
    describeImagePermissionsResponse_nextToken,
    describeImagePermissionsResponse_name,
    describeImagePermissionsResponse_httpStatus,
  )
where

import Amazonka.AppStream.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:/ 'newDescribeImagePermissions' smart constructor.
data DescribeImagePermissions = DescribeImagePermissions'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    DescribeImagePermissions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit identifier of one or more AWS accounts with which the image
    -- is shared.
    DescribeImagePermissions -> Maybe (NonEmpty Text)
sharedAwsAccountIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The maximum size of each page of results.
    DescribeImagePermissions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the private image for which to describe permissions. The
    -- image must be one that you own.
    DescribeImagePermissions -> Text
name :: Prelude.Text
  }
  deriving (DescribeImagePermissions -> DescribeImagePermissions -> Bool
(DescribeImagePermissions -> DescribeImagePermissions -> Bool)
-> (DescribeImagePermissions -> DescribeImagePermissions -> Bool)
-> Eq DescribeImagePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImagePermissions -> DescribeImagePermissions -> Bool
$c/= :: DescribeImagePermissions -> DescribeImagePermissions -> Bool
== :: DescribeImagePermissions -> DescribeImagePermissions -> Bool
$c== :: DescribeImagePermissions -> DescribeImagePermissions -> Bool
Prelude.Eq, ReadPrec [DescribeImagePermissions]
ReadPrec DescribeImagePermissions
Int -> ReadS DescribeImagePermissions
ReadS [DescribeImagePermissions]
(Int -> ReadS DescribeImagePermissions)
-> ReadS [DescribeImagePermissions]
-> ReadPrec DescribeImagePermissions
-> ReadPrec [DescribeImagePermissions]
-> Read DescribeImagePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImagePermissions]
$creadListPrec :: ReadPrec [DescribeImagePermissions]
readPrec :: ReadPrec DescribeImagePermissions
$creadPrec :: ReadPrec DescribeImagePermissions
readList :: ReadS [DescribeImagePermissions]
$creadList :: ReadS [DescribeImagePermissions]
readsPrec :: Int -> ReadS DescribeImagePermissions
$creadsPrec :: Int -> ReadS DescribeImagePermissions
Prelude.Read, Int -> DescribeImagePermissions -> ShowS
[DescribeImagePermissions] -> ShowS
DescribeImagePermissions -> String
(Int -> DescribeImagePermissions -> ShowS)
-> (DescribeImagePermissions -> String)
-> ([DescribeImagePermissions] -> ShowS)
-> Show DescribeImagePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImagePermissions] -> ShowS
$cshowList :: [DescribeImagePermissions] -> ShowS
show :: DescribeImagePermissions -> String
$cshow :: DescribeImagePermissions -> String
showsPrec :: Int -> DescribeImagePermissions -> ShowS
$cshowsPrec :: Int -> DescribeImagePermissions -> ShowS
Prelude.Show, (forall x.
 DescribeImagePermissions -> Rep DescribeImagePermissions x)
-> (forall x.
    Rep DescribeImagePermissions x -> DescribeImagePermissions)
-> Generic DescribeImagePermissions
forall x.
Rep DescribeImagePermissions x -> DescribeImagePermissions
forall x.
DescribeImagePermissions -> Rep DescribeImagePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeImagePermissions x -> DescribeImagePermissions
$cfrom :: forall x.
DescribeImagePermissions -> Rep DescribeImagePermissions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImagePermissions' 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:
--
-- 'nextToken', 'describeImagePermissions_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'sharedAwsAccountIds', 'describeImagePermissions_sharedAwsAccountIds' - The 12-digit identifier of one or more AWS accounts with which the image
-- is shared.
--
-- 'maxResults', 'describeImagePermissions_maxResults' - The maximum size of each page of results.
--
-- 'name', 'describeImagePermissions_name' - The name of the private image for which to describe permissions. The
-- image must be one that you own.
newDescribeImagePermissions ::
  -- | 'name'
  Prelude.Text ->
  DescribeImagePermissions
newDescribeImagePermissions :: Text -> DescribeImagePermissions
newDescribeImagePermissions Text
pName_ =
  DescribeImagePermissions' :: Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> Text
-> DescribeImagePermissions
DescribeImagePermissions'
    { $sel:nextToken:DescribeImagePermissions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sharedAwsAccountIds:DescribeImagePermissions' :: Maybe (NonEmpty Text)
sharedAwsAccountIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeImagePermissions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeImagePermissions' :: Text
name = Text
pName_
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
describeImagePermissions_nextToken :: Lens.Lens' DescribeImagePermissions (Prelude.Maybe Prelude.Text)
describeImagePermissions_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImagePermissions -> f DescribeImagePermissions
describeImagePermissions_nextToken = (DescribeImagePermissions -> Maybe Text)
-> (DescribeImagePermissions
    -> Maybe Text -> DescribeImagePermissions)
-> Lens
     DescribeImagePermissions
     DescribeImagePermissions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImagePermissions
s@DescribeImagePermissions' {} Maybe Text
a -> DescribeImagePermissions
s {$sel:nextToken:DescribeImagePermissions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImagePermissions)

-- | The 12-digit identifier of one or more AWS accounts with which the image
-- is shared.
describeImagePermissions_sharedAwsAccountIds :: Lens.Lens' DescribeImagePermissions (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeImagePermissions_sharedAwsAccountIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeImagePermissions -> f DescribeImagePermissions
describeImagePermissions_sharedAwsAccountIds = (DescribeImagePermissions -> Maybe (NonEmpty Text))
-> (DescribeImagePermissions
    -> Maybe (NonEmpty Text) -> DescribeImagePermissions)
-> Lens
     DescribeImagePermissions
     DescribeImagePermissions
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissions' {Maybe (NonEmpty Text)
sharedAwsAccountIds :: Maybe (NonEmpty Text)
$sel:sharedAwsAccountIds:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe (NonEmpty Text)
sharedAwsAccountIds} -> Maybe (NonEmpty Text)
sharedAwsAccountIds) (\s :: DescribeImagePermissions
s@DescribeImagePermissions' {} Maybe (NonEmpty Text)
a -> DescribeImagePermissions
s {$sel:sharedAwsAccountIds:DescribeImagePermissions' :: Maybe (NonEmpty Text)
sharedAwsAccountIds = Maybe (NonEmpty Text)
a} :: DescribeImagePermissions) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DescribeImagePermissions -> f DescribeImagePermissions)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeImagePermissions
-> f DescribeImagePermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum size of each page of results.
describeImagePermissions_maxResults :: Lens.Lens' DescribeImagePermissions (Prelude.Maybe Prelude.Natural)
describeImagePermissions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeImagePermissions -> f DescribeImagePermissions
describeImagePermissions_maxResults = (DescribeImagePermissions -> Maybe Natural)
-> (DescribeImagePermissions
    -> Maybe Natural -> DescribeImagePermissions)
-> Lens
     DescribeImagePermissions
     DescribeImagePermissions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeImagePermissions
s@DescribeImagePermissions' {} Maybe Natural
a -> DescribeImagePermissions
s {$sel:maxResults:DescribeImagePermissions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeImagePermissions)

-- | The name of the private image for which to describe permissions. The
-- image must be one that you own.
describeImagePermissions_name :: Lens.Lens' DescribeImagePermissions Prelude.Text
describeImagePermissions_name :: (Text -> f Text)
-> DescribeImagePermissions -> f DescribeImagePermissions
describeImagePermissions_name = (DescribeImagePermissions -> Text)
-> (DescribeImagePermissions -> Text -> DescribeImagePermissions)
-> Lens DescribeImagePermissions DescribeImagePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissions' {Text
name :: Text
$sel:name:DescribeImagePermissions' :: DescribeImagePermissions -> Text
name} -> Text
name) (\s :: DescribeImagePermissions
s@DescribeImagePermissions' {} Text
a -> DescribeImagePermissions
s {$sel:name:DescribeImagePermissions' :: Text
name = Text
a} :: DescribeImagePermissions)

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

instance Prelude.NFData DescribeImagePermissions

instance Core.ToHeaders DescribeImagePermissions where
  toHeaders :: DescribeImagePermissions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeImagePermissions -> 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
"PhotonAdminProxyService.DescribeImagePermissions" ::
                          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 DescribeImagePermissions where
  toJSON :: DescribeImagePermissions -> Value
toJSON DescribeImagePermissions' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
sharedAwsAccountIds :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
$sel:name:DescribeImagePermissions' :: DescribeImagePermissions -> Text
$sel:maxResults:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe Natural
$sel:sharedAwsAccountIds:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe (NonEmpty Text)
$sel:nextToken:DescribeImagePermissions' :: DescribeImagePermissions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"SharedAwsAccountIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
sharedAwsAccountIds,
            (Text
"MaxResults" 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newDescribeImagePermissionsResponse' smart constructor.
data DescribeImagePermissionsResponse = DescribeImagePermissionsResponse'
  { -- | The permissions for a private image that you own.
    DescribeImagePermissionsResponse -> Maybe [SharedImagePermissions]
sharedImagePermissionsList :: Prelude.Maybe [SharedImagePermissions],
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    DescribeImagePermissionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the private image.
    DescribeImagePermissionsResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeImagePermissionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeImagePermissionsResponse
-> DescribeImagePermissionsResponse -> Bool
(DescribeImagePermissionsResponse
 -> DescribeImagePermissionsResponse -> Bool)
-> (DescribeImagePermissionsResponse
    -> DescribeImagePermissionsResponse -> Bool)
-> Eq DescribeImagePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImagePermissionsResponse
-> DescribeImagePermissionsResponse -> Bool
$c/= :: DescribeImagePermissionsResponse
-> DescribeImagePermissionsResponse -> Bool
== :: DescribeImagePermissionsResponse
-> DescribeImagePermissionsResponse -> Bool
$c== :: DescribeImagePermissionsResponse
-> DescribeImagePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeImagePermissionsResponse]
ReadPrec DescribeImagePermissionsResponse
Int -> ReadS DescribeImagePermissionsResponse
ReadS [DescribeImagePermissionsResponse]
(Int -> ReadS DescribeImagePermissionsResponse)
-> ReadS [DescribeImagePermissionsResponse]
-> ReadPrec DescribeImagePermissionsResponse
-> ReadPrec [DescribeImagePermissionsResponse]
-> Read DescribeImagePermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImagePermissionsResponse]
$creadListPrec :: ReadPrec [DescribeImagePermissionsResponse]
readPrec :: ReadPrec DescribeImagePermissionsResponse
$creadPrec :: ReadPrec DescribeImagePermissionsResponse
readList :: ReadS [DescribeImagePermissionsResponse]
$creadList :: ReadS [DescribeImagePermissionsResponse]
readsPrec :: Int -> ReadS DescribeImagePermissionsResponse
$creadsPrec :: Int -> ReadS DescribeImagePermissionsResponse
Prelude.Read, Int -> DescribeImagePermissionsResponse -> ShowS
[DescribeImagePermissionsResponse] -> ShowS
DescribeImagePermissionsResponse -> String
(Int -> DescribeImagePermissionsResponse -> ShowS)
-> (DescribeImagePermissionsResponse -> String)
-> ([DescribeImagePermissionsResponse] -> ShowS)
-> Show DescribeImagePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImagePermissionsResponse] -> ShowS
$cshowList :: [DescribeImagePermissionsResponse] -> ShowS
show :: DescribeImagePermissionsResponse -> String
$cshow :: DescribeImagePermissionsResponse -> String
showsPrec :: Int -> DescribeImagePermissionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeImagePermissionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeImagePermissionsResponse
 -> Rep DescribeImagePermissionsResponse x)
-> (forall x.
    Rep DescribeImagePermissionsResponse x
    -> DescribeImagePermissionsResponse)
-> Generic DescribeImagePermissionsResponse
forall x.
Rep DescribeImagePermissionsResponse x
-> DescribeImagePermissionsResponse
forall x.
DescribeImagePermissionsResponse
-> Rep DescribeImagePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeImagePermissionsResponse x
-> DescribeImagePermissionsResponse
$cfrom :: forall x.
DescribeImagePermissionsResponse
-> Rep DescribeImagePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImagePermissionsResponse' 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:
--
-- 'sharedImagePermissionsList', 'describeImagePermissionsResponse_sharedImagePermissionsList' - The permissions for a private image that you own.
--
-- 'nextToken', 'describeImagePermissionsResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'name', 'describeImagePermissionsResponse_name' - The name of the private image.
--
-- 'httpStatus', 'describeImagePermissionsResponse_httpStatus' - The response's http status code.
newDescribeImagePermissionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeImagePermissionsResponse
newDescribeImagePermissionsResponse :: Int -> DescribeImagePermissionsResponse
newDescribeImagePermissionsResponse Int
pHttpStatus_ =
  DescribeImagePermissionsResponse' :: Maybe [SharedImagePermissions]
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeImagePermissionsResponse
DescribeImagePermissionsResponse'
    { $sel:sharedImagePermissionsList:DescribeImagePermissionsResponse' :: Maybe [SharedImagePermissions]
sharedImagePermissionsList =
        Maybe [SharedImagePermissions]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeImagePermissionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeImagePermissionsResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeImagePermissionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The permissions for a private image that you own.
describeImagePermissionsResponse_sharedImagePermissionsList :: Lens.Lens' DescribeImagePermissionsResponse (Prelude.Maybe [SharedImagePermissions])
describeImagePermissionsResponse_sharedImagePermissionsList :: (Maybe [SharedImagePermissions]
 -> f (Maybe [SharedImagePermissions]))
-> DescribeImagePermissionsResponse
-> f DescribeImagePermissionsResponse
describeImagePermissionsResponse_sharedImagePermissionsList = (DescribeImagePermissionsResponse
 -> Maybe [SharedImagePermissions])
-> (DescribeImagePermissionsResponse
    -> Maybe [SharedImagePermissions]
    -> DescribeImagePermissionsResponse)
-> Lens
     DescribeImagePermissionsResponse
     DescribeImagePermissionsResponse
     (Maybe [SharedImagePermissions])
     (Maybe [SharedImagePermissions])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissionsResponse' {Maybe [SharedImagePermissions]
sharedImagePermissionsList :: Maybe [SharedImagePermissions]
$sel:sharedImagePermissionsList:DescribeImagePermissionsResponse' :: DescribeImagePermissionsResponse -> Maybe [SharedImagePermissions]
sharedImagePermissionsList} -> Maybe [SharedImagePermissions]
sharedImagePermissionsList) (\s :: DescribeImagePermissionsResponse
s@DescribeImagePermissionsResponse' {} Maybe [SharedImagePermissions]
a -> DescribeImagePermissionsResponse
s {$sel:sharedImagePermissionsList:DescribeImagePermissionsResponse' :: Maybe [SharedImagePermissions]
sharedImagePermissionsList = Maybe [SharedImagePermissions]
a} :: DescribeImagePermissionsResponse) ((Maybe [SharedImagePermissions]
  -> f (Maybe [SharedImagePermissions]))
 -> DescribeImagePermissionsResponse
 -> f DescribeImagePermissionsResponse)
-> ((Maybe [SharedImagePermissions]
     -> f (Maybe [SharedImagePermissions]))
    -> Maybe [SharedImagePermissions]
    -> f (Maybe [SharedImagePermissions]))
-> (Maybe [SharedImagePermissions]
    -> f (Maybe [SharedImagePermissions]))
-> DescribeImagePermissionsResponse
-> f DescribeImagePermissionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SharedImagePermissions]
  [SharedImagePermissions]
  [SharedImagePermissions]
  [SharedImagePermissions]
-> Iso
     (Maybe [SharedImagePermissions])
     (Maybe [SharedImagePermissions])
     (Maybe [SharedImagePermissions])
     (Maybe [SharedImagePermissions])
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
  [SharedImagePermissions]
  [SharedImagePermissions]
  [SharedImagePermissions]
  [SharedImagePermissions]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
describeImagePermissionsResponse_nextToken :: Lens.Lens' DescribeImagePermissionsResponse (Prelude.Maybe Prelude.Text)
describeImagePermissionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImagePermissionsResponse
-> f DescribeImagePermissionsResponse
describeImagePermissionsResponse_nextToken = (DescribeImagePermissionsResponse -> Maybe Text)
-> (DescribeImagePermissionsResponse
    -> Maybe Text -> DescribeImagePermissionsResponse)
-> Lens
     DescribeImagePermissionsResponse
     DescribeImagePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImagePermissionsResponse' :: DescribeImagePermissionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImagePermissionsResponse
s@DescribeImagePermissionsResponse' {} Maybe Text
a -> DescribeImagePermissionsResponse
s {$sel:nextToken:DescribeImagePermissionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImagePermissionsResponse)

-- | The name of the private image.
describeImagePermissionsResponse_name :: Lens.Lens' DescribeImagePermissionsResponse (Prelude.Maybe Prelude.Text)
describeImagePermissionsResponse_name :: (Maybe Text -> f (Maybe Text))
-> DescribeImagePermissionsResponse
-> f DescribeImagePermissionsResponse
describeImagePermissionsResponse_name = (DescribeImagePermissionsResponse -> Maybe Text)
-> (DescribeImagePermissionsResponse
    -> Maybe Text -> DescribeImagePermissionsResponse)
-> Lens
     DescribeImagePermissionsResponse
     DescribeImagePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagePermissionsResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeImagePermissionsResponse' :: DescribeImagePermissionsResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeImagePermissionsResponse
s@DescribeImagePermissionsResponse' {} Maybe Text
a -> DescribeImagePermissionsResponse
s {$sel:name:DescribeImagePermissionsResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeImagePermissionsResponse)

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

instance
  Prelude.NFData
    DescribeImagePermissionsResponse