{-# 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.ArcZonalShift.GetManagedResource
(
GetManagedResource (..),
newGetManagedResource,
getManagedResource_resourceIdentifier,
GetManagedResourceResponse (..),
newGetManagedResourceResponse,
getManagedResourceResponse_arn,
getManagedResourceResponse_name,
getManagedResourceResponse_httpStatus,
getManagedResourceResponse_appliedWeights,
getManagedResourceResponse_zonalShifts,
)
where
import Amazonka.ArcZonalShift.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 GetManagedResource = GetManagedResource'
{
GetManagedResource -> Text
resourceIdentifier :: Prelude.Text
}
deriving (GetManagedResource -> GetManagedResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetManagedResource -> GetManagedResource -> Bool
$c/= :: GetManagedResource -> GetManagedResource -> Bool
== :: GetManagedResource -> GetManagedResource -> Bool
$c== :: GetManagedResource -> GetManagedResource -> Bool
Prelude.Eq, ReadPrec [GetManagedResource]
ReadPrec GetManagedResource
Int -> ReadS GetManagedResource
ReadS [GetManagedResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetManagedResource]
$creadListPrec :: ReadPrec [GetManagedResource]
readPrec :: ReadPrec GetManagedResource
$creadPrec :: ReadPrec GetManagedResource
readList :: ReadS [GetManagedResource]
$creadList :: ReadS [GetManagedResource]
readsPrec :: Int -> ReadS GetManagedResource
$creadsPrec :: Int -> ReadS GetManagedResource
Prelude.Read, Int -> GetManagedResource -> ShowS
[GetManagedResource] -> ShowS
GetManagedResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetManagedResource] -> ShowS
$cshowList :: [GetManagedResource] -> ShowS
show :: GetManagedResource -> String
$cshow :: GetManagedResource -> String
showsPrec :: Int -> GetManagedResource -> ShowS
$cshowsPrec :: Int -> GetManagedResource -> ShowS
Prelude.Show, forall x. Rep GetManagedResource x -> GetManagedResource
forall x. GetManagedResource -> Rep GetManagedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetManagedResource x -> GetManagedResource
$cfrom :: forall x. GetManagedResource -> Rep GetManagedResource x
Prelude.Generic)
newGetManagedResource ::
Prelude.Text ->
GetManagedResource
newGetManagedResource :: Text -> GetManagedResource
newGetManagedResource Text
pResourceIdentifier_ =
GetManagedResource'
{ $sel:resourceIdentifier:GetManagedResource' :: Text
resourceIdentifier =
Text
pResourceIdentifier_
}
getManagedResource_resourceIdentifier :: Lens.Lens' GetManagedResource Prelude.Text
getManagedResource_resourceIdentifier :: Lens' GetManagedResource Text
getManagedResource_resourceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResource' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:GetManagedResource' :: GetManagedResource -> Text
resourceIdentifier} -> Text
resourceIdentifier) (\s :: GetManagedResource
s@GetManagedResource' {} Text
a -> GetManagedResource
s {$sel:resourceIdentifier:GetManagedResource' :: Text
resourceIdentifier = Text
a} :: GetManagedResource)
instance Core.AWSRequest GetManagedResource where
type
AWSResponse GetManagedResource =
GetManagedResourceResponse
request :: (Service -> Service)
-> GetManagedResource -> Request GetManagedResource
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetManagedResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetManagedResource)))
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
-> Int
-> HashMap Text Double
-> [ZonalShiftInResource]
-> GetManagedResourceResponse
GetManagedResourceResponse'
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
"arn")
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
"name")
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))
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
"appliedWeights" 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"zonalShifts" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable GetManagedResource where
hashWithSalt :: Int -> GetManagedResource -> Int
hashWithSalt Int
_salt GetManagedResource' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:GetManagedResource' :: GetManagedResource -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceIdentifier
instance Prelude.NFData GetManagedResource where
rnf :: GetManagedResource -> ()
rnf GetManagedResource' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:GetManagedResource' :: GetManagedResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceIdentifier
instance Data.ToHeaders GetManagedResource where
toHeaders :: GetManagedResource -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetManagedResource where
toPath :: GetManagedResource -> ByteString
toPath GetManagedResource' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:GetManagedResource' :: GetManagedResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/managedresources/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceIdentifier]
instance Data.ToQuery GetManagedResource where
toQuery :: GetManagedResource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetManagedResourceResponse = GetManagedResourceResponse'
{
GetManagedResourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
GetManagedResourceResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetManagedResourceResponse -> Int
httpStatus :: Prelude.Int,
GetManagedResourceResponse -> HashMap Text Double
appliedWeights :: Prelude.HashMap Prelude.Text Prelude.Double,
GetManagedResourceResponse -> [ZonalShiftInResource]
zonalShifts :: [ZonalShiftInResource]
}
deriving (GetManagedResourceResponse -> GetManagedResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetManagedResourceResponse -> GetManagedResourceResponse -> Bool
$c/= :: GetManagedResourceResponse -> GetManagedResourceResponse -> Bool
== :: GetManagedResourceResponse -> GetManagedResourceResponse -> Bool
$c== :: GetManagedResourceResponse -> GetManagedResourceResponse -> Bool
Prelude.Eq, ReadPrec [GetManagedResourceResponse]
ReadPrec GetManagedResourceResponse
Int -> ReadS GetManagedResourceResponse
ReadS [GetManagedResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetManagedResourceResponse]
$creadListPrec :: ReadPrec [GetManagedResourceResponse]
readPrec :: ReadPrec GetManagedResourceResponse
$creadPrec :: ReadPrec GetManagedResourceResponse
readList :: ReadS [GetManagedResourceResponse]
$creadList :: ReadS [GetManagedResourceResponse]
readsPrec :: Int -> ReadS GetManagedResourceResponse
$creadsPrec :: Int -> ReadS GetManagedResourceResponse
Prelude.Read, Int -> GetManagedResourceResponse -> ShowS
[GetManagedResourceResponse] -> ShowS
GetManagedResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetManagedResourceResponse] -> ShowS
$cshowList :: [GetManagedResourceResponse] -> ShowS
show :: GetManagedResourceResponse -> String
$cshow :: GetManagedResourceResponse -> String
showsPrec :: Int -> GetManagedResourceResponse -> ShowS
$cshowsPrec :: Int -> GetManagedResourceResponse -> ShowS
Prelude.Show, forall x.
Rep GetManagedResourceResponse x -> GetManagedResourceResponse
forall x.
GetManagedResourceResponse -> Rep GetManagedResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetManagedResourceResponse x -> GetManagedResourceResponse
$cfrom :: forall x.
GetManagedResourceResponse -> Rep GetManagedResourceResponse x
Prelude.Generic)
newGetManagedResourceResponse ::
Prelude.Int ->
GetManagedResourceResponse
newGetManagedResourceResponse :: Int -> GetManagedResourceResponse
newGetManagedResourceResponse Int
pHttpStatus_ =
GetManagedResourceResponse'
{ $sel:arn:GetManagedResourceResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:name:GetManagedResourceResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetManagedResourceResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:appliedWeights:GetManagedResourceResponse' :: HashMap Text Double
appliedWeights = forall a. Monoid a => a
Prelude.mempty,
$sel:zonalShifts:GetManagedResourceResponse' :: [ZonalShiftInResource]
zonalShifts = forall a. Monoid a => a
Prelude.mempty
}
getManagedResourceResponse_arn :: Lens.Lens' GetManagedResourceResponse (Prelude.Maybe Prelude.Text)
getManagedResourceResponse_arn :: Lens' GetManagedResourceResponse (Maybe Text)
getManagedResourceResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResourceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetManagedResourceResponse' :: GetManagedResourceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetManagedResourceResponse
s@GetManagedResourceResponse' {} Maybe Text
a -> GetManagedResourceResponse
s {$sel:arn:GetManagedResourceResponse' :: Maybe Text
arn = Maybe Text
a} :: GetManagedResourceResponse)
getManagedResourceResponse_name :: Lens.Lens' GetManagedResourceResponse (Prelude.Maybe Prelude.Text)
getManagedResourceResponse_name :: Lens' GetManagedResourceResponse (Maybe Text)
getManagedResourceResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResourceResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetManagedResourceResponse' :: GetManagedResourceResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetManagedResourceResponse
s@GetManagedResourceResponse' {} Maybe Text
a -> GetManagedResourceResponse
s {$sel:name:GetManagedResourceResponse' :: Maybe Text
name = Maybe Text
a} :: GetManagedResourceResponse)
getManagedResourceResponse_httpStatus :: Lens.Lens' GetManagedResourceResponse Prelude.Int
getManagedResourceResponse_httpStatus :: Lens' GetManagedResourceResponse Int
getManagedResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetManagedResourceResponse' :: GetManagedResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetManagedResourceResponse
s@GetManagedResourceResponse' {} Int
a -> GetManagedResourceResponse
s {$sel:httpStatus:GetManagedResourceResponse' :: Int
httpStatus = Int
a} :: GetManagedResourceResponse)
getManagedResourceResponse_appliedWeights :: Lens.Lens' GetManagedResourceResponse (Prelude.HashMap Prelude.Text Prelude.Double)
getManagedResourceResponse_appliedWeights :: Lens' GetManagedResourceResponse (HashMap Text Double)
getManagedResourceResponse_appliedWeights = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResourceResponse' {HashMap Text Double
appliedWeights :: HashMap Text Double
$sel:appliedWeights:GetManagedResourceResponse' :: GetManagedResourceResponse -> HashMap Text Double
appliedWeights} -> HashMap Text Double
appliedWeights) (\s :: GetManagedResourceResponse
s@GetManagedResourceResponse' {} HashMap Text Double
a -> GetManagedResourceResponse
s {$sel:appliedWeights:GetManagedResourceResponse' :: HashMap Text Double
appliedWeights = HashMap Text Double
a} :: GetManagedResourceResponse) 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
getManagedResourceResponse_zonalShifts :: Lens.Lens' GetManagedResourceResponse [ZonalShiftInResource]
getManagedResourceResponse_zonalShifts :: Lens' GetManagedResourceResponse [ZonalShiftInResource]
getManagedResourceResponse_zonalShifts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetManagedResourceResponse' {[ZonalShiftInResource]
zonalShifts :: [ZonalShiftInResource]
$sel:zonalShifts:GetManagedResourceResponse' :: GetManagedResourceResponse -> [ZonalShiftInResource]
zonalShifts} -> [ZonalShiftInResource]
zonalShifts) (\s :: GetManagedResourceResponse
s@GetManagedResourceResponse' {} [ZonalShiftInResource]
a -> GetManagedResourceResponse
s {$sel:zonalShifts:GetManagedResourceResponse' :: [ZonalShiftInResource]
zonalShifts = [ZonalShiftInResource]
a} :: GetManagedResourceResponse) 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 Prelude.NFData GetManagedResourceResponse where
rnf :: GetManagedResourceResponse -> ()
rnf GetManagedResourceResponse' {Int
[ZonalShiftInResource]
Maybe Text
HashMap Text Double
zonalShifts :: [ZonalShiftInResource]
appliedWeights :: HashMap Text Double
httpStatus :: Int
name :: Maybe Text
arn :: Maybe Text
$sel:zonalShifts:GetManagedResourceResponse' :: GetManagedResourceResponse -> [ZonalShiftInResource]
$sel:appliedWeights:GetManagedResourceResponse' :: GetManagedResourceResponse -> HashMap Text Double
$sel:httpStatus:GetManagedResourceResponse' :: GetManagedResourceResponse -> Int
$sel:name:GetManagedResourceResponse' :: GetManagedResourceResponse -> Maybe Text
$sel:arn:GetManagedResourceResponse' :: GetManagedResourceResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Double
appliedWeights
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ZonalShiftInResource]
zonalShifts