{-# LANGUAGE BangPatterns #-}
module Amazonka.EC2.Metadata
(
isEC2,
dynamic,
metadata,
userdata,
identity,
Dynamic (..),
Metadata (..),
Autoscaling (..),
Mapping (..),
ElasticGpus (..),
ElasticInference (..),
Events (..),
Maintenance (..),
Recommendations (..),
IAM (..),
IdentityCredentialsEC2 (..),
Interface (..),
Placement (..),
Services (..),
Spot (..),
Tags (..),
IdentityDocument (..),
identityDocument_devpayProductCodes,
identityDocument_billingProducts,
identityDocument_version,
identityDocument_privateIp,
identityDocument_availabilityZone,
identityDocument_region,
identityDocument_instanceId,
identityDocument_instanceType,
identityDocument_accountId,
identityDocument_imageId,
identityDocument_kernelId,
identityDocument_ramdiskId,
identityDocument_architecture,
identityDocument_pendingTime,
)
where
import Amazonka.Data
import Amazonka.Prelude
import Amazonka.Types (Region)
import qualified Control.Exception as Exception
import qualified Data.ByteString.Char8 as BS8
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Text as Text
import qualified Network.HTTP.Client as Client
import Network.HTTP.Simple (setRequestHeader, setRequestMethod)
data Dynamic
=
FWS
|
Document
|
PKCS7
|
Signature
deriving stock (Dynamic -> Dynamic -> Bool
(Dynamic -> Dynamic -> Bool)
-> (Dynamic -> Dynamic -> Bool) -> Eq Dynamic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Dynamic -> Dynamic -> Bool
== :: Dynamic -> Dynamic -> Bool
$c/= :: Dynamic -> Dynamic -> Bool
/= :: Dynamic -> Dynamic -> Bool
Eq, Eq Dynamic
Eq Dynamic =>
(Dynamic -> Dynamic -> Ordering)
-> (Dynamic -> Dynamic -> Bool)
-> (Dynamic -> Dynamic -> Bool)
-> (Dynamic -> Dynamic -> Bool)
-> (Dynamic -> Dynamic -> Bool)
-> (Dynamic -> Dynamic -> Dynamic)
-> (Dynamic -> Dynamic -> Dynamic)
-> Ord Dynamic
Dynamic -> Dynamic -> Bool
Dynamic -> Dynamic -> Ordering
Dynamic -> Dynamic -> Dynamic
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Dynamic -> Dynamic -> Ordering
compare :: Dynamic -> Dynamic -> Ordering
$c< :: Dynamic -> Dynamic -> Bool
< :: Dynamic -> Dynamic -> Bool
$c<= :: Dynamic -> Dynamic -> Bool
<= :: Dynamic -> Dynamic -> Bool
$c> :: Dynamic -> Dynamic -> Bool
> :: Dynamic -> Dynamic -> Bool
$c>= :: Dynamic -> Dynamic -> Bool
>= :: Dynamic -> Dynamic -> Bool
$cmax :: Dynamic -> Dynamic -> Dynamic
max :: Dynamic -> Dynamic -> Dynamic
$cmin :: Dynamic -> Dynamic -> Dynamic
min :: Dynamic -> Dynamic -> Dynamic
Ord, Int -> Dynamic -> ShowS
[Dynamic] -> ShowS
Dynamic -> String
(Int -> Dynamic -> ShowS)
-> (Dynamic -> String) -> ([Dynamic] -> ShowS) -> Show Dynamic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Dynamic -> ShowS
showsPrec :: Int -> Dynamic -> ShowS
$cshow :: Dynamic -> String
show :: Dynamic -> String
$cshowList :: [Dynamic] -> ShowS
showList :: [Dynamic] -> ShowS
Show, (forall x. Dynamic -> Rep Dynamic x)
-> (forall x. Rep Dynamic x -> Dynamic) -> Generic Dynamic
forall x. Rep Dynamic x -> Dynamic
forall x. Dynamic -> Rep Dynamic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Dynamic -> Rep Dynamic x
from :: forall x. Dynamic -> Rep Dynamic x
$cto :: forall x. Rep Dynamic x -> Dynamic
to :: forall x. Rep Dynamic x -> Dynamic
Generic)
instance ToText Dynamic where
toText :: Dynamic -> Text
toText =
(Text
"dynamic/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<>) (Text -> Text) -> (Dynamic -> Text) -> Dynamic -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Dynamic
FWS -> Text
"fws/instance-monitoring"
Dynamic
Document -> Text
"instance-identity/document"
Dynamic
PKCS7 -> Text
"instance-identity/pkcs7"
Dynamic
Signature -> Text
"instance-identity/signature"
data Metadata
=
AMIId
|
AMILaunchIndex
|
AMIManifestPath
|
AncestorAMIIds
|
Autoscaling !Autoscaling
|
BlockDevice !Mapping
|
ElasticGpus !ElasticGpus
|
ElasticInference !ElasticInference
|
Events !Events
|
Hostname
|
IAM !IAM
|
IdentityCredentialsEC2 !IdentityCredentialsEC2
|
InstanceAction
|
InstanceId
|
InstanceLifeCycle
|
InstanceType
|
IPV6
|
KernelId
|
LocalHostname
|
LocalIPV4
|
MAC
|
Network !Text !Interface
|
Placement !Placement
|
ProductCodes
|
PublicHostname
|
PublicIPV4
|
OpenSSHKey
|
RAMDiskId
|
ReservationId
|
SecurityGroups
|
Services !Services
|
Spot !Spot
|
Tags !Tags
deriving stock (Metadata -> Metadata -> Bool
(Metadata -> Metadata -> Bool)
-> (Metadata -> Metadata -> Bool) -> Eq Metadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Metadata -> Metadata -> Bool
== :: Metadata -> Metadata -> Bool
$c/= :: Metadata -> Metadata -> Bool
/= :: Metadata -> Metadata -> Bool
Eq, Eq Metadata
Eq Metadata =>
(Metadata -> Metadata -> Ordering)
-> (Metadata -> Metadata -> Bool)
-> (Metadata -> Metadata -> Bool)
-> (Metadata -> Metadata -> Bool)
-> (Metadata -> Metadata -> Bool)
-> (Metadata -> Metadata -> Metadata)
-> (Metadata -> Metadata -> Metadata)
-> Ord Metadata
Metadata -> Metadata -> Bool
Metadata -> Metadata -> Ordering
Metadata -> Metadata -> Metadata
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Metadata -> Metadata -> Ordering
compare :: Metadata -> Metadata -> Ordering
$c< :: Metadata -> Metadata -> Bool
< :: Metadata -> Metadata -> Bool
$c<= :: Metadata -> Metadata -> Bool
<= :: Metadata -> Metadata -> Bool
$c> :: Metadata -> Metadata -> Bool
> :: Metadata -> Metadata -> Bool
$c>= :: Metadata -> Metadata -> Bool
>= :: Metadata -> Metadata -> Bool
$cmax :: Metadata -> Metadata -> Metadata
max :: Metadata -> Metadata -> Metadata
$cmin :: Metadata -> Metadata -> Metadata
min :: Metadata -> Metadata -> Metadata
Ord, Int -> Metadata -> ShowS
[Metadata] -> ShowS
Metadata -> String
(Int -> Metadata -> ShowS)
-> (Metadata -> String) -> ([Metadata] -> ShowS) -> Show Metadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Metadata -> ShowS
showsPrec :: Int -> Metadata -> ShowS
$cshow :: Metadata -> String
show :: Metadata -> String
$cshowList :: [Metadata] -> ShowS
showList :: [Metadata] -> ShowS
Show, (forall x. Metadata -> Rep Metadata x)
-> (forall x. Rep Metadata x -> Metadata) -> Generic Metadata
forall x. Rep Metadata x -> Metadata
forall x. Metadata -> Rep Metadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Metadata -> Rep Metadata x
from :: forall x. Metadata -> Rep Metadata x
$cto :: forall x. Rep Metadata x -> Metadata
to :: forall x. Rep Metadata x -> Metadata
Generic)
instance ToText Metadata where
toText :: Metadata -> Text
toText =
(Text
"meta-data/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<>) (Text -> Text) -> (Metadata -> Text) -> Metadata -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Metadata
AMIId -> Text
"ami-id"
Metadata
AMILaunchIndex -> Text
"ami-launch-index"
Metadata
AMIManifestPath -> Text
"ami-manifest-path"
Metadata
AncestorAMIIds -> Text
"ancestor-ami-ids"
Autoscaling Autoscaling
m -> Text
"autoscaling/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Autoscaling -> Text
forall a. ToText a => a -> Text
toText Autoscaling
m
BlockDevice Mapping
m -> Text
"block-device-mapping/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Mapping -> Text
forall a. ToText a => a -> Text
toText Mapping
m
Metadata
Hostname -> Text
"hostname"
ElasticGpus ElasticGpus
m -> Text
"elastic-gpus/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> ElasticGpus -> Text
forall a. ToText a => a -> Text
toText ElasticGpus
m
ElasticInference ElasticInference
m -> Text
"elastic-inference/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> ElasticInference -> Text
forall a. ToText a => a -> Text
toText ElasticInference
m
Events Events
m -> Text
"events/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Events -> Text
forall a. ToText a => a -> Text
toText Events
m
IAM IAM
m -> Text
"iam/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> IAM -> Text
forall a. ToText a => a -> Text
toText IAM
m
IdentityCredentialsEC2 IdentityCredentialsEC2
m -> Text
"identity-credentials/ec2/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> IdentityCredentialsEC2 -> Text
forall a. ToText a => a -> Text
toText IdentityCredentialsEC2
m
Metadata
InstanceAction -> Text
"instance-action"
Metadata
InstanceId -> Text
"instance-id"
Metadata
InstanceLifeCycle -> Text
"instance-life-cycle"
Metadata
InstanceType -> Text
"instance-type"
Metadata
IPV6 -> Text
"ipv6"
Metadata
KernelId -> Text
"kernel-id"
Metadata
LocalHostname -> Text
"local-hostname"
Metadata
LocalIPV4 -> Text
"local-ipv4"
Metadata
MAC -> Text
"mac"
Network Text
n Interface
m -> Text
"network/interfaces/macs/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text -> Text
forall a. ToText a => a -> Text
toText Text
n Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Interface -> Text
forall a. ToText a => a -> Text
toText Interface
m
Placement Placement
m -> Text
"placement/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Placement -> Text
forall a. ToText a => a -> Text
toText Placement
m
Metadata
ProductCodes -> Text
"product-codes"
Metadata
PublicHostname -> Text
"public-hostname"
Metadata
PublicIPV4 -> Text
"public-ipv4"
Metadata
OpenSSHKey -> Text
"public-keys/0/openssh-key"
Metadata
RAMDiskId -> Text
"ramdisk-id"
Metadata
ReservationId -> Text
"reservation-id"
Metadata
SecurityGroups -> Text
"security-groups"
Services Services
m -> Text
"services/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Services -> Text
forall a. ToText a => a -> Text
toText Services
m
Spot Spot
m -> Text
"spot/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Spot -> Text
forall a. ToText a => a -> Text
toText Spot
m
Tags Tags
m -> Text
"tags/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Tags -> Text
forall a. ToText a => a -> Text
toText Tags
m
data Autoscaling
=
TargetLifecycleState
deriving stock (Autoscaling -> Autoscaling -> Bool
(Autoscaling -> Autoscaling -> Bool)
-> (Autoscaling -> Autoscaling -> Bool) -> Eq Autoscaling
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Autoscaling -> Autoscaling -> Bool
== :: Autoscaling -> Autoscaling -> Bool
$c/= :: Autoscaling -> Autoscaling -> Bool
/= :: Autoscaling -> Autoscaling -> Bool
Eq, Eq Autoscaling
Eq Autoscaling =>
(Autoscaling -> Autoscaling -> Ordering)
-> (Autoscaling -> Autoscaling -> Bool)
-> (Autoscaling -> Autoscaling -> Bool)
-> (Autoscaling -> Autoscaling -> Bool)
-> (Autoscaling -> Autoscaling -> Bool)
-> (Autoscaling -> Autoscaling -> Autoscaling)
-> (Autoscaling -> Autoscaling -> Autoscaling)
-> Ord Autoscaling
Autoscaling -> Autoscaling -> Bool
Autoscaling -> Autoscaling -> Ordering
Autoscaling -> Autoscaling -> Autoscaling
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Autoscaling -> Autoscaling -> Ordering
compare :: Autoscaling -> Autoscaling -> Ordering
$c< :: Autoscaling -> Autoscaling -> Bool
< :: Autoscaling -> Autoscaling -> Bool
$c<= :: Autoscaling -> Autoscaling -> Bool
<= :: Autoscaling -> Autoscaling -> Bool
$c> :: Autoscaling -> Autoscaling -> Bool
> :: Autoscaling -> Autoscaling -> Bool
$c>= :: Autoscaling -> Autoscaling -> Bool
>= :: Autoscaling -> Autoscaling -> Bool
$cmax :: Autoscaling -> Autoscaling -> Autoscaling
max :: Autoscaling -> Autoscaling -> Autoscaling
$cmin :: Autoscaling -> Autoscaling -> Autoscaling
min :: Autoscaling -> Autoscaling -> Autoscaling
Ord, Int -> Autoscaling -> ShowS
[Autoscaling] -> ShowS
Autoscaling -> String
(Int -> Autoscaling -> ShowS)
-> (Autoscaling -> String)
-> ([Autoscaling] -> ShowS)
-> Show Autoscaling
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Autoscaling -> ShowS
showsPrec :: Int -> Autoscaling -> ShowS
$cshow :: Autoscaling -> String
show :: Autoscaling -> String
$cshowList :: [Autoscaling] -> ShowS
showList :: [Autoscaling] -> ShowS
Show, (forall x. Autoscaling -> Rep Autoscaling x)
-> (forall x. Rep Autoscaling x -> Autoscaling)
-> Generic Autoscaling
forall x. Rep Autoscaling x -> Autoscaling
forall x. Autoscaling -> Rep Autoscaling x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Autoscaling -> Rep Autoscaling x
from :: forall x. Autoscaling -> Rep Autoscaling x
$cto :: forall x. Rep Autoscaling x -> Autoscaling
to :: forall x. Rep Autoscaling x -> Autoscaling
Generic)
instance ToText Autoscaling where
toText :: Autoscaling -> Text
toText = \case
Autoscaling
TargetLifecycleState -> Text
"target-lifecycle-state"
data Mapping
=
AMI
|
EBS !Int
|
Ephemeral !Int
|
Root
|
Swap
deriving stock (Mapping -> Mapping -> Bool
(Mapping -> Mapping -> Bool)
-> (Mapping -> Mapping -> Bool) -> Eq Mapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Mapping -> Mapping -> Bool
== :: Mapping -> Mapping -> Bool
$c/= :: Mapping -> Mapping -> Bool
/= :: Mapping -> Mapping -> Bool
Eq, Eq Mapping
Eq Mapping =>
(Mapping -> Mapping -> Ordering)
-> (Mapping -> Mapping -> Bool)
-> (Mapping -> Mapping -> Bool)
-> (Mapping -> Mapping -> Bool)
-> (Mapping -> Mapping -> Bool)
-> (Mapping -> Mapping -> Mapping)
-> (Mapping -> Mapping -> Mapping)
-> Ord Mapping
Mapping -> Mapping -> Bool
Mapping -> Mapping -> Ordering
Mapping -> Mapping -> Mapping
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Mapping -> Mapping -> Ordering
compare :: Mapping -> Mapping -> Ordering
$c< :: Mapping -> Mapping -> Bool
< :: Mapping -> Mapping -> Bool
$c<= :: Mapping -> Mapping -> Bool
<= :: Mapping -> Mapping -> Bool
$c> :: Mapping -> Mapping -> Bool
> :: Mapping -> Mapping -> Bool
$c>= :: Mapping -> Mapping -> Bool
>= :: Mapping -> Mapping -> Bool
$cmax :: Mapping -> Mapping -> Mapping
max :: Mapping -> Mapping -> Mapping
$cmin :: Mapping -> Mapping -> Mapping
min :: Mapping -> Mapping -> Mapping
Ord, Int -> Mapping -> ShowS
[Mapping] -> ShowS
Mapping -> String
(Int -> Mapping -> ShowS)
-> (Mapping -> String) -> ([Mapping] -> ShowS) -> Show Mapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Mapping -> ShowS
showsPrec :: Int -> Mapping -> ShowS
$cshow :: Mapping -> String
show :: Mapping -> String
$cshowList :: [Mapping] -> ShowS
showList :: [Mapping] -> ShowS
Show, (forall x. Mapping -> Rep Mapping x)
-> (forall x. Rep Mapping x -> Mapping) -> Generic Mapping
forall x. Rep Mapping x -> Mapping
forall x. Mapping -> Rep Mapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Mapping -> Rep Mapping x
from :: forall x. Mapping -> Rep Mapping x
$cto :: forall x. Rep Mapping x -> Mapping
to :: forall x. Rep Mapping x -> Mapping
Generic)
instance ToText Mapping where
toText :: Mapping -> Text
toText = \case
Mapping
AMI -> Text
"ami"
EBS Int
n -> Text
"ebs" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Int -> Text
forall a. ToText a => a -> Text
toText Int
n
Ephemeral Int
n -> Text
"ephemeral" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Int -> Text
forall a. ToText a => a -> Text
toText Int
n
Mapping
Root -> Text
"root"
Mapping
Swap -> Text
"root"
newtype ElasticGpus
=
EGAssociations Text
deriving stock (ElasticGpus -> ElasticGpus -> Bool
(ElasticGpus -> ElasticGpus -> Bool)
-> (ElasticGpus -> ElasticGpus -> Bool) -> Eq ElasticGpus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ElasticGpus -> ElasticGpus -> Bool
== :: ElasticGpus -> ElasticGpus -> Bool
$c/= :: ElasticGpus -> ElasticGpus -> Bool
/= :: ElasticGpus -> ElasticGpus -> Bool
Eq, Eq ElasticGpus
Eq ElasticGpus =>
(ElasticGpus -> ElasticGpus -> Ordering)
-> (ElasticGpus -> ElasticGpus -> Bool)
-> (ElasticGpus -> ElasticGpus -> Bool)
-> (ElasticGpus -> ElasticGpus -> Bool)
-> (ElasticGpus -> ElasticGpus -> Bool)
-> (ElasticGpus -> ElasticGpus -> ElasticGpus)
-> (ElasticGpus -> ElasticGpus -> ElasticGpus)
-> Ord ElasticGpus
ElasticGpus -> ElasticGpus -> Bool
ElasticGpus -> ElasticGpus -> Ordering
ElasticGpus -> ElasticGpus -> ElasticGpus
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ElasticGpus -> ElasticGpus -> Ordering
compare :: ElasticGpus -> ElasticGpus -> Ordering
$c< :: ElasticGpus -> ElasticGpus -> Bool
< :: ElasticGpus -> ElasticGpus -> Bool
$c<= :: ElasticGpus -> ElasticGpus -> Bool
<= :: ElasticGpus -> ElasticGpus -> Bool
$c> :: ElasticGpus -> ElasticGpus -> Bool
> :: ElasticGpus -> ElasticGpus -> Bool
$c>= :: ElasticGpus -> ElasticGpus -> Bool
>= :: ElasticGpus -> ElasticGpus -> Bool
$cmax :: ElasticGpus -> ElasticGpus -> ElasticGpus
max :: ElasticGpus -> ElasticGpus -> ElasticGpus
$cmin :: ElasticGpus -> ElasticGpus -> ElasticGpus
min :: ElasticGpus -> ElasticGpus -> ElasticGpus
Ord, Int -> ElasticGpus -> ShowS
[ElasticGpus] -> ShowS
ElasticGpus -> String
(Int -> ElasticGpus -> ShowS)
-> (ElasticGpus -> String)
-> ([ElasticGpus] -> ShowS)
-> Show ElasticGpus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ElasticGpus -> ShowS
showsPrec :: Int -> ElasticGpus -> ShowS
$cshow :: ElasticGpus -> String
show :: ElasticGpus -> String
$cshowList :: [ElasticGpus] -> ShowS
showList :: [ElasticGpus] -> ShowS
Show, (forall x. ElasticGpus -> Rep ElasticGpus x)
-> (forall x. Rep ElasticGpus x -> ElasticGpus)
-> Generic ElasticGpus
forall x. Rep ElasticGpus x -> ElasticGpus
forall x. ElasticGpus -> Rep ElasticGpus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ElasticGpus -> Rep ElasticGpus x
from :: forall x. ElasticGpus -> Rep ElasticGpus x
$cto :: forall x. Rep ElasticGpus x -> ElasticGpus
to :: forall x. Rep ElasticGpus x -> ElasticGpus
Generic)
instance ToText ElasticGpus where
toText :: ElasticGpus -> Text
toText = \case
EGAssociations Text
gpuId -> Text
"associations/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
gpuId
newtype ElasticInference
=
EIAssociations Text
deriving stock (ElasticInference -> ElasticInference -> Bool
(ElasticInference -> ElasticInference -> Bool)
-> (ElasticInference -> ElasticInference -> Bool)
-> Eq ElasticInference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ElasticInference -> ElasticInference -> Bool
== :: ElasticInference -> ElasticInference -> Bool
$c/= :: ElasticInference -> ElasticInference -> Bool
/= :: ElasticInference -> ElasticInference -> Bool
Eq, Eq ElasticInference
Eq ElasticInference =>
(ElasticInference -> ElasticInference -> Ordering)
-> (ElasticInference -> ElasticInference -> Bool)
-> (ElasticInference -> ElasticInference -> Bool)
-> (ElasticInference -> ElasticInference -> Bool)
-> (ElasticInference -> ElasticInference -> Bool)
-> (ElasticInference -> ElasticInference -> ElasticInference)
-> (ElasticInference -> ElasticInference -> ElasticInference)
-> Ord ElasticInference
ElasticInference -> ElasticInference -> Bool
ElasticInference -> ElasticInference -> Ordering
ElasticInference -> ElasticInference -> ElasticInference
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ElasticInference -> ElasticInference -> Ordering
compare :: ElasticInference -> ElasticInference -> Ordering
$c< :: ElasticInference -> ElasticInference -> Bool
< :: ElasticInference -> ElasticInference -> Bool
$c<= :: ElasticInference -> ElasticInference -> Bool
<= :: ElasticInference -> ElasticInference -> Bool
$c> :: ElasticInference -> ElasticInference -> Bool
> :: ElasticInference -> ElasticInference -> Bool
$c>= :: ElasticInference -> ElasticInference -> Bool
>= :: ElasticInference -> ElasticInference -> Bool
$cmax :: ElasticInference -> ElasticInference -> ElasticInference
max :: ElasticInference -> ElasticInference -> ElasticInference
$cmin :: ElasticInference -> ElasticInference -> ElasticInference
min :: ElasticInference -> ElasticInference -> ElasticInference
Ord, Int -> ElasticInference -> ShowS
[ElasticInference] -> ShowS
ElasticInference -> String
(Int -> ElasticInference -> ShowS)
-> (ElasticInference -> String)
-> ([ElasticInference] -> ShowS)
-> Show ElasticInference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ElasticInference -> ShowS
showsPrec :: Int -> ElasticInference -> ShowS
$cshow :: ElasticInference -> String
show :: ElasticInference -> String
$cshowList :: [ElasticInference] -> ShowS
showList :: [ElasticInference] -> ShowS
Show, (forall x. ElasticInference -> Rep ElasticInference x)
-> (forall x. Rep ElasticInference x -> ElasticInference)
-> Generic ElasticInference
forall x. Rep ElasticInference x -> ElasticInference
forall x. ElasticInference -> Rep ElasticInference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ElasticInference -> Rep ElasticInference x
from :: forall x. ElasticInference -> Rep ElasticInference x
$cto :: forall x. Rep ElasticInference x -> ElasticInference
to :: forall x. Rep ElasticInference x -> ElasticInference
Generic)
instance ToText ElasticInference where
toText :: ElasticInference -> Text
toText = \case
EIAssociations Text
eiId -> Text
"associations/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
eiId
data Events
= Maintenance !Maintenance
| Recommendations !Recommendations
deriving stock (Events -> Events -> Bool
(Events -> Events -> Bool)
-> (Events -> Events -> Bool) -> Eq Events
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Events -> Events -> Bool
== :: Events -> Events -> Bool
$c/= :: Events -> Events -> Bool
/= :: Events -> Events -> Bool
Eq, Eq Events
Eq Events =>
(Events -> Events -> Ordering)
-> (Events -> Events -> Bool)
-> (Events -> Events -> Bool)
-> (Events -> Events -> Bool)
-> (Events -> Events -> Bool)
-> (Events -> Events -> Events)
-> (Events -> Events -> Events)
-> Ord Events
Events -> Events -> Bool
Events -> Events -> Ordering
Events -> Events -> Events
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Events -> Events -> Ordering
compare :: Events -> Events -> Ordering
$c< :: Events -> Events -> Bool
< :: Events -> Events -> Bool
$c<= :: Events -> Events -> Bool
<= :: Events -> Events -> Bool
$c> :: Events -> Events -> Bool
> :: Events -> Events -> Bool
$c>= :: Events -> Events -> Bool
>= :: Events -> Events -> Bool
$cmax :: Events -> Events -> Events
max :: Events -> Events -> Events
$cmin :: Events -> Events -> Events
min :: Events -> Events -> Events
Ord, Int -> Events -> ShowS
[Events] -> ShowS
Events -> String
(Int -> Events -> ShowS)
-> (Events -> String) -> ([Events] -> ShowS) -> Show Events
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Events -> ShowS
showsPrec :: Int -> Events -> ShowS
$cshow :: Events -> String
show :: Events -> String
$cshowList :: [Events] -> ShowS
showList :: [Events] -> ShowS
Show, (forall x. Events -> Rep Events x)
-> (forall x. Rep Events x -> Events) -> Generic Events
forall x. Rep Events x -> Events
forall x. Events -> Rep Events x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Events -> Rep Events x
from :: forall x. Events -> Rep Events x
$cto :: forall x. Rep Events x -> Events
to :: forall x. Rep Events x -> Events
Generic)
instance ToText Events where
toText :: Events -> Text
toText = \case
Maintenance Maintenance
m -> Text
"maintenance/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Maintenance -> Text
forall a. ToText a => a -> Text
toText Maintenance
m
Recommendations Recommendations
m -> Text
"recommendations/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Recommendations -> Text
forall a. ToText a => a -> Text
toText Recommendations
m
data Maintenance
=
History
|
Scheduled
deriving stock (Maintenance -> Maintenance -> Bool
(Maintenance -> Maintenance -> Bool)
-> (Maintenance -> Maintenance -> Bool) -> Eq Maintenance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Maintenance -> Maintenance -> Bool
== :: Maintenance -> Maintenance -> Bool
$c/= :: Maintenance -> Maintenance -> Bool
/= :: Maintenance -> Maintenance -> Bool
Eq, Eq Maintenance
Eq Maintenance =>
(Maintenance -> Maintenance -> Ordering)
-> (Maintenance -> Maintenance -> Bool)
-> (Maintenance -> Maintenance -> Bool)
-> (Maintenance -> Maintenance -> Bool)
-> (Maintenance -> Maintenance -> Bool)
-> (Maintenance -> Maintenance -> Maintenance)
-> (Maintenance -> Maintenance -> Maintenance)
-> Ord Maintenance
Maintenance -> Maintenance -> Bool
Maintenance -> Maintenance -> Ordering
Maintenance -> Maintenance -> Maintenance
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Maintenance -> Maintenance -> Ordering
compare :: Maintenance -> Maintenance -> Ordering
$c< :: Maintenance -> Maintenance -> Bool
< :: Maintenance -> Maintenance -> Bool
$c<= :: Maintenance -> Maintenance -> Bool
<= :: Maintenance -> Maintenance -> Bool
$c> :: Maintenance -> Maintenance -> Bool
> :: Maintenance -> Maintenance -> Bool
$c>= :: Maintenance -> Maintenance -> Bool
>= :: Maintenance -> Maintenance -> Bool
$cmax :: Maintenance -> Maintenance -> Maintenance
max :: Maintenance -> Maintenance -> Maintenance
$cmin :: Maintenance -> Maintenance -> Maintenance
min :: Maintenance -> Maintenance -> Maintenance
Ord, Int -> Maintenance -> ShowS
[Maintenance] -> ShowS
Maintenance -> String
(Int -> Maintenance -> ShowS)
-> (Maintenance -> String)
-> ([Maintenance] -> ShowS)
-> Show Maintenance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Maintenance -> ShowS
showsPrec :: Int -> Maintenance -> ShowS
$cshow :: Maintenance -> String
show :: Maintenance -> String
$cshowList :: [Maintenance] -> ShowS
showList :: [Maintenance] -> ShowS
Show, (forall x. Maintenance -> Rep Maintenance x)
-> (forall x. Rep Maintenance x -> Maintenance)
-> Generic Maintenance
forall x. Rep Maintenance x -> Maintenance
forall x. Maintenance -> Rep Maintenance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Maintenance -> Rep Maintenance x
from :: forall x. Maintenance -> Rep Maintenance x
$cto :: forall x. Rep Maintenance x -> Maintenance
to :: forall x. Rep Maintenance x -> Maintenance
Generic)
instance ToText Maintenance where
toText :: Maintenance -> Text
toText = \case
Maintenance
History -> Text
"history"
Maintenance
Scheduled -> Text
"scheduled"
data Recommendations
=
Rebalance
deriving stock (Recommendations -> Recommendations -> Bool
(Recommendations -> Recommendations -> Bool)
-> (Recommendations -> Recommendations -> Bool)
-> Eq Recommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Recommendations -> Recommendations -> Bool
== :: Recommendations -> Recommendations -> Bool
$c/= :: Recommendations -> Recommendations -> Bool
/= :: Recommendations -> Recommendations -> Bool
Eq, Eq Recommendations
Eq Recommendations =>
(Recommendations -> Recommendations -> Ordering)
-> (Recommendations -> Recommendations -> Bool)
-> (Recommendations -> Recommendations -> Bool)
-> (Recommendations -> Recommendations -> Bool)
-> (Recommendations -> Recommendations -> Bool)
-> (Recommendations -> Recommendations -> Recommendations)
-> (Recommendations -> Recommendations -> Recommendations)
-> Ord Recommendations
Recommendations -> Recommendations -> Bool
Recommendations -> Recommendations -> Ordering
Recommendations -> Recommendations -> Recommendations
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Recommendations -> Recommendations -> Ordering
compare :: Recommendations -> Recommendations -> Ordering
$c< :: Recommendations -> Recommendations -> Bool
< :: Recommendations -> Recommendations -> Bool
$c<= :: Recommendations -> Recommendations -> Bool
<= :: Recommendations -> Recommendations -> Bool
$c> :: Recommendations -> Recommendations -> Bool
> :: Recommendations -> Recommendations -> Bool
$c>= :: Recommendations -> Recommendations -> Bool
>= :: Recommendations -> Recommendations -> Bool
$cmax :: Recommendations -> Recommendations -> Recommendations
max :: Recommendations -> Recommendations -> Recommendations
$cmin :: Recommendations -> Recommendations -> Recommendations
min :: Recommendations -> Recommendations -> Recommendations
Ord, Int -> Recommendations -> ShowS
[Recommendations] -> ShowS
Recommendations -> String
(Int -> Recommendations -> ShowS)
-> (Recommendations -> String)
-> ([Recommendations] -> ShowS)
-> Show Recommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Recommendations -> ShowS
showsPrec :: Int -> Recommendations -> ShowS
$cshow :: Recommendations -> String
show :: Recommendations -> String
$cshowList :: [Recommendations] -> ShowS
showList :: [Recommendations] -> ShowS
Show, (forall x. Recommendations -> Rep Recommendations x)
-> (forall x. Rep Recommendations x -> Recommendations)
-> Generic Recommendations
forall x. Rep Recommendations x -> Recommendations
forall x. Recommendations -> Rep Recommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Recommendations -> Rep Recommendations x
from :: forall x. Recommendations -> Rep Recommendations x
$cto :: forall x. Rep Recommendations x -> Recommendations
to :: forall x. Rep Recommendations x -> Recommendations
Generic)
instance ToText Recommendations where
toText :: Recommendations -> Text
toText = \case
Recommendations
Rebalance -> Text
"rebalance"
data IAM
=
Info
|
SecurityCredentials (Maybe Text)
deriving stock (IAM -> IAM -> Bool
(IAM -> IAM -> Bool) -> (IAM -> IAM -> Bool) -> Eq IAM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IAM -> IAM -> Bool
== :: IAM -> IAM -> Bool
$c/= :: IAM -> IAM -> Bool
/= :: IAM -> IAM -> Bool
Eq, Eq IAM
Eq IAM =>
(IAM -> IAM -> Ordering)
-> (IAM -> IAM -> Bool)
-> (IAM -> IAM -> Bool)
-> (IAM -> IAM -> Bool)
-> (IAM -> IAM -> Bool)
-> (IAM -> IAM -> IAM)
-> (IAM -> IAM -> IAM)
-> Ord IAM
IAM -> IAM -> Bool
IAM -> IAM -> Ordering
IAM -> IAM -> IAM
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: IAM -> IAM -> Ordering
compare :: IAM -> IAM -> Ordering
$c< :: IAM -> IAM -> Bool
< :: IAM -> IAM -> Bool
$c<= :: IAM -> IAM -> Bool
<= :: IAM -> IAM -> Bool
$c> :: IAM -> IAM -> Bool
> :: IAM -> IAM -> Bool
$c>= :: IAM -> IAM -> Bool
>= :: IAM -> IAM -> Bool
$cmax :: IAM -> IAM -> IAM
max :: IAM -> IAM -> IAM
$cmin :: IAM -> IAM -> IAM
min :: IAM -> IAM -> IAM
Ord, Int -> IAM -> ShowS
[IAM] -> ShowS
IAM -> String
(Int -> IAM -> ShowS)
-> (IAM -> String) -> ([IAM] -> ShowS) -> Show IAM
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IAM -> ShowS
showsPrec :: Int -> IAM -> ShowS
$cshow :: IAM -> String
show :: IAM -> String
$cshowList :: [IAM] -> ShowS
showList :: [IAM] -> ShowS
Show, (forall x. IAM -> Rep IAM x)
-> (forall x. Rep IAM x -> IAM) -> Generic IAM
forall x. Rep IAM x -> IAM
forall x. IAM -> Rep IAM x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IAM -> Rep IAM x
from :: forall x. IAM -> Rep IAM x
$cto :: forall x. Rep IAM x -> IAM
to :: forall x. Rep IAM x -> IAM
Generic)
instance ToText IAM where
toText :: IAM -> Text
toText = \case
IAM
Info -> Text
"info"
SecurityCredentials Maybe Text
r -> Text
"security-credentials/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text -> (Text -> Text) -> Maybe Text -> Text
forall b a. b -> (a -> b) -> Maybe a -> b
maybe Text
forall a. Monoid a => a
mempty Text -> Text
forall a. ToText a => a -> Text
toText Maybe Text
r
data IdentityCredentialsEC2
=
ICEInfo
|
ICESecurityCredentials
deriving stock (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
(IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> Eq IdentityCredentialsEC2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
== :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
$c/= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
/= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
Eq, Eq IdentityCredentialsEC2
Eq IdentityCredentialsEC2 =>
(IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Ordering)
-> (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> (IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool)
-> (IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2)
-> (IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2)
-> Ord IdentityCredentialsEC2
IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Ordering
IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Ordering
compare :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Ordering
$c< :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
< :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
$c<= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
<= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
$c> :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
> :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
$c>= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
>= :: IdentityCredentialsEC2 -> IdentityCredentialsEC2 -> Bool
$cmax :: IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2
max :: IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2
$cmin :: IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2
min :: IdentityCredentialsEC2
-> IdentityCredentialsEC2 -> IdentityCredentialsEC2
Ord, Int -> IdentityCredentialsEC2 -> ShowS
[IdentityCredentialsEC2] -> ShowS
IdentityCredentialsEC2 -> String
(Int -> IdentityCredentialsEC2 -> ShowS)
-> (IdentityCredentialsEC2 -> String)
-> ([IdentityCredentialsEC2] -> ShowS)
-> Show IdentityCredentialsEC2
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IdentityCredentialsEC2 -> ShowS
showsPrec :: Int -> IdentityCredentialsEC2 -> ShowS
$cshow :: IdentityCredentialsEC2 -> String
show :: IdentityCredentialsEC2 -> String
$cshowList :: [IdentityCredentialsEC2] -> ShowS
showList :: [IdentityCredentialsEC2] -> ShowS
Show, (forall x. IdentityCredentialsEC2 -> Rep IdentityCredentialsEC2 x)
-> (forall x.
Rep IdentityCredentialsEC2 x -> IdentityCredentialsEC2)
-> Generic IdentityCredentialsEC2
forall x. Rep IdentityCredentialsEC2 x -> IdentityCredentialsEC2
forall x. IdentityCredentialsEC2 -> Rep IdentityCredentialsEC2 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IdentityCredentialsEC2 -> Rep IdentityCredentialsEC2 x
from :: forall x. IdentityCredentialsEC2 -> Rep IdentityCredentialsEC2 x
$cto :: forall x. Rep IdentityCredentialsEC2 x -> IdentityCredentialsEC2
to :: forall x. Rep IdentityCredentialsEC2 x -> IdentityCredentialsEC2
Generic)
instance ToText IdentityCredentialsEC2 where
toText :: IdentityCredentialsEC2 -> Text
toText = \case
IdentityCredentialsEC2
ICEInfo -> Text
"info"
IdentityCredentialsEC2
ICESecurityCredentials -> Text
"security-credentials/ec2-instance"
data Interface
=
IDeviceNumber
|
IInterfaceId
|
IIPV4Associations !Text
|
IIPV6s
|
ILocalHostname
|
ILocalIPV4s
|
IMAC
|
INetworkCardIndex
|
IOwnerId
|
IPublicHostname
|
IPublicIPV4s
|
ISecurityGroups
|
ISecurityGroupIds
|
ISubnetId
|
ISubnetIPV4_CIDRBlock
|
ISubnetIPV6_CIDRBlock
|
IVPCId
|
IVPCIPV4_CIDRBlock
|
IVPCIPV4_CIDRBlocks
|
IVPCIPV6_CIDRBlocks
deriving stock (Interface -> Interface -> Bool
(Interface -> Interface -> Bool)
-> (Interface -> Interface -> Bool) -> Eq Interface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Interface -> Interface -> Bool
== :: Interface -> Interface -> Bool
$c/= :: Interface -> Interface -> Bool
/= :: Interface -> Interface -> Bool
Eq, Eq Interface
Eq Interface =>
(Interface -> Interface -> Ordering)
-> (Interface -> Interface -> Bool)
-> (Interface -> Interface -> Bool)
-> (Interface -> Interface -> Bool)
-> (Interface -> Interface -> Bool)
-> (Interface -> Interface -> Interface)
-> (Interface -> Interface -> Interface)
-> Ord Interface
Interface -> Interface -> Bool
Interface -> Interface -> Ordering
Interface -> Interface -> Interface
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Interface -> Interface -> Ordering
compare :: Interface -> Interface -> Ordering
$c< :: Interface -> Interface -> Bool
< :: Interface -> Interface -> Bool
$c<= :: Interface -> Interface -> Bool
<= :: Interface -> Interface -> Bool
$c> :: Interface -> Interface -> Bool
> :: Interface -> Interface -> Bool
$c>= :: Interface -> Interface -> Bool
>= :: Interface -> Interface -> Bool
$cmax :: Interface -> Interface -> Interface
max :: Interface -> Interface -> Interface
$cmin :: Interface -> Interface -> Interface
min :: Interface -> Interface -> Interface
Ord, Int -> Interface -> ShowS
[Interface] -> ShowS
Interface -> String
(Int -> Interface -> ShowS)
-> (Interface -> String)
-> ([Interface] -> ShowS)
-> Show Interface
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Interface -> ShowS
showsPrec :: Int -> Interface -> ShowS
$cshow :: Interface -> String
show :: Interface -> String
$cshowList :: [Interface] -> ShowS
showList :: [Interface] -> ShowS
Show, (forall x. Interface -> Rep Interface x)
-> (forall x. Rep Interface x -> Interface) -> Generic Interface
forall x. Rep Interface x -> Interface
forall x. Interface -> Rep Interface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Interface -> Rep Interface x
from :: forall x. Interface -> Rep Interface x
$cto :: forall x. Rep Interface x -> Interface
to :: forall x. Rep Interface x -> Interface
Generic)
instance ToText Interface where
toText :: Interface -> Text
toText = \case
Interface
IDeviceNumber -> Text
"device-number"
Interface
IInterfaceId -> Text
"interface-id"
IIPV4Associations Text
ip -> Text
"ipv4-associations/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text -> Text
forall a. ToText a => a -> Text
toText Text
ip
Interface
IIPV6s -> Text
"ipv6s"
Interface
ILocalHostname -> Text
"local-hostname"
Interface
ILocalIPV4s -> Text
"local-ipv4s"
Interface
IMAC -> Text
"mac"
Interface
INetworkCardIndex -> Text
"network-card-index"
Interface
IOwnerId -> Text
"owner-id"
Interface
IPublicHostname -> Text
"public-hostname"
Interface
IPublicIPV4s -> Text
"public-ipv4s"
Interface
ISecurityGroups -> Text
"security-groups"
Interface
ISecurityGroupIds -> Text
"security-group-ids"
Interface
ISubnetId -> Text
"subnet-id"
Interface
ISubnetIPV4_CIDRBlock -> Text
"subnet-ipv4-cidr-block"
Interface
ISubnetIPV6_CIDRBlock -> Text
"subnet-ipv6-cidr-block"
Interface
IVPCId -> Text
"vpc-id"
Interface
IVPCIPV4_CIDRBlock -> Text
"vpc-ipv4-cidr-block"
Interface
IVPCIPV4_CIDRBlocks -> Text
"vpc-ipv4-cidr-blocks"
Interface
IVPCIPV6_CIDRBlocks -> Text
"vpc-ipv6-cidr-blocks"
data Placement
=
AvailabilityZone
|
AvailabilityZoneId
|
GroupName
|
HostId
|
PartitionNumber
|
Region
deriving stock (Placement -> Placement -> Bool
(Placement -> Placement -> Bool)
-> (Placement -> Placement -> Bool) -> Eq Placement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Placement -> Placement -> Bool
== :: Placement -> Placement -> Bool
$c/= :: Placement -> Placement -> Bool
/= :: Placement -> Placement -> Bool
Eq, Eq Placement
Eq Placement =>
(Placement -> Placement -> Ordering)
-> (Placement -> Placement -> Bool)
-> (Placement -> Placement -> Bool)
-> (Placement -> Placement -> Bool)
-> (Placement -> Placement -> Bool)
-> (Placement -> Placement -> Placement)
-> (Placement -> Placement -> Placement)
-> Ord Placement
Placement -> Placement -> Bool
Placement -> Placement -> Ordering
Placement -> Placement -> Placement
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Placement -> Placement -> Ordering
compare :: Placement -> Placement -> Ordering
$c< :: Placement -> Placement -> Bool
< :: Placement -> Placement -> Bool
$c<= :: Placement -> Placement -> Bool
<= :: Placement -> Placement -> Bool
$c> :: Placement -> Placement -> Bool
> :: Placement -> Placement -> Bool
$c>= :: Placement -> Placement -> Bool
>= :: Placement -> Placement -> Bool
$cmax :: Placement -> Placement -> Placement
max :: Placement -> Placement -> Placement
$cmin :: Placement -> Placement -> Placement
min :: Placement -> Placement -> Placement
Ord, Int -> Placement -> ShowS
[Placement] -> ShowS
Placement -> String
(Int -> Placement -> ShowS)
-> (Placement -> String)
-> ([Placement] -> ShowS)
-> Show Placement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Placement -> ShowS
showsPrec :: Int -> Placement -> ShowS
$cshow :: Placement -> String
show :: Placement -> String
$cshowList :: [Placement] -> ShowS
showList :: [Placement] -> ShowS
Show, (forall x. Placement -> Rep Placement x)
-> (forall x. Rep Placement x -> Placement) -> Generic Placement
forall x. Rep Placement x -> Placement
forall x. Placement -> Rep Placement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Placement -> Rep Placement x
from :: forall x. Placement -> Rep Placement x
$cto :: forall x. Rep Placement x -> Placement
to :: forall x. Rep Placement x -> Placement
Generic)
instance ToText Placement where
toText :: Placement -> Text
toText = \case
Placement
AvailabilityZone -> Text
"availability-zone"
Placement
AvailabilityZoneId -> Text
"availability-zone-id"
Placement
GroupName -> Text
"group-name"
Placement
HostId -> Text
"host-id"
Placement
PartitionNumber -> Text
"partition-number"
Placement
Region -> Text
"region"
data Services
=
Domain
|
Partition
deriving stock (Services -> Services -> Bool
(Services -> Services -> Bool)
-> (Services -> Services -> Bool) -> Eq Services
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Services -> Services -> Bool
== :: Services -> Services -> Bool
$c/= :: Services -> Services -> Bool
/= :: Services -> Services -> Bool
Eq, Eq Services
Eq Services =>
(Services -> Services -> Ordering)
-> (Services -> Services -> Bool)
-> (Services -> Services -> Bool)
-> (Services -> Services -> Bool)
-> (Services -> Services -> Bool)
-> (Services -> Services -> Services)
-> (Services -> Services -> Services)
-> Ord Services
Services -> Services -> Bool
Services -> Services -> Ordering
Services -> Services -> Services
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Services -> Services -> Ordering
compare :: Services -> Services -> Ordering
$c< :: Services -> Services -> Bool
< :: Services -> Services -> Bool
$c<= :: Services -> Services -> Bool
<= :: Services -> Services -> Bool
$c> :: Services -> Services -> Bool
> :: Services -> Services -> Bool
$c>= :: Services -> Services -> Bool
>= :: Services -> Services -> Bool
$cmax :: Services -> Services -> Services
max :: Services -> Services -> Services
$cmin :: Services -> Services -> Services
min :: Services -> Services -> Services
Ord, Int -> Services -> ShowS
[Services] -> ShowS
Services -> String
(Int -> Services -> ShowS)
-> (Services -> String) -> ([Services] -> ShowS) -> Show Services
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Services -> ShowS
showsPrec :: Int -> Services -> ShowS
$cshow :: Services -> String
show :: Services -> String
$cshowList :: [Services] -> ShowS
showList :: [Services] -> ShowS
Show, (forall x. Services -> Rep Services x)
-> (forall x. Rep Services x -> Services) -> Generic Services
forall x. Rep Services x -> Services
forall x. Services -> Rep Services x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Services -> Rep Services x
from :: forall x. Services -> Rep Services x
$cto :: forall x. Rep Services x -> Services
to :: forall x. Rep Services x -> Services
Generic)
instance ToText Services where
toText :: Services -> Text
toText = \case
Services
Domain -> Text
"domain"
Services
Partition -> Text
"partition"
data Spot
=
SInstanceAction
|
STerminationTime
deriving stock (Spot -> Spot -> Bool
(Spot -> Spot -> Bool) -> (Spot -> Spot -> Bool) -> Eq Spot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Spot -> Spot -> Bool
== :: Spot -> Spot -> Bool
$c/= :: Spot -> Spot -> Bool
/= :: Spot -> Spot -> Bool
Eq, Eq Spot
Eq Spot =>
(Spot -> Spot -> Ordering)
-> (Spot -> Spot -> Bool)
-> (Spot -> Spot -> Bool)
-> (Spot -> Spot -> Bool)
-> (Spot -> Spot -> Bool)
-> (Spot -> Spot -> Spot)
-> (Spot -> Spot -> Spot)
-> Ord Spot
Spot -> Spot -> Bool
Spot -> Spot -> Ordering
Spot -> Spot -> Spot
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Spot -> Spot -> Ordering
compare :: Spot -> Spot -> Ordering
$c< :: Spot -> Spot -> Bool
< :: Spot -> Spot -> Bool
$c<= :: Spot -> Spot -> Bool
<= :: Spot -> Spot -> Bool
$c> :: Spot -> Spot -> Bool
> :: Spot -> Spot -> Bool
$c>= :: Spot -> Spot -> Bool
>= :: Spot -> Spot -> Bool
$cmax :: Spot -> Spot -> Spot
max :: Spot -> Spot -> Spot
$cmin :: Spot -> Spot -> Spot
min :: Spot -> Spot -> Spot
Ord, Int -> Spot -> ShowS
[Spot] -> ShowS
Spot -> String
(Int -> Spot -> ShowS)
-> (Spot -> String) -> ([Spot] -> ShowS) -> Show Spot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Spot -> ShowS
showsPrec :: Int -> Spot -> ShowS
$cshow :: Spot -> String
show :: Spot -> String
$cshowList :: [Spot] -> ShowS
showList :: [Spot] -> ShowS
Show, (forall x. Spot -> Rep Spot x)
-> (forall x. Rep Spot x -> Spot) -> Generic Spot
forall x. Rep Spot x -> Spot
forall x. Spot -> Rep Spot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Spot -> Rep Spot x
from :: forall x. Spot -> Rep Spot x
$cto :: forall x. Rep Spot x -> Spot
to :: forall x. Rep Spot x -> Spot
Generic)
instance ToText Spot where
toText :: Spot -> Text
toText = \case
Spot
SInstanceAction -> Text
"instance-action"
Spot
STerminationTime -> Text
"termination-time"
data Tags
=
Instance
deriving stock (Tags -> Tags -> Bool
(Tags -> Tags -> Bool) -> (Tags -> Tags -> Bool) -> Eq Tags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Tags -> Tags -> Bool
== :: Tags -> Tags -> Bool
$c/= :: Tags -> Tags -> Bool
/= :: Tags -> Tags -> Bool
Eq, Eq Tags
Eq Tags =>
(Tags -> Tags -> Ordering)
-> (Tags -> Tags -> Bool)
-> (Tags -> Tags -> Bool)
-> (Tags -> Tags -> Bool)
-> (Tags -> Tags -> Bool)
-> (Tags -> Tags -> Tags)
-> (Tags -> Tags -> Tags)
-> Ord Tags
Tags -> Tags -> Bool
Tags -> Tags -> Ordering
Tags -> Tags -> Tags
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Tags -> Tags -> Ordering
compare :: Tags -> Tags -> Ordering
$c< :: Tags -> Tags -> Bool
< :: Tags -> Tags -> Bool
$c<= :: Tags -> Tags -> Bool
<= :: Tags -> Tags -> Bool
$c> :: Tags -> Tags -> Bool
> :: Tags -> Tags -> Bool
$c>= :: Tags -> Tags -> Bool
>= :: Tags -> Tags -> Bool
$cmax :: Tags -> Tags -> Tags
max :: Tags -> Tags -> Tags
$cmin :: Tags -> Tags -> Tags
min :: Tags -> Tags -> Tags
Ord, Int -> Tags -> ShowS
[Tags] -> ShowS
Tags -> String
(Int -> Tags -> ShowS)
-> (Tags -> String) -> ([Tags] -> ShowS) -> Show Tags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Tags -> ShowS
showsPrec :: Int -> Tags -> ShowS
$cshow :: Tags -> String
show :: Tags -> String
$cshowList :: [Tags] -> ShowS
showList :: [Tags] -> ShowS
Show, (forall x. Tags -> Rep Tags x)
-> (forall x. Rep Tags x -> Tags) -> Generic Tags
forall x. Rep Tags x -> Tags
forall x. Tags -> Rep Tags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Tags -> Rep Tags x
from :: forall x. Tags -> Rep Tags x
$cto :: forall x. Rep Tags x -> Tags
to :: forall x. Rep Tags x -> Tags
Generic)
instance ToText Tags where
toText :: Tags -> Text
toText = \case
Tags
Instance -> Text
"instance"
latest :: Text
latest :: Text
latest = Text
"http://169.254.169.254/latest/"
isEC2 :: MonadIO m => Client.Manager -> m Bool
isEC2 :: forall (m :: * -> *). MonadIO m => Manager -> m Bool
isEC2 Manager
m = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> (HttpException -> IO Bool) -> IO Bool
forall e a. Exception e => IO a -> (e -> IO a) -> IO a
Exception.catch IO Bool
req HttpException -> IO Bool
err)
where
req :: IO Bool
req = do
!ByteString
_ <- Manager -> Text -> IO ByteString
forall (m :: * -> *). MonadIO m => Manager -> Text -> m ByteString
get Manager
m Text
"http://instance-data/latest"
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
err :: Client.HttpException -> IO Bool
err :: HttpException -> IO Bool
err = IO Bool -> HttpException -> IO Bool
forall a b. a -> b -> a
const (Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False)
dynamic :: MonadIO m => Client.Manager -> Dynamic -> m ByteString
dynamic :: forall (m :: * -> *).
MonadIO m =>
Manager -> Dynamic -> m ByteString
dynamic Manager
m = Manager -> Text -> m ByteString
forall (m :: * -> *). MonadIO m => Manager -> Text -> m ByteString
get Manager
m (Text -> m ByteString)
-> (Dynamic -> Text) -> Dynamic -> m ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Text -> Text
forall a. Monoid a => a -> a -> a
mappend Text
latest (Text -> Text) -> (Dynamic -> Text) -> Dynamic -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Dynamic -> Text
forall a. ToText a => a -> Text
toText
metadata :: MonadIO m => Client.Manager -> Metadata -> m ByteString
metadata :: forall (m :: * -> *).
MonadIO m =>
Manager -> Metadata -> m ByteString
metadata Manager
m = Manager -> Text -> m ByteString
forall (m :: * -> *). MonadIO m => Manager -> Text -> m ByteString
get Manager
m (Text -> m ByteString)
-> (Metadata -> Text) -> Metadata -> m ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Text -> Text
forall a. Monoid a => a -> a -> a
mappend Text
latest (Text -> Text) -> (Metadata -> Text) -> Metadata -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Metadata -> Text
forall a. ToText a => a -> Text
toText
userdata :: MonadIO m => Client.Manager -> m (Maybe ByteString)
userdata :: forall (m :: * -> *). MonadIO m => Manager -> m (Maybe ByteString)
userdata Manager
m =
IO (Maybe ByteString) -> m (Maybe ByteString)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString) -> m (Maybe ByteString))
-> IO (Maybe ByteString) -> m (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$
IO ByteString -> IO (Either HttpException ByteString)
forall e a. Exception e => IO a -> IO (Either e a)
Exception.try (Manager -> Text -> IO ByteString
forall (m :: * -> *). MonadIO m => Manager -> Text -> m ByteString
get Manager
m (Text
latest Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"user-data")) IO (Either HttpException ByteString)
-> (Either HttpException ByteString -> IO (Maybe ByteString))
-> IO (Maybe ByteString)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
Left (Client.HttpExceptionRequest Request
_ (Client.StatusCodeException Response ()
rs ByteString
_))
| Status -> Int
forall a. Enum a => a -> Int
fromEnum (Response () -> Status
forall body. Response body -> Status
Client.responseStatus Response ()
rs) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
404 ->
Maybe ByteString -> IO (Maybe ByteString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ByteString
forall a. Maybe a
Nothing
Left HttpException
e -> HttpException -> IO (Maybe ByteString)
forall e a. Exception e => e -> IO a
Exception.throwIO HttpException
e
Right ByteString
b -> Maybe ByteString -> IO (Maybe ByteString)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just ByteString
b)
data IdentityDocument = IdentityDocument
{ IdentityDocument -> Maybe [Text]
devpayProductCodes :: Maybe [Text],
IdentityDocument -> Maybe [Text]
billingProducts :: Maybe [Text],
IdentityDocument -> Maybe Text
version :: Maybe Text,
IdentityDocument -> Maybe Text
privateIp :: Maybe Text,
IdentityDocument -> Text
availabilityZone :: Text,
IdentityDocument -> Region
region :: Region,
IdentityDocument -> Text
instanceId :: Text,
IdentityDocument -> Text
instanceType :: Text,
IdentityDocument -> Text
accountId :: Text,
IdentityDocument -> Maybe Text
imageId :: Maybe Text,
IdentityDocument -> Maybe Text
kernelId :: Maybe Text,
IdentityDocument -> Maybe Text
ramdiskId :: Maybe Text,
IdentityDocument -> Maybe Text
architecture :: Maybe Text,
IdentityDocument -> Maybe ISO8601
pendingTime :: Maybe ISO8601
}
deriving stock (IdentityDocument -> IdentityDocument -> Bool
(IdentityDocument -> IdentityDocument -> Bool)
-> (IdentityDocument -> IdentityDocument -> Bool)
-> Eq IdentityDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IdentityDocument -> IdentityDocument -> Bool
== :: IdentityDocument -> IdentityDocument -> Bool
$c/= :: IdentityDocument -> IdentityDocument -> Bool
/= :: IdentityDocument -> IdentityDocument -> Bool
Eq, Int -> IdentityDocument -> ShowS
[IdentityDocument] -> ShowS
IdentityDocument -> String
(Int -> IdentityDocument -> ShowS)
-> (IdentityDocument -> String)
-> ([IdentityDocument] -> ShowS)
-> Show IdentityDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IdentityDocument -> ShowS
showsPrec :: Int -> IdentityDocument -> ShowS
$cshow :: IdentityDocument -> String
show :: IdentityDocument -> String
$cshowList :: [IdentityDocument] -> ShowS
showList :: [IdentityDocument] -> ShowS
Show, (forall x. IdentityDocument -> Rep IdentityDocument x)
-> (forall x. Rep IdentityDocument x -> IdentityDocument)
-> Generic IdentityDocument
forall x. Rep IdentityDocument x -> IdentityDocument
forall x. IdentityDocument -> Rep IdentityDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IdentityDocument -> Rep IdentityDocument x
from :: forall x. IdentityDocument -> Rep IdentityDocument x
$cto :: forall x. Rep IdentityDocument x -> IdentityDocument
to :: forall x. Rep IdentityDocument x -> IdentityDocument
Generic)
instance FromJSON IdentityDocument where
parseJSON :: Value -> Parser IdentityDocument
parseJSON = String
-> (Object -> Parser IdentityDocument)
-> Value
-> Parser IdentityDocument
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"dynamic/instance-identity/document" ((Object -> Parser IdentityDocument)
-> Value -> Parser IdentityDocument)
-> (Object -> Parser IdentityDocument)
-> Value
-> Parser IdentityDocument
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe [Text]
devpayProductCodes <- Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"devpayProductCodes"
Maybe [Text]
billingProducts <- Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"billingProducts"
Maybe Text
privateIp <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"privateIp"
Maybe Text
version <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"version"
Text
availabilityZone <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"availabilityZone"
Region
region <- Object
o Object -> Key -> Parser Region
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"region"
Text
instanceId <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"instanceId"
Text
instanceType <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"instanceType"
Text
accountId <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"accountId"
Maybe Text
imageId <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"imageId"
Maybe Text
kernelId <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"kernelId"
Maybe Text
ramdiskId <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"ramdiskId"
Maybe Text
architecture <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"architecture"
Maybe ISO8601
pendingTime <- Object
o Object -> Key -> Parser (Maybe ISO8601)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"pendingTime"
IdentityDocument -> Parser IdentityDocument
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure IdentityDocument {Maybe [Text]
Maybe Text
Maybe ISO8601
Text
Region
$sel:devpayProductCodes:IdentityDocument :: Maybe [Text]
$sel:billingProducts:IdentityDocument :: Maybe [Text]
$sel:version:IdentityDocument :: Maybe Text
$sel:privateIp:IdentityDocument :: Maybe Text
$sel:availabilityZone:IdentityDocument :: Text
$sel:region:IdentityDocument :: Region
$sel:instanceId:IdentityDocument :: Text
$sel:instanceType:IdentityDocument :: Text
$sel:accountId:IdentityDocument :: Text
$sel:imageId:IdentityDocument :: Maybe Text
$sel:kernelId:IdentityDocument :: Maybe Text
$sel:ramdiskId:IdentityDocument :: Maybe Text
$sel:architecture:IdentityDocument :: Maybe Text
$sel:pendingTime:IdentityDocument :: Maybe ISO8601
devpayProductCodes :: Maybe [Text]
billingProducts :: Maybe [Text]
privateIp :: Maybe Text
version :: Maybe Text
availabilityZone :: Text
region :: Region
instanceId :: Text
instanceType :: Text
accountId :: Text
imageId :: Maybe Text
kernelId :: Maybe Text
ramdiskId :: Maybe Text
architecture :: Maybe Text
pendingTime :: Maybe ISO8601
..}
instance ToJSON IdentityDocument where
toJSON :: IdentityDocument -> Value
toJSON IdentityDocument {Maybe [Text]
Maybe Text
Maybe ISO8601
Text
Region
$sel:devpayProductCodes:IdentityDocument :: IdentityDocument -> Maybe [Text]
$sel:billingProducts:IdentityDocument :: IdentityDocument -> Maybe [Text]
$sel:version:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:privateIp:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:availabilityZone:IdentityDocument :: IdentityDocument -> Text
$sel:region:IdentityDocument :: IdentityDocument -> Region
$sel:instanceId:IdentityDocument :: IdentityDocument -> Text
$sel:instanceType:IdentityDocument :: IdentityDocument -> Text
$sel:accountId:IdentityDocument :: IdentityDocument -> Text
$sel:imageId:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:kernelId:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:ramdiskId:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:architecture:IdentityDocument :: IdentityDocument -> Maybe Text
$sel:pendingTime:IdentityDocument :: IdentityDocument -> Maybe ISO8601
devpayProductCodes :: Maybe [Text]
billingProducts :: Maybe [Text]
version :: Maybe Text
privateIp :: Maybe Text
availabilityZone :: Text
region :: Region
instanceId :: Text
instanceType :: Text
accountId :: Text
imageId :: Maybe Text
kernelId :: Maybe Text
ramdiskId :: Maybe Text
architecture :: Maybe Text
pendingTime :: Maybe ISO8601
..} =
[Pair] -> Value
object
[ Key
"devpayProductCodes" Key -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe [Text]
devpayProductCodes,
Key
"billingProducts" Key -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe [Text]
billingProducts,
Key
"privateIp" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
privateIp,
Key
"version" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
version,
Key
"availabilityZone" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text
availabilityZone,
Key
"region" Key -> Region -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Region
region,
Key
"instanceId" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text
instanceId,
Key
"instanceType" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text
instanceType,
Key
"accountId" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text
accountId,
Key
"imageId" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
imageId,
Key
"kernelId" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
kernelId,
Key
"ramdiskId" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
ramdiskId,
Key
"architecture" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Text
architecture
]
{-# INLINE identityDocument_devpayProductCodes #-}
identityDocument_devpayProductCodes :: Lens' IdentityDocument (Maybe [Text])
identityDocument_devpayProductCodes :: Lens' IdentityDocument (Maybe [Text])
identityDocument_devpayProductCodes Maybe [Text] -> f (Maybe [Text])
f i :: IdentityDocument
i@IdentityDocument {Maybe [Text]
$sel:devpayProductCodes:IdentityDocument :: IdentityDocument -> Maybe [Text]
devpayProductCodes :: Maybe [Text]
devpayProductCodes} = Maybe [Text] -> f (Maybe [Text])
f Maybe [Text]
devpayProductCodes f (Maybe [Text])
-> (Maybe [Text] -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe [Text]
devpayProductCodes' -> IdentityDocument
i {devpayProductCodes = devpayProductCodes'}
{-# INLINE identityDocument_billingProducts #-}
identityDocument_billingProducts :: Lens' IdentityDocument (Maybe [Text])
identityDocument_billingProducts :: Lens' IdentityDocument (Maybe [Text])
identityDocument_billingProducts Maybe [Text] -> f (Maybe [Text])
f i :: IdentityDocument
i@IdentityDocument {Maybe [Text]
$sel:billingProducts:IdentityDocument :: IdentityDocument -> Maybe [Text]
billingProducts :: Maybe [Text]
billingProducts} = Maybe [Text] -> f (Maybe [Text])
f Maybe [Text]
billingProducts f (Maybe [Text])
-> (Maybe [Text] -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe [Text]
billingProducts' -> IdentityDocument
i {billingProducts = billingProducts'}
{-# INLINE identityDocument_version #-}
identityDocument_version :: Lens' IdentityDocument (Maybe Text)
identityDocument_version :: Lens' IdentityDocument (Maybe Text)
identityDocument_version Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:version:IdentityDocument :: IdentityDocument -> Maybe Text
version :: Maybe Text
version} = Maybe Text -> f (Maybe Text)
f Maybe Text
version f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
version' -> IdentityDocument
i {version = version'}
{-# INLINE identityDocument_privateIp #-}
identityDocument_privateIp :: Lens' IdentityDocument (Maybe Text)
identityDocument_privateIp :: Lens' IdentityDocument (Maybe Text)
identityDocument_privateIp Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:privateIp:IdentityDocument :: IdentityDocument -> Maybe Text
privateIp :: Maybe Text
privateIp} = Maybe Text -> f (Maybe Text)
f Maybe Text
privateIp f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
privateIp' -> IdentityDocument
i {privateIp = privateIp'}
{-# INLINE identityDocument_availabilityZone #-}
identityDocument_availabilityZone :: Lens' IdentityDocument Text
identityDocument_availabilityZone :: Lens' IdentityDocument Text
identityDocument_availabilityZone Text -> f Text
f i :: IdentityDocument
i@IdentityDocument {Text
$sel:availabilityZone:IdentityDocument :: IdentityDocument -> Text
availabilityZone :: Text
availabilityZone} = Text -> f Text
f Text
availabilityZone f Text -> (Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Text
availabilityZone' -> IdentityDocument
i {availabilityZone = availabilityZone'}
{-# INLINE identityDocument_region #-}
identityDocument_region :: Lens' IdentityDocument Region
identityDocument_region :: Lens' IdentityDocument Region
identityDocument_region Region -> f Region
f i :: IdentityDocument
i@IdentityDocument {Region
$sel:region:IdentityDocument :: IdentityDocument -> Region
region :: Region
region} = Region -> f Region
f Region
region f Region -> (Region -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Region
region' -> IdentityDocument
i {region = region'}
{-# INLINE identityDocument_instanceId #-}
identityDocument_instanceId :: Lens' IdentityDocument Text
identityDocument_instanceId :: Lens' IdentityDocument Text
identityDocument_instanceId Text -> f Text
f i :: IdentityDocument
i@IdentityDocument {Text
$sel:instanceId:IdentityDocument :: IdentityDocument -> Text
instanceId :: Text
instanceId} = Text -> f Text
f Text
instanceId f Text -> (Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Text
instanceId' -> IdentityDocument
i {instanceId = instanceId'}
{-# INLINE identityDocument_instanceType #-}
identityDocument_instanceType :: Lens' IdentityDocument Text
identityDocument_instanceType :: Lens' IdentityDocument Text
identityDocument_instanceType Text -> f Text
f i :: IdentityDocument
i@IdentityDocument {Text
$sel:instanceType:IdentityDocument :: IdentityDocument -> Text
instanceType :: Text
instanceType} = Text -> f Text
f Text
instanceType f Text -> (Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Text
instanceType' -> IdentityDocument
i {instanceType = instanceType'}
{-# INLINE identityDocument_accountId #-}
identityDocument_accountId :: Lens' IdentityDocument Text
identityDocument_accountId :: Lens' IdentityDocument Text
identityDocument_accountId Text -> f Text
f i :: IdentityDocument
i@IdentityDocument {Text
$sel:accountId:IdentityDocument :: IdentityDocument -> Text
accountId :: Text
accountId} = Text -> f Text
f Text
accountId f Text -> (Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Text
accountId' -> IdentityDocument
i {accountId = accountId'}
{-# INLINE identityDocument_imageId #-}
identityDocument_imageId :: Lens' IdentityDocument (Maybe Text)
identityDocument_imageId :: Lens' IdentityDocument (Maybe Text)
identityDocument_imageId Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:imageId:IdentityDocument :: IdentityDocument -> Maybe Text
imageId :: Maybe Text
imageId} = Maybe Text -> f (Maybe Text)
f Maybe Text
imageId f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
imageId' -> IdentityDocument
i {imageId = imageId'}
{-# INLINE identityDocument_kernelId #-}
identityDocument_kernelId :: Lens' IdentityDocument (Maybe Text)
identityDocument_kernelId :: Lens' IdentityDocument (Maybe Text)
identityDocument_kernelId Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:kernelId:IdentityDocument :: IdentityDocument -> Maybe Text
kernelId :: Maybe Text
kernelId} = Maybe Text -> f (Maybe Text)
f Maybe Text
kernelId f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
kernelId' -> IdentityDocument
i {kernelId = kernelId'}
{-# INLINE identityDocument_ramdiskId #-}
identityDocument_ramdiskId :: Lens' IdentityDocument (Maybe Text)
identityDocument_ramdiskId :: Lens' IdentityDocument (Maybe Text)
identityDocument_ramdiskId Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:ramdiskId:IdentityDocument :: IdentityDocument -> Maybe Text
ramdiskId :: Maybe Text
ramdiskId} = Maybe Text -> f (Maybe Text)
f Maybe Text
ramdiskId f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
ramdiskId' -> IdentityDocument
i {ramdiskId = ramdiskId'}
{-# INLINE identityDocument_architecture #-}
identityDocument_architecture :: Lens' IdentityDocument (Maybe Text)
identityDocument_architecture :: Lens' IdentityDocument (Maybe Text)
identityDocument_architecture Maybe Text -> f (Maybe Text)
f i :: IdentityDocument
i@IdentityDocument {Maybe Text
$sel:architecture:IdentityDocument :: IdentityDocument -> Maybe Text
architecture :: Maybe Text
architecture} = Maybe Text -> f (Maybe Text)
f Maybe Text
architecture f (Maybe Text)
-> (Maybe Text -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe Text
architecture' -> IdentityDocument
i {architecture = architecture'}
{-# INLINE identityDocument_pendingTime #-}
identityDocument_pendingTime :: Lens' IdentityDocument (Maybe ISO8601)
identityDocument_pendingTime :: Lens' IdentityDocument (Maybe ISO8601)
identityDocument_pendingTime Maybe ISO8601 -> f (Maybe ISO8601)
f i :: IdentityDocument
i@IdentityDocument {Maybe ISO8601
$sel:pendingTime:IdentityDocument :: IdentityDocument -> Maybe ISO8601
pendingTime :: Maybe ISO8601
pendingTime} = Maybe ISO8601 -> f (Maybe ISO8601)
f Maybe ISO8601
pendingTime f (Maybe ISO8601)
-> (Maybe ISO8601 -> IdentityDocument) -> f IdentityDocument
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe ISO8601
pendingTime' -> IdentityDocument
i {pendingTime = pendingTime'}
identity ::
MonadIO m =>
Client.Manager ->
m (Either String IdentityDocument)
identity :: forall (m :: * -> *).
MonadIO m =>
Manager -> m (Either String IdentityDocument)
identity Manager
m = ByteString -> Either String IdentityDocument
forall a. FromJSON a => ByteString -> Either String a
eitherDecode (ByteString -> Either String IdentityDocument)
-> (ByteString -> ByteString)
-> ByteString
-> Either String IdentityDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
LBS.fromStrict (ByteString -> Either String IdentityDocument)
-> m ByteString -> m (Either String IdentityDocument)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Manager -> Dynamic -> m ByteString
forall (m :: * -> *).
MonadIO m =>
Manager -> Dynamic -> m ByteString
dynamic Manager
m Dynamic
Document
get :: MonadIO m => Client.Manager -> Text -> m ByteString
get :: forall (m :: * -> *). MonadIO m => Manager -> Text -> m ByteString
get Manager
m Text
url = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
ByteString
token <- ByteString -> ByteString
strip (ByteString -> ByteString) -> IO ByteString -> IO ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO ByteString
requestToken
ByteString -> ByteString
strip (ByteString -> ByteString) -> IO ByteString -> IO ByteString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Request -> Request) -> Manager -> Text -> IO ByteString
requestWith (ByteString -> Request -> Request
addToken ByteString
token) Manager
m Text
url
where
requestToken :: IO ByteString
requestToken =
(Request -> Request) -> Manager -> Text -> IO ByteString
requestWith
( ByteString -> Request -> Request
setRequestMethod ByteString
"PUT"
(Request -> Request) -> (Request -> Request) -> Request -> Request
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HeaderName -> [ByteString] -> Request -> Request
setRequestHeader HeaderName
"X-aws-ec2-metadata-token-ttl-seconds" [ByteString
"60"]
)
Manager
m
(Text
latest Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"api/token")
addToken :: ByteString -> Request -> Request
addToken ByteString
token = HeaderName -> [ByteString] -> Request -> Request
setRequestHeader HeaderName
"X-aws-ec2-metadata-token" [ByteString
token]
strip :: ByteString -> ByteString
strip ByteString
bs
| ByteString -> ByteString -> Bool
BS8.isSuffixOf ByteString
"\n" ByteString
bs = HasCallStack => ByteString -> ByteString
ByteString -> ByteString
BS8.init ByteString
bs
| Bool
otherwise = ByteString
bs
requestWith ::
(Client.Request -> Client.Request) ->
Client.Manager ->
Text ->
IO ByteString
requestWith :: (Request -> Request) -> Manager -> Text -> IO ByteString
requestWith Request -> Request
modifyRequest Manager
m Text
url = do
Request
rq <- String -> IO Request
forall (m :: * -> *). MonadThrow m => String -> m Request
Client.parseUrlThrow (Text -> String
Text.unpack Text
url)
Response ByteString
rs <- Request -> Manager -> IO (Response ByteString)
Client.httpLbs (Request -> Request
modifyRequest Request
rq) Manager
m
ByteString -> IO ByteString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (ByteString -> IO ByteString)
-> (ByteString -> ByteString) -> ByteString -> IO ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
LBS.toStrict (ByteString -> IO ByteString) -> ByteString -> IO ByteString
forall a b. (a -> b) -> a -> b
$ Response ByteString -> ByteString
forall body. Response body -> body
Client.responseBody Response ByteString
rs