{-# 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.GroundStation.ReserveContact
(
ReserveContact (..),
newReserveContact,
reserveContact_tags,
reserveContact_endTime,
reserveContact_groundStation,
reserveContact_missionProfileArn,
reserveContact_satelliteArn,
reserveContact_startTime,
ContactIdResponse (..),
newContactIdResponse,
contactIdResponse_contactId,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GroundStation.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ReserveContact = ReserveContact'
{
ReserveContact -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ReserveContact -> POSIX
endTime :: Core.POSIX,
ReserveContact -> Text
groundStation :: Prelude.Text,
ReserveContact -> Text
missionProfileArn :: Prelude.Text,
ReserveContact -> Text
satelliteArn :: Prelude.Text,
ReserveContact -> POSIX
startTime :: Core.POSIX
}
deriving (ReserveContact -> ReserveContact -> Bool
(ReserveContact -> ReserveContact -> Bool)
-> (ReserveContact -> ReserveContact -> Bool) -> Eq ReserveContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReserveContact -> ReserveContact -> Bool
$c/= :: ReserveContact -> ReserveContact -> Bool
== :: ReserveContact -> ReserveContact -> Bool
$c== :: ReserveContact -> ReserveContact -> Bool
Prelude.Eq, ReadPrec [ReserveContact]
ReadPrec ReserveContact
Int -> ReadS ReserveContact
ReadS [ReserveContact]
(Int -> ReadS ReserveContact)
-> ReadS [ReserveContact]
-> ReadPrec ReserveContact
-> ReadPrec [ReserveContact]
-> Read ReserveContact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReserveContact]
$creadListPrec :: ReadPrec [ReserveContact]
readPrec :: ReadPrec ReserveContact
$creadPrec :: ReadPrec ReserveContact
readList :: ReadS [ReserveContact]
$creadList :: ReadS [ReserveContact]
readsPrec :: Int -> ReadS ReserveContact
$creadsPrec :: Int -> ReadS ReserveContact
Prelude.Read, Int -> ReserveContact -> ShowS
[ReserveContact] -> ShowS
ReserveContact -> String
(Int -> ReserveContact -> ShowS)
-> (ReserveContact -> String)
-> ([ReserveContact] -> ShowS)
-> Show ReserveContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReserveContact] -> ShowS
$cshowList :: [ReserveContact] -> ShowS
show :: ReserveContact -> String
$cshow :: ReserveContact -> String
showsPrec :: Int -> ReserveContact -> ShowS
$cshowsPrec :: Int -> ReserveContact -> ShowS
Prelude.Show, (forall x. ReserveContact -> Rep ReserveContact x)
-> (forall x. Rep ReserveContact x -> ReserveContact)
-> Generic ReserveContact
forall x. Rep ReserveContact x -> ReserveContact
forall x. ReserveContact -> Rep ReserveContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReserveContact x -> ReserveContact
$cfrom :: forall x. ReserveContact -> Rep ReserveContact x
Prelude.Generic)
newReserveContact ::
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
ReserveContact
newReserveContact :: UTCTime -> Text -> Text -> Text -> UTCTime -> ReserveContact
newReserveContact
UTCTime
pEndTime_
Text
pGroundStation_
Text
pMissionProfileArn_
Text
pSatelliteArn_
UTCTime
pStartTime_ =
ReserveContact' :: Maybe (HashMap Text Text)
-> POSIX -> Text -> Text -> Text -> POSIX -> ReserveContact
ReserveContact'
{ $sel:tags:ReserveContact' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:ReserveContact' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
$sel:groundStation:ReserveContact' :: Text
groundStation = Text
pGroundStation_,
$sel:missionProfileArn:ReserveContact' :: Text
missionProfileArn = Text
pMissionProfileArn_,
$sel:satelliteArn:ReserveContact' :: Text
satelliteArn = Text
pSatelliteArn_,
$sel:startTime:ReserveContact' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
}
reserveContact_tags :: Lens.Lens' ReserveContact (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
reserveContact_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ReserveContact -> f ReserveContact
reserveContact_tags = (ReserveContact -> Maybe (HashMap Text Text))
-> (ReserveContact -> Maybe (HashMap Text Text) -> ReserveContact)
-> Lens
ReserveContact
ReserveContact
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ReserveContact' :: ReserveContact -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ReserveContact
s@ReserveContact' {} Maybe (HashMap Text Text)
a -> ReserveContact
s {$sel:tags:ReserveContact' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ReserveContact) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ReserveContact -> f ReserveContact)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ReserveContact
-> f ReserveContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
reserveContact_endTime :: Lens.Lens' ReserveContact Prelude.UTCTime
reserveContact_endTime :: (UTCTime -> f UTCTime) -> ReserveContact -> f ReserveContact
reserveContact_endTime = (ReserveContact -> POSIX)
-> (ReserveContact -> POSIX -> ReserveContact)
-> Lens ReserveContact ReserveContact POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {POSIX
endTime :: POSIX
$sel:endTime:ReserveContact' :: ReserveContact -> POSIX
endTime} -> POSIX
endTime) (\s :: ReserveContact
s@ReserveContact' {} POSIX
a -> ReserveContact
s {$sel:endTime:ReserveContact' :: POSIX
endTime = POSIX
a} :: ReserveContact) ((POSIX -> f POSIX) -> ReserveContact -> f ReserveContact)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ReserveContact
-> f ReserveContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
reserveContact_groundStation :: Lens.Lens' ReserveContact Prelude.Text
reserveContact_groundStation :: (Text -> f Text) -> ReserveContact -> f ReserveContact
reserveContact_groundStation = (ReserveContact -> Text)
-> (ReserveContact -> Text -> ReserveContact)
-> Lens ReserveContact ReserveContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {Text
groundStation :: Text
$sel:groundStation:ReserveContact' :: ReserveContact -> Text
groundStation} -> Text
groundStation) (\s :: ReserveContact
s@ReserveContact' {} Text
a -> ReserveContact
s {$sel:groundStation:ReserveContact' :: Text
groundStation = Text
a} :: ReserveContact)
reserveContact_missionProfileArn :: Lens.Lens' ReserveContact Prelude.Text
reserveContact_missionProfileArn :: (Text -> f Text) -> ReserveContact -> f ReserveContact
reserveContact_missionProfileArn = (ReserveContact -> Text)
-> (ReserveContact -> Text -> ReserveContact)
-> Lens ReserveContact ReserveContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {Text
missionProfileArn :: Text
$sel:missionProfileArn:ReserveContact' :: ReserveContact -> Text
missionProfileArn} -> Text
missionProfileArn) (\s :: ReserveContact
s@ReserveContact' {} Text
a -> ReserveContact
s {$sel:missionProfileArn:ReserveContact' :: Text
missionProfileArn = Text
a} :: ReserveContact)
reserveContact_satelliteArn :: Lens.Lens' ReserveContact Prelude.Text
reserveContact_satelliteArn :: (Text -> f Text) -> ReserveContact -> f ReserveContact
reserveContact_satelliteArn = (ReserveContact -> Text)
-> (ReserveContact -> Text -> ReserveContact)
-> Lens ReserveContact ReserveContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {Text
satelliteArn :: Text
$sel:satelliteArn:ReserveContact' :: ReserveContact -> Text
satelliteArn} -> Text
satelliteArn) (\s :: ReserveContact
s@ReserveContact' {} Text
a -> ReserveContact
s {$sel:satelliteArn:ReserveContact' :: Text
satelliteArn = Text
a} :: ReserveContact)
reserveContact_startTime :: Lens.Lens' ReserveContact Prelude.UTCTime
reserveContact_startTime :: (UTCTime -> f UTCTime) -> ReserveContact -> f ReserveContact
reserveContact_startTime = (ReserveContact -> POSIX)
-> (ReserveContact -> POSIX -> ReserveContact)
-> Lens ReserveContact ReserveContact POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReserveContact' {POSIX
startTime :: POSIX
$sel:startTime:ReserveContact' :: ReserveContact -> POSIX
startTime} -> POSIX
startTime) (\s :: ReserveContact
s@ReserveContact' {} POSIX
a -> ReserveContact
s {$sel:startTime:ReserveContact' :: POSIX
startTime = POSIX
a} :: ReserveContact) ((POSIX -> f POSIX) -> ReserveContact -> f ReserveContact)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ReserveContact
-> f ReserveContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.AWSRequest ReserveContact where
type AWSResponse ReserveContact = ContactIdResponse
request :: ReserveContact -> Request ReserveContact
request = Service -> ReserveContact -> Request ReserveContact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ReserveContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ReserveContact)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ReserveContact))
-> Logger
-> Service
-> Proxy ReserveContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ReserveContact)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String ContactIdResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable ReserveContact
instance Prelude.NFData ReserveContact
instance Core.ToHeaders ReserveContact where
toHeaders :: ReserveContact -> ResponseHeaders
toHeaders =
ResponseHeaders -> ReserveContact -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ReserveContact where
toJSON :: ReserveContact -> Value
toJSON ReserveContact' {Maybe (HashMap Text Text)
Text
POSIX
startTime :: POSIX
satelliteArn :: Text
missionProfileArn :: Text
groundStation :: Text
endTime :: POSIX
tags :: Maybe (HashMap Text Text)
$sel:startTime:ReserveContact' :: ReserveContact -> POSIX
$sel:satelliteArn:ReserveContact' :: ReserveContact -> Text
$sel:missionProfileArn:ReserveContact' :: ReserveContact -> Text
$sel:groundStation:ReserveContact' :: ReserveContact -> Text
$sel:endTime:ReserveContact' :: ReserveContact -> POSIX
$sel:tags:ReserveContact' :: ReserveContact -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"endTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
endTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"groundStation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
groundStation),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"missionProfileArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
missionProfileArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"satelliteArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
satelliteArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"startTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
startTime)
]
)
instance Core.ToPath ReserveContact where
toPath :: ReserveContact -> ByteString
toPath = ByteString -> ReserveContact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/contact"
instance Core.ToQuery ReserveContact where
toQuery :: ReserveContact -> QueryString
toQuery = QueryString -> ReserveContact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty