{-# 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.BackupGateway.PutHypervisorPropertyMappings
(
PutHypervisorPropertyMappings (..),
newPutHypervisorPropertyMappings,
putHypervisorPropertyMappings_hypervisorArn,
putHypervisorPropertyMappings_iamRoleArn,
putHypervisorPropertyMappings_vmwareToAwsTagMappings,
PutHypervisorPropertyMappingsResponse (..),
newPutHypervisorPropertyMappingsResponse,
putHypervisorPropertyMappingsResponse_hypervisorArn,
putHypervisorPropertyMappingsResponse_httpStatus,
)
where
import Amazonka.BackupGateway.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 PutHypervisorPropertyMappings = PutHypervisorPropertyMappings'
{
PutHypervisorPropertyMappings -> Text
hypervisorArn :: Prelude.Text,
PutHypervisorPropertyMappings -> Text
iamRoleArn :: Prelude.Text,
PutHypervisorPropertyMappings -> [VmwareToAwsTagMapping]
vmwareToAwsTagMappings :: [VmwareToAwsTagMapping]
}
deriving (PutHypervisorPropertyMappings
-> PutHypervisorPropertyMappings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutHypervisorPropertyMappings
-> PutHypervisorPropertyMappings -> Bool
$c/= :: PutHypervisorPropertyMappings
-> PutHypervisorPropertyMappings -> Bool
== :: PutHypervisorPropertyMappings
-> PutHypervisorPropertyMappings -> Bool
$c== :: PutHypervisorPropertyMappings
-> PutHypervisorPropertyMappings -> Bool
Prelude.Eq, ReadPrec [PutHypervisorPropertyMappings]
ReadPrec PutHypervisorPropertyMappings
Int -> ReadS PutHypervisorPropertyMappings
ReadS [PutHypervisorPropertyMappings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutHypervisorPropertyMappings]
$creadListPrec :: ReadPrec [PutHypervisorPropertyMappings]
readPrec :: ReadPrec PutHypervisorPropertyMappings
$creadPrec :: ReadPrec PutHypervisorPropertyMappings
readList :: ReadS [PutHypervisorPropertyMappings]
$creadList :: ReadS [PutHypervisorPropertyMappings]
readsPrec :: Int -> ReadS PutHypervisorPropertyMappings
$creadsPrec :: Int -> ReadS PutHypervisorPropertyMappings
Prelude.Read, Int -> PutHypervisorPropertyMappings -> ShowS
[PutHypervisorPropertyMappings] -> ShowS
PutHypervisorPropertyMappings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutHypervisorPropertyMappings] -> ShowS
$cshowList :: [PutHypervisorPropertyMappings] -> ShowS
show :: PutHypervisorPropertyMappings -> String
$cshow :: PutHypervisorPropertyMappings -> String
showsPrec :: Int -> PutHypervisorPropertyMappings -> ShowS
$cshowsPrec :: Int -> PutHypervisorPropertyMappings -> ShowS
Prelude.Show, forall x.
Rep PutHypervisorPropertyMappings x
-> PutHypervisorPropertyMappings
forall x.
PutHypervisorPropertyMappings
-> Rep PutHypervisorPropertyMappings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutHypervisorPropertyMappings x
-> PutHypervisorPropertyMappings
$cfrom :: forall x.
PutHypervisorPropertyMappings
-> Rep PutHypervisorPropertyMappings x
Prelude.Generic)
newPutHypervisorPropertyMappings ::
Prelude.Text ->
Prelude.Text ->
PutHypervisorPropertyMappings
newPutHypervisorPropertyMappings :: Text -> Text -> PutHypervisorPropertyMappings
newPutHypervisorPropertyMappings
Text
pHypervisorArn_
Text
pIamRoleArn_ =
PutHypervisorPropertyMappings'
{ $sel:hypervisorArn:PutHypervisorPropertyMappings' :: Text
hypervisorArn =
Text
pHypervisorArn_,
$sel:iamRoleArn:PutHypervisorPropertyMappings' :: Text
iamRoleArn = Text
pIamRoleArn_,
$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: [VmwareToAwsTagMapping]
vmwareToAwsTagMappings = forall a. Monoid a => a
Prelude.mempty
}
putHypervisorPropertyMappings_hypervisorArn :: Lens.Lens' PutHypervisorPropertyMappings Prelude.Text
putHypervisorPropertyMappings_hypervisorArn :: Lens' PutHypervisorPropertyMappings Text
putHypervisorPropertyMappings_hypervisorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutHypervisorPropertyMappings' {Text
hypervisorArn :: Text
$sel:hypervisorArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
hypervisorArn} -> Text
hypervisorArn) (\s :: PutHypervisorPropertyMappings
s@PutHypervisorPropertyMappings' {} Text
a -> PutHypervisorPropertyMappings
s {$sel:hypervisorArn:PutHypervisorPropertyMappings' :: Text
hypervisorArn = Text
a} :: PutHypervisorPropertyMappings)
putHypervisorPropertyMappings_iamRoleArn :: Lens.Lens' PutHypervisorPropertyMappings Prelude.Text
putHypervisorPropertyMappings_iamRoleArn :: Lens' PutHypervisorPropertyMappings Text
putHypervisorPropertyMappings_iamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutHypervisorPropertyMappings' {Text
iamRoleArn :: Text
$sel:iamRoleArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: PutHypervisorPropertyMappings
s@PutHypervisorPropertyMappings' {} Text
a -> PutHypervisorPropertyMappings
s {$sel:iamRoleArn:PutHypervisorPropertyMappings' :: Text
iamRoleArn = Text
a} :: PutHypervisorPropertyMappings)
putHypervisorPropertyMappings_vmwareToAwsTagMappings :: Lens.Lens' PutHypervisorPropertyMappings [VmwareToAwsTagMapping]
putHypervisorPropertyMappings_vmwareToAwsTagMappings :: Lens' PutHypervisorPropertyMappings [VmwareToAwsTagMapping]
putHypervisorPropertyMappings_vmwareToAwsTagMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutHypervisorPropertyMappings' {[VmwareToAwsTagMapping]
vmwareToAwsTagMappings :: [VmwareToAwsTagMapping]
$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> [VmwareToAwsTagMapping]
vmwareToAwsTagMappings} -> [VmwareToAwsTagMapping]
vmwareToAwsTagMappings) (\s :: PutHypervisorPropertyMappings
s@PutHypervisorPropertyMappings' {} [VmwareToAwsTagMapping]
a -> PutHypervisorPropertyMappings
s {$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: [VmwareToAwsTagMapping]
vmwareToAwsTagMappings = [VmwareToAwsTagMapping]
a} :: PutHypervisorPropertyMappings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.AWSRequest
PutHypervisorPropertyMappings
where
type
AWSResponse PutHypervisorPropertyMappings =
PutHypervisorPropertyMappingsResponse
request :: (Service -> Service)
-> PutHypervisorPropertyMappings
-> Request PutHypervisorPropertyMappings
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 PutHypervisorPropertyMappings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutHypervisorPropertyMappings)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> PutHypervisorPropertyMappingsResponse
PutHypervisorPropertyMappingsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"HypervisorArn")
forall (f :: * -> *) a b. Applicative f => 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
PutHypervisorPropertyMappings
where
hashWithSalt :: Int -> PutHypervisorPropertyMappings -> Int
hashWithSalt Int
_salt PutHypervisorPropertyMappings' {[VmwareToAwsTagMapping]
Text
vmwareToAwsTagMappings :: [VmwareToAwsTagMapping]
iamRoleArn :: Text
hypervisorArn :: Text
$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> [VmwareToAwsTagMapping]
$sel:iamRoleArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
$sel:hypervisorArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hypervisorArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
iamRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [VmwareToAwsTagMapping]
vmwareToAwsTagMappings
instance Prelude.NFData PutHypervisorPropertyMappings where
rnf :: PutHypervisorPropertyMappings -> ()
rnf PutHypervisorPropertyMappings' {[VmwareToAwsTagMapping]
Text
vmwareToAwsTagMappings :: [VmwareToAwsTagMapping]
iamRoleArn :: Text
hypervisorArn :: Text
$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> [VmwareToAwsTagMapping]
$sel:iamRoleArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
$sel:hypervisorArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
hypervisorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
iamRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [VmwareToAwsTagMapping]
vmwareToAwsTagMappings
instance Data.ToHeaders PutHypervisorPropertyMappings where
toHeaders :: PutHypervisorPropertyMappings -> 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
"BackupOnPremises_v20210101.PutHypervisorPropertyMappings" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutHypervisorPropertyMappings where
toJSON :: PutHypervisorPropertyMappings -> Value
toJSON PutHypervisorPropertyMappings' {[VmwareToAwsTagMapping]
Text
vmwareToAwsTagMappings :: [VmwareToAwsTagMapping]
iamRoleArn :: Text
hypervisorArn :: Text
$sel:vmwareToAwsTagMappings:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> [VmwareToAwsTagMapping]
$sel:iamRoleArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
$sel:hypervisorArn:PutHypervisorPropertyMappings' :: PutHypervisorPropertyMappings -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"HypervisorArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hypervisorArn),
forall a. a -> Maybe a
Prelude.Just (Key
"IamRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
iamRoleArn),
forall a. a -> Maybe a
Prelude.Just
( Key
"VmwareToAwsTagMappings"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [VmwareToAwsTagMapping]
vmwareToAwsTagMappings
)
]
)
instance Data.ToPath PutHypervisorPropertyMappings where
toPath :: PutHypervisorPropertyMappings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutHypervisorPropertyMappings where
toQuery :: PutHypervisorPropertyMappings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutHypervisorPropertyMappingsResponse = PutHypervisorPropertyMappingsResponse'
{
PutHypervisorPropertyMappingsResponse -> Maybe Text
hypervisorArn :: Prelude.Maybe Prelude.Text,
PutHypervisorPropertyMappingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutHypervisorPropertyMappingsResponse
-> PutHypervisorPropertyMappingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutHypervisorPropertyMappingsResponse
-> PutHypervisorPropertyMappingsResponse -> Bool
$c/= :: PutHypervisorPropertyMappingsResponse
-> PutHypervisorPropertyMappingsResponse -> Bool
== :: PutHypervisorPropertyMappingsResponse
-> PutHypervisorPropertyMappingsResponse -> Bool
$c== :: PutHypervisorPropertyMappingsResponse
-> PutHypervisorPropertyMappingsResponse -> Bool
Prelude.Eq, ReadPrec [PutHypervisorPropertyMappingsResponse]
ReadPrec PutHypervisorPropertyMappingsResponse
Int -> ReadS PutHypervisorPropertyMappingsResponse
ReadS [PutHypervisorPropertyMappingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutHypervisorPropertyMappingsResponse]
$creadListPrec :: ReadPrec [PutHypervisorPropertyMappingsResponse]
readPrec :: ReadPrec PutHypervisorPropertyMappingsResponse
$creadPrec :: ReadPrec PutHypervisorPropertyMappingsResponse
readList :: ReadS [PutHypervisorPropertyMappingsResponse]
$creadList :: ReadS [PutHypervisorPropertyMappingsResponse]
readsPrec :: Int -> ReadS PutHypervisorPropertyMappingsResponse
$creadsPrec :: Int -> ReadS PutHypervisorPropertyMappingsResponse
Prelude.Read, Int -> PutHypervisorPropertyMappingsResponse -> ShowS
[PutHypervisorPropertyMappingsResponse] -> ShowS
PutHypervisorPropertyMappingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutHypervisorPropertyMappingsResponse] -> ShowS
$cshowList :: [PutHypervisorPropertyMappingsResponse] -> ShowS
show :: PutHypervisorPropertyMappingsResponse -> String
$cshow :: PutHypervisorPropertyMappingsResponse -> String
showsPrec :: Int -> PutHypervisorPropertyMappingsResponse -> ShowS
$cshowsPrec :: Int -> PutHypervisorPropertyMappingsResponse -> ShowS
Prelude.Show, forall x.
Rep PutHypervisorPropertyMappingsResponse x
-> PutHypervisorPropertyMappingsResponse
forall x.
PutHypervisorPropertyMappingsResponse
-> Rep PutHypervisorPropertyMappingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutHypervisorPropertyMappingsResponse x
-> PutHypervisorPropertyMappingsResponse
$cfrom :: forall x.
PutHypervisorPropertyMappingsResponse
-> Rep PutHypervisorPropertyMappingsResponse x
Prelude.Generic)
newPutHypervisorPropertyMappingsResponse ::
Prelude.Int ->
PutHypervisorPropertyMappingsResponse
newPutHypervisorPropertyMappingsResponse :: Int -> PutHypervisorPropertyMappingsResponse
newPutHypervisorPropertyMappingsResponse Int
pHttpStatus_ =
PutHypervisorPropertyMappingsResponse'
{ $sel:hypervisorArn:PutHypervisorPropertyMappingsResponse' :: Maybe Text
hypervisorArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutHypervisorPropertyMappingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putHypervisorPropertyMappingsResponse_hypervisorArn :: Lens.Lens' PutHypervisorPropertyMappingsResponse (Prelude.Maybe Prelude.Text)
putHypervisorPropertyMappingsResponse_hypervisorArn :: Lens' PutHypervisorPropertyMappingsResponse (Maybe Text)
putHypervisorPropertyMappingsResponse_hypervisorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutHypervisorPropertyMappingsResponse' {Maybe Text
hypervisorArn :: Maybe Text
$sel:hypervisorArn:PutHypervisorPropertyMappingsResponse' :: PutHypervisorPropertyMappingsResponse -> Maybe Text
hypervisorArn} -> Maybe Text
hypervisorArn) (\s :: PutHypervisorPropertyMappingsResponse
s@PutHypervisorPropertyMappingsResponse' {} Maybe Text
a -> PutHypervisorPropertyMappingsResponse
s {$sel:hypervisorArn:PutHypervisorPropertyMappingsResponse' :: Maybe Text
hypervisorArn = Maybe Text
a} :: PutHypervisorPropertyMappingsResponse)
putHypervisorPropertyMappingsResponse_httpStatus :: Lens.Lens' PutHypervisorPropertyMappingsResponse Prelude.Int
putHypervisorPropertyMappingsResponse_httpStatus :: Lens' PutHypervisorPropertyMappingsResponse Int
putHypervisorPropertyMappingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutHypervisorPropertyMappingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutHypervisorPropertyMappingsResponse' :: PutHypervisorPropertyMappingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutHypervisorPropertyMappingsResponse
s@PutHypervisorPropertyMappingsResponse' {} Int
a -> PutHypervisorPropertyMappingsResponse
s {$sel:httpStatus:PutHypervisorPropertyMappingsResponse' :: Int
httpStatus = Int
a} :: PutHypervisorPropertyMappingsResponse)
instance
Prelude.NFData
PutHypervisorPropertyMappingsResponse
where
rnf :: PutHypervisorPropertyMappingsResponse -> ()
rnf PutHypervisorPropertyMappingsResponse' {Int
Maybe Text
httpStatus :: Int
hypervisorArn :: Maybe Text
$sel:httpStatus:PutHypervisorPropertyMappingsResponse' :: PutHypervisorPropertyMappingsResponse -> Int
$sel:hypervisorArn:PutHypervisorPropertyMappingsResponse' :: PutHypervisorPropertyMappingsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hypervisorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus