{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.PartnerIntegrationInputMessage
-- 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)
module Amazonka.Redshift.Types.PartnerIntegrationInputMessage where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal

-- | /See:/ 'newPartnerIntegrationInputMessage' smart constructor.
data PartnerIntegrationInputMessage = PartnerIntegrationInputMessage'
  { -- | The Amazon Web Services account ID that owns the cluster.
    PartnerIntegrationInputMessage -> Text
accountId :: Prelude.Text,
    -- | The cluster identifier of the cluster that receives data from the
    -- partner.
    PartnerIntegrationInputMessage -> Text
clusterIdentifier :: Prelude.Text,
    -- | The name of the database that receives data from the partner.
    PartnerIntegrationInputMessage -> Text
databaseName :: Prelude.Text,
    -- | The name of the partner that is authorized to send data.
    PartnerIntegrationInputMessage -> Text
partnerName :: Prelude.Text
  }
  deriving (PartnerIntegrationInputMessage
-> PartnerIntegrationInputMessage -> Bool
(PartnerIntegrationInputMessage
 -> PartnerIntegrationInputMessage -> Bool)
-> (PartnerIntegrationInputMessage
    -> PartnerIntegrationInputMessage -> Bool)
-> Eq PartnerIntegrationInputMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartnerIntegrationInputMessage
-> PartnerIntegrationInputMessage -> Bool
$c/= :: PartnerIntegrationInputMessage
-> PartnerIntegrationInputMessage -> Bool
== :: PartnerIntegrationInputMessage
-> PartnerIntegrationInputMessage -> Bool
$c== :: PartnerIntegrationInputMessage
-> PartnerIntegrationInputMessage -> Bool
Prelude.Eq, ReadPrec [PartnerIntegrationInputMessage]
ReadPrec PartnerIntegrationInputMessage
Int -> ReadS PartnerIntegrationInputMessage
ReadS [PartnerIntegrationInputMessage]
(Int -> ReadS PartnerIntegrationInputMessage)
-> ReadS [PartnerIntegrationInputMessage]
-> ReadPrec PartnerIntegrationInputMessage
-> ReadPrec [PartnerIntegrationInputMessage]
-> Read PartnerIntegrationInputMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PartnerIntegrationInputMessage]
$creadListPrec :: ReadPrec [PartnerIntegrationInputMessage]
readPrec :: ReadPrec PartnerIntegrationInputMessage
$creadPrec :: ReadPrec PartnerIntegrationInputMessage
readList :: ReadS [PartnerIntegrationInputMessage]
$creadList :: ReadS [PartnerIntegrationInputMessage]
readsPrec :: Int -> ReadS PartnerIntegrationInputMessage
$creadsPrec :: Int -> ReadS PartnerIntegrationInputMessage
Prelude.Read, Int -> PartnerIntegrationInputMessage -> ShowS
[PartnerIntegrationInputMessage] -> ShowS
PartnerIntegrationInputMessage -> String
(Int -> PartnerIntegrationInputMessage -> ShowS)
-> (PartnerIntegrationInputMessage -> String)
-> ([PartnerIntegrationInputMessage] -> ShowS)
-> Show PartnerIntegrationInputMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartnerIntegrationInputMessage] -> ShowS
$cshowList :: [PartnerIntegrationInputMessage] -> ShowS
show :: PartnerIntegrationInputMessage -> String
$cshow :: PartnerIntegrationInputMessage -> String
showsPrec :: Int -> PartnerIntegrationInputMessage -> ShowS
$cshowsPrec :: Int -> PartnerIntegrationInputMessage -> ShowS
Prelude.Show, (forall x.
 PartnerIntegrationInputMessage
 -> Rep PartnerIntegrationInputMessage x)
-> (forall x.
    Rep PartnerIntegrationInputMessage x
    -> PartnerIntegrationInputMessage)
-> Generic PartnerIntegrationInputMessage
forall x.
Rep PartnerIntegrationInputMessage x
-> PartnerIntegrationInputMessage
forall x.
PartnerIntegrationInputMessage
-> Rep PartnerIntegrationInputMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PartnerIntegrationInputMessage x
-> PartnerIntegrationInputMessage
$cfrom :: forall x.
PartnerIntegrationInputMessage
-> Rep PartnerIntegrationInputMessage x
Prelude.Generic)

-- |
-- Create a value of 'PartnerIntegrationInputMessage' 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:
--
-- 'accountId', 'partnerIntegrationInputMessage_accountId' - The Amazon Web Services account ID that owns the cluster.
--
-- 'clusterIdentifier', 'partnerIntegrationInputMessage_clusterIdentifier' - The cluster identifier of the cluster that receives data from the
-- partner.
--
-- 'databaseName', 'partnerIntegrationInputMessage_databaseName' - The name of the database that receives data from the partner.
--
-- 'partnerName', 'partnerIntegrationInputMessage_partnerName' - The name of the partner that is authorized to send data.
newPartnerIntegrationInputMessage ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'clusterIdentifier'
  Prelude.Text ->
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'partnerName'
  Prelude.Text ->
  PartnerIntegrationInputMessage
newPartnerIntegrationInputMessage :: Text -> Text -> Text -> Text -> PartnerIntegrationInputMessage
newPartnerIntegrationInputMessage
  Text
pAccountId_
  Text
pClusterIdentifier_
  Text
pDatabaseName_
  Text
pPartnerName_ =
    PartnerIntegrationInputMessage' :: Text -> Text -> Text -> Text -> PartnerIntegrationInputMessage
PartnerIntegrationInputMessage'
      { $sel:accountId:PartnerIntegrationInputMessage' :: Text
accountId =
          Text
pAccountId_,
        $sel:clusterIdentifier:PartnerIntegrationInputMessage' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
        $sel:databaseName:PartnerIntegrationInputMessage' :: Text
databaseName = Text
pDatabaseName_,
        $sel:partnerName:PartnerIntegrationInputMessage' :: Text
partnerName = Text
pPartnerName_
      }

-- | The Amazon Web Services account ID that owns the cluster.
partnerIntegrationInputMessage_accountId :: Lens.Lens' PartnerIntegrationInputMessage Prelude.Text
partnerIntegrationInputMessage_accountId :: (Text -> f Text)
-> PartnerIntegrationInputMessage
-> f PartnerIntegrationInputMessage
partnerIntegrationInputMessage_accountId = (PartnerIntegrationInputMessage -> Text)
-> (PartnerIntegrationInputMessage
    -> Text -> PartnerIntegrationInputMessage)
-> Lens
     PartnerIntegrationInputMessage
     PartnerIntegrationInputMessage
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerIntegrationInputMessage' {Text
accountId :: Text
$sel:accountId:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
accountId} -> Text
accountId) (\s :: PartnerIntegrationInputMessage
s@PartnerIntegrationInputMessage' {} Text
a -> PartnerIntegrationInputMessage
s {$sel:accountId:PartnerIntegrationInputMessage' :: Text
accountId = Text
a} :: PartnerIntegrationInputMessage)

-- | The cluster identifier of the cluster that receives data from the
-- partner.
partnerIntegrationInputMessage_clusterIdentifier :: Lens.Lens' PartnerIntegrationInputMessage Prelude.Text
partnerIntegrationInputMessage_clusterIdentifier :: (Text -> f Text)
-> PartnerIntegrationInputMessage
-> f PartnerIntegrationInputMessage
partnerIntegrationInputMessage_clusterIdentifier = (PartnerIntegrationInputMessage -> Text)
-> (PartnerIntegrationInputMessage
    -> Text -> PartnerIntegrationInputMessage)
-> Lens
     PartnerIntegrationInputMessage
     PartnerIntegrationInputMessage
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerIntegrationInputMessage' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: PartnerIntegrationInputMessage
s@PartnerIntegrationInputMessage' {} Text
a -> PartnerIntegrationInputMessage
s {$sel:clusterIdentifier:PartnerIntegrationInputMessage' :: Text
clusterIdentifier = Text
a} :: PartnerIntegrationInputMessage)

-- | The name of the database that receives data from the partner.
partnerIntegrationInputMessage_databaseName :: Lens.Lens' PartnerIntegrationInputMessage Prelude.Text
partnerIntegrationInputMessage_databaseName :: (Text -> f Text)
-> PartnerIntegrationInputMessage
-> f PartnerIntegrationInputMessage
partnerIntegrationInputMessage_databaseName = (PartnerIntegrationInputMessage -> Text)
-> (PartnerIntegrationInputMessage
    -> Text -> PartnerIntegrationInputMessage)
-> Lens
     PartnerIntegrationInputMessage
     PartnerIntegrationInputMessage
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerIntegrationInputMessage' {Text
databaseName :: Text
$sel:databaseName:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
databaseName} -> Text
databaseName) (\s :: PartnerIntegrationInputMessage
s@PartnerIntegrationInputMessage' {} Text
a -> PartnerIntegrationInputMessage
s {$sel:databaseName:PartnerIntegrationInputMessage' :: Text
databaseName = Text
a} :: PartnerIntegrationInputMessage)

-- | The name of the partner that is authorized to send data.
partnerIntegrationInputMessage_partnerName :: Lens.Lens' PartnerIntegrationInputMessage Prelude.Text
partnerIntegrationInputMessage_partnerName :: (Text -> f Text)
-> PartnerIntegrationInputMessage
-> f PartnerIntegrationInputMessage
partnerIntegrationInputMessage_partnerName = (PartnerIntegrationInputMessage -> Text)
-> (PartnerIntegrationInputMessage
    -> Text -> PartnerIntegrationInputMessage)
-> Lens
     PartnerIntegrationInputMessage
     PartnerIntegrationInputMessage
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerIntegrationInputMessage' {Text
partnerName :: Text
$sel:partnerName:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
partnerName} -> Text
partnerName) (\s :: PartnerIntegrationInputMessage
s@PartnerIntegrationInputMessage' {} Text
a -> PartnerIntegrationInputMessage
s {$sel:partnerName:PartnerIntegrationInputMessage' :: Text
partnerName = Text
a} :: PartnerIntegrationInputMessage)

instance
  Prelude.Hashable
    PartnerIntegrationInputMessage

instance
  Prelude.NFData
    PartnerIntegrationInputMessage

instance Core.ToQuery PartnerIntegrationInputMessage where
  toQuery :: PartnerIntegrationInputMessage -> QueryString
toQuery PartnerIntegrationInputMessage' {Text
partnerName :: Text
databaseName :: Text
clusterIdentifier :: Text
accountId :: Text
$sel:partnerName:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
$sel:databaseName:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
$sel:clusterIdentifier:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
$sel:accountId:PartnerIntegrationInputMessage' :: PartnerIntegrationInputMessage -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"AccountId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
accountId,
        ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier,
        ByteString
"DatabaseName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
databaseName,
        ByteString
"PartnerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
partnerName
      ]