{-# 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 #-}
module Amazonka.ServiceCatalog.DescribePortfolioShares
(
DescribePortfolioShares (..),
newDescribePortfolioShares,
describePortfolioShares_pageSize,
describePortfolioShares_pageToken,
describePortfolioShares_portfolioId,
describePortfolioShares_type,
DescribePortfolioSharesResponse (..),
newDescribePortfolioSharesResponse,
describePortfolioSharesResponse_nextPageToken,
describePortfolioSharesResponse_portfolioShareDetails,
describePortfolioSharesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types
data DescribePortfolioShares = DescribePortfolioShares'
{
DescribePortfolioShares -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
DescribePortfolioShares -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
DescribePortfolioShares -> Text
portfolioId :: Prelude.Text,
DescribePortfolioShares -> DescribePortfolioShareType
type' :: DescribePortfolioShareType
}
deriving (DescribePortfolioShares -> DescribePortfolioShares -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
$c/= :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
== :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
$c== :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
Prelude.Eq, ReadPrec [DescribePortfolioShares]
ReadPrec DescribePortfolioShares
Int -> ReadS DescribePortfolioShares
ReadS [DescribePortfolioShares]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePortfolioShares]
$creadListPrec :: ReadPrec [DescribePortfolioShares]
readPrec :: ReadPrec DescribePortfolioShares
$creadPrec :: ReadPrec DescribePortfolioShares
readList :: ReadS [DescribePortfolioShares]
$creadList :: ReadS [DescribePortfolioShares]
readsPrec :: Int -> ReadS DescribePortfolioShares
$creadsPrec :: Int -> ReadS DescribePortfolioShares
Prelude.Read, Int -> DescribePortfolioShares -> ShowS
[DescribePortfolioShares] -> ShowS
DescribePortfolioShares -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePortfolioShares] -> ShowS
$cshowList :: [DescribePortfolioShares] -> ShowS
show :: DescribePortfolioShares -> String
$cshow :: DescribePortfolioShares -> String
showsPrec :: Int -> DescribePortfolioShares -> ShowS
$cshowsPrec :: Int -> DescribePortfolioShares -> ShowS
Prelude.Show, forall x. Rep DescribePortfolioShares x -> DescribePortfolioShares
forall x. DescribePortfolioShares -> Rep DescribePortfolioShares x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePortfolioShares x -> DescribePortfolioShares
$cfrom :: forall x. DescribePortfolioShares -> Rep DescribePortfolioShares x
Prelude.Generic)
newDescribePortfolioShares ::
Prelude.Text ->
DescribePortfolioShareType ->
DescribePortfolioShares
newDescribePortfolioShares :: Text -> DescribePortfolioShareType -> DescribePortfolioShares
newDescribePortfolioShares Text
pPortfolioId_ DescribePortfolioShareType
pType_ =
DescribePortfolioShares'
{ $sel:pageSize:DescribePortfolioShares' :: Maybe Natural
pageSize =
forall a. Maybe a
Prelude.Nothing,
$sel:pageToken:DescribePortfolioShares' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
$sel:portfolioId:DescribePortfolioShares' :: Text
portfolioId = Text
pPortfolioId_,
$sel:type':DescribePortfolioShares' :: DescribePortfolioShareType
type' = DescribePortfolioShareType
pType_
}
describePortfolioShares_pageSize :: Lens.Lens' DescribePortfolioShares (Prelude.Maybe Prelude.Natural)
describePortfolioShares_pageSize :: Lens' DescribePortfolioShares (Maybe Natural)
describePortfolioShares_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} Maybe Natural
a -> DescribePortfolioShares
s {$sel:pageSize:DescribePortfolioShares' :: Maybe Natural
pageSize = Maybe Natural
a} :: DescribePortfolioShares)
describePortfolioShares_pageToken :: Lens.Lens' DescribePortfolioShares (Prelude.Maybe Prelude.Text)
describePortfolioShares_pageToken :: Lens' DescribePortfolioShares (Maybe Text)
describePortfolioShares_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} Maybe Text
a -> DescribePortfolioShares
s {$sel:pageToken:DescribePortfolioShares' :: Maybe Text
pageToken = Maybe Text
a} :: DescribePortfolioShares)
describePortfolioShares_portfolioId :: Lens.Lens' DescribePortfolioShares Prelude.Text
describePortfolioShares_portfolioId :: Lens' DescribePortfolioShares Text
describePortfolioShares_portfolioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {Text
portfolioId :: Text
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
portfolioId} -> Text
portfolioId) (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} Text
a -> DescribePortfolioShares
s {$sel:portfolioId:DescribePortfolioShares' :: Text
portfolioId = Text
a} :: DescribePortfolioShares)
describePortfolioShares_type :: Lens.Lens' DescribePortfolioShares DescribePortfolioShareType
describePortfolioShares_type :: Lens' DescribePortfolioShares DescribePortfolioShareType
describePortfolioShares_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {DescribePortfolioShareType
type' :: DescribePortfolioShareType
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
type'} -> DescribePortfolioShareType
type') (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} DescribePortfolioShareType
a -> DescribePortfolioShares
s {$sel:type':DescribePortfolioShares' :: DescribePortfolioShareType
type' = DescribePortfolioShareType
a} :: DescribePortfolioShares)
instance Core.AWSRequest DescribePortfolioShares where
type
AWSResponse DescribePortfolioShares =
DescribePortfolioSharesResponse
request :: (Service -> Service)
-> DescribePortfolioShares -> Request DescribePortfolioShares
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribePortfolioShares
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribePortfolioShares)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [PortfolioShareDetail]
-> Int
-> DescribePortfolioSharesResponse
DescribePortfolioSharesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextPageToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PortfolioShareDetails"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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 DescribePortfolioShares where
hashWithSalt :: Int -> DescribePortfolioShares -> Int
hashWithSalt Int
_salt DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portfolioId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DescribePortfolioShareType
type'
instance Prelude.NFData DescribePortfolioShares where
rnf :: DescribePortfolioShares -> ()
rnf DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portfolioId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DescribePortfolioShareType
type'
instance Data.ToHeaders DescribePortfolioShares where
toHeaders :: DescribePortfolioShares -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWS242ServiceCatalogService.DescribePortfolioShares" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribePortfolioShares where
toJSON :: DescribePortfolioShares -> Value
toJSON DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"PageSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
pageSize,
(Key
"PageToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken,
forall a. a -> Maybe a
Prelude.Just (Key
"PortfolioId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portfolioId),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DescribePortfolioShareType
type')
]
)
instance Data.ToPath DescribePortfolioShares where
toPath :: DescribePortfolioShares -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribePortfolioShares where
toQuery :: DescribePortfolioShares -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribePortfolioSharesResponse = DescribePortfolioSharesResponse'
{
DescribePortfolioSharesResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail]
portfolioShareDetails :: Prelude.Maybe [PortfolioShareDetail],
DescribePortfolioSharesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribePortfolioSharesResponse
-> DescribePortfolioSharesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePortfolioSharesResponse
-> DescribePortfolioSharesResponse -> Bool
$c/= :: DescribePortfolioSharesResponse
-> DescribePortfolioSharesResponse -> Bool
== :: DescribePortfolioSharesResponse
-> DescribePortfolioSharesResponse -> Bool
$c== :: DescribePortfolioSharesResponse
-> DescribePortfolioSharesResponse -> Bool
Prelude.Eq, ReadPrec [DescribePortfolioSharesResponse]
ReadPrec DescribePortfolioSharesResponse
Int -> ReadS DescribePortfolioSharesResponse
ReadS [DescribePortfolioSharesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePortfolioSharesResponse]
$creadListPrec :: ReadPrec [DescribePortfolioSharesResponse]
readPrec :: ReadPrec DescribePortfolioSharesResponse
$creadPrec :: ReadPrec DescribePortfolioSharesResponse
readList :: ReadS [DescribePortfolioSharesResponse]
$creadList :: ReadS [DescribePortfolioSharesResponse]
readsPrec :: Int -> ReadS DescribePortfolioSharesResponse
$creadsPrec :: Int -> ReadS DescribePortfolioSharesResponse
Prelude.Read, Int -> DescribePortfolioSharesResponse -> ShowS
[DescribePortfolioSharesResponse] -> ShowS
DescribePortfolioSharesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePortfolioSharesResponse] -> ShowS
$cshowList :: [DescribePortfolioSharesResponse] -> ShowS
show :: DescribePortfolioSharesResponse -> String
$cshow :: DescribePortfolioSharesResponse -> String
showsPrec :: Int -> DescribePortfolioSharesResponse -> ShowS
$cshowsPrec :: Int -> DescribePortfolioSharesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribePortfolioSharesResponse x
-> DescribePortfolioSharesResponse
forall x.
DescribePortfolioSharesResponse
-> Rep DescribePortfolioSharesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePortfolioSharesResponse x
-> DescribePortfolioSharesResponse
$cfrom :: forall x.
DescribePortfolioSharesResponse
-> Rep DescribePortfolioSharesResponse x
Prelude.Generic)
newDescribePortfolioSharesResponse ::
Prelude.Int ->
DescribePortfolioSharesResponse
newDescribePortfolioSharesResponse :: Int -> DescribePortfolioSharesResponse
newDescribePortfolioSharesResponse Int
pHttpStatus_ =
DescribePortfolioSharesResponse'
{ $sel:nextPageToken:DescribePortfolioSharesResponse' :: Maybe Text
nextPageToken =
forall a. Maybe a
Prelude.Nothing,
$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: Maybe [PortfolioShareDetail]
portfolioShareDetails = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribePortfolioSharesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describePortfolioSharesResponse_nextPageToken :: Lens.Lens' DescribePortfolioSharesResponse (Prelude.Maybe Prelude.Text)
describePortfolioSharesResponse_nextPageToken :: Lens' DescribePortfolioSharesResponse (Maybe Text)
describePortfolioSharesResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioSharesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: DescribePortfolioSharesResponse
s@DescribePortfolioSharesResponse' {} Maybe Text
a -> DescribePortfolioSharesResponse
s {$sel:nextPageToken:DescribePortfolioSharesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: DescribePortfolioSharesResponse)
describePortfolioSharesResponse_portfolioShareDetails :: Lens.Lens' DescribePortfolioSharesResponse (Prelude.Maybe [PortfolioShareDetail])
describePortfolioSharesResponse_portfolioShareDetails :: Lens'
DescribePortfolioSharesResponse (Maybe [PortfolioShareDetail])
describePortfolioSharesResponse_portfolioShareDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioSharesResponse' {Maybe [PortfolioShareDetail]
portfolioShareDetails :: Maybe [PortfolioShareDetail]
$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail]
portfolioShareDetails} -> Maybe [PortfolioShareDetail]
portfolioShareDetails) (\s :: DescribePortfolioSharesResponse
s@DescribePortfolioSharesResponse' {} Maybe [PortfolioShareDetail]
a -> DescribePortfolioSharesResponse
s {$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: Maybe [PortfolioShareDetail]
portfolioShareDetails = Maybe [PortfolioShareDetail]
a} :: DescribePortfolioSharesResponse) 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
describePortfolioSharesResponse_httpStatus :: Lens.Lens' DescribePortfolioSharesResponse Prelude.Int
describePortfolioSharesResponse_httpStatus :: Lens' DescribePortfolioSharesResponse Int
describePortfolioSharesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioSharesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePortfolioSharesResponse
s@DescribePortfolioSharesResponse' {} Int
a -> DescribePortfolioSharesResponse
s {$sel:httpStatus:DescribePortfolioSharesResponse' :: Int
httpStatus = Int
a} :: DescribePortfolioSharesResponse)
instance
Prelude.NFData
DescribePortfolioSharesResponse
where
rnf :: DescribePortfolioSharesResponse -> ()
rnf DescribePortfolioSharesResponse' {Int
Maybe [PortfolioShareDetail]
Maybe Text
httpStatus :: Int
portfolioShareDetails :: Maybe [PortfolioShareDetail]
nextPageToken :: Maybe Text
$sel:httpStatus:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Int
$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail]
$sel:nextPageToken:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PortfolioShareDetail]
portfolioShareDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus