{-# 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.MediaLive.CreatePartnerInput
(
CreatePartnerInput' (..),
newCreatePartnerInput',
createPartnerInput'_requestId,
createPartnerInput'_tags,
createPartnerInput'_inputId,
CreatePartnerInputResponse (..),
newCreatePartnerInputResponse,
createPartnerInputResponse_input,
createPartnerInputResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreatePartnerInput' = CreatePartnerInput''
{
CreatePartnerInput' -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreatePartnerInput' -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreatePartnerInput' -> Text
inputId :: Prelude.Text
}
deriving (CreatePartnerInput' -> CreatePartnerInput' -> Bool
(CreatePartnerInput' -> CreatePartnerInput' -> Bool)
-> (CreatePartnerInput' -> CreatePartnerInput' -> Bool)
-> Eq CreatePartnerInput'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePartnerInput' -> CreatePartnerInput' -> Bool
$c/= :: CreatePartnerInput' -> CreatePartnerInput' -> Bool
== :: CreatePartnerInput' -> CreatePartnerInput' -> Bool
$c== :: CreatePartnerInput' -> CreatePartnerInput' -> Bool
Prelude.Eq, ReadPrec [CreatePartnerInput']
ReadPrec CreatePartnerInput'
Int -> ReadS CreatePartnerInput'
ReadS [CreatePartnerInput']
(Int -> ReadS CreatePartnerInput')
-> ReadS [CreatePartnerInput']
-> ReadPrec CreatePartnerInput'
-> ReadPrec [CreatePartnerInput']
-> Read CreatePartnerInput'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePartnerInput']
$creadListPrec :: ReadPrec [CreatePartnerInput']
readPrec :: ReadPrec CreatePartnerInput'
$creadPrec :: ReadPrec CreatePartnerInput'
readList :: ReadS [CreatePartnerInput']
$creadList :: ReadS [CreatePartnerInput']
readsPrec :: Int -> ReadS CreatePartnerInput'
$creadsPrec :: Int -> ReadS CreatePartnerInput'
Prelude.Read, Int -> CreatePartnerInput' -> ShowS
[CreatePartnerInput'] -> ShowS
CreatePartnerInput' -> String
(Int -> CreatePartnerInput' -> ShowS)
-> (CreatePartnerInput' -> String)
-> ([CreatePartnerInput'] -> ShowS)
-> Show CreatePartnerInput'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePartnerInput'] -> ShowS
$cshowList :: [CreatePartnerInput'] -> ShowS
show :: CreatePartnerInput' -> String
$cshow :: CreatePartnerInput' -> String
showsPrec :: Int -> CreatePartnerInput' -> ShowS
$cshowsPrec :: Int -> CreatePartnerInput' -> ShowS
Prelude.Show, (forall x. CreatePartnerInput' -> Rep CreatePartnerInput' x)
-> (forall x. Rep CreatePartnerInput' x -> CreatePartnerInput')
-> Generic CreatePartnerInput'
forall x. Rep CreatePartnerInput' x -> CreatePartnerInput'
forall x. CreatePartnerInput' -> Rep CreatePartnerInput' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePartnerInput' x -> CreatePartnerInput'
$cfrom :: forall x. CreatePartnerInput' -> Rep CreatePartnerInput' x
Prelude.Generic)
newCreatePartnerInput' ::
Prelude.Text ->
CreatePartnerInput'
newCreatePartnerInput' :: Text -> CreatePartnerInput'
newCreatePartnerInput' Text
pInputId_ =
CreatePartnerInput'' :: Maybe Text
-> Maybe (HashMap Text Text) -> Text -> CreatePartnerInput'
CreatePartnerInput''
{ $sel:requestId:CreatePartnerInput'' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreatePartnerInput'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:inputId:CreatePartnerInput'' :: Text
inputId = Text
pInputId_
}
createPartnerInput'_requestId :: Lens.Lens' CreatePartnerInput' (Prelude.Maybe Prelude.Text)
createPartnerInput'_requestId :: (Maybe Text -> f (Maybe Text))
-> CreatePartnerInput' -> f CreatePartnerInput'
createPartnerInput'_requestId = (CreatePartnerInput' -> Maybe Text)
-> (CreatePartnerInput' -> Maybe Text -> CreatePartnerInput')
-> Lens
CreatePartnerInput' CreatePartnerInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePartnerInput'' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreatePartnerInput'
s@CreatePartnerInput'' {} Maybe Text
a -> CreatePartnerInput'
s {$sel:requestId:CreatePartnerInput'' :: Maybe Text
requestId = Maybe Text
a} :: CreatePartnerInput')
createPartnerInput'_tags :: Lens.Lens' CreatePartnerInput' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPartnerInput'_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePartnerInput' -> f CreatePartnerInput'
createPartnerInput'_tags = (CreatePartnerInput' -> Maybe (HashMap Text Text))
-> (CreatePartnerInput'
-> Maybe (HashMap Text Text) -> CreatePartnerInput')
-> Lens
CreatePartnerInput'
CreatePartnerInput'
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePartnerInput'' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreatePartnerInput'
s@CreatePartnerInput'' {} Maybe (HashMap Text Text)
a -> CreatePartnerInput'
s {$sel:tags:CreatePartnerInput'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreatePartnerInput') ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePartnerInput' -> f CreatePartnerInput')
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePartnerInput'
-> f CreatePartnerInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createPartnerInput'_inputId :: Lens.Lens' CreatePartnerInput' Prelude.Text
createPartnerInput'_inputId :: (Text -> f Text) -> CreatePartnerInput' -> f CreatePartnerInput'
createPartnerInput'_inputId = (CreatePartnerInput' -> Text)
-> (CreatePartnerInput' -> Text -> CreatePartnerInput')
-> Lens CreatePartnerInput' CreatePartnerInput' Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePartnerInput'' {Text
inputId :: Text
$sel:inputId:CreatePartnerInput'' :: CreatePartnerInput' -> Text
inputId} -> Text
inputId) (\s :: CreatePartnerInput'
s@CreatePartnerInput'' {} Text
a -> CreatePartnerInput'
s {$sel:inputId:CreatePartnerInput'' :: Text
inputId = Text
a} :: CreatePartnerInput')
instance Core.AWSRequest CreatePartnerInput' where
type
AWSResponse CreatePartnerInput' =
CreatePartnerInputResponse
request :: CreatePartnerInput' -> Request CreatePartnerInput'
request = Service -> CreatePartnerInput' -> Request CreatePartnerInput'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreatePartnerInput'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreatePartnerInput')))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreatePartnerInput'))
-> Logger
-> Service
-> Proxy CreatePartnerInput'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreatePartnerInput')))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Input -> Int -> CreatePartnerInputResponse
CreatePartnerInputResponse'
(Maybe Input -> Int -> CreatePartnerInputResponse)
-> Either String (Maybe Input)
-> Either String (Int -> CreatePartnerInputResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Input)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"input")
Either String (Int -> CreatePartnerInputResponse)
-> Either String Int -> Either String CreatePartnerInputResponse
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 CreatePartnerInput'
instance Prelude.NFData CreatePartnerInput'
instance Core.ToHeaders CreatePartnerInput' where
toHeaders :: CreatePartnerInput' -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreatePartnerInput' -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreatePartnerInput' where
toJSON :: CreatePartnerInput' -> Value
toJSON CreatePartnerInput'' {Maybe Text
Maybe (HashMap Text Text)
Text
inputId :: Text
tags :: Maybe (HashMap Text Text)
requestId :: Maybe Text
$sel:inputId:CreatePartnerInput'' :: CreatePartnerInput' -> Text
$sel:tags:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe (HashMap Text Text)
$sel:requestId:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"requestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
requestId,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
]
)
instance Core.ToPath CreatePartnerInput' where
toPath :: CreatePartnerInput' -> ByteString
toPath CreatePartnerInput'' {Maybe Text
Maybe (HashMap Text Text)
Text
inputId :: Text
tags :: Maybe (HashMap Text Text)
requestId :: Maybe Text
$sel:inputId:CreatePartnerInput'' :: CreatePartnerInput' -> Text
$sel:tags:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe (HashMap Text Text)
$sel:requestId:CreatePartnerInput'' :: CreatePartnerInput' -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/prod/inputs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
inputId, ByteString
"/partners"]
instance Core.ToQuery CreatePartnerInput' where
toQuery :: CreatePartnerInput' -> QueryString
toQuery = QueryString -> CreatePartnerInput' -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreatePartnerInputResponse = CreatePartnerInputResponse'
{ CreatePartnerInputResponse -> Maybe Input
input :: Prelude.Maybe Input,
CreatePartnerInputResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool
(CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool)
-> (CreatePartnerInputResponse
-> CreatePartnerInputResponse -> Bool)
-> Eq CreatePartnerInputResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool
$c/= :: CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool
== :: CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool
$c== :: CreatePartnerInputResponse -> CreatePartnerInputResponse -> Bool
Prelude.Eq, ReadPrec [CreatePartnerInputResponse]
ReadPrec CreatePartnerInputResponse
Int -> ReadS CreatePartnerInputResponse
ReadS [CreatePartnerInputResponse]
(Int -> ReadS CreatePartnerInputResponse)
-> ReadS [CreatePartnerInputResponse]
-> ReadPrec CreatePartnerInputResponse
-> ReadPrec [CreatePartnerInputResponse]
-> Read CreatePartnerInputResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePartnerInputResponse]
$creadListPrec :: ReadPrec [CreatePartnerInputResponse]
readPrec :: ReadPrec CreatePartnerInputResponse
$creadPrec :: ReadPrec CreatePartnerInputResponse
readList :: ReadS [CreatePartnerInputResponse]
$creadList :: ReadS [CreatePartnerInputResponse]
readsPrec :: Int -> ReadS CreatePartnerInputResponse
$creadsPrec :: Int -> ReadS CreatePartnerInputResponse
Prelude.Read, Int -> CreatePartnerInputResponse -> ShowS
[CreatePartnerInputResponse] -> ShowS
CreatePartnerInputResponse -> String
(Int -> CreatePartnerInputResponse -> ShowS)
-> (CreatePartnerInputResponse -> String)
-> ([CreatePartnerInputResponse] -> ShowS)
-> Show CreatePartnerInputResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePartnerInputResponse] -> ShowS
$cshowList :: [CreatePartnerInputResponse] -> ShowS
show :: CreatePartnerInputResponse -> String
$cshow :: CreatePartnerInputResponse -> String
showsPrec :: Int -> CreatePartnerInputResponse -> ShowS
$cshowsPrec :: Int -> CreatePartnerInputResponse -> ShowS
Prelude.Show, (forall x.
CreatePartnerInputResponse -> Rep CreatePartnerInputResponse x)
-> (forall x.
Rep CreatePartnerInputResponse x -> CreatePartnerInputResponse)
-> Generic CreatePartnerInputResponse
forall x.
Rep CreatePartnerInputResponse x -> CreatePartnerInputResponse
forall x.
CreatePartnerInputResponse -> Rep CreatePartnerInputResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePartnerInputResponse x -> CreatePartnerInputResponse
$cfrom :: forall x.
CreatePartnerInputResponse -> Rep CreatePartnerInputResponse x
Prelude.Generic)
newCreatePartnerInputResponse ::
Prelude.Int ->
CreatePartnerInputResponse
newCreatePartnerInputResponse :: Int -> CreatePartnerInputResponse
newCreatePartnerInputResponse Int
pHttpStatus_ =
CreatePartnerInputResponse' :: Maybe Input -> Int -> CreatePartnerInputResponse
CreatePartnerInputResponse'
{ $sel:input:CreatePartnerInputResponse' :: Maybe Input
input =
Maybe Input
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreatePartnerInputResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createPartnerInputResponse_input :: Lens.Lens' CreatePartnerInputResponse (Prelude.Maybe Input)
createPartnerInputResponse_input :: (Maybe Input -> f (Maybe Input))
-> CreatePartnerInputResponse -> f CreatePartnerInputResponse
createPartnerInputResponse_input = (CreatePartnerInputResponse -> Maybe Input)
-> (CreatePartnerInputResponse
-> Maybe Input -> CreatePartnerInputResponse)
-> Lens
CreatePartnerInputResponse
CreatePartnerInputResponse
(Maybe Input)
(Maybe Input)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePartnerInputResponse' {Maybe Input
input :: Maybe Input
$sel:input:CreatePartnerInputResponse' :: CreatePartnerInputResponse -> Maybe Input
input} -> Maybe Input
input) (\s :: CreatePartnerInputResponse
s@CreatePartnerInputResponse' {} Maybe Input
a -> CreatePartnerInputResponse
s {$sel:input:CreatePartnerInputResponse' :: Maybe Input
input = Maybe Input
a} :: CreatePartnerInputResponse)
createPartnerInputResponse_httpStatus :: Lens.Lens' CreatePartnerInputResponse Prelude.Int
createPartnerInputResponse_httpStatus :: (Int -> f Int)
-> CreatePartnerInputResponse -> f CreatePartnerInputResponse
createPartnerInputResponse_httpStatus = (CreatePartnerInputResponse -> Int)
-> (CreatePartnerInputResponse
-> Int -> CreatePartnerInputResponse)
-> Lens
CreatePartnerInputResponse CreatePartnerInputResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePartnerInputResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreatePartnerInputResponse' :: CreatePartnerInputResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreatePartnerInputResponse
s@CreatePartnerInputResponse' {} Int
a -> CreatePartnerInputResponse
s {$sel:httpStatus:CreatePartnerInputResponse' :: Int
httpStatus = Int
a} :: CreatePartnerInputResponse)
instance Prelude.NFData CreatePartnerInputResponse