{-# 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-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)
--
-- Returns a list of datashares when the account identifier being called is
-- a producer account identifier.
module Amazonka.Redshift.DescribeDataSharesForProducer
  ( -- * Creating a Request
    DescribeDataSharesForProducer (..),
    newDescribeDataSharesForProducer,

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

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

    -- * Response Lenses
    describeDataSharesForProducerResponse_marker,
    describeDataSharesForProducerResponse_dataShares,
    describeDataSharesForProducerResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | The Amazon Resource Name (ARN) of the producer that returns in the list
    -- of datashares.
    DescribeDataSharesForProducer -> Maybe Text
producerArn :: Prelude.Maybe Prelude.Text,
    -- | 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@, AWS 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
  }
  deriving (DescribeDataSharesForProducer
-> DescribeDataSharesForProducer -> Bool
(DescribeDataSharesForProducer
 -> DescribeDataSharesForProducer -> Bool)
-> (DescribeDataSharesForProducer
    -> DescribeDataSharesForProducer -> Bool)
-> Eq DescribeDataSharesForProducer
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]
(Int -> ReadS DescribeDataSharesForProducer)
-> ReadS [DescribeDataSharesForProducer]
-> ReadPrec DescribeDataSharesForProducer
-> ReadPrec [DescribeDataSharesForProducer]
-> Read 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
(Int -> DescribeDataSharesForProducer -> ShowS)
-> (DescribeDataSharesForProducer -> String)
-> ([DescribeDataSharesForProducer] -> ShowS)
-> Show DescribeDataSharesForProducer
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.
 DescribeDataSharesForProducer
 -> Rep DescribeDataSharesForProducer x)
-> (forall x.
    Rep DescribeDataSharesForProducer x
    -> DescribeDataSharesForProducer)
-> Generic DescribeDataSharesForProducer
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:
--
-- '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.
--
-- 'producerArn', 'describeDataSharesForProducer_producerArn' - The Amazon Resource Name (ARN) of the producer that returns in the list
-- of datashares.
--
-- '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@, AWS 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.
newDescribeDataSharesForProducer ::
  DescribeDataSharesForProducer
newDescribeDataSharesForProducer :: DescribeDataSharesForProducer
newDescribeDataSharesForProducer =
  DescribeDataSharesForProducer' :: Maybe DataShareStatusForProducer
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> DescribeDataSharesForProducer
DescribeDataSharesForProducer'
    { $sel:status:DescribeDataSharesForProducer' :: Maybe DataShareStatusForProducer
status =
        Maybe DataShareStatusForProducer
forall a. Maybe a
Prelude.Nothing,
      $sel:producerArn:DescribeDataSharesForProducer' :: Maybe Text
producerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDataSharesForProducer' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDataSharesForProducer' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe DataShareStatusForProducer
 -> f (Maybe DataShareStatusForProducer))
-> DescribeDataSharesForProducer -> f DescribeDataSharesForProducer
describeDataSharesForProducer_status = (DescribeDataSharesForProducer -> Maybe DataShareStatusForProducer)
-> (DescribeDataSharesForProducer
    -> Maybe DataShareStatusForProducer
    -> DescribeDataSharesForProducer)
-> Lens
     DescribeDataSharesForProducer
     DescribeDataSharesForProducer
     (Maybe DataShareStatusForProducer)
     (Maybe DataShareStatusForProducer)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSharesForProducer -> f DescribeDataSharesForProducer
describeDataSharesForProducer_producerArn = (DescribeDataSharesForProducer -> Maybe Text)
-> (DescribeDataSharesForProducer
    -> Maybe Text -> DescribeDataSharesForProducer)
-> Lens
     DescribeDataSharesForProducer
     DescribeDataSharesForProducer
     (Maybe Text)
     (Maybe Text)
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 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@, AWS 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSharesForProducer -> f DescribeDataSharesForProducer
describeDataSharesForProducer_marker = (DescribeDataSharesForProducer -> Maybe Text)
-> (DescribeDataSharesForProducer
    -> Maybe Text -> DescribeDataSharesForProducer)
-> Lens
     DescribeDataSharesForProducer
     DescribeDataSharesForProducer
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Int -> f (Maybe Int))
-> DescribeDataSharesForProducer -> f DescribeDataSharesForProducer
describeDataSharesForProducer_maxRecords = (DescribeDataSharesForProducer -> Maybe Int)
-> (DescribeDataSharesForProducer
    -> Maybe Int -> DescribeDataSharesForProducer)
-> Lens
     DescribeDataSharesForProducer
     DescribeDataSharesForProducer
     (Maybe Int)
     (Maybe Int)
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)

instance
  Core.AWSRequest
    DescribeDataSharesForProducer
  where
  type
    AWSResponse DescribeDataSharesForProducer =
      DescribeDataSharesForProducerResponse
  request :: DescribeDataSharesForProducer
-> Request DescribeDataSharesForProducer
request = Service
-> DescribeDataSharesForProducer
-> Request DescribeDataSharesForProducer
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDataSharesForProducer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSharesForProducer)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeDataSharesForProducer))
-> Logger
-> Service
-> Proxy DescribeDataSharesForProducer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSharesForProducer)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeDataSharesForProducerResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [DataShare]
-> Int
-> DescribeDataSharesForProducerResponse
DescribeDataSharesForProducerResponse'
            (Maybe Text
 -> Maybe [DataShare]
 -> Int
 -> DescribeDataSharesForProducerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DataShare] -> Int -> DescribeDataSharesForProducerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either
  String
  (Maybe [DataShare] -> Int -> DescribeDataSharesForProducerResponse)
-> Either String (Maybe [DataShare])
-> Either String (Int -> DescribeDataSharesForProducerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DataShares" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [DataShare]))
-> Either String (Maybe [DataShare])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [DataShare])
-> [Node] -> Either String (Maybe [DataShare])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [DataShare]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> DescribeDataSharesForProducerResponse)
-> Either String Int
-> Either String DescribeDataSharesForProducerResponse
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
    DescribeDataSharesForProducer

instance Prelude.NFData DescribeDataSharesForProducer

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

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

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

-- | /See:/ 'newDescribeDataSharesForProducerResponse' smart constructor.
data DescribeDataSharesForProducerResponse = DescribeDataSharesForProducerResponse'
  { -- | 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@, AWS 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,
    -- | Shows the results of datashares available for producers.
    DescribeDataSharesForProducerResponse -> Maybe [DataShare]
dataShares :: Prelude.Maybe [DataShare],
    -- | The response's http status code.
    DescribeDataSharesForProducerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDataSharesForProducerResponse
-> DescribeDataSharesForProducerResponse -> Bool
(DescribeDataSharesForProducerResponse
 -> DescribeDataSharesForProducerResponse -> Bool)
-> (DescribeDataSharesForProducerResponse
    -> DescribeDataSharesForProducerResponse -> Bool)
-> Eq DescribeDataSharesForProducerResponse
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]
(Int -> ReadS DescribeDataSharesForProducerResponse)
-> ReadS [DescribeDataSharesForProducerResponse]
-> ReadPrec DescribeDataSharesForProducerResponse
-> ReadPrec [DescribeDataSharesForProducerResponse]
-> Read 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
(Int -> DescribeDataSharesForProducerResponse -> ShowS)
-> (DescribeDataSharesForProducerResponse -> String)
-> ([DescribeDataSharesForProducerResponse] -> ShowS)
-> Show DescribeDataSharesForProducerResponse
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.
 DescribeDataSharesForProducerResponse
 -> Rep DescribeDataSharesForProducerResponse x)
-> (forall x.
    Rep DescribeDataSharesForProducerResponse x
    -> DescribeDataSharesForProducerResponse)
-> Generic DescribeDataSharesForProducerResponse
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:
--
-- '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@, AWS 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.
--
-- 'dataShares', 'describeDataSharesForProducerResponse_dataShares' - Shows the results of datashares available for producers.
--
-- 'httpStatus', 'describeDataSharesForProducerResponse_httpStatus' - The response's http status code.
newDescribeDataSharesForProducerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDataSharesForProducerResponse
newDescribeDataSharesForProducerResponse :: Int -> DescribeDataSharesForProducerResponse
newDescribeDataSharesForProducerResponse Int
pHttpStatus_ =
  DescribeDataSharesForProducerResponse' :: Maybe Text
-> Maybe [DataShare]
-> Int
-> DescribeDataSharesForProducerResponse
DescribeDataSharesForProducerResponse'
    { $sel:marker:DescribeDataSharesForProducerResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataShares:DescribeDataSharesForProducerResponse' :: Maybe [DataShare]
dataShares = Maybe [DataShare]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDataSharesForProducerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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@, AWS 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSharesForProducerResponse
-> f DescribeDataSharesForProducerResponse
describeDataSharesForProducerResponse_marker = (DescribeDataSharesForProducerResponse -> Maybe Text)
-> (DescribeDataSharesForProducerResponse
    -> Maybe Text -> DescribeDataSharesForProducerResponse)
-> Lens
     DescribeDataSharesForProducerResponse
     DescribeDataSharesForProducerResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | Shows the results of datashares available for producers.
describeDataSharesForProducerResponse_dataShares :: Lens.Lens' DescribeDataSharesForProducerResponse (Prelude.Maybe [DataShare])
describeDataSharesForProducerResponse_dataShares :: (Maybe [DataShare] -> f (Maybe [DataShare]))
-> DescribeDataSharesForProducerResponse
-> f DescribeDataSharesForProducerResponse
describeDataSharesForProducerResponse_dataShares = (DescribeDataSharesForProducerResponse -> Maybe [DataShare])
-> (DescribeDataSharesForProducerResponse
    -> Maybe [DataShare] -> DescribeDataSharesForProducerResponse)
-> Lens
     DescribeDataSharesForProducerResponse
     DescribeDataSharesForProducerResponse
     (Maybe [DataShare])
     (Maybe [DataShare])
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) ((Maybe [DataShare] -> f (Maybe [DataShare]))
 -> DescribeDataSharesForProducerResponse
 -> f DescribeDataSharesForProducerResponse)
-> ((Maybe [DataShare] -> f (Maybe [DataShare]))
    -> Maybe [DataShare] -> f (Maybe [DataShare]))
-> (Maybe [DataShare] -> f (Maybe [DataShare]))
-> DescribeDataSharesForProducerResponse
-> f DescribeDataSharesForProducerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DataShare] [DataShare] [DataShare] [DataShare]
-> Iso
     (Maybe [DataShare])
     (Maybe [DataShare])
     (Maybe [DataShare])
     (Maybe [DataShare])
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 [DataShare] [DataShare] [DataShare] [DataShare]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeDataSharesForProducerResponse_httpStatus :: Lens.Lens' DescribeDataSharesForProducerResponse Prelude.Int
describeDataSharesForProducerResponse_httpStatus :: (Int -> f Int)
-> DescribeDataSharesForProducerResponse
-> f DescribeDataSharesForProducerResponse
describeDataSharesForProducerResponse_httpStatus = (DescribeDataSharesForProducerResponse -> Int)
-> (DescribeDataSharesForProducerResponse
    -> Int -> DescribeDataSharesForProducerResponse)
-> Lens
     DescribeDataSharesForProducerResponse
     DescribeDataSharesForProducerResponse
     Int
     Int
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