{-# 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.DescribeDataSharesForConsumer
-- 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 where the account identifier being called
-- is a consumer account identifier.
module Amazonka.Redshift.DescribeDataSharesForConsumer
  ( -- * Creating a Request
    DescribeDataSharesForConsumer (..),
    newDescribeDataSharesForConsumer,

    -- * Request Lenses
    describeDataSharesForConsumer_status,
    describeDataSharesForConsumer_consumerArn,
    describeDataSharesForConsumer_marker,
    describeDataSharesForConsumer_maxRecords,

    -- * Destructuring the Response
    DescribeDataSharesForConsumerResponse (..),
    newDescribeDataSharesForConsumerResponse,

    -- * Response Lenses
    describeDataSharesForConsumerResponse_marker,
    describeDataSharesForConsumerResponse_dataShares,
    describeDataSharesForConsumerResponse_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:/ 'newDescribeDataSharesForConsumer' smart constructor.
data DescribeDataSharesForConsumer = DescribeDataSharesForConsumer'
  { -- | An identifier giving the status of a datashare in the consumer cluster.
    -- If this field is specified, Amazon Redshift returns the list of
    -- datashares that have the specified status.
    DescribeDataSharesForConsumer -> Maybe DataShareStatusForConsumer
status :: Prelude.Maybe DataShareStatusForConsumer,
    -- | The Amazon Resource Name (ARN) of the consumer that returns in the list
    -- of datashares.
    DescribeDataSharesForConsumer -> Maybe Text
consumerArn :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeDataSharesForConsumer
    -- 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.
    DescribeDataSharesForConsumer -> 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.
    DescribeDataSharesForConsumer -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeDataSharesForConsumer
-> DescribeDataSharesForConsumer -> Bool
(DescribeDataSharesForConsumer
 -> DescribeDataSharesForConsumer -> Bool)
-> (DescribeDataSharesForConsumer
    -> DescribeDataSharesForConsumer -> Bool)
-> Eq DescribeDataSharesForConsumer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSharesForConsumer
-> DescribeDataSharesForConsumer -> Bool
$c/= :: DescribeDataSharesForConsumer
-> DescribeDataSharesForConsumer -> Bool
== :: DescribeDataSharesForConsumer
-> DescribeDataSharesForConsumer -> Bool
$c== :: DescribeDataSharesForConsumer
-> DescribeDataSharesForConsumer -> Bool
Prelude.Eq, ReadPrec [DescribeDataSharesForConsumer]
ReadPrec DescribeDataSharesForConsumer
Int -> ReadS DescribeDataSharesForConsumer
ReadS [DescribeDataSharesForConsumer]
(Int -> ReadS DescribeDataSharesForConsumer)
-> ReadS [DescribeDataSharesForConsumer]
-> ReadPrec DescribeDataSharesForConsumer
-> ReadPrec [DescribeDataSharesForConsumer]
-> Read DescribeDataSharesForConsumer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSharesForConsumer]
$creadListPrec :: ReadPrec [DescribeDataSharesForConsumer]
readPrec :: ReadPrec DescribeDataSharesForConsumer
$creadPrec :: ReadPrec DescribeDataSharesForConsumer
readList :: ReadS [DescribeDataSharesForConsumer]
$creadList :: ReadS [DescribeDataSharesForConsumer]
readsPrec :: Int -> ReadS DescribeDataSharesForConsumer
$creadsPrec :: Int -> ReadS DescribeDataSharesForConsumer
Prelude.Read, Int -> DescribeDataSharesForConsumer -> ShowS
[DescribeDataSharesForConsumer] -> ShowS
DescribeDataSharesForConsumer -> String
(Int -> DescribeDataSharesForConsumer -> ShowS)
-> (DescribeDataSharesForConsumer -> String)
-> ([DescribeDataSharesForConsumer] -> ShowS)
-> Show DescribeDataSharesForConsumer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSharesForConsumer] -> ShowS
$cshowList :: [DescribeDataSharesForConsumer] -> ShowS
show :: DescribeDataSharesForConsumer -> String
$cshow :: DescribeDataSharesForConsumer -> String
showsPrec :: Int -> DescribeDataSharesForConsumer -> ShowS
$cshowsPrec :: Int -> DescribeDataSharesForConsumer -> ShowS
Prelude.Show, (forall x.
 DescribeDataSharesForConsumer
 -> Rep DescribeDataSharesForConsumer x)
-> (forall x.
    Rep DescribeDataSharesForConsumer x
    -> DescribeDataSharesForConsumer)
-> Generic DescribeDataSharesForConsumer
forall x.
Rep DescribeDataSharesForConsumer x
-> DescribeDataSharesForConsumer
forall x.
DescribeDataSharesForConsumer
-> Rep DescribeDataSharesForConsumer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSharesForConsumer x
-> DescribeDataSharesForConsumer
$cfrom :: forall x.
DescribeDataSharesForConsumer
-> Rep DescribeDataSharesForConsumer x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSharesForConsumer' 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', 'describeDataSharesForConsumer_status' - An identifier giving the status of a datashare in the consumer cluster.
-- If this field is specified, Amazon Redshift returns the list of
-- datashares that have the specified status.
--
-- 'consumerArn', 'describeDataSharesForConsumer_consumerArn' - The Amazon Resource Name (ARN) of the consumer that returns in the list
-- of datashares.
--
-- 'marker', 'describeDataSharesForConsumer_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForConsumer
-- 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', 'describeDataSharesForConsumer_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.
newDescribeDataSharesForConsumer ::
  DescribeDataSharesForConsumer
newDescribeDataSharesForConsumer :: DescribeDataSharesForConsumer
newDescribeDataSharesForConsumer =
  DescribeDataSharesForConsumer' :: Maybe DataShareStatusForConsumer
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> DescribeDataSharesForConsumer
DescribeDataSharesForConsumer'
    { $sel:status:DescribeDataSharesForConsumer' :: Maybe DataShareStatusForConsumer
status =
        Maybe DataShareStatusForConsumer
forall a. Maybe a
Prelude.Nothing,
      $sel:consumerArn:DescribeDataSharesForConsumer' :: Maybe Text
consumerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDataSharesForConsumer' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDataSharesForConsumer' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForConsumer
-- 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.
describeDataSharesForConsumer_marker :: Lens.Lens' DescribeDataSharesForConsumer (Prelude.Maybe Prelude.Text)
describeDataSharesForConsumer_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSharesForConsumer -> f DescribeDataSharesForConsumer
describeDataSharesForConsumer_marker = (DescribeDataSharesForConsumer -> Maybe Text)
-> (DescribeDataSharesForConsumer
    -> Maybe Text -> DescribeDataSharesForConsumer)
-> Lens
     DescribeDataSharesForConsumer
     DescribeDataSharesForConsumer
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForConsumer' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDataSharesForConsumer
s@DescribeDataSharesForConsumer' {} Maybe Text
a -> DescribeDataSharesForConsumer
s {$sel:marker:DescribeDataSharesForConsumer' :: Maybe Text
marker = Maybe Text
a} :: DescribeDataSharesForConsumer)

-- | 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.
describeDataSharesForConsumer_maxRecords :: Lens.Lens' DescribeDataSharesForConsumer (Prelude.Maybe Prelude.Int)
describeDataSharesForConsumer_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeDataSharesForConsumer -> f DescribeDataSharesForConsumer
describeDataSharesForConsumer_maxRecords = (DescribeDataSharesForConsumer -> Maybe Int)
-> (DescribeDataSharesForConsumer
    -> Maybe Int -> DescribeDataSharesForConsumer)
-> Lens
     DescribeDataSharesForConsumer
     DescribeDataSharesForConsumer
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForConsumer' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDataSharesForConsumer
s@DescribeDataSharesForConsumer' {} Maybe Int
a -> DescribeDataSharesForConsumer
s {$sel:maxRecords:DescribeDataSharesForConsumer' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDataSharesForConsumer)

instance
  Core.AWSRequest
    DescribeDataSharesForConsumer
  where
  type
    AWSResponse DescribeDataSharesForConsumer =
      DescribeDataSharesForConsumerResponse
  request :: DescribeDataSharesForConsumer
-> Request DescribeDataSharesForConsumer
request = Service
-> DescribeDataSharesForConsumer
-> Request DescribeDataSharesForConsumer
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDataSharesForConsumer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSharesForConsumer)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeDataSharesForConsumer))
-> Logger
-> Service
-> Proxy DescribeDataSharesForConsumer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDataSharesForConsumer)))
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
"DescribeDataSharesForConsumerResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [DataShare]
-> Int
-> DescribeDataSharesForConsumerResponse
DescribeDataSharesForConsumerResponse'
            (Maybe Text
 -> Maybe [DataShare]
 -> Int
 -> DescribeDataSharesForConsumerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DataShare] -> Int -> DescribeDataSharesForConsumerResponse)
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 -> DescribeDataSharesForConsumerResponse)
-> Either String (Maybe [DataShare])
-> Either String (Int -> DescribeDataSharesForConsumerResponse)
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 -> DescribeDataSharesForConsumerResponse)
-> Either String Int
-> Either String DescribeDataSharesForConsumerResponse
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
    DescribeDataSharesForConsumer

