{-# 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.AppStream.AssociateApplicationToEntitlement
(
AssociateApplicationToEntitlement (..),
newAssociateApplicationToEntitlement,
associateApplicationToEntitlement_stackName,
associateApplicationToEntitlement_entitlementName,
associateApplicationToEntitlement_applicationIdentifier,
AssociateApplicationToEntitlementResponse (..),
newAssociateApplicationToEntitlementResponse,
associateApplicationToEntitlementResponse_httpStatus,
)
where
import Amazonka.AppStream.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateApplicationToEntitlement = AssociateApplicationToEntitlement'
{
AssociateApplicationToEntitlement -> Text
stackName :: Prelude.Text,
AssociateApplicationToEntitlement -> Text
entitlementName :: Prelude.Text,
AssociateApplicationToEntitlement -> Text
applicationIdentifier :: Prelude.Text
}
deriving (AssociateApplicationToEntitlement
-> AssociateApplicationToEntitlement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateApplicationToEntitlement
-> AssociateApplicationToEntitlement -> Bool
$c/= :: AssociateApplicationToEntitlement
-> AssociateApplicationToEntitlement -> Bool
== :: AssociateApplicationToEntitlement
-> AssociateApplicationToEntitlement -> Bool
$c== :: AssociateApplicationToEntitlement
-> AssociateApplicationToEntitlement -> Bool
Prelude.Eq, ReadPrec [AssociateApplicationToEntitlement]
ReadPrec AssociateApplicationToEntitlement
Int -> ReadS AssociateApplicationToEntitlement
ReadS [AssociateApplicationToEntitlement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateApplicationToEntitlement]
$creadListPrec :: ReadPrec [AssociateApplicationToEntitlement]
readPrec :: ReadPrec AssociateApplicationToEntitlement
$creadPrec :: ReadPrec AssociateApplicationToEntitlement
readList :: ReadS [AssociateApplicationToEntitlement]
$creadList :: ReadS [AssociateApplicationToEntitlement]
readsPrec :: Int -> ReadS AssociateApplicationToEntitlement
$creadsPrec :: Int -> ReadS AssociateApplicationToEntitlement
Prelude.Read, Int -> AssociateApplicationToEntitlement -> ShowS
[AssociateApplicationToEntitlement] -> ShowS
AssociateApplicationToEntitlement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateApplicationToEntitlement] -> ShowS
$cshowList :: [AssociateApplicationToEntitlement] -> ShowS
show :: AssociateApplicationToEntitlement -> String
$cshow :: AssociateApplicationToEntitlement -> String
showsPrec :: Int -> AssociateApplicationToEntitlement -> ShowS
$cshowsPrec :: Int -> AssociateApplicationToEntitlement -> ShowS
Prelude.Show, forall x.
Rep AssociateApplicationToEntitlement x
-> AssociateApplicationToEntitlement
forall x.
AssociateApplicationToEntitlement
-> Rep AssociateApplicationToEntitlement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateApplicationToEntitlement x
-> AssociateApplicationToEntitlement
$cfrom :: forall x.
AssociateApplicationToEntitlement
-> Rep AssociateApplicationToEntitlement x
Prelude.Generic)
newAssociateApplicationToEntitlement ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AssociateApplicationToEntitlement
newAssociateApplicationToEntitlement :: Text -> Text -> Text -> AssociateApplicationToEntitlement
newAssociateApplicationToEntitlement
Text
pStackName_
Text
pEntitlementName_
Text
pApplicationIdentifier_ =
AssociateApplicationToEntitlement'
{ $sel:stackName:AssociateApplicationToEntitlement' :: Text
stackName =
Text
pStackName_,
$sel:entitlementName:AssociateApplicationToEntitlement' :: Text
entitlementName = Text
pEntitlementName_,
$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: Text
applicationIdentifier =
Text
pApplicationIdentifier_
}
associateApplicationToEntitlement_stackName :: Lens.Lens' AssociateApplicationToEntitlement Prelude.Text
associateApplicationToEntitlement_stackName :: Lens' AssociateApplicationToEntitlement Text
associateApplicationToEntitlement_stackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApplicationToEntitlement' {Text
stackName :: Text
$sel:stackName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
stackName} -> Text
stackName) (\s :: AssociateApplicationToEntitlement
s@AssociateApplicationToEntitlement' {} Text
a -> AssociateApplicationToEntitlement
s {$sel:stackName:AssociateApplicationToEntitlement' :: Text
stackName = Text
a} :: AssociateApplicationToEntitlement)
associateApplicationToEntitlement_entitlementName :: Lens.Lens' AssociateApplicationToEntitlement Prelude.Text
associateApplicationToEntitlement_entitlementName :: Lens' AssociateApplicationToEntitlement Text
associateApplicationToEntitlement_entitlementName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApplicationToEntitlement' {Text
entitlementName :: Text
$sel:entitlementName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
entitlementName} -> Text
entitlementName) (\s :: AssociateApplicationToEntitlement
s@AssociateApplicationToEntitlement' {} Text
a -> AssociateApplicationToEntitlement
s {$sel:entitlementName:AssociateApplicationToEntitlement' :: Text
entitlementName = Text
a} :: AssociateApplicationToEntitlement)
associateApplicationToEntitlement_applicationIdentifier :: Lens.Lens' AssociateApplicationToEntitlement Prelude.Text
associateApplicationToEntitlement_applicationIdentifier :: Lens' AssociateApplicationToEntitlement Text
associateApplicationToEntitlement_applicationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApplicationToEntitlement' {Text
applicationIdentifier :: Text
$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
applicationIdentifier} -> Text
applicationIdentifier) (\s :: AssociateApplicationToEntitlement
s@AssociateApplicationToEntitlement' {} Text
a -> AssociateApplicationToEntitlement
s {$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: Text
applicationIdentifier = Text
a} :: AssociateApplicationToEntitlement)
instance
Core.AWSRequest
AssociateApplicationToEntitlement
where
type
AWSResponse AssociateApplicationToEntitlement =
AssociateApplicationToEntitlementResponse
request :: (Service -> Service)
-> AssociateApplicationToEntitlement
-> Request AssociateApplicationToEntitlement
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociateApplicationToEntitlement
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateApplicationToEntitlement)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AssociateApplicationToEntitlementResponse
AssociateApplicationToEntitlementResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
AssociateApplicationToEntitlement
where
hashWithSalt :: Int -> AssociateApplicationToEntitlement -> Int
hashWithSalt
Int
_salt
AssociateApplicationToEntitlement' {Text
applicationIdentifier :: Text
entitlementName :: Text
stackName :: Text
$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:entitlementName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:stackName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entitlementName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationIdentifier
instance
Prelude.NFData
AssociateApplicationToEntitlement
where
rnf :: AssociateApplicationToEntitlement -> ()
rnf AssociateApplicationToEntitlement' {Text
applicationIdentifier :: Text
entitlementName :: Text
stackName :: Text
$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:entitlementName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:stackName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
stackName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entitlementName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationIdentifier
instance
Data.ToHeaders
AssociateApplicationToEntitlement
where
toHeaders :: AssociateApplicationToEntitlement -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"PhotonAdminProxyService.AssociateApplicationToEntitlement" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Data.ToJSON
AssociateApplicationToEntitlement
where
toJSON :: AssociateApplicationToEntitlement -> Value
toJSON AssociateApplicationToEntitlement' {Text
applicationIdentifier :: Text
entitlementName :: Text
stackName :: Text
$sel:applicationIdentifier:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:entitlementName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
$sel:stackName:AssociateApplicationToEntitlement' :: AssociateApplicationToEntitlement -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"StackName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stackName),
forall a. a -> Maybe a
Prelude.Just
(Key
"EntitlementName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entitlementName),
forall a. a -> Maybe a
Prelude.Just
( Key
"ApplicationIdentifier"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
applicationIdentifier
)
]
)
instance
Data.ToPath
AssociateApplicationToEntitlement
where
toPath :: AssociateApplicationToEntitlement -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
AssociateApplicationToEntitlement
where
toQuery :: AssociateApplicationToEntitlement -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateApplicationToEntitlementResponse = AssociateApplicationToEntitlementResponse'
{
AssociateApplicationToEntitlementResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateApplicationToEntitlementResponse
-> AssociateApplicationToEntitlementResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateApplicationToEntitlementResponse
-> AssociateApplicationToEntitlementResponse -> Bool
$c/= :: AssociateApplicationToEntitlementResponse
-> AssociateApplicationToEntitlementResponse -> Bool
== :: AssociateApplicationToEntitlementResponse
-> AssociateApplicationToEntitlementResponse -> Bool
$c== :: AssociateApplicationToEntitlementResponse
-> AssociateApplicationToEntitlementResponse -> Bool
Prelude.Eq, ReadPrec [AssociateApplicationToEntitlementResponse]
ReadPrec AssociateApplicationToEntitlementResponse
Int -> ReadS AssociateApplicationToEntitlementResponse
ReadS [AssociateApplicationToEntitlementResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateApplicationToEntitlementResponse]
$creadListPrec :: ReadPrec [AssociateApplicationToEntitlementResponse]
readPrec :: ReadPrec AssociateApplicationToEntitlementResponse
$creadPrec :: ReadPrec AssociateApplicationToEntitlementResponse
readList :: ReadS [AssociateApplicationToEntitlementResponse]
$creadList :: ReadS [AssociateApplicationToEntitlementResponse]
readsPrec :: Int -> ReadS AssociateApplicationToEntitlementResponse
$creadsPrec :: Int -> ReadS AssociateApplicationToEntitlementResponse
Prelude.Read, Int -> AssociateApplicationToEntitlementResponse -> ShowS
[AssociateApplicationToEntitlementResponse] -> ShowS
AssociateApplicationToEntitlementResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateApplicationToEntitlementResponse] -> ShowS
$cshowList :: [AssociateApplicationToEntitlementResponse] -> ShowS
show :: AssociateApplicationToEntitlementResponse -> String
$cshow :: AssociateApplicationToEntitlementResponse -> String
showsPrec :: Int -> AssociateApplicationToEntitlementResponse -> ShowS
$cshowsPrec :: Int -> AssociateApplicationToEntitlementResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateApplicationToEntitlementResponse x
-> AssociateApplicationToEntitlementResponse
forall x.
AssociateApplicationToEntitlementResponse
-> Rep AssociateApplicationToEntitlementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateApplicationToEntitlementResponse x
-> AssociateApplicationToEntitlementResponse
$cfrom :: forall x.
AssociateApplicationToEntitlementResponse
-> Rep AssociateApplicationToEntitlementResponse x
Prelude.Generic)
newAssociateApplicationToEntitlementResponse ::
Prelude.Int ->
AssociateApplicationToEntitlementResponse
newAssociateApplicationToEntitlementResponse :: Int -> AssociateApplicationToEntitlementResponse
newAssociateApplicationToEntitlementResponse
Int
pHttpStatus_ =
AssociateApplicationToEntitlementResponse'
{ $sel:httpStatus:AssociateApplicationToEntitlementResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateApplicationToEntitlementResponse_httpStatus :: Lens.Lens' AssociateApplicationToEntitlementResponse Prelude.Int
associateApplicationToEntitlementResponse_httpStatus :: Lens' AssociateApplicationToEntitlementResponse Int
associateApplicationToEntitlementResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateApplicationToEntitlementResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateApplicationToEntitlementResponse' :: AssociateApplicationToEntitlementResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateApplicationToEntitlementResponse
s@AssociateApplicationToEntitlementResponse' {} Int
a -> AssociateApplicationToEntitlementResponse
s {$sel:httpStatus:AssociateApplicationToEntitlementResponse' :: Int
httpStatus = Int
a} :: AssociateApplicationToEntitlementResponse)
instance
Prelude.NFData
AssociateApplicationToEntitlementResponse
where
rnf :: AssociateApplicationToEntitlementResponse -> ()
rnf AssociateApplicationToEntitlementResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateApplicationToEntitlementResponse' :: AssociateApplicationToEntitlementResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus