{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Connect.AssociateApprovedOrigin
(
AssociateApprovedOrigin (..),
newAssociateApprovedOrigin,
associateApprovedOrigin_instanceId,
associateApprovedOrigin_origin,
AssociateApprovedOriginResponse (..),
newAssociateApprovedOriginResponse,
)
where
import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateApprovedOrigin = AssociateApprovedOrigin'
{
AssociateApprovedOrigin -> Text
instanceId :: Prelude.Text,
AssociateApprovedOrigin -> Text
origin :: Prelude.Text
}
deriving (AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool
(AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool)
-> (AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool)
-> Eq AssociateApprovedOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool
$c/= :: AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool
== :: AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool
$c== :: AssociateApprovedOrigin -> AssociateApprovedOrigin -> Bool
Prelude.Eq, ReadPrec [AssociateApprovedOrigin]
ReadPrec AssociateApprovedOrigin
Int -> ReadS AssociateApprovedOrigin
ReadS [AssociateApprovedOrigin]
(Int -> ReadS AssociateApprovedOrigin)
-> ReadS [AssociateApprovedOrigin]
-> ReadPrec AssociateApprovedOrigin
-> ReadPrec [AssociateApprovedOrigin]
-> Read AssociateApprovedOrigin
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateApprovedOrigin]
$creadListPrec :: ReadPrec [AssociateApprovedOrigin]
readPrec :: ReadPrec AssociateApprovedOrigin
$creadPrec :: ReadPrec AssociateApprovedOrigin
readList :: ReadS [AssociateApprovedOrigin]
$creadList :: ReadS [AssociateApprovedOrigin]
readsPrec :: Int -> ReadS AssociateApprovedOrigin
$creadsPrec :: Int -> ReadS AssociateApprovedOrigin
Prelude.Read, Int -> AssociateApprovedOrigin -> ShowS
[AssociateApprovedOrigin] -> ShowS
AssociateApprovedOrigin -> String
(Int -> AssociateApprovedOrigin -> ShowS)
-> (AssociateApprovedOrigin -> String)
-> ([AssociateApprovedOrigin] -> ShowS)
-> Show AssociateApprovedOrigin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateApprovedOrigin] -> ShowS
$cshowList :: [AssociateApprovedOrigin] -> ShowS
show :: AssociateApprovedOrigin -> String
$cshow :: AssociateApprovedOrigin -> String
showsPrec :: Int -> AssociateApprovedOrigin -> ShowS
$cshowsPrec :: Int -> AssociateApprovedOrigin -> ShowS
Prelude.Show, (forall x.
AssociateApprovedOrigin -> Rep AssociateApprovedOrigin x)
-> (forall x.
Rep AssociateApprovedOrigin x -> AssociateApprovedOrigin)
-> Generic AssociateApprovedOrigin
forall x. Rep AssociateApprovedOrigin x -> AssociateApprovedOrigin
forall x. AssociateApprovedOrigin -> Rep AssociateApprovedOrigin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateApprovedOrigin x -> AssociateApprovedOrigin
$cfrom :: forall x. AssociateApprovedOrigin -> Rep AssociateApprovedOrigin x
Prelude.Generic)
newAssociateApprovedOrigin ::
Prelude.Text ->
Prelude.Text ->
AssociateApprovedOrigin
newAssociateApprovedOrigin :: Text -> Text -> AssociateApprovedOrigin
newAssociateApprovedOrigin Text
pInstanceId_ Text
pOrigin_ =
AssociateApprovedOrigin' :: Text -> Text -> AssociateApprovedOrigin
AssociateApprovedOrigin'
{ $sel:instanceId:AssociateApprovedOrigin' :: Text
instanceId = Text
pInstanceId_,
$sel:origin:AssociateApprovedOrigin' :: Text
origin = Text
pOrigin_
}
associateApprovedOrigin_instanceId :: Lens.Lens' AssociateApprovedOrigin Prelude.Text
associateApprovedOrigin_instanceId :: (Text -> f Text)
-> AssociateApprovedOrigin -> f AssociateApprovedOrigin
associateApprovedOrigin_instanceId = (AssociateApprovedOrigin -> Text)
-> (AssociateApprovedOrigin -> Text -> AssociateApprovedOrigin)
-> Lens AssociateApprovedOrigin AssociateApprovedOrigin Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApprovedOrigin' {Text
instanceId :: Text
$sel:instanceId:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
instanceId} -> Text
instanceId) (\s :: AssociateApprovedOrigin
s@AssociateApprovedOrigin' {} Text
a -> AssociateApprovedOrigin
s {$sel:instanceId:AssociateApprovedOrigin' :: Text
instanceId = Text
a} :: AssociateApprovedOrigin)
associateApprovedOrigin_origin :: Lens.Lens' AssociateApprovedOrigin Prelude.Text
associateApprovedOrigin_origin :: (Text -> f Text)
-> AssociateApprovedOrigin -> f AssociateApprovedOrigin
associateApprovedOrigin_origin = (AssociateApprovedOrigin -> Text)
-> (AssociateApprovedOrigin -> Text -> AssociateApprovedOrigin)
-> Lens AssociateApprovedOrigin AssociateApprovedOrigin Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApprovedOrigin' {Text
origin :: Text
$sel:origin:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
origin} -> Text
origin) (\s :: AssociateApprovedOrigin
s@AssociateApprovedOrigin' {} Text
a -> AssociateApprovedOrigin
s {$sel:origin:AssociateApprovedOrigin' :: Text
origin = Text
a} :: AssociateApprovedOrigin)
instance Core.AWSRequest AssociateApprovedOrigin where
type
AWSResponse AssociateApprovedOrigin =
AssociateApprovedOriginResponse
request :: AssociateApprovedOrigin -> Request AssociateApprovedOrigin
request = Service
-> AssociateApprovedOrigin -> Request AssociateApprovedOrigin
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateApprovedOrigin
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateApprovedOrigin)))
response =
AWSResponse AssociateApprovedOrigin
-> Logger
-> Service
-> Proxy AssociateApprovedOrigin
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateApprovedOrigin)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse AssociateApprovedOrigin
AssociateApprovedOriginResponse
AssociateApprovedOriginResponse'
instance Prelude.Hashable AssociateApprovedOrigin
instance Prelude.NFData AssociateApprovedOrigin
instance Core.ToHeaders AssociateApprovedOrigin where
toHeaders :: AssociateApprovedOrigin -> [Header]
toHeaders =
[Header] -> AssociateApprovedOrigin -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON AssociateApprovedOrigin where
toJSON :: AssociateApprovedOrigin -> Value
toJSON AssociateApprovedOrigin' {Text
origin :: Text
instanceId :: Text
$sel:origin:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
$sel:instanceId:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Origin" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
origin)]
)
instance Core.ToPath AssociateApprovedOrigin where
toPath :: AssociateApprovedOrigin -> ByteString
toPath AssociateApprovedOrigin' {Text
origin :: Text
instanceId :: Text
$sel:origin:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
$sel:instanceId:AssociateApprovedOrigin' :: AssociateApprovedOrigin -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/instance/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
ByteString
"/approved-origin"
]
instance Core.ToQuery AssociateApprovedOrigin where
toQuery :: AssociateApprovedOrigin -> QueryString
toQuery = QueryString -> AssociateApprovedOrigin -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateApprovedOriginResponse = AssociateApprovedOriginResponse'
{
}
deriving (AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool
(AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool)
-> (AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool)
-> Eq AssociateApprovedOriginResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool
$c/= :: AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool
== :: AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool
$c== :: AssociateApprovedOriginResponse
-> AssociateApprovedOriginResponse -> Bool
Prelude.Eq, ReadPrec [AssociateApprovedOriginResponse]
ReadPrec AssociateApprovedOriginResponse
Int -> ReadS AssociateApprovedOriginResponse
ReadS [AssociateApprovedOriginResponse]
(Int -> ReadS AssociateApprovedOriginResponse)
-> ReadS [AssociateApprovedOriginResponse]
-> ReadPrec AssociateApprovedOriginResponse
-> ReadPrec [AssociateApprovedOriginResponse]
-> Read AssociateApprovedOriginResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateApprovedOriginResponse]
$creadListPrec :: ReadPrec [AssociateApprovedOriginResponse]
readPrec :: ReadPrec AssociateApprovedOriginResponse
$creadPrec :: ReadPrec AssociateApprovedOriginResponse
readList :: ReadS [AssociateApprovedOriginResponse]
$creadList :: ReadS [AssociateApprovedOriginResponse]
readsPrec :: Int -> ReadS AssociateApprovedOriginResponse
$creadsPrec :: Int -> ReadS AssociateApprovedOriginResponse
Prelude.Read, Int -> AssociateApprovedOriginResponse -> ShowS
[AssociateApprovedOriginResponse] -> ShowS
AssociateApprovedOriginResponse -> String
(Int -> AssociateApprovedOriginResponse -> ShowS)
-> (AssociateApprovedOriginResponse -> String)
-> ([AssociateApprovedOriginResponse] -> ShowS)
-> Show AssociateApprovedOriginResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateApprovedOriginResponse] -> ShowS
$cshowList :: [AssociateApprovedOriginResponse] -> ShowS
show :: AssociateApprovedOriginResponse -> String
$cshow :: AssociateApprovedOriginResponse -> String
showsPrec :: Int -> AssociateApprovedOriginResponse -> ShowS
$cshowsPrec :: Int -> AssociateApprovedOriginResponse -> ShowS
Prelude.Show, (forall x.
AssociateApprovedOriginResponse
-> Rep AssociateApprovedOriginResponse x)
-> (forall x.
Rep AssociateApprovedOriginResponse x
-> AssociateApprovedOriginResponse)
-> Generic AssociateApprovedOriginResponse
forall x.
Rep AssociateApprovedOriginResponse x
-> AssociateApprovedOriginResponse
forall x.
AssociateApprovedOriginResponse
-> Rep AssociateApprovedOriginResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateApprovedOriginResponse x
-> AssociateApprovedOriginResponse
$cfrom :: forall x.
AssociateApprovedOriginResponse
-> Rep AssociateApprovedOriginResponse x
Prelude.Generic)
newAssociateApprovedOriginResponse ::
AssociateApprovedOriginResponse
newAssociateApprovedOriginResponse :: AssociateApprovedOriginResponse
newAssociateApprovedOriginResponse =
AssociateApprovedOriginResponse
AssociateApprovedOriginResponse'
instance
Prelude.NFData
AssociateApprovedOriginResponse