{-# 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.Redshift.DescribeDataSharesForProducer
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of datashares when the account identifier being called is
-- a producer account identifier.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeDataSharesForProducer
  ( -- * Creating a Request
    DescribeDataSharesForProducer (..),
    newDescribeDataSharesForProducer,

    -- * Request Lenses
    describeDataSharesForProducer_marker,
    describeDataSharesForProducer_maxRecords,
    describeDataSharesForProducer_producerArn,
    describeDataSharesForProducer_status,

    -- * Destructuring the Response
    DescribeDataSharesForProducerResponse (..),
    newDescribeDataSharesForProducerResponse,

    -- * Response Lenses
    describeDataSharesForProducerResponse_dataShares,
    describeDataSharesForProducerResponse_marker,
    describeDataSharesForProducerResponse_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 Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeDataSharesForProducer' smart constructor.
data DescribeDataSharesForProducer = DescribeDataSharesForProducer'
  { -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeDataSharesForProducer
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeDataSharesForProducer -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    DescribeDataSharesForProducer -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the producer that returns in the list
    -- of datashares.
    DescribeDataSharesForProducer -> Maybe Text
producerArn :: Prelude.Maybe Prelude.Text,
    -- | An identifier giving the status of a datashare in the producer. If this
    -- field is specified, Amazon Redshift returns the list of datashares that
    -- have the specified status.
    DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer
status :: Prelude.Maybe DataShareStatusForProducer
  }
  deriving (DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
$c/= :: DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
== :: DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
$c== :: DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
Prelude.Eq, ReadPrec [DescribeDataSharesForProducer]
ReadPrec DescribeDataSharesForProducer
Int -> ReadS DescribeDataSharesForProducer
ReadS [DescribeDataSharesForProducer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSharesForProducer]
$creadListPrec :: ReadPrec [DescribeDataSharesForProducer]
readPrec :: ReadPrec DescribeDataSharesForProducer
$creadPrec :: ReadPrec DescribeDataSharesForProducer
readList :: ReadS [DescribeDataSharesForProducer]
$creadList :: ReadS [DescribeDataSharesForProducer]
readsPrec :: Int -> ReadS DescribeDataSharesForProducer
$creadsPrec :: Int -> ReadS DescribeDataSharesForProducer
Prelude.Read, Int -> DescribeDataSharesForProducer -> ShowS
[DescribeDataSharesForProducer] -> ShowS
DescribeDataSharesForProducer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSharesForProducer] -> ShowS
$cshowList :: [DescribeDataSharesForProducer] -> ShowS
show :: DescribeDataSharesForProducer -> String
$cshow :: DescribeDataSharesForProducer -> String
showsPrec :: Int -> DescribeDataSharesForProducer -> ShowS
$cshowsPrec :: Int -> DescribeDataSharesForProducer -> ShowS
Prelude.Show, forall x.
Rep DescribeDataSharesForProducer x
-> DescribeDataSharesForProducer
forall x.
DescribeDataSharesForProducer
-> Rep DescribeDataSharesForProducer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSharesForProducer x
-> DescribeDataSharesForProducer
$cfrom :: forall x.
DescribeDataSharesForProducer
-> Rep DescribeDataSharesForProducer x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSharesForProducer' 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:
--
-- 'marker', 'describeDataSharesForProducer_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForProducer
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeDataSharesForProducer_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- 'producerArn', 'describeDataSharesForProducer_producerArn' - The Amazon Resource Name (ARN) of the producer that returns in the list
-- of datashares.
--
-- 'status', 'describeDataSharesForProducer_status' - An identifier giving the status of a datashare in the producer. If this
-- field is specified, Amazon Redshift returns the list of datashares that
-- have the specified status.
newDescribeDataSharesForProducer ::
  DescribeDataSharesForProducer
newDescribeDataSharesForProducer :: DescribeDataSharesForProducer
newDescribeDataSharesForProducer =
  DescribeDataSharesForProducer'
    { $sel:marker:DescribeDataSharesForProducer' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDataSharesForProducer' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:producerArn:DescribeDataSharesForProducer' :: Maybe Text
producerArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeDataSharesForProducer' :: Maybe DataShareStatusForProducer
status = forall a. Maybe a
Prelude.Nothing
    }

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForProducer
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeDataSharesForProducer_marker :: Lens.Lens' DescribeDataSharesForProducer (Prelude.Maybe Prelude.Text)
describeDataSharesForProducer_marker :: Lens' DescribeDataSharesForProducer (Maybe Text)
describeDataSharesForProducer_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducer' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDataSharesForProducer
s@DescribeDataSharesForProducer' {} Maybe Text
a -> DescribeDataSharesForProducer
s {$sel:marker:DescribeDataSharesForProducer' :: Maybe Text
marker = Maybe Text
a} :: DescribeDataSharesForProducer)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
describeDataSharesForProducer_maxRecords :: Lens.Lens' DescribeDataSharesForProducer (Prelude.Maybe Prelude.Int)
describeDataSharesForProducer_maxRecords :: Lens' DescribeDataSharesForProducer (Maybe Int)
describeDataSharesForProducer_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducer' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDataSharesForProducer
s@DescribeDataSharesForProducer' {} Maybe Int
a -> DescribeDataSharesForProducer
s {$sel:maxRecords:DescribeDataSharesForProducer' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDataSharesForProducer)

-- | The Amazon Resource Name (ARN) of the producer that returns in the list
-- of datashares.
describeDataSharesForProducer_producerArn :: Lens.Lens' DescribeDataSharesForProducer (Prelude.Maybe Prelude.Text)
describeDataSharesForProducer_producerArn :: Lens' DescribeDataSharesForProducer (Maybe Text)
describeDataSharesForProducer_producerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducer' {Maybe Text
producerArn :: Maybe Text
$sel:producerArn:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
producerArn} -> Maybe Text
producerArn) (\s :: DescribeDataSharesForProducer
s@DescribeDataSharesForProducer' {} Maybe Text
a -> DescribeDataSharesForProducer
s {$sel:producerArn:DescribeDataSharesForProducer' :: Maybe Text
producerArn = Maybe Text
a} :: DescribeDataSharesForProducer)

-- | An identifier giving the status of a datashare in the producer. If this
-- field is specified, Amazon Redshift returns the list of datashares that
-- have the specified status.
describeDataSharesForProducer_status :: Lens.Lens' DescribeDataSharesForProducer (Prelude.Maybe DataShareStatusForProducer)
describeDataSharesForProducer_status :: Lens'
  DescribeDataSharesForProducer (Maybe DataShareStatusForProducer)
describeDataSharesForProducer_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducer' {Maybe DataShareStatusForProducer
status :: Maybe DataShareStatusForProducer
$sel:status:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer
status} -> Maybe DataShareStatusForProducer
status) (\s :: DescribeDataSharesForProducer
s@DescribeDataSharesForProducer' {} Maybe DataShareStatusForProducer
a -> DescribeDataSharesForProducer
s {$sel:status:DescribeDataSharesForProducer' :: Maybe DataShareStatusForProducer
status = Maybe DataShareStatusForProducer
a} :: DescribeDataSharesForProducer)

instance Core.AWSPager DescribeDataSharesForProducer where
  page :: DescribeDataSharesForProducer
-> AWSResponse DescribeDataSharesForProducer
-> Maybe DescribeDataSharesForProducer
page DescribeDataSharesForProducer
rq AWSResponse DescribeDataSharesForProducer
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDataSharesForProducer
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDataSharesForProducerResponse (Maybe Text)
describeDataSharesForProducerResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDataSharesForProducer
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDataSharesForProducerResponse (Maybe [DataShare])
describeDataSharesForProducerResponse_dataShares
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeDataSharesForProducer
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeDataSharesForProducer (Maybe Text)
describeDataSharesForProducer_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDataSharesForProducer
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDataSharesForProducerResponse (Maybe Text)
describeDataSharesForProducerResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeDataSharesForProducer
  where
  type
    AWSResponse DescribeDataSharesForProducer =
      DescribeDataSharesForProducerResponse
  request :: (Service -> Service)
-> DescribeDataSharesForProducer
-> Request DescribeDataSharesForProducer
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 DescribeDataSharesForProducer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSharesForProducer)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeDataSharesForProducerResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [DataShare]
-> Maybe Text -> Int -> DescribeDataSharesForProducerResponse
DescribeDataSharesForProducerResponse'
            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
"DataShares"
                            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
"member")
                        )
            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
"Marker")
            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
    DescribeDataSharesForProducer
  where
  hashWithSalt :: Int -> DescribeDataSharesForProducer -> Int
hashWithSalt Int
_salt DescribeDataSharesForProducer' {Maybe Int
Maybe Text
Maybe DataShareStatusForProducer
status :: Maybe DataShareStatusForProducer
producerArn :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:status:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer
$sel:producerArn:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
$sel:maxRecords:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Int
$sel:marker:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
producerArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataShareStatusForProducer
status

instance Prelude.NFData DescribeDataSharesForProducer where
  rnf :: DescribeDataSharesForProducer -> ()
rnf DescribeDataSharesForProducer' {Maybe Int
Maybe Text
Maybe DataShareStatusForProducer
status :: Maybe DataShareStatusForProducer
producerArn :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:status:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer
$sel:producerArn:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
$sel:maxRecords:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Int
$sel:marker:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
producerArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataShareStatusForProducer
status

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

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

instance Data.ToQuery DescribeDataSharesForProducer where
  toQuery :: DescribeDataSharesForProducer -> QueryString
toQuery DescribeDataSharesForProducer' {Maybe Int
Maybe Text
Maybe DataShareStatusForProducer
status :: Maybe DataShareStatusForProducer
producerArn :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:status:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer
$sel:producerArn:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
$sel:maxRecords:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Int
$sel:marker:DescribeDataSharesForProducer' :: DescribeDataSharesForProducer -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeDataSharesForProducer" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"ProducerArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
producerArn,
        ByteString
"Status" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe DataShareStatusForProducer
status
      ]

-- | /See:/ 'newDescribeDataSharesForProducerResponse' smart constructor.
data DescribeDataSharesForProducerResponse = DescribeDataSharesForProducerResponse'
  { -- | Shows the results of datashares available for producers.
    DescribeDataSharesForProducerResponse -> Maybe [DataShare]
dataShares :: Prelude.Maybe [DataShare],
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeDataSharesForProducer
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeDataSharesForProducerResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDataSharesForProducerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
$c/= :: DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
== :: DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
$c== :: DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDataSharesForProducerResponse]
ReadPrec DescribeDataSharesForProducerResponse
Int -> ReadS DescribeDataSharesForProducerResponse
ReadS [DescribeDataSharesForProducerResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSharesForProducerResponse]
$creadListPrec :: ReadPrec [DescribeDataSharesForProducerResponse]
readPrec :: ReadPrec DescribeDataSharesForProducerResponse
$creadPrec :: ReadPrec DescribeDataSharesForProducerResponse
readList :: ReadS [DescribeDataSharesForProducerResponse]
$creadList :: ReadS [DescribeDataSharesForProducerResponse]
readsPrec :: Int -> ReadS DescribeDataSharesForProducerResponse
$creadsPrec :: Int -> ReadS DescribeDataSharesForProducerResponse
Prelude.Read, Int -> DescribeDataSharesForProducerResponse -> ShowS
[DescribeDataSharesForProducerResponse] -> ShowS
DescribeDataSharesForProducerResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSharesForProducerResponse] -> ShowS
$cshowList :: [DescribeDataSharesForProducerResponse] -> ShowS
show :: DescribeDataSharesForProducerResponse -> String
$cshow :: DescribeDataSharesForProducerResponse -> String
showsPrec :: Int -> DescribeDataSharesForProducerResponse -> ShowS
$cshowsPrec :: Int -> DescribeDataSharesForProducerResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeDataSharesForProducerResponse x
-> DescribeDataSharesForProducerResponse
forall x.
DescribeDataSharesForProducerResponse
-> Rep DescribeDataSharesForProducerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSharesForProducerResponse x
-> DescribeDataSharesForProducerResponse
$cfrom :: forall x.
DescribeDataSharesForProducerResponse
-> Rep DescribeDataSharesForProducerResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSharesForProducerResponse' 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:
--
-- 'dataShares', 'describeDataSharesForProducerResponse_dataShares' - Shows the results of datashares available for producers.
--
-- 'marker', 'describeDataSharesForProducerResponse_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForProducer
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'httpStatus', 'describeDataSharesForProducerResponse_httpStatus' - The response's http status code.
newDescribeDataSharesForProducerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDataSharesForProducerResponse
newDescribeDataSharesForProducerResponse :: Int -> DescribeDataSharesForProducerResponse
newDescribeDataSharesForProducerResponse Int
pHttpStatus_ =
  DescribeDataSharesForProducerResponse'
    { $sel:dataShares:DescribeDataSharesForProducerResponse' :: Maybe [DataShare]
dataShares =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDataSharesForProducerResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDataSharesForProducerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Shows the results of datashares available for producers.
describeDataSharesForProducerResponse_dataShares :: Lens.Lens' DescribeDataSharesForProducerResponse (Prelude.Maybe [DataShare])
describeDataSharesForProducerResponse_dataShares :: Lens' DescribeDataSharesForProducerResponse (Maybe [DataShare])
describeDataSharesForProducerResponse_dataShares = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducerResponse' {Maybe [DataShare]
dataShares :: Maybe [DataShare]
$sel:dataShares:DescribeDataSharesForProducerResponse' :: DescribeDataSharesForProducerResponse -> Maybe [DataShare]
dataShares} -> Maybe [DataShare]
dataShares) (\s :: DescribeDataSharesForProducerResponse
s@DescribeDataSharesForProducerResponse' {} Maybe [DataShare]
a -> DescribeDataSharesForProducerResponse
s {$sel:dataShares:DescribeDataSharesForProducerResponse' :: Maybe [DataShare]
dataShares = Maybe [DataShare]
a} :: DescribeDataSharesForProducerResponse) 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

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForProducer
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeDataSharesForProducerResponse_marker :: Lens.Lens' DescribeDataSharesForProducerResponse (Prelude.Maybe Prelude.Text)
describeDataSharesForProducerResponse_marker :: Lens' DescribeDataSharesForProducerResponse (Maybe Text)
describeDataSharesForProducerResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForProducerResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDataSharesForProducerResponse' :: DescribeDataSharesForProducerResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDataSharesForProducerResponse
s@DescribeDataSharesForProducerResponse' {} Maybe Text
a -> DescribeDataSharesForProducerResponse
s {$sel:marker:DescribeDataSharesForProducerResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDataSharesForProducerResponse)

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

instance
  Prelude.NFData
    DescribeDataSharesForProducerResponse
  where
  rnf :: DescribeDataSharesForProducerResponse -> ()
rnf DescribeDataSharesForProducerResponse' {Int
Maybe [DataShare]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
dataShares :: Maybe [DataShare]
$sel:httpStatus:DescribeDataSharesForProducerResponse' :: DescribeDataSharesForProducerResponse -> Int
$sel:marker:DescribeDataSharesForProducerResponse' :: DescribeDataSharesForProducerResponse -> Maybe Text
$sel:dataShares:DescribeDataSharesForProducerResponse' :: DescribeDataSharesForProducerResponse -> Maybe [DataShare]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DataShare]
dataShares
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus