{-# 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.IoTRoboRunner.GetDestination
(
GetDestination (..),
newGetDestination,
getDestination_id,
GetDestinationResponse (..),
newGetDestinationResponse,
getDestinationResponse_additionalFixedProperties,
getDestinationResponse_httpStatus,
getDestinationResponse_arn,
getDestinationResponse_id,
getDestinationResponse_name,
getDestinationResponse_site,
getDestinationResponse_createdAt,
getDestinationResponse_updatedAt,
getDestinationResponse_state,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTRoboRunner.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetDestination = GetDestination'
{ GetDestination -> Text
id :: Prelude.Text
}
deriving (GetDestination -> GetDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDestination -> GetDestination -> Bool
$c/= :: GetDestination -> GetDestination -> Bool
== :: GetDestination -> GetDestination -> Bool
$c== :: GetDestination -> GetDestination -> Bool
Prelude.Eq, ReadPrec [GetDestination]
ReadPrec GetDestination
Int -> ReadS GetDestination
ReadS [GetDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDestination]
$creadListPrec :: ReadPrec [GetDestination]
readPrec :: ReadPrec GetDestination
$creadPrec :: ReadPrec GetDestination
readList :: ReadS [GetDestination]
$creadList :: ReadS [GetDestination]
readsPrec :: Int -> ReadS GetDestination
$creadsPrec :: Int -> ReadS GetDestination
Prelude.Read, Int -> GetDestination -> ShowS
[GetDestination] -> ShowS
GetDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDestination] -> ShowS
$cshowList :: [GetDestination] -> ShowS
show :: GetDestination -> String
$cshow :: GetDestination -> String
showsPrec :: Int -> GetDestination -> ShowS
$cshowsPrec :: Int -> GetDestination -> ShowS
Prelude.Show, forall x. Rep GetDestination x -> GetDestination
forall x. GetDestination -> Rep GetDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDestination x -> GetDestination
$cfrom :: forall x. GetDestination -> Rep GetDestination x
Prelude.Generic)
newGetDestination ::
Prelude.Text ->
GetDestination
newGetDestination :: Text -> GetDestination
newGetDestination Text
pId_ = GetDestination' {$sel:id:GetDestination' :: Text
id = Text
pId_}
getDestination_id :: Lens.Lens' GetDestination Prelude.Text
getDestination_id :: Lens' GetDestination Text
getDestination_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestination' {Text
id :: Text
$sel:id:GetDestination' :: GetDestination -> Text
id} -> Text
id) (\s :: GetDestination
s@GetDestination' {} Text
a -> GetDestination
s {$sel:id:GetDestination' :: Text
id = Text
a} :: GetDestination)
instance Core.AWSRequest GetDestination where
type
AWSResponse GetDestination =
GetDestinationResponse
request :: (Service -> Service) -> GetDestination -> Request GetDestination
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 GetDestination
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDestination)))
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
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> DestinationState
-> GetDestinationResponse
GetDestinationResponse'
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
"additionalFixedProperties")
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 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 a
Data..:> Key
"id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"site")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"updatedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"state")
)
instance Prelude.Hashable GetDestination where
hashWithSalt :: Int -> GetDestination -> Int
hashWithSalt Int
_salt GetDestination' {Text
id :: Text
$sel:id:GetDestination' :: GetDestination -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData GetDestination where
rnf :: GetDestination -> ()
rnf GetDestination' {Text
id :: Text
$sel:id:GetDestination' :: GetDestination -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders GetDestination where
toHeaders :: GetDestination -> 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 GetDestination where
toPath :: GetDestination -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/getDestination"
instance Data.ToQuery GetDestination where
toQuery :: GetDestination -> QueryString
toQuery GetDestination' {Text
id :: Text
$sel:id:GetDestination' :: GetDestination -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"id" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
id]
data GetDestinationResponse = GetDestinationResponse'
{ GetDestinationResponse -> Maybe Text
additionalFixedProperties :: Prelude.Maybe Prelude.Text,
GetDestinationResponse -> Int
httpStatus :: Prelude.Int,
GetDestinationResponse -> Text
arn :: Prelude.Text,
GetDestinationResponse -> Text
id :: Prelude.Text,
GetDestinationResponse -> Text
name :: Prelude.Text,
GetDestinationResponse -> Text
site :: Prelude.Text,
GetDestinationResponse -> POSIX
createdAt :: Data.POSIX,
GetDestinationResponse -> POSIX
updatedAt :: Data.POSIX,
GetDestinationResponse -> DestinationState
state :: DestinationState
}
deriving (GetDestinationResponse -> GetDestinationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDestinationResponse -> GetDestinationResponse -> Bool
$c/= :: GetDestinationResponse -> GetDestinationResponse -> Bool
== :: GetDestinationResponse -> GetDestinationResponse -> Bool
$c== :: GetDestinationResponse -> GetDestinationResponse -> Bool
Prelude.Eq, ReadPrec [GetDestinationResponse]
ReadPrec GetDestinationResponse
Int -> ReadS GetDestinationResponse
ReadS [GetDestinationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDestinationResponse]
$creadListPrec :: ReadPrec [GetDestinationResponse]
readPrec :: ReadPrec GetDestinationResponse
$creadPrec :: ReadPrec GetDestinationResponse
readList :: ReadS [GetDestinationResponse]
$creadList :: ReadS [GetDestinationResponse]
readsPrec :: Int -> ReadS GetDestinationResponse
$creadsPrec :: Int -> ReadS GetDestinationResponse
Prelude.Read, Int -> GetDestinationResponse -> ShowS
[GetDestinationResponse] -> ShowS
GetDestinationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDestinationResponse] -> ShowS
$cshowList :: [GetDestinationResponse] -> ShowS
show :: GetDestinationResponse -> String
$cshow :: GetDestinationResponse -> String
showsPrec :: Int -> GetDestinationResponse -> ShowS
$cshowsPrec :: Int -> GetDestinationResponse -> ShowS
Prelude.Show, forall x. Rep GetDestinationResponse x -> GetDestinationResponse
forall x. GetDestinationResponse -> Rep GetDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDestinationResponse x -> GetDestinationResponse
$cfrom :: forall x. GetDestinationResponse -> Rep GetDestinationResponse x
Prelude.Generic)
newGetDestinationResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
DestinationState ->
GetDestinationResponse
newGetDestinationResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> DestinationState
-> GetDestinationResponse
newGetDestinationResponse
Int
pHttpStatus_
Text
pArn_
Text
pId_
Text
pName_
Text
pSite_
UTCTime
pCreatedAt_
UTCTime
pUpdatedAt_
DestinationState
pState_ =
GetDestinationResponse'
{ $sel:additionalFixedProperties:GetDestinationResponse' :: Maybe Text
additionalFixedProperties =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDestinationResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:arn:GetDestinationResponse' :: Text
arn = Text
pArn_,
$sel:id:GetDestinationResponse' :: Text
id = Text
pId_,
$sel:name:GetDestinationResponse' :: Text
name = Text
pName_,
$sel:site:GetDestinationResponse' :: Text
site = Text
pSite_,
$sel:createdAt:GetDestinationResponse' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:updatedAt:GetDestinationResponse' :: POSIX
updatedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_,
$sel:state:GetDestinationResponse' :: DestinationState
state = DestinationState
pState_
}
getDestinationResponse_additionalFixedProperties :: Lens.Lens' GetDestinationResponse (Prelude.Maybe Prelude.Text)
getDestinationResponse_additionalFixedProperties :: Lens' GetDestinationResponse (Maybe Text)
getDestinationResponse_additionalFixedProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Maybe Text
additionalFixedProperties :: Maybe Text
$sel:additionalFixedProperties:GetDestinationResponse' :: GetDestinationResponse -> Maybe Text
additionalFixedProperties} -> Maybe Text
additionalFixedProperties) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Maybe Text
a -> GetDestinationResponse
s {$sel:additionalFixedProperties:GetDestinationResponse' :: Maybe Text
additionalFixedProperties = Maybe Text
a} :: GetDestinationResponse)
getDestinationResponse_httpStatus :: Lens.Lens' GetDestinationResponse Prelude.Int
getDestinationResponse_httpStatus :: Lens' GetDestinationResponse Int
getDestinationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDestinationResponse' :: GetDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Int
a -> GetDestinationResponse
s {$sel:httpStatus:GetDestinationResponse' :: Int
httpStatus = Int
a} :: GetDestinationResponse)
getDestinationResponse_arn :: Lens.Lens' GetDestinationResponse Prelude.Text
getDestinationResponse_arn :: Lens' GetDestinationResponse Text
getDestinationResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Text
arn :: Text
$sel:arn:GetDestinationResponse' :: GetDestinationResponse -> Text
arn} -> Text
arn) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Text
a -> GetDestinationResponse
s {$sel:arn:GetDestinationResponse' :: Text
arn = Text
a} :: GetDestinationResponse)
getDestinationResponse_id :: Lens.Lens' GetDestinationResponse Prelude.Text
getDestinationResponse_id :: Lens' GetDestinationResponse Text
getDestinationResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Text
id :: Text
$sel:id:GetDestinationResponse' :: GetDestinationResponse -> Text
id} -> Text
id) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Text
a -> GetDestinationResponse
s {$sel:id:GetDestinationResponse' :: Text
id = Text
a} :: GetDestinationResponse)
getDestinationResponse_name :: Lens.Lens' GetDestinationResponse Prelude.Text
getDestinationResponse_name :: Lens' GetDestinationResponse Text
getDestinationResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Text
name :: Text
$sel:name:GetDestinationResponse' :: GetDestinationResponse -> Text
name} -> Text
name) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Text
a -> GetDestinationResponse
s {$sel:name:GetDestinationResponse' :: Text
name = Text
a} :: GetDestinationResponse)
getDestinationResponse_site :: Lens.Lens' GetDestinationResponse Prelude.Text
getDestinationResponse_site :: Lens' GetDestinationResponse Text
getDestinationResponse_site = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {Text
site :: Text
$sel:site:GetDestinationResponse' :: GetDestinationResponse -> Text
site} -> Text
site) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} Text
a -> GetDestinationResponse
s {$sel:site:GetDestinationResponse' :: Text
site = Text
a} :: GetDestinationResponse)
getDestinationResponse_createdAt :: Lens.Lens' GetDestinationResponse Prelude.UTCTime
getDestinationResponse_createdAt :: Lens' GetDestinationResponse UTCTime
getDestinationResponse_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:GetDestinationResponse' :: GetDestinationResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} POSIX
a -> GetDestinationResponse
s {$sel:createdAt:GetDestinationResponse' :: POSIX
createdAt = POSIX
a} :: GetDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getDestinationResponse_updatedAt :: Lens.Lens' GetDestinationResponse Prelude.UTCTime
getDestinationResponse_updatedAt :: Lens' GetDestinationResponse UTCTime
getDestinationResponse_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {POSIX
updatedAt :: POSIX
$sel:updatedAt:GetDestinationResponse' :: GetDestinationResponse -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} POSIX
a -> GetDestinationResponse
s {$sel:updatedAt:GetDestinationResponse' :: POSIX
updatedAt = POSIX
a} :: GetDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getDestinationResponse_state :: Lens.Lens' GetDestinationResponse DestinationState
getDestinationResponse_state :: Lens' GetDestinationResponse DestinationState
getDestinationResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDestinationResponse' {DestinationState
state :: DestinationState
$sel:state:GetDestinationResponse' :: GetDestinationResponse -> DestinationState
state} -> DestinationState
state) (\s :: GetDestinationResponse
s@GetDestinationResponse' {} DestinationState
a -> GetDestinationResponse
s {$sel:state:GetDestinationResponse' :: DestinationState
state = DestinationState
a} :: GetDestinationResponse)
instance Prelude.NFData GetDestinationResponse where
rnf :: GetDestinationResponse -> ()
rnf GetDestinationResponse' {Int
Maybe Text
Text
POSIX
DestinationState
state :: DestinationState
updatedAt :: POSIX
createdAt :: POSIX
site :: Text
name :: Text
id :: Text
arn :: Text
httpStatus :: Int
additionalFixedProperties :: Maybe Text
$sel:state:GetDestinationResponse' :: GetDestinationResponse -> DestinationState
$sel:updatedAt:GetDestinationResponse' :: GetDestinationResponse -> POSIX
$sel:createdAt:GetDestinationResponse' :: GetDestinationResponse -> POSIX
$sel:site:GetDestinationResponse' :: GetDestinationResponse -> Text
$sel:name:GetDestinationResponse' :: GetDestinationResponse -> Text
$sel:id:GetDestinationResponse' :: GetDestinationResponse -> Text
$sel:arn:GetDestinationResponse' :: GetDestinationResponse -> Text
$sel:httpStatus:GetDestinationResponse' :: GetDestinationResponse -> Int
$sel:additionalFixedProperties:GetDestinationResponse' :: GetDestinationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
additionalFixedProperties
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 Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
site
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updatedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DestinationState
state