instance Prelude.NFData DescribeDataSharesForConsumer

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

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

instance Core.ToQuery DescribeDataSharesForConsumer where
  toQuery :: DescribeDataSharesForConsumer -> QueryString
toQuery DescribeDataSharesForConsumer' {Maybe Int
Maybe Text
Maybe DataShareStatusForConsumer
maxRecords :: Maybe Int
marker :: Maybe Text
consumerArn :: Maybe Text
status :: Maybe DataShareStatusForConsumer
$sel:maxRecords:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe Int
$sel:marker:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe Text
$sel:consumerArn:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe Text
$sel:status:DescribeDataSharesForConsumer' :: DescribeDataSharesForConsumer -> Maybe DataShareStatusForConsumer
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeDataSharesForConsumer" ::
                      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 DataShareStatusForConsumer -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DataShareStatusForConsumer
status,
        ByteString
"ConsumerArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
consumerArn,
        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:/ 'newDescribeDataSharesForConsumerResponse' smart constructor.
data DescribeDataSharesForConsumerResponse = DescribeDataSharesForConsumerResponse'
  { -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeDataSharesForConsumer
    -- 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.
    DescribeDataSharesForConsumerResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Shows the results of datashares available for consumers.
    DescribeDataSharesForConsumerResponse -> Maybe [DataShare]
dataShares :: Prelude.Maybe [DataShare],
    -- | The response's http status code.
    DescribeDataSharesForConsumerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDataSharesForConsumerResponse
-> DescribeDataSharesForConsumerResponse -> Bool
(DescribeDataSharesForConsumerResponse
 -> DescribeDataSharesForConsumerResponse -> Bool)
-> (DescribeDataSharesForConsumerResponse
    -> DescribeDataSharesForConsumerResponse -> Bool)
-> Eq DescribeDataSharesForConsumerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSharesForConsumerResponse
-> DescribeDataSharesForConsumerResponse -> Bool
$c/= :: DescribeDataSharesForConsumerResponse
-> DescribeDataSharesForConsumerResponse -> Bool
== :: DescribeDataSharesForConsumerResponse
-> DescribeDataSharesForConsumerResponse -> Bool
$c== :: DescribeDataSharesForConsumerResponse
-> DescribeDataSharesForConsumerResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDataSharesForConsumerResponse]
ReadPrec DescribeDataSharesForConsumerResponse
Int -> ReadS DescribeDataSharesForConsumerResponse
ReadS [DescribeDataSharesForConsumerResponse]
(Int -> ReadS DescribeDataSharesForConsumerResponse)
-> ReadS [DescribeDataSharesForConsumerResponse]
-> ReadPrec DescribeDataSharesForConsumerResponse
-> ReadPrec [DescribeDataSharesForConsumerResponse]
-> Read DescribeDataSharesForConsumerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSharesForConsumerResponse]
$creadListPrec :: ReadPrec [DescribeDataSharesForConsumerResponse]
readPrec :: ReadPrec DescribeDataSharesForConsumerResponse
$creadPrec :: ReadPrec DescribeDataSharesForConsumerResponse
readList :: ReadS [DescribeDataSharesForConsumerResponse]
$creadList :: ReadS [DescribeDataSharesForConsumerResponse]
readsPrec :: Int -> ReadS DescribeDataSharesForConsumerResponse
$creadsPrec :: Int -> ReadS DescribeDataSharesForConsumerResponse
Prelude.Read, Int -> DescribeDataSharesForConsumerResponse -> ShowS
[DescribeDataSharesForConsumerResponse] -> ShowS
DescribeDataSharesForConsumerResponse -> String
(Int -> DescribeDataSharesForConsumerResponse -> ShowS)
-> (DescribeDataSharesForConsumerResponse -> String)
-> ([DescribeDataSharesForConsumerResponse] -> ShowS)
-> Show DescribeDataSharesForConsumerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSharesForConsumerResponse] -> ShowS
$cshowList :: [DescribeDataSharesForConsumerResponse] -> ShowS
show :: DescribeDataSharesForConsumerResponse -> String
$cshow :: DescribeDataSharesForConsumerResponse -> String
showsPrec :: Int -> DescribeDataSharesForConsumerResponse -> ShowS
$cshowsPrec :: Int -> DescribeDataSharesForConsumerResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDataSharesForConsumerResponse
 -> Rep DescribeDataSharesForConsumerResponse x)
