{-# 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.GetHypervisorPropertyMappings
(
GetHypervisorPropertyMappings (..),
newGetHypervisorPropertyMappings,
getHypervisorPropertyMappings_hypervisorArn,
GetHypervisorPropertyMappingsResponse (..),
newGetHypervisorPropertyMappingsResponse,
getHypervisorPropertyMappingsResponse_hypervisorArn,
getHypervisorPropertyMappingsResponse_iamRoleArn,
getHypervisorPropertyMappingsResponse_vmwareToAwsTagMappings,
getHypervisorPropertyMappingsResponse_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 GetHypervisorPropertyMappings = GetHypervisorPropertyMappings'
{
GetHypervisorPropertyMappings -> Text
hypervisorArn :: Prelude.Text
}
deriving (GetHypervisorPropertyMappings
-> GetHypervisorPropertyMappings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHypervisorPropertyMappings
-> GetHypervisorPropertyMappings -> Bool
$c/= :: GetHypervisorPropertyMappings
-> GetHypervisorPropertyMappings -> Bool
== :: GetHypervisorPropertyMappings
-> GetHypervisorPropertyMappings -> Bool
$c== :: GetHypervisorPropertyMappings
-> GetHypervisorPropertyMappings -> Bool
Prelude.Eq, ReadPrec [GetHypervisorPropertyMappings]
ReadPrec GetHypervisorPropertyMappings
Int -> ReadS GetHypervisorPropertyMappings
ReadS [GetHypervisorPropertyMappings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHypervisorPropertyMappings]
$creadListPrec :: ReadPrec [GetHypervisorPropertyMappings]
readPrec :: ReadPrec GetHypervisorPropertyMappings
$creadPrec :: ReadPrec GetHypervisorPropertyMappings
readList :: ReadS [GetHypervisorPropertyMappings]
$creadList :: ReadS [GetHypervisorPropertyMappings]
readsPrec :: Int -> ReadS GetHypervisorPropertyMappings
$creadsPrec :: Int -> ReadS GetHypervisorPropertyMappings
Prelude.Read, Int -> GetHypervisorPropertyMappings -> ShowS
[GetHypervisorPropertyMappings] -> ShowS
GetHypervisorPropertyMappings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHypervisorPropertyMappings] -> ShowS
$cshowList :: [GetHypervisorPropertyMappings] -> ShowS
show :: GetHypervisorPropertyMappings -> String
$cshow :: GetHypervisorPropertyMappings -> String
showsPrec :: Int -> GetHypervisorPropertyMappings -> ShowS
$cshowsPrec :: Int -> GetHypervisorPropertyMappings -> ShowS
Prelude.Show, forall x.
Rep GetHypervisorPropertyMappings x
-> GetHypervisorPropertyMappings
forall x.
GetHypervisorPropertyMappings
-> Rep GetHypervisorPropertyMappings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetHypervisorPropertyMappings x
-> GetHypervisorPropertyMappings
$cfrom :: forall x.
GetHypervisorPropertyMappings
-> Rep GetHypervisorPropertyMappings x
Prelude.Generic)
newGetHypervisorPropertyMappings ::
Prelude.Text ->
GetHypervisorPropertyMappings
newGetHypervisorPropertyMappings :: Text -> GetHypervisorPropertyMappings
newGetHypervisorPropertyMappings Text
pHypervisorArn_ =
GetHypervisorPropertyMappings'
{ $sel:hypervisorArn:GetHypervisorPropertyMappings' :: Text
hypervisorArn =
Text
pHypervisorArn_
}
getHypervisorPropertyMappings_hypervisorArn :: Lens.Lens' GetHypervisorPropertyMappings Prelude.Text
getHypervisorPropertyMappings_hypervisorArn :: Lens' GetHypervisorPropertyMappings Text
getHypervisorPropertyMappings_hypervisorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHypervisorPropertyMappings' {Text
hypervisorArn :: Text
$sel:hypervisorArn:GetHypervisorPropertyMappings' :: GetHypervisorPropertyMappings -> Text
hypervisorArn} -> Text
hypervisorArn) (\s :: GetHypervisorPropertyMappings
s@GetHypervisorPropertyMappings' {} Text
a -> GetHypervisorPropertyMappings
s {$sel:hypervisorArn:GetHypervisorPropertyMappings' :: Text
hypervisorArn = Text
a} :: GetHypervisorPropertyMappings)
instance
Core.AWSRequest
GetHypervisorPropertyMappings
where
type
AWSResponse GetHypervisorPropertyMappings =
GetHypervisorPropertyMappingsResponse
request :: (Service -> Service)
-> GetHypervisorPropertyMappings
-> Request GetHypervisorPropertyMappings
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 GetHypervisorPropertyMappings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetHypervisorPropertyMappings)))
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
-> Maybe Text
-> Maybe [VmwareToAwsTagMapping]
-> Int
-> GetHypervisorPropertyMappingsResponse
GetHypervisorPropertyMappingsResponse'
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"IamRoleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VmwareToAwsTagMappings"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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
GetHypervisorPropertyMappings
where
hashWithSalt :: Int -> GetHypervisorPropertyMappings -> Int
hashWithSalt Int
_salt GetHypervisorPropertyMappings' {Text
hypervisorArn :: Text
$sel:hypervisorArn:GetHypervisorPropertyMappings' :: GetHypervisorPropertyMappings -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hypervisorArn
instance Prelude.NFData GetHypervisorPropertyMappings where
rnf :: GetHypervisorPropertyMappings -> ()
rnf GetHypervisorPropertyMappings' {Text
hypervisorArn :: Text
$sel:hypervisorArn:GetHypervisorPropertyMappings' :: GetHypervisorPropertyMappings -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
hypervisorArn
instance Data.ToHeaders GetHypervisorPropertyMappings where
toHeaders :: GetHypervisorPropertyMappings -> 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.GetHypervisorPropertyMappings" ::
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 GetHypervisorPropertyMappings where
toJSON :: GetHypervisorPropertyMappings -> Value
toJSON GetHypervisorPropertyMappings' {Text
hypervisorArn :: Text
$sel:hypervisorArn:GetHypervisorPropertyMappings' :: GetHypervisorPropertyMappings -> 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)
]
)
instance Data.ToPath GetHypervisorPropertyMappings where
toPath :: GetHypervisorPropertyMappings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetHypervisorPropertyMappings where
toQuery :: GetHypervisorPropertyMappings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetHypervisorPropertyMappingsResponse = GetHypervisorPropertyMappingsResponse'
{
GetHypervisorPropertyMappingsResponse -> Maybe Text
hypervisorArn :: Prelude.Maybe Prelude.Text,
GetHypervisorPropertyMappingsResponse -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
GetHypervisorPropertyMappingsResponse
-> Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings :: Prelude.Maybe [VmwareToAwsTagMapping],
GetHypervisorPropertyMappingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetHypervisorPropertyMappingsResponse
-> GetHypervisorPropertyMappingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHypervisorPropertyMappingsResponse
-> GetHypervisorPropertyMappingsResponse -> Bool
$c/= :: GetHypervisorPropertyMappingsResponse
-> GetHypervisorPropertyMappingsResponse -> Bool
== :: GetHypervisorPropertyMappingsResponse
-> GetHypervisorPropertyMappingsResponse -> Bool
$c== :: GetHypervisorPropertyMappingsResponse
-> GetHypervisorPropertyMappingsResponse -> Bool
Prelude.Eq, ReadPrec [GetHypervisorPropertyMappingsResponse]
ReadPrec GetHypervisorPropertyMappingsResponse
Int -> ReadS GetHypervisorPropertyMappingsResponse
ReadS [GetHypervisorPropertyMappingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHypervisorPropertyMappingsResponse]
$creadListPrec :: ReadPrec [GetHypervisorPropertyMappingsResponse]
readPrec :: ReadPrec GetHypervisorPropertyMappingsResponse
$creadPrec :: ReadPrec GetHypervisorPropertyMappingsResponse
readList :: ReadS [GetHypervisorPropertyMappingsResponse]
$creadList :: ReadS [GetHypervisorPropertyMappingsResponse]
readsPrec :: Int -> ReadS GetHypervisorPropertyMappingsResponse
$creadsPrec :: Int -> ReadS GetHypervisorPropertyMappingsResponse
Prelude.Read, Int -> GetHypervisorPropertyMappingsResponse -> ShowS
[GetHypervisorPropertyMappingsResponse] -> ShowS
GetHypervisorPropertyMappingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHypervisorPropertyMappingsResponse] -> ShowS
$cshowList :: [GetHypervisorPropertyMappingsResponse] -> ShowS
show :: GetHypervisorPropertyMappingsResponse -> String
$cshow :: GetHypervisorPropertyMappingsResponse -> String
showsPrec :: Int -> GetHypervisorPropertyMappingsResponse -> ShowS
$cshowsPrec :: Int -> GetHypervisorPropertyMappingsResponse -> ShowS
Prelude.Show, forall x.
Rep GetHypervisorPropertyMappingsResponse x
-> GetHypervisorPropertyMappingsResponse
forall x.
GetHypervisorPropertyMappingsResponse
-> Rep GetHypervisorPropertyMappingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetHypervisorPropertyMappingsResponse x
-> GetHypervisorPropertyMappingsResponse
$cfrom :: forall x.
GetHypervisorPropertyMappingsResponse
-> Rep GetHypervisorPropertyMappingsResponse x
Prelude.Generic)
newGetHypervisorPropertyMappingsResponse ::
Prelude.Int ->
GetHypervisorPropertyMappingsResponse
newGetHypervisorPropertyMappingsResponse :: Int -> GetHypervisorPropertyMappingsResponse
newGetHypervisorPropertyMappingsResponse Int
pHttpStatus_ =
GetHypervisorPropertyMappingsResponse'
{ $sel:hypervisorArn:GetHypervisorPropertyMappingsResponse' :: Maybe Text
hypervisorArn =
forall a. Maybe a
Prelude.Nothing,
$sel:iamRoleArn:GetHypervisorPropertyMappingsResponse' :: Maybe Text
iamRoleArn = forall a. Maybe a
Prelude.Nothing,
$sel:vmwareToAwsTagMappings:GetHypervisorPropertyMappingsResponse' :: Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetHypervisorPropertyMappingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getHypervisorPropertyMappingsResponse_hypervisorArn :: Lens.Lens' GetHypervisorPropertyMappingsResponse (Prelude.Maybe Prelude.Text)
getHypervisorPropertyMappingsResponse_hypervisorArn :: Lens' GetHypervisorPropertyMappingsResponse (Maybe Text)
getHypervisorPropertyMappingsResponse_hypervisorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHypervisorPropertyMappingsResponse' {Maybe Text
hypervisorArn :: Maybe Text
$sel:hypervisorArn:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> Maybe Text
hypervisorArn} -> Maybe Text
hypervisorArn) (\s :: GetHypervisorPropertyMappingsResponse
s@GetHypervisorPropertyMappingsResponse' {} Maybe Text
a -> GetHypervisorPropertyMappingsResponse
s {$sel:hypervisorArn:GetHypervisorPropertyMappingsResponse' :: Maybe Text
hypervisorArn = Maybe Text
a} :: GetHypervisorPropertyMappingsResponse)
getHypervisorPropertyMappingsResponse_iamRoleArn :: Lens.Lens' GetHypervisorPropertyMappingsResponse (Prelude.Maybe Prelude.Text)
getHypervisorPropertyMappingsResponse_iamRoleArn :: Lens' GetHypervisorPropertyMappingsResponse (Maybe Text)
getHypervisorPropertyMappingsResponse_iamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHypervisorPropertyMappingsResponse' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: GetHypervisorPropertyMappingsResponse
s@GetHypervisorPropertyMappingsResponse' {} Maybe Text
a -> GetHypervisorPropertyMappingsResponse
s {$sel:iamRoleArn:GetHypervisorPropertyMappingsResponse' :: Maybe Text
iamRoleArn = Maybe Text
a} :: GetHypervisorPropertyMappingsResponse)
getHypervisorPropertyMappingsResponse_vmwareToAwsTagMappings :: Lens.Lens' GetHypervisorPropertyMappingsResponse (Prelude.Maybe [VmwareToAwsTagMapping])
getHypervisorPropertyMappingsResponse_vmwareToAwsTagMappings :: Lens'
GetHypervisorPropertyMappingsResponse
(Maybe [VmwareToAwsTagMapping])
getHypervisorPropertyMappingsResponse_vmwareToAwsTagMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHypervisorPropertyMappingsResponse' {Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings :: Maybe [VmwareToAwsTagMapping]
$sel:vmwareToAwsTagMappings:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse
-> Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings} -> Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings) (\s :: GetHypervisorPropertyMappingsResponse
s@GetHypervisorPropertyMappingsResponse' {} Maybe [VmwareToAwsTagMapping]
a -> GetHypervisorPropertyMappingsResponse
s {$sel:vmwareToAwsTagMappings:GetHypervisorPropertyMappingsResponse' :: Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings = Maybe [VmwareToAwsTagMapping]
a} :: GetHypervisorPropertyMappingsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getHypervisorPropertyMappingsResponse_httpStatus :: Lens.Lens' GetHypervisorPropertyMappingsResponse Prelude.Int
getHypervisorPropertyMappingsResponse_httpStatus :: Lens' GetHypervisorPropertyMappingsResponse Int
getHypervisorPropertyMappingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHypervisorPropertyMappingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetHypervisorPropertyMappingsResponse
s@GetHypervisorPropertyMappingsResponse' {} Int
a -> GetHypervisorPropertyMappingsResponse
s {$sel:httpStatus:GetHypervisorPropertyMappingsResponse' :: Int
httpStatus = Int
a} :: GetHypervisorPropertyMappingsResponse)
instance
Prelude.NFData
GetHypervisorPropertyMappingsResponse
where
rnf :: GetHypervisorPropertyMappingsResponse -> ()
rnf GetHypervisorPropertyMappingsResponse' {Int
Maybe [VmwareToAwsTagMapping]
Maybe Text
httpStatus :: Int
vmwareToAwsTagMappings :: Maybe [VmwareToAwsTagMapping]
iamRoleArn :: Maybe Text
hypervisorArn :: Maybe Text
$sel:httpStatus:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> Int
$sel:vmwareToAwsTagMappings:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse
-> Maybe [VmwareToAwsTagMapping]
$sel:iamRoleArn:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> Maybe Text
$sel:hypervisorArn:GetHypervisorPropertyMappingsResponse' :: GetHypervisorPropertyMappingsResponse -> 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 Maybe Text
iamRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VmwareToAwsTagMapping]
vmwareToAwsTagMappings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus