module Network.AWS.Route53.Types
(
Route53
, RESTError
, ns
, AliasTarget
, aliasTarget
, atDNSName
, atEvaluateTargetHealth
, atHostedZoneId
, ResourceRecord
, resourceRecord
, rrValue
, Tag
, tag
, tagKey
, tagValue
, GeoLocationDetails
, geoLocationDetails
, gldContinentCode
, gldContinentName
, gldCountryCode
, gldCountryName
, gldSubdivisionCode
, gldSubdivisionName
, HealthCheck
, healthCheck
, hcCallerReference
, hcHealthCheckConfig
, hcHealthCheckVersion
, hcId
, VPCRegion (..)
, RecordType (..)
, ChangeAction (..)
, TagResourceType (..)
, HealthCheckConfig
, healthCheckConfig
, hccFailureThreshold
, hccFullyQualifiedDomainName
, hccIPAddress
, hccPort
, hccRequestInterval
, hccResourcePath
, hccSearchString
, hccType
, Change
, change
, cAction
, cResourceRecordSet
, Failover (..)
, HostedZone
, hostedZone
, hzCallerReference
, hzConfig
, hzId
, hzName
, hzResourceRecordSetCount
, ResourceTagSet
, resourceTagSet
, rtsResourceId
, rtsResourceType
, rtsTags
, ChangeStatus (..)
, ChangeBatch
, changeBatch
, cbChanges
, cbComment
, StatusReport
, statusReport
, srCheckedTime
, srStatus
, HealthCheckType (..)
, VPC
, vpc
, vpcVPCId
, vpcVPCRegion
, HostedZoneConfig
, hostedZoneConfig
, hzcComment
, hzcPrivateZone
, ResourceRecordSet
, resourceRecordSet
, rrsAliasTarget
, rrsFailover
, rrsGeoLocation
, rrsHealthCheckId
, rrsName
, rrsRegion
, rrsResourceRecords
, rrsSetIdentifier
, rrsTTL
, rrsType
, rrsWeight
, DelegationSet
, delegationSet
, dsCallerReference
, dsId
, dsNameServers
, ChangeInfo
, changeInfo
, ciComment
, ciId
, ciStatus
, ciSubmittedAt
, GeoLocation
, geoLocation
, glContinentCode
, glCountryCode
, glSubdivisionCode
, HealthCheckObservation
, healthCheckObservation
, hcoIPAddress
, hcoStatusReport
, module Network.AWS.Route53.Internal
) where
import Network.AWS.Error
import Network.AWS.Prelude
import Network.AWS.Signing.V3
import Network.AWS.Route53.Internal
import qualified GHC.Exts
data Route53
instance AWSService Route53 where
type Sg Route53 = V3
type Er Route53 = RESTError
service = Service
{ _svcEndpoint = global
, _svcAbbrev = "Route53"
, _svcPrefix = "route53"
, _svcVersion = "2013-04-01"
, _svcTargetPrefix = Nothing
, _svcJSONVersion = Nothing
}
handle = restError statusSuccess
ns :: Text
ns = "http://route53.amazonaws.com/doc/2013-04-01/"
data AliasTarget = AliasTarget
{ _atDNSName :: Text
, _atEvaluateTargetHealth :: Bool
, _atHostedZoneId :: Text
} deriving (Eq, Ord, Show)
aliasTarget :: Text
-> Text
-> Bool
-> AliasTarget
aliasTarget p1 p2 p3 = AliasTarget
{ _atHostedZoneId = p1
, _atDNSName = p2
, _atEvaluateTargetHealth = p3
}
atDNSName :: Lens' AliasTarget Text
atDNSName = lens _atDNSName (\s a -> s { _atDNSName = a })
atEvaluateTargetHealth :: Lens' AliasTarget Bool
atEvaluateTargetHealth =
lens _atEvaluateTargetHealth (\s a -> s { _atEvaluateTargetHealth = a })
atHostedZoneId :: Lens' AliasTarget Text
atHostedZoneId = lens _atHostedZoneId (\s a -> s { _atHostedZoneId = a })
instance FromXML AliasTarget where
parseXML x = AliasTarget
<$> x .@ "DNSName"
<*> x .@ "EvaluateTargetHealth"
<*> x .@ "HostedZoneId"
instance ToXML AliasTarget where
toXML AliasTarget{..} = nodes "AliasTarget"
[ "HostedZoneId" =@ _atHostedZoneId
, "DNSName" =@ _atDNSName
, "EvaluateTargetHealth" =@ _atEvaluateTargetHealth
]
newtype ResourceRecord = ResourceRecord
{ _rrValue :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
resourceRecord :: Text
-> ResourceRecord
resourceRecord p1 = ResourceRecord
{ _rrValue = p1
}
rrValue :: Lens' ResourceRecord Text
rrValue = lens _rrValue (\s a -> s { _rrValue = a })
instance FromXML ResourceRecord where
parseXML x = ResourceRecord
<$> x .@ "Value"
instance ToXML ResourceRecord where
toXML ResourceRecord{..} = nodes "ResourceRecord"
[ "Value" =@ _rrValue
]
data Tag = Tag
{ _tagKey :: Maybe Text
, _tagValue :: Maybe Text
} deriving (Eq, Ord, Show)
tag :: Tag
tag = Tag
{ _tagKey = Nothing
, _tagValue = Nothing
}
tagKey :: Lens' Tag (Maybe Text)
tagKey = lens _tagKey (\s a -> s { _tagKey = a })
tagValue :: Lens' Tag (Maybe Text)
tagValue = lens _tagValue (\s a -> s { _tagValue = a })
instance FromXML Tag where
parseXML x = Tag
<$> x .@? "Key"
<*> x .@? "Value"
instance ToXML Tag where
toXML Tag{..} = nodes "Tag"
[ "Key" =@ _tagKey
, "Value" =@ _tagValue
]
data GeoLocationDetails = GeoLocationDetails
{ _gldContinentCode :: Maybe Text
, _gldContinentName :: Maybe Text
, _gldCountryCode :: Maybe Text
, _gldCountryName :: Maybe Text
, _gldSubdivisionCode :: Maybe Text
, _gldSubdivisionName :: Maybe Text
} deriving (Eq, Ord, Show)
geoLocationDetails :: GeoLocationDetails
geoLocationDetails = GeoLocationDetails
{ _gldContinentCode = Nothing
, _gldContinentName = Nothing
, _gldCountryCode = Nothing
, _gldCountryName = Nothing
, _gldSubdivisionCode = Nothing
, _gldSubdivisionName = Nothing
}
gldContinentCode :: Lens' GeoLocationDetails (Maybe Text)
gldContinentCode = lens _gldContinentCode (\s a -> s { _gldContinentCode = a })
gldContinentName :: Lens' GeoLocationDetails (Maybe Text)
gldContinentName = lens _gldContinentName (\s a -> s { _gldContinentName = a })
gldCountryCode :: Lens' GeoLocationDetails (Maybe Text)
gldCountryCode = lens _gldCountryCode (\s a -> s { _gldCountryCode = a })
gldCountryName :: Lens' GeoLocationDetails (Maybe Text)
gldCountryName = lens _gldCountryName (\s a -> s { _gldCountryName = a })
gldSubdivisionCode :: Lens' GeoLocationDetails (Maybe Text)
gldSubdivisionCode =
lens _gldSubdivisionCode (\s a -> s { _gldSubdivisionCode = a })
gldSubdivisionName :: Lens' GeoLocationDetails (Maybe Text)
gldSubdivisionName =
lens _gldSubdivisionName (\s a -> s { _gldSubdivisionName = a })
instance FromXML GeoLocationDetails where
parseXML x = GeoLocationDetails
<$> x .@? "ContinentCode"
<*> x .@? "ContinentName"
<*> x .@? "CountryCode"
<*> x .@? "CountryName"
<*> x .@? "SubdivisionCode"
<*> x .@? "SubdivisionName"
instance ToXML GeoLocationDetails where
toXML GeoLocationDetails{..} = nodes "GeoLocationDetails"
[ "ContinentCode" =@ _gldContinentCode
, "ContinentName" =@ _gldContinentName
, "CountryCode" =@ _gldCountryCode
, "CountryName" =@ _gldCountryName
, "SubdivisionCode" =@ _gldSubdivisionCode
, "SubdivisionName" =@ _gldSubdivisionName
]
data HealthCheck = HealthCheck
{ _hcCallerReference :: Text
, _hcHealthCheckConfig :: HealthCheckConfig
, _hcHealthCheckVersion :: Nat
, _hcId :: Text
} deriving (Eq, Show)
healthCheck :: Text
-> Text
-> HealthCheckConfig
-> Natural
-> HealthCheck
healthCheck p1 p2 p3 p4 = HealthCheck
{ _hcId = p1
, _hcCallerReference = p2
, _hcHealthCheckConfig = p3
, _hcHealthCheckVersion = withIso _Nat (const id) p4
}
hcCallerReference :: Lens' HealthCheck Text
hcCallerReference =
lens _hcCallerReference (\s a -> s { _hcCallerReference = a })
hcHealthCheckConfig :: Lens' HealthCheck HealthCheckConfig
hcHealthCheckConfig =
lens _hcHealthCheckConfig (\s a -> s { _hcHealthCheckConfig = a })
hcHealthCheckVersion :: Lens' HealthCheck Natural
hcHealthCheckVersion =
lens _hcHealthCheckVersion (\s a -> s { _hcHealthCheckVersion = a })
. _Nat
hcId :: Lens' HealthCheck Text
hcId = lens _hcId (\s a -> s { _hcId = a })
instance FromXML HealthCheck where
parseXML x = HealthCheck
<$> x .@ "CallerReference"
<*> x .@ "HealthCheckConfig"
<*> x .@ "HealthCheckVersion"
<*> x .@ "Id"
instance ToXML HealthCheck where
toXML HealthCheck{..} = nodes "HealthCheck"
[ "Id" =@ _hcId
, "CallerReference" =@ _hcCallerReference
, "HealthCheckConfig" =@ _hcHealthCheckConfig
, "HealthCheckVersion" =@ _hcHealthCheckVersion
]
data VPCRegion
= ApNortheast1
| ApSoutheast1
| ApSoutheast2
| CnNorth1
| EuCentral1
| EuWest1
| SaEast1
| UsEast1
| UsWest1
| UsWest2
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable VPCRegion
instance FromText VPCRegion where
parser = takeText >>= \case
"ap-northeast-1" -> pure ApNortheast1
"ap-southeast-1" -> pure ApSoutheast1
"ap-southeast-2" -> pure ApSoutheast2
"cn-north-1" -> pure CnNorth1
"eu-central-1" -> pure EuCentral1
"eu-west-1" -> pure EuWest1
"sa-east-1" -> pure SaEast1
"us-east-1" -> pure UsEast1
"us-west-1" -> pure UsWest1
"us-west-2" -> pure UsWest2
e -> fail $
"Failure parsing VPCRegion from " ++ show e
instance ToText VPCRegion where
toText = \case
ApNortheast1 -> "ap-northeast-1"
ApSoutheast1 -> "ap-southeast-1"
ApSoutheast2 -> "ap-southeast-2"
CnNorth1 -> "cn-north-1"
EuCentral1 -> "eu-central-1"
EuWest1 -> "eu-west-1"
SaEast1 -> "sa-east-1"
UsEast1 -> "us-east-1"
UsWest1 -> "us-west-1"
UsWest2 -> "us-west-2"
instance ToByteString VPCRegion
instance ToHeader VPCRegion
instance ToQuery VPCRegion
instance FromXML VPCRegion where
parseXML = parseXMLText "VPCRegion"
instance ToXML VPCRegion where
toXML = toXMLText
data RecordType
= A
| AAAA
| CNAME
| MX
| NS
| PTR
| SOA
| SPF
| SRV
| TXT
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable RecordType
instance FromText RecordType where
parser = takeText >>= \case
"A" -> pure A
"AAAA" -> pure AAAA
"CNAME" -> pure CNAME
"MX" -> pure MX
"NS" -> pure NS
"PTR" -> pure PTR
"SOA" -> pure SOA
"SPF" -> pure SPF
"SRV" -> pure SRV
"TXT" -> pure TXT
e -> fail $
"Failure parsing RecordType from " ++ show e
instance ToText RecordType where
toText = \case
A -> "A"
AAAA -> "AAAA"
CNAME -> "CNAME"
MX -> "MX"
NS -> "NS"
PTR -> "PTR"
SOA -> "SOA"
SPF -> "SPF"
SRV -> "SRV"
TXT -> "TXT"
instance ToByteString RecordType
instance ToHeader RecordType
instance ToQuery RecordType
instance FromXML RecordType where
parseXML = parseXMLText "RecordType"
instance ToXML RecordType where
toXML = toXMLText
data ChangeAction
= Create
| Delete'
| Upsert
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ChangeAction
instance FromText ChangeAction where
parser = takeText >>= \case
"CREATE" -> pure Create
"DELETE" -> pure Delete'
"UPSERT" -> pure Upsert
e -> fail $
"Failure parsing ChangeAction from " ++ show e
instance ToText ChangeAction where
toText = \case
Create -> "CREATE"
Delete' -> "DELETE"
Upsert -> "UPSERT"
instance ToByteString ChangeAction
instance ToHeader ChangeAction
instance ToQuery ChangeAction
instance FromXML ChangeAction where
parseXML = parseXMLText "ChangeAction"
instance ToXML ChangeAction where
toXML = toXMLText
data TagResourceType
= Healthcheck
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable TagResourceType
instance FromText TagResourceType where
parser = takeText >>= \case
"healthcheck" -> pure Healthcheck
e -> fail $
"Failure parsing TagResourceType from " ++ show e
instance ToText TagResourceType where
toText Healthcheck = "healthcheck"
instance ToByteString TagResourceType
instance ToHeader TagResourceType
instance ToQuery TagResourceType
instance FromXML TagResourceType where
parseXML = parseXMLText "TagResourceType"
instance ToXML TagResourceType where
toXML = toXMLText
data HealthCheckConfig = HealthCheckConfig
{ _hccFailureThreshold :: Maybe Nat
, _hccFullyQualifiedDomainName :: Maybe Text
, _hccIPAddress :: Maybe Text
, _hccPort :: Maybe Nat
, _hccRequestInterval :: Maybe Nat
, _hccResourcePath :: Maybe Text
, _hccSearchString :: Maybe Text
, _hccType :: HealthCheckType
} deriving (Eq, Show)
healthCheckConfig :: HealthCheckType
-> HealthCheckConfig
healthCheckConfig p1 = HealthCheckConfig
{ _hccType = p1
, _hccIPAddress = Nothing
, _hccPort = Nothing
, _hccResourcePath = Nothing
, _hccFullyQualifiedDomainName = Nothing
, _hccSearchString = Nothing
, _hccRequestInterval = Nothing
, _hccFailureThreshold = Nothing
}
hccFailureThreshold :: Lens' HealthCheckConfig (Maybe Natural)
hccFailureThreshold =
lens _hccFailureThreshold (\s a -> s { _hccFailureThreshold = a })
. mapping _Nat
hccFullyQualifiedDomainName :: Lens' HealthCheckConfig (Maybe Text)
hccFullyQualifiedDomainName =
lens _hccFullyQualifiedDomainName
(\s a -> s { _hccFullyQualifiedDomainName = a })
hccIPAddress :: Lens' HealthCheckConfig (Maybe Text)
hccIPAddress = lens _hccIPAddress (\s a -> s { _hccIPAddress = a })
hccPort :: Lens' HealthCheckConfig (Maybe Natural)
hccPort = lens _hccPort (\s a -> s { _hccPort = a }) . mapping _Nat
hccRequestInterval :: Lens' HealthCheckConfig (Maybe Natural)
hccRequestInterval =
lens _hccRequestInterval (\s a -> s { _hccRequestInterval = a })
. mapping _Nat
hccResourcePath :: Lens' HealthCheckConfig (Maybe Text)
hccResourcePath = lens _hccResourcePath (\s a -> s { _hccResourcePath = a })
hccSearchString :: Lens' HealthCheckConfig (Maybe Text)
hccSearchString = lens _hccSearchString (\s a -> s { _hccSearchString = a })
hccType :: Lens' HealthCheckConfig HealthCheckType
hccType = lens _hccType (\s a -> s { _hccType = a })
instance FromXML HealthCheckConfig where
parseXML x = HealthCheckConfig
<$> x .@? "FailureThreshold"
<*> x .@? "FullyQualifiedDomainName"
<*> x .@? "IPAddress"
<*> x .@? "Port"
<*> x .@? "RequestInterval"
<*> x .@? "ResourcePath"
<*> x .@? "SearchString"
<*> x .@ "Type"
instance ToXML HealthCheckConfig where
toXML HealthCheckConfig{..} = nodes "HealthCheckConfig"
[ "IPAddress" =@ _hccIPAddress
, "Port" =@ _hccPort
, "Type" =@ _hccType
, "ResourcePath" =@ _hccResourcePath
, "FullyQualifiedDomainName" =@ _hccFullyQualifiedDomainName
, "SearchString" =@ _hccSearchString
, "RequestInterval" =@ _hccRequestInterval
, "FailureThreshold" =@ _hccFailureThreshold
]
data Change = Change
{ _cAction :: ChangeAction
, _cResourceRecordSet :: ResourceRecordSet
} deriving (Eq, Show)
change :: ChangeAction
-> ResourceRecordSet
-> Change
change p1 p2 = Change
{ _cAction = p1
, _cResourceRecordSet = p2
}
cAction :: Lens' Change ChangeAction
cAction = lens _cAction (\s a -> s { _cAction = a })
cResourceRecordSet :: Lens' Change ResourceRecordSet
cResourceRecordSet =
lens _cResourceRecordSet (\s a -> s { _cResourceRecordSet = a })
instance FromXML Change where
parseXML x = Change
<$> x .@ "Action"
<*> x .@ "ResourceRecordSet"
instance ToXML Change where
toXML Change{..} = nodes "Change"
[ "Action" =@ _cAction
, "ResourceRecordSet" =@ _cResourceRecordSet
]
data Failover
= Primary
| Secondary
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable Failover
instance FromText Failover where
parser = takeText >>= \case
"PRIMARY" -> pure Primary
"SECONDARY" -> pure Secondary
e -> fail $
"Failure parsing Failover from " ++ show e
instance ToText Failover where
toText = \case
Primary -> "PRIMARY"
Secondary -> "SECONDARY"
instance ToByteString Failover
instance ToHeader Failover
instance ToQuery Failover
instance FromXML Failover where
parseXML = parseXMLText "Failover"
instance ToXML Failover where
toXML = toXMLText
data HostedZone = HostedZone
{ _hzCallerReference :: Text
, _hzConfig :: Maybe HostedZoneConfig
, _hzId :: Text
, _hzName :: Text
, _hzResourceRecordSetCount :: Maybe Integer
} deriving (Eq, Show)
hostedZone :: Text
-> Text
-> Text
-> HostedZone
hostedZone p1 p2 p3 = HostedZone
{ _hzId = p1
, _hzName = p2
, _hzCallerReference = p3
, _hzConfig = Nothing
, _hzResourceRecordSetCount = Nothing
}
hzCallerReference :: Lens' HostedZone Text
hzCallerReference =
lens _hzCallerReference (\s a -> s { _hzCallerReference = a })
hzConfig :: Lens' HostedZone (Maybe HostedZoneConfig)
hzConfig = lens _hzConfig (\s a -> s { _hzConfig = a })
hzId :: Lens' HostedZone Text
hzId = lens _hzId (\s a -> s { _hzId = a })
hzName :: Lens' HostedZone Text
hzName = lens _hzName (\s a -> s { _hzName = a })
hzResourceRecordSetCount :: Lens' HostedZone (Maybe Integer)
hzResourceRecordSetCount =
lens _hzResourceRecordSetCount
(\s a -> s { _hzResourceRecordSetCount = a })
instance FromXML HostedZone where
parseXML x = HostedZone
<$> x .@ "CallerReference"
<*> x .@? "Config"
<*> x .@ "Id"
<*> x .@ "Name"
<*> x .@? "ResourceRecordSetCount"
instance ToXML HostedZone where
toXML HostedZone{..} = nodes "HostedZone"
[ "Id" =@ _hzId
, "Name" =@ _hzName
, "CallerReference" =@ _hzCallerReference
, "Config" =@ _hzConfig
, "ResourceRecordSetCount" =@ _hzResourceRecordSetCount
]
data ResourceTagSet = ResourceTagSet
{ _rtsResourceId :: Maybe Text
, _rtsResourceType :: Maybe TagResourceType
, _rtsTags :: List1 "Tag" Tag
} deriving (Eq, Show)
resourceTagSet :: NonEmpty Tag
-> ResourceTagSet
resourceTagSet p1 = ResourceTagSet
{ _rtsTags = withIso _List1 (const id) p1
, _rtsResourceType = Nothing
, _rtsResourceId = Nothing
}
rtsResourceId :: Lens' ResourceTagSet (Maybe Text)
rtsResourceId = lens _rtsResourceId (\s a -> s { _rtsResourceId = a })
rtsResourceType :: Lens' ResourceTagSet (Maybe TagResourceType)
rtsResourceType = lens _rtsResourceType (\s a -> s { _rtsResourceType = a })
rtsTags :: Lens' ResourceTagSet (NonEmpty Tag)
rtsTags = lens _rtsTags (\s a -> s { _rtsTags = a }) . _List1
instance FromXML ResourceTagSet where
parseXML x = ResourceTagSet
<$> x .@? "ResourceId"
<*> x .@? "ResourceType"
<*> x .@ "Tags"
instance ToXML ResourceTagSet where
toXML ResourceTagSet{..} = nodes "ResourceTagSet"
[ "ResourceType" =@ _rtsResourceType
, "ResourceId" =@ _rtsResourceId
, "Tags" =@ _rtsTags
]
data ChangeStatus
= Insync
| Pending
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ChangeStatus
instance FromText ChangeStatus where
parser = takeText >>= \case
"INSYNC" -> pure Insync
"PENDING" -> pure Pending
e -> fail $
"Failure parsing ChangeStatus from " ++ show e
instance ToText ChangeStatus where
toText = \case
Insync -> "INSYNC"
Pending -> "PENDING"
instance ToByteString ChangeStatus
instance ToHeader ChangeStatus
instance ToQuery ChangeStatus
instance FromXML ChangeStatus where
parseXML = parseXMLText "ChangeStatus"
instance ToXML ChangeStatus where
toXML = toXMLText
data ChangeBatch = ChangeBatch
{ _cbChanges :: List1 "Change" Change
, _cbComment :: Maybe Text
} deriving (Eq, Show)
changeBatch :: NonEmpty Change
-> ChangeBatch
changeBatch p1 = ChangeBatch
{ _cbChanges = withIso _List1 (const id) p1
, _cbComment = Nothing
}
cbChanges :: Lens' ChangeBatch (NonEmpty Change)
cbChanges = lens _cbChanges (\s a -> s { _cbChanges = a }) . _List1
cbComment :: Lens' ChangeBatch (Maybe Text)
cbComment = lens _cbComment (\s a -> s { _cbComment = a })
instance FromXML ChangeBatch where
parseXML x = ChangeBatch
<$> x .@ "Changes"
<*> x .@? "Comment"
instance ToXML ChangeBatch where
toXML ChangeBatch{..} = nodes "ChangeBatch"
[ "Comment" =@ _cbComment
, "Changes" =@ _cbChanges
]
data StatusReport = StatusReport
{ _srCheckedTime :: Maybe ISO8601
, _srStatus :: Maybe Text
} deriving (Eq, Ord, Show)
statusReport :: StatusReport
statusReport = StatusReport
{ _srStatus = Nothing
, _srCheckedTime = Nothing
}
srCheckedTime :: Lens' StatusReport (Maybe UTCTime)
srCheckedTime = lens _srCheckedTime (\s a -> s { _srCheckedTime = a }) . mapping _Time
srStatus :: Lens' StatusReport (Maybe Text)
srStatus = lens _srStatus (\s a -> s { _srStatus = a })
instance FromXML StatusReport where
parseXML x = StatusReport
<$> x .@? "CheckedTime"
<*> x .@? "Status"
instance ToXML StatusReport where
toXML StatusReport{..} = nodes "StatusReport"
[ "Status" =@ _srStatus
, "CheckedTime" =@ _srCheckedTime
]
data HealthCheckType
= Http
| HttpStrMatch
| Https
| HttpsStrMatch
| Tcp
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable HealthCheckType
instance FromText HealthCheckType where
parser = takeText >>= \case
"HTTP" -> pure Http
"HTTP_STR_MATCH" -> pure HttpStrMatch
"HTTPS" -> pure Https
"HTTPS_STR_MATCH" -> pure HttpsStrMatch
"TCP" -> pure Tcp
e -> fail $
"Failure parsing HealthCheckType from " ++ show e
instance ToText HealthCheckType where
toText = \case
Http -> "HTTP"
HttpStrMatch -> "HTTP_STR_MATCH"
Https -> "HTTPS"
HttpsStrMatch -> "HTTPS_STR_MATCH"
Tcp -> "TCP"
instance ToByteString HealthCheckType
instance ToHeader HealthCheckType
instance ToQuery HealthCheckType
instance FromXML HealthCheckType where
parseXML = parseXMLText "HealthCheckType"
instance ToXML HealthCheckType where
toXML = toXMLText
data VPC = VPC
{ _vpcVPCId :: Maybe Text
, _vpcVPCRegion :: Maybe VPCRegion
} deriving (Eq, Show)
vpc :: VPC
vpc = VPC
{ _vpcVPCRegion = Nothing
, _vpcVPCId = Nothing
}
vpcVPCId :: Lens' VPC (Maybe Text)
vpcVPCId = lens _vpcVPCId (\s a -> s { _vpcVPCId = a })
vpcVPCRegion :: Lens' VPC (Maybe VPCRegion)
vpcVPCRegion = lens _vpcVPCRegion (\s a -> s { _vpcVPCRegion = a })
instance FromXML VPC where
parseXML x = VPC
<$> x .@? "VPCId"
<*> x .@? "VPCRegion"
instance ToXMLRoot VPC where
toXMLRoot VPC{..} = namespaced ns "VPC"
[ "VPCRegion" =@ _vpcVPCRegion
, "VPCId" =@ _vpcVPCId
]
instance ToXML VPC
data HostedZoneConfig = HostedZoneConfig
{ _hzcComment :: Maybe Text
, _hzcPrivateZone :: Maybe Bool
} deriving (Eq, Ord, Show)
hostedZoneConfig :: HostedZoneConfig
hostedZoneConfig = HostedZoneConfig
{ _hzcComment = Nothing
, _hzcPrivateZone = Nothing
}
hzcComment :: Lens' HostedZoneConfig (Maybe Text)
hzcComment = lens _hzcComment (\s a -> s { _hzcComment = a })
hzcPrivateZone :: Lens' HostedZoneConfig (Maybe Bool)
hzcPrivateZone = lens _hzcPrivateZone (\s a -> s { _hzcPrivateZone = a })
instance FromXML HostedZoneConfig where
parseXML x = HostedZoneConfig
<$> x .@? "Comment"
<*> x .@? "PrivateZone"
instance ToXML HostedZoneConfig where
toXML HostedZoneConfig{..} = nodes "HostedZoneConfig"
[ "Comment" =@ _hzcComment
, "PrivateZone" =@ _hzcPrivateZone
]
data ResourceRecordSet = ResourceRecordSet
{ _rrsAliasTarget :: Maybe AliasTarget
, _rrsFailover :: Maybe Failover
, _rrsGeoLocation :: Maybe GeoLocation
, _rrsHealthCheckId :: Maybe Text
, _rrsName :: Text
, _rrsRegion :: Maybe Region
, _rrsResourceRecords :: List1 "ResourceRecord" ResourceRecord
, _rrsSetIdentifier :: Maybe Text
, _rrsTTL :: Maybe Nat
, _rrsType :: RecordType
, _rrsWeight :: Maybe Nat
} deriving (Eq, Show)
resourceRecordSet :: Text
-> RecordType
-> NonEmpty ResourceRecord
-> ResourceRecordSet
resourceRecordSet p1 p2 p3 = ResourceRecordSet
{ _rrsName = p1
, _rrsType = p2
, _rrsResourceRecords = withIso _List1 (const id) p3
, _rrsSetIdentifier = Nothing
, _rrsWeight = Nothing
, _rrsRegion = Nothing
, _rrsGeoLocation = Nothing
, _rrsFailover = Nothing
, _rrsTTL = Nothing
, _rrsAliasTarget = Nothing
, _rrsHealthCheckId = Nothing
}
rrsAliasTarget :: Lens' ResourceRecordSet (Maybe AliasTarget)
rrsAliasTarget = lens _rrsAliasTarget (\s a -> s { _rrsAliasTarget = a })
rrsFailover :: Lens' ResourceRecordSet (Maybe Failover)
rrsFailover = lens _rrsFailover (\s a -> s { _rrsFailover = a })
rrsGeoLocation :: Lens' ResourceRecordSet (Maybe GeoLocation)
rrsGeoLocation = lens _rrsGeoLocation (\s a -> s { _rrsGeoLocation = a })
rrsHealthCheckId :: Lens' ResourceRecordSet (Maybe Text)
rrsHealthCheckId = lens _rrsHealthCheckId (\s a -> s { _rrsHealthCheckId = a })
rrsName :: Lens' ResourceRecordSet Text
rrsName = lens _rrsName (\s a -> s { _rrsName = a })
rrsRegion :: Lens' ResourceRecordSet (Maybe Region)
rrsRegion = lens _rrsRegion (\s a -> s { _rrsRegion = a })
rrsResourceRecords :: Lens' ResourceRecordSet (NonEmpty ResourceRecord)
rrsResourceRecords =
lens _rrsResourceRecords (\s a -> s { _rrsResourceRecords = a })
. _List1
rrsSetIdentifier :: Lens' ResourceRecordSet (Maybe Text)
rrsSetIdentifier = lens _rrsSetIdentifier (\s a -> s { _rrsSetIdentifier = a })
rrsTTL :: Lens' ResourceRecordSet (Maybe Natural)
rrsTTL = lens _rrsTTL (\s a -> s { _rrsTTL = a }) . mapping _Nat
rrsType :: Lens' ResourceRecordSet RecordType
rrsType = lens _rrsType (\s a -> s { _rrsType = a })
rrsWeight :: Lens' ResourceRecordSet (Maybe Natural)
rrsWeight = lens _rrsWeight (\s a -> s { _rrsWeight = a }) . mapping _Nat
instance FromXML ResourceRecordSet where
parseXML x = ResourceRecordSet
<$> x .@? "AliasTarget"
<*> x .@? "Failover"
<*> x .@? "GeoLocation"
<*> x .@? "HealthCheckId"
<*> x .@ "Name"
<*> x .@? "Region"
<*> x .@ "ResourceRecords"
<*> x .@? "SetIdentifier"
<*> x .@? "TTL"
<*> x .@ "Type"
<*> x .@? "Weight"
instance ToXML ResourceRecordSet where
toXML ResourceRecordSet{..} = nodes "ResourceRecordSet"
[ "Name" =@ _rrsName
, "Type" =@ _rrsType
, "SetIdentifier" =@ _rrsSetIdentifier
, "Weight" =@ _rrsWeight
, "Region" =@ _rrsRegion
, "GeoLocation" =@ _rrsGeoLocation
, "Failover" =@ _rrsFailover
, "TTL" =@ _rrsTTL
, "ResourceRecords" =@ _rrsResourceRecords
, "AliasTarget" =@ _rrsAliasTarget
, "HealthCheckId" =@ _rrsHealthCheckId
]
data DelegationSet = DelegationSet
{ _dsCallerReference :: Maybe Text
, _dsId :: Maybe Text
, _dsNameServers :: List1 "NameServer" Text
} deriving (Eq, Ord, Show)
delegationSet :: NonEmpty Text
-> DelegationSet
delegationSet p1 = DelegationSet
{ _dsNameServers = withIso _List1 (const id) p1
, _dsId = Nothing
, _dsCallerReference = Nothing
}
dsCallerReference :: Lens' DelegationSet (Maybe Text)
dsCallerReference =
lens _dsCallerReference (\s a -> s { _dsCallerReference = a })
dsId :: Lens' DelegationSet (Maybe Text)
dsId = lens _dsId (\s a -> s { _dsId = a })
dsNameServers :: Lens' DelegationSet (NonEmpty Text)
dsNameServers = lens _dsNameServers (\s a -> s { _dsNameServers = a }) . _List1
instance FromXML DelegationSet where
parseXML x = DelegationSet
<$> x .@? "CallerReference"
<*> x .@? "Id"
<*> x .@ "NameServers"
instance ToXMLRoot DelegationSet where
toXMLRoot DelegationSet{..} = namespaced ns "DelegationSet"
[ "Id" =@ _dsId
, "CallerReference" =@ _dsCallerReference
, "NameServers" =@ _dsNameServers
]
instance ToXML DelegationSet
data ChangeInfo = ChangeInfo
{ _ciComment :: Maybe Text
, _ciId :: Text
, _ciStatus :: ChangeStatus
, _ciSubmittedAt :: ISO8601
} deriving (Eq, Show)
changeInfo :: Text
-> ChangeStatus
-> UTCTime
-> ChangeInfo
changeInfo p1 p2 p3 = ChangeInfo
{ _ciId = p1
, _ciStatus = p2
, _ciSubmittedAt = withIso _Time (const id) p3
, _ciComment = Nothing
}
ciComment :: Lens' ChangeInfo (Maybe Text)
ciComment = lens _ciComment (\s a -> s { _ciComment = a })
ciId :: Lens' ChangeInfo Text
ciId = lens _ciId (\s a -> s { _ciId = a })
ciStatus :: Lens' ChangeInfo ChangeStatus
ciStatus = lens _ciStatus (\s a -> s { _ciStatus = a })
ciSubmittedAt :: Lens' ChangeInfo UTCTime
ciSubmittedAt = lens _ciSubmittedAt (\s a -> s { _ciSubmittedAt = a }) . _Time
instance FromXML ChangeInfo where
parseXML x = ChangeInfo
<$> x .@? "Comment"
<*> x .@ "Id"
<*> x .@ "Status"
<*> x .@ "SubmittedAt"
instance ToXML ChangeInfo where
toXML ChangeInfo{..} = nodes "ChangeInfo"
[ "Id" =@ _ciId
, "Status" =@ _ciStatus
, "SubmittedAt" =@ _ciSubmittedAt
, "Comment" =@ _ciComment
]
data GeoLocation = GeoLocation
{ _glContinentCode :: Maybe Text
, _glCountryCode :: Maybe Text
, _glSubdivisionCode :: Maybe Text
} deriving (Eq, Ord, Show)
geoLocation :: GeoLocation
geoLocation = GeoLocation
{ _glContinentCode = Nothing
, _glCountryCode = Nothing
, _glSubdivisionCode = Nothing
}
glContinentCode :: Lens' GeoLocation (Maybe Text)
glContinentCode = lens _glContinentCode (\s a -> s { _glContinentCode = a })
glCountryCode :: Lens' GeoLocation (Maybe Text)
glCountryCode = lens _glCountryCode (\s a -> s { _glCountryCode = a })
glSubdivisionCode :: Lens' GeoLocation (Maybe Text)
glSubdivisionCode =
lens _glSubdivisionCode (\s a -> s { _glSubdivisionCode = a })
instance FromXML GeoLocation where
parseXML x = GeoLocation
<$> x .@? "ContinentCode"
<*> x .@? "CountryCode"
<*> x .@? "SubdivisionCode"
instance ToXML GeoLocation where
toXML GeoLocation{..} = nodes "GeoLocation"
[ "ContinentCode" =@ _glContinentCode
, "CountryCode" =@ _glCountryCode
, "SubdivisionCode" =@ _glSubdivisionCode
]
data HealthCheckObservation = HealthCheckObservation
{ _hcoIPAddress :: Maybe Text
, _hcoStatusReport :: Maybe StatusReport
} deriving (Eq, Show)
healthCheckObservation :: HealthCheckObservation
healthCheckObservation = HealthCheckObservation
{ _hcoIPAddress = Nothing
, _hcoStatusReport = Nothing
}
hcoIPAddress :: Lens' HealthCheckObservation (Maybe Text)
hcoIPAddress = lens _hcoIPAddress (\s a -> s { _hcoIPAddress = a })
hcoStatusReport :: Lens' HealthCheckObservation (Maybe StatusReport)
hcoStatusReport = lens _hcoStatusReport (\s a -> s { _hcoStatusReport = a })
instance FromXML HealthCheckObservation where
parseXML x = HealthCheckObservation
<$> x .@? "IPAddress"
<*> x .@? "StatusReport"
instance ToXMLRoot HealthCheckObservation where
toXMLRoot HealthCheckObservation{..} = namespaced ns "HealthCheckObservation"
[ "IPAddress" =@ _hcoIPAddress
, "StatusReport" =@ _hcoStatusReport
]
instance ToXML HealthCheckObservation