{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Billing.Types.Product where
import Network.Google.Billing.Types.Sum
import Network.Google.Prelude
data AuditConfig = AuditConfig'
{ _acService :: !(Maybe Text)
, _acAuditLogConfigs :: !(Maybe [AuditLogConfig])
} deriving (Eq,Show,Data,Typeable,Generic)
auditConfig
:: AuditConfig
auditConfig =
AuditConfig'
{ _acService = Nothing
, _acAuditLogConfigs = Nothing
}
acService :: Lens' AuditConfig (Maybe Text)
acService
= lens _acService (\ s a -> s{_acService = a})
acAuditLogConfigs :: Lens' AuditConfig [AuditLogConfig]
acAuditLogConfigs
= lens _acAuditLogConfigs
(\ s a -> s{_acAuditLogConfigs = a})
. _Default
. _Coerce
instance FromJSON AuditConfig where
parseJSON
= withObject "AuditConfig"
(\ o ->
AuditConfig' <$>
(o .:? "service") <*>
(o .:? "auditLogConfigs" .!= mempty))
instance ToJSON AuditConfig where
toJSON AuditConfig'{..}
= object
(catMaybes
[("service" .=) <$> _acService,
("auditLogConfigs" .=) <$> _acAuditLogConfigs])
data ListServicesResponse = ListServicesResponse'
{ _lsrNextPageToken :: !(Maybe Text)
, _lsrServices :: !(Maybe [Service])
} deriving (Eq,Show,Data,Typeable,Generic)
listServicesResponse
:: ListServicesResponse
listServicesResponse =
ListServicesResponse'
{ _lsrNextPageToken = Nothing
, _lsrServices = Nothing
}
lsrNextPageToken :: Lens' ListServicesResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
lsrServices :: Lens' ListServicesResponse [Service]
lsrServices
= lens _lsrServices (\ s a -> s{_lsrServices = a}) .
_Default
. _Coerce
instance FromJSON ListServicesResponse where
parseJSON
= withObject "ListServicesResponse"
(\ o ->
ListServicesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "services" .!= mempty))
instance ToJSON ListServicesResponse where
toJSON ListServicesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrNextPageToken,
("services" .=) <$> _lsrServices])
data Expr = Expr'
{ _eLocation :: !(Maybe Text)
, _eExpression :: !(Maybe Text)
, _eTitle :: !(Maybe Text)
, _eDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
expr
:: Expr
expr =
Expr'
{ _eLocation = Nothing
, _eExpression = Nothing
, _eTitle = Nothing
, _eDescription = Nothing
}
eLocation :: Lens' Expr (Maybe Text)
eLocation
= lens _eLocation (\ s a -> s{_eLocation = a})
eExpression :: Lens' Expr (Maybe Text)
eExpression
= lens _eExpression (\ s a -> s{_eExpression = a})
eTitle :: Lens' Expr (Maybe Text)
eTitle = lens _eTitle (\ s a -> s{_eTitle = a})
eDescription :: Lens' Expr (Maybe Text)
eDescription
= lens _eDescription (\ s a -> s{_eDescription = a})
instance FromJSON Expr where
parseJSON
= withObject "Expr"
(\ o ->
Expr' <$>
(o .:? "location") <*> (o .:? "expression") <*>
(o .:? "title")
<*> (o .:? "description"))
instance ToJSON Expr where
toJSON Expr'{..}
= object
(catMaybes
[("location" .=) <$> _eLocation,
("expression" .=) <$> _eExpression,
("title" .=) <$> _eTitle,
("description" .=) <$> _eDescription])
data BillingAccount = BillingAccount'
{ _baMasterBillingAccount :: !(Maybe Text)
, _baOpen :: !(Maybe Bool)
, _baName :: !(Maybe Text)
, _baDisplayName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
billingAccount
:: BillingAccount
billingAccount =
BillingAccount'
{ _baMasterBillingAccount = Nothing
, _baOpen = Nothing
, _baName = Nothing
, _baDisplayName = Nothing
}
baMasterBillingAccount :: Lens' BillingAccount (Maybe Text)
baMasterBillingAccount
= lens _baMasterBillingAccount
(\ s a -> s{_baMasterBillingAccount = a})
baOpen :: Lens' BillingAccount (Maybe Bool)
baOpen = lens _baOpen (\ s a -> s{_baOpen = a})
baName :: Lens' BillingAccount (Maybe Text)
baName = lens _baName (\ s a -> s{_baName = a})
baDisplayName :: Lens' BillingAccount (Maybe Text)
baDisplayName
= lens _baDisplayName
(\ s a -> s{_baDisplayName = a})
instance FromJSON BillingAccount where
parseJSON
= withObject "BillingAccount"
(\ o ->
BillingAccount' <$>
(o .:? "masterBillingAccount") <*> (o .:? "open") <*>
(o .:? "name")
<*> (o .:? "displayName"))
instance ToJSON BillingAccount where
toJSON BillingAccount'{..}
= object
(catMaybes
[("masterBillingAccount" .=) <$>
_baMasterBillingAccount,
("open" .=) <$> _baOpen, ("name" .=) <$> _baName,
("displayName" .=) <$> _baDisplayName])
data Service = Service'
{ _sName :: !(Maybe Text)
, _sDisplayName :: !(Maybe Text)
, _sServiceId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
service
:: Service
service =
Service'
{ _sName = Nothing
, _sDisplayName = Nothing
, _sServiceId = Nothing
}
sName :: Lens' Service (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})
sDisplayName :: Lens' Service (Maybe Text)
sDisplayName
= lens _sDisplayName (\ s a -> s{_sDisplayName = a})
sServiceId :: Lens' Service (Maybe Text)
sServiceId
= lens _sServiceId (\ s a -> s{_sServiceId = a})
instance FromJSON Service where
parseJSON
= withObject "Service"
(\ o ->
Service' <$>
(o .:? "name") <*> (o .:? "displayName") <*>
(o .:? "serviceId"))
instance ToJSON Service where
toJSON Service'{..}
= object
(catMaybes
[("name" .=) <$> _sName,
("displayName" .=) <$> _sDisplayName,
("serviceId" .=) <$> _sServiceId])
data ProjectBillingInfo = ProjectBillingInfo'
{ _pbiName :: !(Maybe Text)
, _pbiBillingAccountName :: !(Maybe Text)
, _pbiProjectId :: !(Maybe Text)
, _pbiBillingEnabled :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
projectBillingInfo
:: ProjectBillingInfo
projectBillingInfo =
ProjectBillingInfo'
{ _pbiName = Nothing
, _pbiBillingAccountName = Nothing
, _pbiProjectId = Nothing
, _pbiBillingEnabled = Nothing
}
pbiName :: Lens' ProjectBillingInfo (Maybe Text)
pbiName = lens _pbiName (\ s a -> s{_pbiName = a})
pbiBillingAccountName :: Lens' ProjectBillingInfo (Maybe Text)
pbiBillingAccountName
= lens _pbiBillingAccountName
(\ s a -> s{_pbiBillingAccountName = a})
pbiProjectId :: Lens' ProjectBillingInfo (Maybe Text)
pbiProjectId
= lens _pbiProjectId (\ s a -> s{_pbiProjectId = a})
pbiBillingEnabled :: Lens' ProjectBillingInfo (Maybe Bool)
pbiBillingEnabled
= lens _pbiBillingEnabled
(\ s a -> s{_pbiBillingEnabled = a})
instance FromJSON ProjectBillingInfo where
parseJSON
= withObject "ProjectBillingInfo"
(\ o ->
ProjectBillingInfo' <$>
(o .:? "name") <*> (o .:? "billingAccountName") <*>
(o .:? "projectId")
<*> (o .:? "billingEnabled"))
instance ToJSON ProjectBillingInfo where
toJSON ProjectBillingInfo'{..}
= object
(catMaybes
[("name" .=) <$> _pbiName,
("billingAccountName" .=) <$> _pbiBillingAccountName,
("projectId" .=) <$> _pbiProjectId,
("billingEnabled" .=) <$> _pbiBillingEnabled])
data TierRate = TierRate'
{ _trUnitPrice :: !(Maybe Money)
, _trStartUsageAmount :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
tierRate
:: TierRate
tierRate =
TierRate'
{ _trUnitPrice = Nothing
, _trStartUsageAmount = Nothing
}
trUnitPrice :: Lens' TierRate (Maybe Money)
trUnitPrice
= lens _trUnitPrice (\ s a -> s{_trUnitPrice = a})
trStartUsageAmount :: Lens' TierRate (Maybe Double)
trStartUsageAmount
= lens _trStartUsageAmount
(\ s a -> s{_trStartUsageAmount = a})
. mapping _Coerce
instance FromJSON TierRate where
parseJSON
= withObject "TierRate"
(\ o ->
TierRate' <$>
(o .:? "unitPrice") <*> (o .:? "startUsageAmount"))
instance ToJSON TierRate where
toJSON TierRate'{..}
= object
(catMaybes
[("unitPrice" .=) <$> _trUnitPrice,
("startUsageAmount" .=) <$> _trStartUsageAmount])
data Money = Money'
{ _mCurrencyCode :: !(Maybe Text)
, _mNanos :: !(Maybe (Textual Int32))
, _mUnits :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
money
:: Money
money =
Money'
{ _mCurrencyCode = Nothing
, _mNanos = Nothing
, _mUnits = Nothing
}
mCurrencyCode :: Lens' Money (Maybe Text)
mCurrencyCode
= lens _mCurrencyCode
(\ s a -> s{_mCurrencyCode = a})
mNanos :: Lens' Money (Maybe Int32)
mNanos
= lens _mNanos (\ s a -> s{_mNanos = a}) .
mapping _Coerce
mUnits :: Lens' Money (Maybe Int64)
mUnits
= lens _mUnits (\ s a -> s{_mUnits = a}) .
mapping _Coerce
instance FromJSON Money where
parseJSON
= withObject "Money"
(\ o ->
Money' <$>
(o .:? "currencyCode") <*> (o .:? "nanos") <*>
(o .:? "units"))
instance ToJSON Money where
toJSON Money'{..}
= object
(catMaybes
[("currencyCode" .=) <$> _mCurrencyCode,
("nanos" .=) <$> _mNanos, ("units" .=) <$> _mUnits])
data Category = Category'
{ _cResourceFamily :: !(Maybe Text)
, _cUsageType :: !(Maybe Text)
, _cServiceDisplayName :: !(Maybe Text)
, _cResourceGroup :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
category
:: Category
category =
Category'
{ _cResourceFamily = Nothing
, _cUsageType = Nothing
, _cServiceDisplayName = Nothing
, _cResourceGroup = Nothing
}
cResourceFamily :: Lens' Category (Maybe Text)
cResourceFamily
= lens _cResourceFamily
(\ s a -> s{_cResourceFamily = a})
cUsageType :: Lens' Category (Maybe Text)
cUsageType
= lens _cUsageType (\ s a -> s{_cUsageType = a})
cServiceDisplayName :: Lens' Category (Maybe Text)
cServiceDisplayName
= lens _cServiceDisplayName
(\ s a -> s{_cServiceDisplayName = a})
cResourceGroup :: Lens' Category (Maybe Text)
cResourceGroup
= lens _cResourceGroup
(\ s a -> s{_cResourceGroup = a})
instance FromJSON Category where
parseJSON
= withObject "Category"
(\ o ->
Category' <$>
(o .:? "resourceFamily") <*> (o .:? "usageType") <*>
(o .:? "serviceDisplayName")
<*> (o .:? "resourceGroup"))
instance ToJSON Category where
toJSON Category'{..}
= object
(catMaybes
[("resourceFamily" .=) <$> _cResourceFamily,
("usageType" .=) <$> _cUsageType,
("serviceDisplayName" .=) <$> _cServiceDisplayName,
("resourceGroup" .=) <$> _cResourceGroup])
data SetIAMPolicyRequest = SetIAMPolicyRequest'
{ _siprUpdateMask :: !(Maybe GFieldMask)
, _siprPolicy :: !(Maybe Policy)
} deriving (Eq,Show,Data,Typeable,Generic)
setIAMPolicyRequest
:: SetIAMPolicyRequest
setIAMPolicyRequest =
SetIAMPolicyRequest'
{ _siprUpdateMask = Nothing
, _siprPolicy = Nothing
}
siprUpdateMask :: Lens' SetIAMPolicyRequest (Maybe GFieldMask)
siprUpdateMask
= lens _siprUpdateMask
(\ s a -> s{_siprUpdateMask = a})
siprPolicy :: Lens' SetIAMPolicyRequest (Maybe Policy)
siprPolicy
= lens _siprPolicy (\ s a -> s{_siprPolicy = a})
instance FromJSON SetIAMPolicyRequest where
parseJSON
= withObject "SetIAMPolicyRequest"
(\ o ->
SetIAMPolicyRequest' <$>
(o .:? "updateMask") <*> (o .:? "policy"))
instance ToJSON SetIAMPolicyRequest where
toJSON SetIAMPolicyRequest'{..}
= object
(catMaybes
[("updateMask" .=) <$> _siprUpdateMask,
("policy" .=) <$> _siprPolicy])
data ListProjectBillingInfoResponse = ListProjectBillingInfoResponse'
{ _lpbirNextPageToken :: !(Maybe Text)
, _lpbirProjectBillingInfo :: !(Maybe [ProjectBillingInfo])
} deriving (Eq,Show,Data,Typeable,Generic)
listProjectBillingInfoResponse
:: ListProjectBillingInfoResponse
listProjectBillingInfoResponse =
ListProjectBillingInfoResponse'
{ _lpbirNextPageToken = Nothing
, _lpbirProjectBillingInfo = Nothing
}
lpbirNextPageToken :: Lens' ListProjectBillingInfoResponse (Maybe Text)
lpbirNextPageToken
= lens _lpbirNextPageToken
(\ s a -> s{_lpbirNextPageToken = a})
lpbirProjectBillingInfo :: Lens' ListProjectBillingInfoResponse [ProjectBillingInfo]
lpbirProjectBillingInfo
= lens _lpbirProjectBillingInfo
(\ s a -> s{_lpbirProjectBillingInfo = a})
. _Default
. _Coerce
instance FromJSON ListProjectBillingInfoResponse
where
parseJSON
= withObject "ListProjectBillingInfoResponse"
(\ o ->
ListProjectBillingInfoResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "projectBillingInfo" .!= mempty))
instance ToJSON ListProjectBillingInfoResponse where
toJSON ListProjectBillingInfoResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lpbirNextPageToken,
("projectBillingInfo" .=) <$>
_lpbirProjectBillingInfo])
data ListSKUsResponse = ListSKUsResponse'
{ _lskurNextPageToken :: !(Maybe Text)
, _lskurSKUs :: !(Maybe [SKU])
} deriving (Eq,Show,Data,Typeable,Generic)
listSKUsResponse
:: ListSKUsResponse
listSKUsResponse =
ListSKUsResponse'
{ _lskurNextPageToken = Nothing
, _lskurSKUs = Nothing
}
lskurNextPageToken :: Lens' ListSKUsResponse (Maybe Text)
lskurNextPageToken
= lens _lskurNextPageToken
(\ s a -> s{_lskurNextPageToken = a})
lskurSKUs :: Lens' ListSKUsResponse [SKU]
lskurSKUs
= lens _lskurSKUs (\ s a -> s{_lskurSKUs = a}) .
_Default
. _Coerce
instance FromJSON ListSKUsResponse where
parseJSON
= withObject "ListSKUsResponse"
(\ o ->
ListSKUsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "skus" .!= mempty))
instance ToJSON ListSKUsResponse where
toJSON ListSKUsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lskurNextPageToken,
("skus" .=) <$> _lskurSKUs])
data PricingExpression = PricingExpression'
{ _peUsageUnitDescription :: !(Maybe Text)
, _peBaseUnit :: !(Maybe Text)
, _peBaseUnitConversionFactor :: !(Maybe (Textual Double))
, _peDisplayQuantity :: !(Maybe (Textual Double))
, _peTieredRates :: !(Maybe [TierRate])
, _peBaseUnitDescription :: !(Maybe Text)
, _peUsageUnit :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
pricingExpression
:: PricingExpression
pricingExpression =
PricingExpression'
{ _peUsageUnitDescription = Nothing
, _peBaseUnit = Nothing
, _peBaseUnitConversionFactor = Nothing
, _peDisplayQuantity = Nothing
, _peTieredRates = Nothing
, _peBaseUnitDescription = Nothing
, _peUsageUnit = Nothing
}
peUsageUnitDescription :: Lens' PricingExpression (Maybe Text)
peUsageUnitDescription
= lens _peUsageUnitDescription
(\ s a -> s{_peUsageUnitDescription = a})
peBaseUnit :: Lens' PricingExpression (Maybe Text)
peBaseUnit
= lens _peBaseUnit (\ s a -> s{_peBaseUnit = a})
peBaseUnitConversionFactor :: Lens' PricingExpression (Maybe Double)
peBaseUnitConversionFactor
= lens _peBaseUnitConversionFactor
(\ s a -> s{_peBaseUnitConversionFactor = a})
. mapping _Coerce
peDisplayQuantity :: Lens' PricingExpression (Maybe Double)
peDisplayQuantity
= lens _peDisplayQuantity
(\ s a -> s{_peDisplayQuantity = a})
. mapping _Coerce
peTieredRates :: Lens' PricingExpression [TierRate]
peTieredRates
= lens _peTieredRates
(\ s a -> s{_peTieredRates = a})
. _Default
. _Coerce
peBaseUnitDescription :: Lens' PricingExpression (Maybe Text)
peBaseUnitDescription
= lens _peBaseUnitDescription
(\ s a -> s{_peBaseUnitDescription = a})
peUsageUnit :: Lens' PricingExpression (Maybe Text)
peUsageUnit
= lens _peUsageUnit (\ s a -> s{_peUsageUnit = a})
instance FromJSON PricingExpression where
parseJSON
= withObject "PricingExpression"
(\ o ->
PricingExpression' <$>
(o .:? "usageUnitDescription") <*> (o .:? "baseUnit")
<*> (o .:? "baseUnitConversionFactor")
<*> (o .:? "displayQuantity")
<*> (o .:? "tieredRates" .!= mempty)
<*> (o .:? "baseUnitDescription")
<*> (o .:? "usageUnit"))
instance ToJSON PricingExpression where
toJSON PricingExpression'{..}
= object
(catMaybes
[("usageUnitDescription" .=) <$>
_peUsageUnitDescription,
("baseUnit" .=) <$> _peBaseUnit,
("baseUnitConversionFactor" .=) <$>
_peBaseUnitConversionFactor,
("displayQuantity" .=) <$> _peDisplayQuantity,
("tieredRates" .=) <$> _peTieredRates,
("baseUnitDescription" .=) <$>
_peBaseUnitDescription,
("usageUnit" .=) <$> _peUsageUnit])
newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest'
{ _tiprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsRequest
:: TestIAMPermissionsRequest
testIAMPermissionsRequest =
TestIAMPermissionsRequest'
{ _tiprPermissions = Nothing
}
tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsRequest where
parseJSON
= withObject "TestIAMPermissionsRequest"
(\ o ->
TestIAMPermissionsRequest' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsRequest where
toJSON TestIAMPermissionsRequest'{..}
= object
(catMaybes [("permissions" .=) <$> _tiprPermissions])
data AggregationInfo = AggregationInfo'
{ _aiAggregationInterval :: !(Maybe AggregationInfoAggregationInterval)
, _aiAggregationCount :: !(Maybe (Textual Int32))
, _aiAggregationLevel :: !(Maybe AggregationInfoAggregationLevel)
} deriving (Eq,Show,Data,Typeable,Generic)
aggregationInfo
:: AggregationInfo
aggregationInfo =
AggregationInfo'
{ _aiAggregationInterval = Nothing
, _aiAggregationCount = Nothing
, _aiAggregationLevel = Nothing
}
aiAggregationInterval :: Lens' AggregationInfo (Maybe AggregationInfoAggregationInterval)
aiAggregationInterval
= lens _aiAggregationInterval
(\ s a -> s{_aiAggregationInterval = a})
aiAggregationCount :: Lens' AggregationInfo (Maybe Int32)
aiAggregationCount
= lens _aiAggregationCount
(\ s a -> s{_aiAggregationCount = a})
. mapping _Coerce
aiAggregationLevel :: Lens' AggregationInfo (Maybe AggregationInfoAggregationLevel)
aiAggregationLevel
= lens _aiAggregationLevel
(\ s a -> s{_aiAggregationLevel = a})
instance FromJSON AggregationInfo where
parseJSON
= withObject "AggregationInfo"
(\ o ->
AggregationInfo' <$>
(o .:? "aggregationInterval") <*>
(o .:? "aggregationCount")
<*> (o .:? "aggregationLevel"))
instance ToJSON AggregationInfo where
toJSON AggregationInfo'{..}
= object
(catMaybes
[("aggregationInterval" .=) <$>
_aiAggregationInterval,
("aggregationCount" .=) <$> _aiAggregationCount,
("aggregationLevel" .=) <$> _aiAggregationLevel])
data SKU = SKU'
{ _skukCategory :: !(Maybe Category)
, _skukSKUId :: !(Maybe Text)
, _skukServiceProviderName :: !(Maybe Text)
, _skukServiceRegions :: !(Maybe [Text])
, _skukName :: !(Maybe Text)
, _skukPricingInfo :: !(Maybe [PricingInfo])
, _skukDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sKU
:: SKU
sKU =
SKU'
{ _skukCategory = Nothing
, _skukSKUId = Nothing
, _skukServiceProviderName = Nothing
, _skukServiceRegions = Nothing
, _skukName = Nothing
, _skukPricingInfo = Nothing
, _skukDescription = Nothing
}
skukCategory :: Lens' SKU (Maybe Category)
skukCategory
= lens _skukCategory (\ s a -> s{_skukCategory = a})
skukSKUId :: Lens' SKU (Maybe Text)
skukSKUId
= lens _skukSKUId (\ s a -> s{_skukSKUId = a})
skukServiceProviderName :: Lens' SKU (Maybe Text)
skukServiceProviderName
= lens _skukServiceProviderName
(\ s a -> s{_skukServiceProviderName = a})
skukServiceRegions :: Lens' SKU [Text]
skukServiceRegions
= lens _skukServiceRegions
(\ s a -> s{_skukServiceRegions = a})
. _Default
. _Coerce
skukName :: Lens' SKU (Maybe Text)
skukName = lens _skukName (\ s a -> s{_skukName = a})
skukPricingInfo :: Lens' SKU [PricingInfo]
skukPricingInfo
= lens _skukPricingInfo
(\ s a -> s{_skukPricingInfo = a})
. _Default
. _Coerce
skukDescription :: Lens' SKU (Maybe Text)
skukDescription
= lens _skukDescription
(\ s a -> s{_skukDescription = a})
instance FromJSON SKU where
parseJSON
= withObject "SKU"
(\ o ->
SKU' <$>
(o .:? "category") <*> (o .:? "skuId") <*>
(o .:? "serviceProviderName")
<*> (o .:? "serviceRegions" .!= mempty)
<*> (o .:? "name")
<*> (o .:? "pricingInfo" .!= mempty)
<*> (o .:? "description"))
instance ToJSON SKU where
toJSON SKU'{..}
= object
(catMaybes
[("category" .=) <$> _skukCategory,
("skuId" .=) <$> _skukSKUId,
("serviceProviderName" .=) <$>
_skukServiceProviderName,
("serviceRegions" .=) <$> _skukServiceRegions,
("name" .=) <$> _skukName,
("pricingInfo" .=) <$> _skukPricingInfo,
("description" .=) <$> _skukDescription])
newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse'
{ _tiamprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsResponse
:: TestIAMPermissionsResponse
testIAMPermissionsResponse =
TestIAMPermissionsResponse'
{ _tiamprPermissions = Nothing
}
tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
tiamprPermissions
= lens _tiamprPermissions
(\ s a -> s{_tiamprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsResponse where
parseJSON
= withObject "TestIAMPermissionsResponse"
(\ o ->
TestIAMPermissionsResponse' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsResponse where
toJSON TestIAMPermissionsResponse'{..}
= object
(catMaybes
[("permissions" .=) <$> _tiamprPermissions])
data Policy = Policy'
{ _pAuditConfigs :: !(Maybe [AuditConfig])
, _pEtag :: !(Maybe Bytes)
, _pVersion :: !(Maybe (Textual Int32))
, _pBindings :: !(Maybe [Binding])
} deriving (Eq,Show,Data,Typeable,Generic)
policy
:: Policy
policy =
Policy'
{ _pAuditConfigs = Nothing
, _pEtag = Nothing
, _pVersion = Nothing
, _pBindings = Nothing
}
pAuditConfigs :: Lens' Policy [AuditConfig]
pAuditConfigs
= lens _pAuditConfigs
(\ s a -> s{_pAuditConfigs = a})
. _Default
. _Coerce
pEtag :: Lens' Policy (Maybe ByteString)
pEtag
= lens _pEtag (\ s a -> s{_pEtag = a}) .
mapping _Bytes
pVersion :: Lens' Policy (Maybe Int32)
pVersion
= lens _pVersion (\ s a -> s{_pVersion = a}) .
mapping _Coerce
pBindings :: Lens' Policy [Binding]
pBindings
= lens _pBindings (\ s a -> s{_pBindings = a}) .
_Default
. _Coerce
instance FromJSON Policy where
parseJSON
= withObject "Policy"
(\ o ->
Policy' <$>
(o .:? "auditConfigs" .!= mempty) <*> (o .:? "etag")
<*> (o .:? "version")
<*> (o .:? "bindings" .!= mempty))
instance ToJSON Policy where
toJSON Policy'{..}
= object
(catMaybes
[("auditConfigs" .=) <$> _pAuditConfigs,
("etag" .=) <$> _pEtag, ("version" .=) <$> _pVersion,
("bindings" .=) <$> _pBindings])
data ListBillingAccountsResponse = ListBillingAccountsResponse'
{ _lbarNextPageToken :: !(Maybe Text)
, _lbarBillingAccounts :: !(Maybe [BillingAccount])
} deriving (Eq,Show,Data,Typeable,Generic)
listBillingAccountsResponse
:: ListBillingAccountsResponse
listBillingAccountsResponse =
ListBillingAccountsResponse'
{ _lbarNextPageToken = Nothing
, _lbarBillingAccounts = Nothing
}
lbarNextPageToken :: Lens' ListBillingAccountsResponse (Maybe Text)
lbarNextPageToken
= lens _lbarNextPageToken
(\ s a -> s{_lbarNextPageToken = a})
lbarBillingAccounts :: Lens' ListBillingAccountsResponse [BillingAccount]
lbarBillingAccounts
= lens _lbarBillingAccounts
(\ s a -> s{_lbarBillingAccounts = a})
. _Default
. _Coerce
instance FromJSON ListBillingAccountsResponse where
parseJSON
= withObject "ListBillingAccountsResponse"
(\ o ->
ListBillingAccountsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "billingAccounts" .!= mempty))
instance ToJSON ListBillingAccountsResponse where
toJSON ListBillingAccountsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lbarNextPageToken,
("billingAccounts" .=) <$> _lbarBillingAccounts])
data AuditLogConfig = AuditLogConfig'
{ _alcLogType :: !(Maybe AuditLogConfigLogType)
, _alcExemptedMembers :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
auditLogConfig
:: AuditLogConfig
auditLogConfig =
AuditLogConfig'
{ _alcLogType = Nothing
, _alcExemptedMembers = Nothing
}
alcLogType :: Lens' AuditLogConfig (Maybe AuditLogConfigLogType)
alcLogType
= lens _alcLogType (\ s a -> s{_alcLogType = a})
alcExemptedMembers :: Lens' AuditLogConfig [Text]
alcExemptedMembers
= lens _alcExemptedMembers
(\ s a -> s{_alcExemptedMembers = a})
. _Default
. _Coerce
instance FromJSON AuditLogConfig where
parseJSON
= withObject "AuditLogConfig"
(\ o ->
AuditLogConfig' <$>
(o .:? "logType") <*>
(o .:? "exemptedMembers" .!= mempty))
instance ToJSON AuditLogConfig where
toJSON AuditLogConfig'{..}
= object
(catMaybes
[("logType" .=) <$> _alcLogType,
("exemptedMembers" .=) <$> _alcExemptedMembers])
data PricingInfo = PricingInfo'
{ _piSummary :: !(Maybe Text)
, _piAggregationInfo :: !(Maybe AggregationInfo)
, _piPricingExpression :: !(Maybe PricingExpression)
, _piCurrencyConversionRate :: !(Maybe (Textual Double))
, _piEffectiveTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
pricingInfo
:: PricingInfo
pricingInfo =
PricingInfo'
{ _piSummary = Nothing
, _piAggregationInfo = Nothing
, _piPricingExpression = Nothing
, _piCurrencyConversionRate = Nothing
, _piEffectiveTime = Nothing
}
piSummary :: Lens' PricingInfo (Maybe Text)
piSummary
= lens _piSummary (\ s a -> s{_piSummary = a})
piAggregationInfo :: Lens' PricingInfo (Maybe AggregationInfo)
piAggregationInfo
= lens _piAggregationInfo
(\ s a -> s{_piAggregationInfo = a})
piPricingExpression :: Lens' PricingInfo (Maybe PricingExpression)
piPricingExpression
= lens _piPricingExpression
(\ s a -> s{_piPricingExpression = a})
piCurrencyConversionRate :: Lens' PricingInfo (Maybe Double)
piCurrencyConversionRate
= lens _piCurrencyConversionRate
(\ s a -> s{_piCurrencyConversionRate = a})
. mapping _Coerce
piEffectiveTime :: Lens' PricingInfo (Maybe UTCTime)
piEffectiveTime
= lens _piEffectiveTime
(\ s a -> s{_piEffectiveTime = a})
. mapping _DateTime
instance FromJSON PricingInfo where
parseJSON
= withObject "PricingInfo"
(\ o ->
PricingInfo' <$>
(o .:? "summary") <*> (o .:? "aggregationInfo") <*>
(o .:? "pricingExpression")
<*> (o .:? "currencyConversionRate")
<*> (o .:? "effectiveTime"))
instance ToJSON PricingInfo where
toJSON PricingInfo'{..}
= object
(catMaybes
[("summary" .=) <$> _piSummary,
("aggregationInfo" .=) <$> _piAggregationInfo,
("pricingExpression" .=) <$> _piPricingExpression,
("currencyConversionRate" .=) <$>
_piCurrencyConversionRate,
("effectiveTime" .=) <$> _piEffectiveTime])
data Binding = Binding'
{ _bMembers :: !(Maybe [Text])
, _bRole :: !(Maybe Text)
, _bCondition :: !(Maybe Expr)
} deriving (Eq,Show,Data,Typeable,Generic)
binding
:: Binding
binding =
Binding'
{ _bMembers = Nothing
, _bRole = Nothing
, _bCondition = Nothing
}
bMembers :: Lens' Binding [Text]
bMembers
= lens _bMembers (\ s a -> s{_bMembers = a}) .
_Default
. _Coerce
bRole :: Lens' Binding (Maybe Text)
bRole = lens _bRole (\ s a -> s{_bRole = a})
bCondition :: Lens' Binding (Maybe Expr)
bCondition
= lens _bCondition (\ s a -> s{_bCondition = a})
instance FromJSON Binding where
parseJSON
= withObject "Binding"
(\ o ->
Binding' <$>
(o .:? "members" .!= mempty) <*> (o .:? "role") <*>
(o .:? "condition"))
instance ToJSON Binding where
toJSON Binding'{..}
= object
(catMaybes
[("members" .=) <$> _bMembers,
("role" .=) <$> _bRole,
("condition" .=) <$> _bCondition])