-> (forall x.
    Rep DescribeDataSharesForConsumerResponse x
    -> DescribeDataSharesForConsumerResponse)
-> Generic DescribeDataSharesForConsumerResponse
forall x.
Rep DescribeDataSharesForConsumerResponse x
-> DescribeDataSharesForConsumerResponse
forall x.
DescribeDataSharesForConsumerResponse
-> Rep DescribeDataSharesForConsumerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSharesForConsumerResponse x
-> DescribeDataSharesForConsumerResponse
$cfrom :: forall x.
DescribeDataSharesForConsumerResponse
-> Rep DescribeDataSharesForConsumerResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataSharesForConsumerResponse' 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', 'describeDataSharesForConsumerResponse_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForConsumer
-- 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', 'describeDataSharesForConsumerResponse_dataShares' - Shows the results of datashares available for consumers.
--
-- 'httpStatus', 'describeDataSharesForConsumerResponse_httpStatus' - The response's http status code.
newDescribeDataSharesForConsumerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDataSharesForConsumerResponse
newDescribeDataSharesForConsumerResponse :: Int -> DescribeDataSharesForConsumerResponse
newDescribeDataSharesForConsumerResponse Int
pHttpStatus_ =
  DescribeDataSharesForConsumerResponse' :: Maybe Text
-> Maybe [DataShare]
-> Int
-> DescribeDataSharesForConsumerResponse
DescribeDataSharesForConsumerResponse'
    { $sel:marker:DescribeDataSharesForConsumerResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataShares:DescribeDataSharesForConsumerResponse' :: Maybe [DataShare]
dataShares = Maybe [DataShare]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDataSharesForConsumerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeDataSharesForConsumer
-- 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.
describeDataSharesForConsumerResponse_marker :: Lens.Lens' DescribeDataSharesForConsumerResponse (Prelude.Maybe Prelude.Text)
describeDataSharesForConsumerResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSharesForConsumerResponse
-> f DescribeDataSharesForConsumerResponse
describeDataSharesForConsumerResponse_marker = (DescribeDataSharesForConsumerResponse -> Maybe Text)
-> (DescribeDataSharesForConsumerResponse
    -> Maybe Text -> DescribeDataSharesForConsumerResponse)
-> Lens
     DescribeDataSharesForConsumerResponse
     DescribeDataSharesForConsumerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSharesForConsumerResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDataSharesForConsumerResponse' :: DescribeDataSharesForConsumerResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDataSharesForConsumerResponse
s@DescribeDataSharesForConsumerResponse' {} Maybe Text
a -> DescribeDataSharesForConsumerResponse
s {$sel:marker:DescribeDataSharesForConsumerResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDataSharesForConsumerResponse)

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

instance
  Prelude.NFData
    DescribeDataSharesForConsumerResponse