module Network.Google.AndroidEnterprise.Types.Product where
import Network.Google.AndroidEnterprise.Types.Sum
import Network.Google.Prelude
data GroupLicense = GroupLicense'
{ _glKind :: !Text
, _glNumProvisioned :: !(Maybe (Textual Int32))
, _glNumPurchased :: !(Maybe (Textual Int32))
, _glApproval :: !(Maybe Text)
, _glProductId :: !(Maybe Text)
, _glAcquisitionKind :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
groupLicense
:: GroupLicense
groupLicense =
GroupLicense'
{ _glKind = "androidenterprise#groupLicense"
, _glNumProvisioned = Nothing
, _glNumPurchased = Nothing
, _glApproval = Nothing
, _glProductId = Nothing
, _glAcquisitionKind = Nothing
}
glKind :: Lens' GroupLicense Text
glKind = lens _glKind (\ s a -> s{_glKind = a})
glNumProvisioned :: Lens' GroupLicense (Maybe Int32)
glNumProvisioned
= lens _glNumProvisioned
(\ s a -> s{_glNumProvisioned = a})
. mapping _Coerce
glNumPurchased :: Lens' GroupLicense (Maybe Int32)
glNumPurchased
= lens _glNumPurchased
(\ s a -> s{_glNumPurchased = a})
. mapping _Coerce
glApproval :: Lens' GroupLicense (Maybe Text)
glApproval
= lens _glApproval (\ s a -> s{_glApproval = a})
glProductId :: Lens' GroupLicense (Maybe Text)
glProductId
= lens _glProductId (\ s a -> s{_glProductId = a})
glAcquisitionKind :: Lens' GroupLicense (Maybe Text)
glAcquisitionKind
= lens _glAcquisitionKind
(\ s a -> s{_glAcquisitionKind = a})
instance FromJSON GroupLicense where
parseJSON
= withObject "GroupLicense"
(\ o ->
GroupLicense' <$>
(o .:? "kind" .!= "androidenterprise#groupLicense")
<*> (o .:? "numProvisioned")
<*> (o .:? "numPurchased")
<*> (o .:? "approval")
<*> (o .:? "productId")
<*> (o .:? "acquisitionKind"))
instance ToJSON GroupLicense where
toJSON GroupLicense'{..}
= object
(catMaybes
[Just ("kind" .= _glKind),
("numProvisioned" .=) <$> _glNumProvisioned,
("numPurchased" .=) <$> _glNumPurchased,
("approval" .=) <$> _glApproval,
("productId" .=) <$> _glProductId,
("acquisitionKind" .=) <$> _glAcquisitionKind])
data StoreLayoutPagesListResponse = StoreLayoutPagesListResponse'
{ _slplrKind :: !Text
, _slplrPage :: !(Maybe [StorePage])
} deriving (Eq,Show,Data,Typeable,Generic)
storeLayoutPagesListResponse
:: StoreLayoutPagesListResponse
storeLayoutPagesListResponse =
StoreLayoutPagesListResponse'
{ _slplrKind = "androidenterprise#storeLayoutPagesListResponse"
, _slplrPage = Nothing
}
slplrKind :: Lens' StoreLayoutPagesListResponse Text
slplrKind
= lens _slplrKind (\ s a -> s{_slplrKind = a})
slplrPage :: Lens' StoreLayoutPagesListResponse [StorePage]
slplrPage
= lens _slplrPage (\ s a -> s{_slplrPage = a}) .
_Default
. _Coerce
instance FromJSON StoreLayoutPagesListResponse where
parseJSON
= withObject "StoreLayoutPagesListResponse"
(\ o ->
StoreLayoutPagesListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#storeLayoutPagesListResponse")
<*> (o .:? "page" .!= mempty))
instance ToJSON StoreLayoutPagesListResponse where
toJSON StoreLayoutPagesListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _slplrKind),
("page" .=) <$> _slplrPage])
data EnterpriseAccount = EnterpriseAccount'
{ _eaKind :: !Text
, _eaAccountEmail :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
enterpriseAccount
:: EnterpriseAccount
enterpriseAccount =
EnterpriseAccount'
{ _eaKind = "androidenterprise#enterpriseAccount"
, _eaAccountEmail = Nothing
}
eaKind :: Lens' EnterpriseAccount Text
eaKind = lens _eaKind (\ s a -> s{_eaKind = a})
eaAccountEmail :: Lens' EnterpriseAccount (Maybe Text)
eaAccountEmail
= lens _eaAccountEmail
(\ s a -> s{_eaAccountEmail = a})
instance FromJSON EnterpriseAccount where
parseJSON
= withObject "EnterpriseAccount"
(\ o ->
EnterpriseAccount' <$>
(o .:? "kind" .!=
"androidenterprise#enterpriseAccount")
<*> (o .:? "accountEmail"))
instance ToJSON EnterpriseAccount where
toJSON EnterpriseAccount'{..}
= object
(catMaybes
[Just ("kind" .= _eaKind),
("accountEmail" .=) <$> _eaAccountEmail])
data CollectionsListResponse = CollectionsListResponse'
{ _clrKind :: !Text
, _clrCollection :: !(Maybe [Collection])
} deriving (Eq,Show,Data,Typeable,Generic)
collectionsListResponse
:: CollectionsListResponse
collectionsListResponse =
CollectionsListResponse'
{ _clrKind = "androidenterprise#collectionsListResponse"
, _clrCollection = Nothing
}
clrKind :: Lens' CollectionsListResponse Text
clrKind = lens _clrKind (\ s a -> s{_clrKind = a})
clrCollection :: Lens' CollectionsListResponse [Collection]
clrCollection
= lens _clrCollection
(\ s a -> s{_clrCollection = a})
. _Default
. _Coerce
instance FromJSON CollectionsListResponse where
parseJSON
= withObject "CollectionsListResponse"
(\ o ->
CollectionsListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#collectionsListResponse")
<*> (o .:? "collection" .!= mempty))
instance ToJSON CollectionsListResponse where
toJSON CollectionsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _clrKind),
("collection" .=) <$> _clrCollection])
data AppRestrictionsSchemaRestrictionRestrictionValue = AppRestrictionsSchemaRestrictionRestrictionValue'
{ _arsrrvValueMultiselect :: !(Maybe [Text])
, _arsrrvValueBool :: !(Maybe Bool)
, _arsrrvValueInteger :: !(Maybe (Textual Int32))
, _arsrrvType :: !(Maybe Text)
, _arsrrvValueString :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
appRestrictionsSchemaRestrictionRestrictionValue
:: AppRestrictionsSchemaRestrictionRestrictionValue
appRestrictionsSchemaRestrictionRestrictionValue =
AppRestrictionsSchemaRestrictionRestrictionValue'
{ _arsrrvValueMultiselect = Nothing
, _arsrrvValueBool = Nothing
, _arsrrvValueInteger = Nothing
, _arsrrvType = Nothing
, _arsrrvValueString = Nothing
}
arsrrvValueMultiselect :: Lens' AppRestrictionsSchemaRestrictionRestrictionValue [Text]
arsrrvValueMultiselect
= lens _arsrrvValueMultiselect
(\ s a -> s{_arsrrvValueMultiselect = a})
. _Default
. _Coerce
arsrrvValueBool :: Lens' AppRestrictionsSchemaRestrictionRestrictionValue (Maybe Bool)
arsrrvValueBool
= lens _arsrrvValueBool
(\ s a -> s{_arsrrvValueBool = a})
arsrrvValueInteger :: Lens' AppRestrictionsSchemaRestrictionRestrictionValue (Maybe Int32)
arsrrvValueInteger
= lens _arsrrvValueInteger
(\ s a -> s{_arsrrvValueInteger = a})
. mapping _Coerce
arsrrvType :: Lens' AppRestrictionsSchemaRestrictionRestrictionValue (Maybe Text)
arsrrvType
= lens _arsrrvType (\ s a -> s{_arsrrvType = a})
arsrrvValueString :: Lens' AppRestrictionsSchemaRestrictionRestrictionValue (Maybe Text)
arsrrvValueString
= lens _arsrrvValueString
(\ s a -> s{_arsrrvValueString = a})
instance FromJSON
AppRestrictionsSchemaRestrictionRestrictionValue
where
parseJSON
= withObject
"AppRestrictionsSchemaRestrictionRestrictionValue"
(\ o ->
AppRestrictionsSchemaRestrictionRestrictionValue' <$>
(o .:? "valueMultiselect" .!= mempty) <*>
(o .:? "valueBool")
<*> (o .:? "valueInteger")
<*> (o .:? "type")
<*> (o .:? "valueString"))
instance ToJSON
AppRestrictionsSchemaRestrictionRestrictionValue
where
toJSON
AppRestrictionsSchemaRestrictionRestrictionValue'{..}
= object
(catMaybes
[("valueMultiselect" .=) <$> _arsrrvValueMultiselect,
("valueBool" .=) <$> _arsrrvValueBool,
("valueInteger" .=) <$> _arsrrvValueInteger,
("type" .=) <$> _arsrrvType,
("valueString" .=) <$> _arsrrvValueString])
data DeviceState = DeviceState'
{ _dsKind :: !Text
, _dsAccountState :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
deviceState
:: DeviceState
deviceState =
DeviceState'
{ _dsKind = "androidenterprise#deviceState"
, _dsAccountState = Nothing
}
dsKind :: Lens' DeviceState Text
dsKind = lens _dsKind (\ s a -> s{_dsKind = a})
dsAccountState :: Lens' DeviceState (Maybe Text)
dsAccountState
= lens _dsAccountState
(\ s a -> s{_dsAccountState = a})
instance FromJSON DeviceState where
parseJSON
= withObject "DeviceState"
(\ o ->
DeviceState' <$>
(o .:? "kind" .!= "androidenterprise#deviceState")
<*> (o .:? "accountState"))
instance ToJSON DeviceState where
toJSON DeviceState'{..}
= object
(catMaybes
[Just ("kind" .= _dsKind),
("accountState" .=) <$> _dsAccountState])
data GroupLicenseUsersListResponse = GroupLicenseUsersListResponse'
{ _glulrKind :: !Text
, _glulrUser :: !(Maybe [User])
} deriving (Eq,Show,Data,Typeable,Generic)
groupLicenseUsersListResponse
:: GroupLicenseUsersListResponse
groupLicenseUsersListResponse =
GroupLicenseUsersListResponse'
{ _glulrKind = "androidenterprise#groupLicenseUsersListResponse"
, _glulrUser = Nothing
}
glulrKind :: Lens' GroupLicenseUsersListResponse Text
glulrKind
= lens _glulrKind (\ s a -> s{_glulrKind = a})
glulrUser :: Lens' GroupLicenseUsersListResponse [User]
glulrUser
= lens _glulrUser (\ s a -> s{_glulrUser = a}) .
_Default
. _Coerce
instance FromJSON GroupLicenseUsersListResponse where
parseJSON
= withObject "GroupLicenseUsersListResponse"
(\ o ->
GroupLicenseUsersListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#groupLicenseUsersListResponse")
<*> (o .:? "user" .!= mempty))
instance ToJSON GroupLicenseUsersListResponse where
toJSON GroupLicenseUsersListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _glulrKind),
("user" .=) <$> _glulrUser])
data TokenPagination = TokenPagination'
{ _tpNextPageToken :: !(Maybe Text)
, _tpPreviousPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
tokenPagination
:: TokenPagination
tokenPagination =
TokenPagination'
{ _tpNextPageToken = Nothing
, _tpPreviousPageToken = Nothing
}
tpNextPageToken :: Lens' TokenPagination (Maybe Text)
tpNextPageToken
= lens _tpNextPageToken
(\ s a -> s{_tpNextPageToken = a})
tpPreviousPageToken :: Lens' TokenPagination (Maybe Text)
tpPreviousPageToken
= lens _tpPreviousPageToken
(\ s a -> s{_tpPreviousPageToken = a})
instance FromJSON TokenPagination where
parseJSON
= withObject "TokenPagination"
(\ o ->
TokenPagination' <$>
(o .:? "nextPageToken") <*>
(o .:? "previousPageToken"))
instance ToJSON TokenPagination where
toJSON TokenPagination'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _tpNextPageToken,
("previousPageToken" .=) <$> _tpPreviousPageToken])
data ApprovalURLInfo = ApprovalURLInfo'
{ _auiApprovalURL :: !(Maybe Text)
, _auiKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
approvalURLInfo
:: ApprovalURLInfo
approvalURLInfo =
ApprovalURLInfo'
{ _auiApprovalURL = Nothing
, _auiKind = "androidenterprise#approvalUrlInfo"
}
auiApprovalURL :: Lens' ApprovalURLInfo (Maybe Text)
auiApprovalURL
= lens _auiApprovalURL
(\ s a -> s{_auiApprovalURL = a})
auiKind :: Lens' ApprovalURLInfo Text
auiKind = lens _auiKind (\ s a -> s{_auiKind = a})
instance FromJSON ApprovalURLInfo where
parseJSON
= withObject "ApprovalURLInfo"
(\ o ->
ApprovalURLInfo' <$>
(o .:? "approvalUrl") <*>
(o .:? "kind" .!=
"androidenterprise#approvalUrlInfo"))
instance ToJSON ApprovalURLInfo where
toJSON ApprovalURLInfo'{..}
= object
(catMaybes
[("approvalUrl" .=) <$> _auiApprovalURL,
Just ("kind" .= _auiKind)])
data StoreLayoutClustersListResponse = StoreLayoutClustersListResponse'
{ _slclrCluster :: !(Maybe [StoreCluster])
, _slclrKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
storeLayoutClustersListResponse
:: StoreLayoutClustersListResponse
storeLayoutClustersListResponse =
StoreLayoutClustersListResponse'
{ _slclrCluster = Nothing
, _slclrKind = "androidenterprise#storeLayoutClustersListResponse"
}
slclrCluster :: Lens' StoreLayoutClustersListResponse [StoreCluster]
slclrCluster
= lens _slclrCluster (\ s a -> s{_slclrCluster = a})
. _Default
. _Coerce
slclrKind :: Lens' StoreLayoutClustersListResponse Text
slclrKind
= lens _slclrKind (\ s a -> s{_slclrKind = a})
instance FromJSON StoreLayoutClustersListResponse
where
parseJSON
= withObject "StoreLayoutClustersListResponse"
(\ o ->
StoreLayoutClustersListResponse' <$>
(o .:? "cluster" .!= mempty) <*>
(o .:? "kind" .!=
"androidenterprise#storeLayoutClustersListResponse"))
instance ToJSON StoreLayoutClustersListResponse where
toJSON StoreLayoutClustersListResponse'{..}
= object
(catMaybes
[("cluster" .=) <$> _slclrCluster,
Just ("kind" .= _slclrKind)])
data StoreCluster = StoreCluster'
{ _scKind :: !Text
, _scName :: !(Maybe [LocalizedText])
, _scOrderInPage :: !(Maybe Text)
, _scId :: !(Maybe Text)
, _scProductId :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
storeCluster
:: StoreCluster
storeCluster =
StoreCluster'
{ _scKind = "androidenterprise#storeCluster"
, _scName = Nothing
, _scOrderInPage = Nothing
, _scId = Nothing
, _scProductId = Nothing
}
scKind :: Lens' StoreCluster Text
scKind = lens _scKind (\ s a -> s{_scKind = a})
scName :: Lens' StoreCluster [LocalizedText]
scName
= lens _scName (\ s a -> s{_scName = a}) . _Default .
_Coerce
scOrderInPage :: Lens' StoreCluster (Maybe Text)
scOrderInPage
= lens _scOrderInPage
(\ s a -> s{_scOrderInPage = a})
scId :: Lens' StoreCluster (Maybe Text)
scId = lens _scId (\ s a -> s{_scId = a})
scProductId :: Lens' StoreCluster [Text]
scProductId
= lens _scProductId (\ s a -> s{_scProductId = a}) .
_Default
. _Coerce
instance FromJSON StoreCluster where
parseJSON
= withObject "StoreCluster"
(\ o ->
StoreCluster' <$>
(o .:? "kind" .!= "androidenterprise#storeCluster")
<*> (o .:? "name" .!= mempty)
<*> (o .:? "orderInPage")
<*> (o .:? "id")
<*> (o .:? "productId" .!= mempty))
instance ToJSON StoreCluster where
toJSON StoreCluster'{..}
= object
(catMaybes
[Just ("kind" .= _scKind), ("name" .=) <$> _scName,
("orderInPage" .=) <$> _scOrderInPage,
("id" .=) <$> _scId,
("productId" .=) <$> _scProductId])
data PageInfo = PageInfo'
{ _piResultPerPage :: !(Maybe (Textual Int32))
, _piTotalResults :: !(Maybe (Textual Int32))
, _piStartIndex :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
pageInfo
:: PageInfo
pageInfo =
PageInfo'
{ _piResultPerPage = Nothing
, _piTotalResults = Nothing
, _piStartIndex = Nothing
}
piResultPerPage :: Lens' PageInfo (Maybe Int32)
piResultPerPage
= lens _piResultPerPage
(\ s a -> s{_piResultPerPage = a})
. mapping _Coerce
piTotalResults :: Lens' PageInfo (Maybe Int32)
piTotalResults
= lens _piTotalResults
(\ s a -> s{_piTotalResults = a})
. mapping _Coerce
piStartIndex :: Lens' PageInfo (Maybe Int32)
piStartIndex
= lens _piStartIndex (\ s a -> s{_piStartIndex = a})
. mapping _Coerce
instance FromJSON PageInfo where
parseJSON
= withObject "PageInfo"
(\ o ->
PageInfo' <$>
(o .:? "resultPerPage") <*> (o .:? "totalResults")
<*> (o .:? "startIndex"))
instance ToJSON PageInfo where
toJSON PageInfo'{..}
= object
(catMaybes
[("resultPerPage" .=) <$> _piResultPerPage,
("totalResults" .=) <$> _piTotalResults,
("startIndex" .=) <$> _piStartIndex])
data ProductPermission = ProductPermission'
{ _ppState :: !(Maybe Text)
, _ppPermissionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
productPermission
:: ProductPermission
productPermission =
ProductPermission'
{ _ppState = Nothing
, _ppPermissionId = Nothing
}
ppState :: Lens' ProductPermission (Maybe Text)
ppState = lens _ppState (\ s a -> s{_ppState = a})
ppPermissionId :: Lens' ProductPermission (Maybe Text)
ppPermissionId
= lens _ppPermissionId
(\ s a -> s{_ppPermissionId = a})
instance FromJSON ProductPermission where
parseJSON
= withObject "ProductPermission"
(\ o ->
ProductPermission' <$>
(o .:? "state") <*> (o .:? "permissionId"))
instance ToJSON ProductPermission where
toJSON ProductPermission'{..}
= object
(catMaybes
[("state" .=) <$> _ppState,
("permissionId" .=) <$> _ppPermissionId])
data Device = Device'
{ _dKind :: !Text
, _dManagementType :: !(Maybe Text)
, _dAndroidId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
device
:: Device
device =
Device'
{ _dKind = "androidenterprise#device"
, _dManagementType = Nothing
, _dAndroidId = Nothing
}
dKind :: Lens' Device Text
dKind = lens _dKind (\ s a -> s{_dKind = a})
dManagementType :: Lens' Device (Maybe Text)
dManagementType
= lens _dManagementType
(\ s a -> s{_dManagementType = a})
dAndroidId :: Lens' Device (Maybe Text)
dAndroidId
= lens _dAndroidId (\ s a -> s{_dAndroidId = a})
instance FromJSON Device where
parseJSON
= withObject "Device"
(\ o ->
Device' <$>
(o .:? "kind" .!= "androidenterprise#device") <*>
(o .:? "managementType")
<*> (o .:? "androidId"))
instance ToJSON Device where
toJSON Device'{..}
= object
(catMaybes
[Just ("kind" .= _dKind),
("managementType" .=) <$> _dManagementType,
("androidId" .=) <$> _dAndroidId])
data InstallsListResponse = InstallsListResponse'
{ _ilrKind :: !Text
, _ilrInstall :: !(Maybe [Install])
} deriving (Eq,Show,Data,Typeable,Generic)
installsListResponse
:: InstallsListResponse
installsListResponse =
InstallsListResponse'
{ _ilrKind = "androidenterprise#installsListResponse"
, _ilrInstall = Nothing
}
ilrKind :: Lens' InstallsListResponse Text
ilrKind = lens _ilrKind (\ s a -> s{_ilrKind = a})
ilrInstall :: Lens' InstallsListResponse [Install]
ilrInstall
= lens _ilrInstall (\ s a -> s{_ilrInstall = a}) .
_Default
. _Coerce
instance FromJSON InstallsListResponse where
parseJSON
= withObject "InstallsListResponse"
(\ o ->
InstallsListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#installsListResponse")
<*> (o .:? "install" .!= mempty))
instance ToJSON InstallsListResponse where
toJSON InstallsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _ilrKind),
("install" .=) <$> _ilrInstall])
data AppRestrictionsSchemaRestriction = AppRestrictionsSchemaRestriction'
{ _arsrRestrictionType :: !(Maybe Text)
, _arsrEntry :: !(Maybe [Text])
, _arsrKey :: !(Maybe Text)
, _arsrEntryValue :: !(Maybe [Text])
, _arsrDefaultValue :: !(Maybe AppRestrictionsSchemaRestrictionRestrictionValue)
, _arsrTitle :: !(Maybe Text)
, _arsrDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
appRestrictionsSchemaRestriction
:: AppRestrictionsSchemaRestriction
appRestrictionsSchemaRestriction =
AppRestrictionsSchemaRestriction'
{ _arsrRestrictionType = Nothing
, _arsrEntry = Nothing
, _arsrKey = Nothing
, _arsrEntryValue = Nothing
, _arsrDefaultValue = Nothing
, _arsrTitle = Nothing
, _arsrDescription = Nothing
}
arsrRestrictionType :: Lens' AppRestrictionsSchemaRestriction (Maybe Text)
arsrRestrictionType
= lens _arsrRestrictionType
(\ s a -> s{_arsrRestrictionType = a})
arsrEntry :: Lens' AppRestrictionsSchemaRestriction [Text]
arsrEntry
= lens _arsrEntry (\ s a -> s{_arsrEntry = a}) .
_Default
. _Coerce
arsrKey :: Lens' AppRestrictionsSchemaRestriction (Maybe Text)
arsrKey = lens _arsrKey (\ s a -> s{_arsrKey = a})
arsrEntryValue :: Lens' AppRestrictionsSchemaRestriction [Text]
arsrEntryValue
= lens _arsrEntryValue
(\ s a -> s{_arsrEntryValue = a})
. _Default
. _Coerce
arsrDefaultValue :: Lens' AppRestrictionsSchemaRestriction (Maybe AppRestrictionsSchemaRestrictionRestrictionValue)
arsrDefaultValue
= lens _arsrDefaultValue
(\ s a -> s{_arsrDefaultValue = a})
arsrTitle :: Lens' AppRestrictionsSchemaRestriction (Maybe Text)
arsrTitle
= lens _arsrTitle (\ s a -> s{_arsrTitle = a})
arsrDescription :: Lens' AppRestrictionsSchemaRestriction (Maybe Text)
arsrDescription
= lens _arsrDescription
(\ s a -> s{_arsrDescription = a})
instance FromJSON AppRestrictionsSchemaRestriction
where
parseJSON
= withObject "AppRestrictionsSchemaRestriction"
(\ o ->
AppRestrictionsSchemaRestriction' <$>
(o .:? "restrictionType") <*>
(o .:? "entry" .!= mempty)
<*> (o .:? "key")
<*> (o .:? "entryValue" .!= mempty)
<*> (o .:? "defaultValue")
<*> (o .:? "title")
<*> (o .:? "description"))
instance ToJSON AppRestrictionsSchemaRestriction
where
toJSON AppRestrictionsSchemaRestriction'{..}
= object
(catMaybes
[("restrictionType" .=) <$> _arsrRestrictionType,
("entry" .=) <$> _arsrEntry, ("key" .=) <$> _arsrKey,
("entryValue" .=) <$> _arsrEntryValue,
("defaultValue" .=) <$> _arsrDefaultValue,
("title" .=) <$> _arsrTitle,
("description" .=) <$> _arsrDescription])
data UsersListResponse = UsersListResponse'
{ _ulrKind :: !Text
, _ulrUser :: !(Maybe [User])
} deriving (Eq,Show,Data,Typeable,Generic)
usersListResponse
:: UsersListResponse
usersListResponse =
UsersListResponse'
{ _ulrKind = "androidenterprise#usersListResponse"
, _ulrUser = Nothing
}
ulrKind :: Lens' UsersListResponse Text
ulrKind = lens _ulrKind (\ s a -> s{_ulrKind = a})
ulrUser :: Lens' UsersListResponse [User]
ulrUser
= lens _ulrUser (\ s a -> s{_ulrUser = a}) . _Default
. _Coerce
instance FromJSON UsersListResponse where
parseJSON
= withObject "UsersListResponse"
(\ o ->
UsersListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#usersListResponse")
<*> (o .:? "user" .!= mempty))
instance ToJSON UsersListResponse where
toJSON UsersListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _ulrKind),
("user" .=) <$> _ulrUser])
data AppVersion = AppVersion'
{ _avVersionCode :: !(Maybe (Textual Int32))
, _avVersionString :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
appVersion
:: AppVersion
appVersion =
AppVersion'
{ _avVersionCode = Nothing
, _avVersionString = Nothing
}
avVersionCode :: Lens' AppVersion (Maybe Int32)
avVersionCode
= lens _avVersionCode
(\ s a -> s{_avVersionCode = a})
. mapping _Coerce
avVersionString :: Lens' AppVersion (Maybe Text)
avVersionString
= lens _avVersionString
(\ s a -> s{_avVersionString = a})
instance FromJSON AppVersion where
parseJSON
= withObject "AppVersion"
(\ o ->
AppVersion' <$>
(o .:? "versionCode") <*> (o .:? "versionString"))
instance ToJSON AppVersion where
toJSON AppVersion'{..}
= object
(catMaybes
[("versionCode" .=) <$> _avVersionCode,
("versionString" .=) <$> _avVersionString])
data GroupLicensesListResponse = GroupLicensesListResponse'
{ _gllrGroupLicense :: !(Maybe [GroupLicense])
, _gllrKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
groupLicensesListResponse
:: GroupLicensesListResponse
groupLicensesListResponse =
GroupLicensesListResponse'
{ _gllrGroupLicense = Nothing
, _gllrKind = "androidenterprise#groupLicensesListResponse"
}
gllrGroupLicense :: Lens' GroupLicensesListResponse [GroupLicense]
gllrGroupLicense
= lens _gllrGroupLicense
(\ s a -> s{_gllrGroupLicense = a})
. _Default
. _Coerce
gllrKind :: Lens' GroupLicensesListResponse Text
gllrKind = lens _gllrKind (\ s a -> s{_gllrKind = a})
instance FromJSON GroupLicensesListResponse where
parseJSON
= withObject "GroupLicensesListResponse"
(\ o ->
GroupLicensesListResponse' <$>
(o .:? "groupLicense" .!= mempty) <*>
(o .:? "kind" .!=
"androidenterprise#groupLicensesListResponse"))
instance ToJSON GroupLicensesListResponse where
toJSON GroupLicensesListResponse'{..}
= object
(catMaybes
[("groupLicense" .=) <$> _gllrGroupLicense,
Just ("kind" .= _gllrKind)])
data Collection = Collection'
{ _colKind :: !Text
, _colCollectionId :: !(Maybe Text)
, _colVisibility :: !(Maybe Text)
, _colName :: !(Maybe Text)
, _colProductId :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
collection
:: Collection
collection =
Collection'
{ _colKind = "androidenterprise#collection"
, _colCollectionId = Nothing
, _colVisibility = Nothing
, _colName = Nothing
, _colProductId = Nothing
}
colKind :: Lens' Collection Text
colKind = lens _colKind (\ s a -> s{_colKind = a})
colCollectionId :: Lens' Collection (Maybe Text)
colCollectionId
= lens _colCollectionId
(\ s a -> s{_colCollectionId = a})
colVisibility :: Lens' Collection (Maybe Text)
colVisibility
= lens _colVisibility
(\ s a -> s{_colVisibility = a})
colName :: Lens' Collection (Maybe Text)
colName = lens _colName (\ s a -> s{_colName = a})
colProductId :: Lens' Collection [Text]
colProductId
= lens _colProductId (\ s a -> s{_colProductId = a})
. _Default
. _Coerce
instance FromJSON Collection where
parseJSON
= withObject "Collection"
(\ o ->
Collection' <$>
(o .:? "kind" .!= "androidenterprise#collection") <*>
(o .:? "collectionId")
<*> (o .:? "visibility")
<*> (o .:? "name")
<*> (o .:? "productId" .!= mempty))
instance ToJSON Collection where
toJSON Collection'{..}
= object
(catMaybes
[Just ("kind" .= _colKind),
("collectionId" .=) <$> _colCollectionId,
("visibility" .=) <$> _colVisibility,
("name" .=) <$> _colName,
("productId" .=) <$> _colProductId])
data ProductSet = ProductSet'
{ _psKind :: !Text
, _psProductId :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
productSet
:: ProductSet
productSet =
ProductSet'
{ _psKind = "androidenterprise#productSet"
, _psProductId = Nothing
}
psKind :: Lens' ProductSet Text
psKind = lens _psKind (\ s a -> s{_psKind = a})
psProductId :: Lens' ProductSet [Text]
psProductId
= lens _psProductId (\ s a -> s{_psProductId = a}) .
_Default
. _Coerce
instance FromJSON ProductSet where
parseJSON
= withObject "ProductSet"
(\ o ->
ProductSet' <$>
(o .:? "kind" .!= "androidenterprise#productSet") <*>
(o .:? "productId" .!= mempty))
instance ToJSON ProductSet where
toJSON ProductSet'{..}
= object
(catMaybes
[Just ("kind" .= _psKind),
("productId" .=) <$> _psProductId])
data Install = Install'
{ _iVersionCode :: !(Maybe (Textual Int32))
, _iKind :: !Text
, _iInstallState :: !(Maybe Text)
, _iProductId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
install
:: Install
install =
Install'
{ _iVersionCode = Nothing
, _iKind = "androidenterprise#install"
, _iInstallState = Nothing
, _iProductId = Nothing
}
iVersionCode :: Lens' Install (Maybe Int32)
iVersionCode
= lens _iVersionCode (\ s a -> s{_iVersionCode = a})
. mapping _Coerce
iKind :: Lens' Install Text
iKind = lens _iKind (\ s a -> s{_iKind = a})
iInstallState :: Lens' Install (Maybe Text)
iInstallState
= lens _iInstallState
(\ s a -> s{_iInstallState = a})
iProductId :: Lens' Install (Maybe Text)
iProductId
= lens _iProductId (\ s a -> s{_iProductId = a})
instance FromJSON Install where
parseJSON
= withObject "Install"
(\ o ->
Install' <$>
(o .:? "versionCode") <*>
(o .:? "kind" .!= "androidenterprise#install")
<*> (o .:? "installState")
<*> (o .:? "productId"))
instance ToJSON Install where
toJSON Install'{..}
= object
(catMaybes
[("versionCode" .=) <$> _iVersionCode,
Just ("kind" .= _iKind),
("installState" .=) <$> _iInstallState,
("productId" .=) <$> _iProductId])
data User = User'
{ _uKind :: !Text
, _uId :: !(Maybe Text)
, _uPrimaryEmail :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
user
:: User
user =
User'
{ _uKind = "androidenterprise#user"
, _uId = Nothing
, _uPrimaryEmail = Nothing
}
uKind :: Lens' User Text
uKind = lens _uKind (\ s a -> s{_uKind = a})
uId :: Lens' User (Maybe Text)
uId = lens _uId (\ s a -> s{_uId = a})
uPrimaryEmail :: Lens' User (Maybe Text)
uPrimaryEmail
= lens _uPrimaryEmail
(\ s a -> s{_uPrimaryEmail = a})
instance FromJSON User where
parseJSON
= withObject "User"
(\ o ->
User' <$>
(o .:? "kind" .!= "androidenterprise#user") <*>
(o .:? "id")
<*> (o .:? "primaryEmail"))
instance ToJSON User where
toJSON User'{..}
= object
(catMaybes
[Just ("kind" .= _uKind), ("id" .=) <$> _uId,
("primaryEmail" .=) <$> _uPrimaryEmail])
newtype ProductsGenerateApprovalURLResponse = ProductsGenerateApprovalURLResponse'
{ _pgaurURL :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
productsGenerateApprovalURLResponse
:: ProductsGenerateApprovalURLResponse
productsGenerateApprovalURLResponse =
ProductsGenerateApprovalURLResponse'
{ _pgaurURL = Nothing
}
pgaurURL :: Lens' ProductsGenerateApprovalURLResponse (Maybe Text)
pgaurURL = lens _pgaurURL (\ s a -> s{_pgaurURL = a})
instance FromJSON ProductsGenerateApprovalURLResponse
where
parseJSON
= withObject "ProductsGenerateApprovalURLResponse"
(\ o ->
ProductsGenerateApprovalURLResponse' <$>
(o .:? "url"))
instance ToJSON ProductsGenerateApprovalURLResponse
where
toJSON ProductsGenerateApprovalURLResponse'{..}
= object (catMaybes [("url" .=) <$> _pgaurURL])
data StorePage = StorePage'
{ _spKind :: !Text
, _spLink :: !(Maybe [Text])
, _spName :: !(Maybe [LocalizedText])
, _spId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
storePage
:: StorePage
storePage =
StorePage'
{ _spKind = "androidenterprise#storePage"
, _spLink = Nothing
, _spName = Nothing
, _spId = Nothing
}
spKind :: Lens' StorePage Text
spKind = lens _spKind (\ s a -> s{_spKind = a})
spLink :: Lens' StorePage [Text]
spLink
= lens _spLink (\ s a -> s{_spLink = a}) . _Default .
_Coerce
spName :: Lens' StorePage [LocalizedText]
spName
= lens _spName (\ s a -> s{_spName = a}) . _Default .
_Coerce
spId :: Lens' StorePage (Maybe Text)
spId = lens _spId (\ s a -> s{_spId = a})
instance FromJSON StorePage where
parseJSON
= withObject "StorePage"
(\ o ->
StorePage' <$>
(o .:? "kind" .!= "androidenterprise#storePage") <*>
(o .:? "link" .!= mempty)
<*> (o .:? "name" .!= mempty)
<*> (o .:? "id"))
instance ToJSON StorePage where
toJSON StorePage'{..}
= object
(catMaybes
[Just ("kind" .= _spKind), ("link" .=) <$> _spLink,
("name" .=) <$> _spName, ("id" .=) <$> _spId])
data EnterprisesSendTestPushNotificationResponse = EnterprisesSendTestPushNotificationResponse'
{ _estpnrTopicName :: !(Maybe Text)
, _estpnrMessageId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
enterprisesSendTestPushNotificationResponse
:: EnterprisesSendTestPushNotificationResponse
enterprisesSendTestPushNotificationResponse =
EnterprisesSendTestPushNotificationResponse'
{ _estpnrTopicName = Nothing
, _estpnrMessageId = Nothing
}
estpnrTopicName :: Lens' EnterprisesSendTestPushNotificationResponse (Maybe Text)
estpnrTopicName
= lens _estpnrTopicName
(\ s a -> s{_estpnrTopicName = a})
estpnrMessageId :: Lens' EnterprisesSendTestPushNotificationResponse (Maybe Text)
estpnrMessageId
= lens _estpnrMessageId
(\ s a -> s{_estpnrMessageId = a})
instance FromJSON
EnterprisesSendTestPushNotificationResponse where
parseJSON
= withObject
"EnterprisesSendTestPushNotificationResponse"
(\ o ->
EnterprisesSendTestPushNotificationResponse' <$>
(o .:? "topicName") <*> (o .:? "messageId"))
instance ToJSON
EnterprisesSendTestPushNotificationResponse where
toJSON
EnterprisesSendTestPushNotificationResponse'{..}
= object
(catMaybes
[("topicName" .=) <$> _estpnrTopicName,
("messageId" .=) <$> _estpnrMessageId])
data EnterprisesListResponse = EnterprisesListResponse'
{ _elrKind :: !Text
, _elrEnterprise :: !(Maybe [Enterprise])
} deriving (Eq,Show,Data,Typeable,Generic)
enterprisesListResponse
:: EnterprisesListResponse
enterprisesListResponse =
EnterprisesListResponse'
{ _elrKind = "androidenterprise#enterprisesListResponse"
, _elrEnterprise = Nothing
}
elrKind :: Lens' EnterprisesListResponse Text
elrKind = lens _elrKind (\ s a -> s{_elrKind = a})
elrEnterprise :: Lens' EnterprisesListResponse [Enterprise]
elrEnterprise
= lens _elrEnterprise
(\ s a -> s{_elrEnterprise = a})
. _Default
. _Coerce
instance FromJSON EnterprisesListResponse where
parseJSON
= withObject "EnterprisesListResponse"
(\ o ->
EnterprisesListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#enterprisesListResponse")
<*> (o .:? "enterprise" .!= mempty))
instance ToJSON EnterprisesListResponse where
toJSON EnterprisesListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _elrKind),
("enterprise" .=) <$> _elrEnterprise])
data AppRestrictionsSchema = AppRestrictionsSchema'
{ _arsKind :: !Text
, _arsRestrictions :: !(Maybe [AppRestrictionsSchemaRestriction])
} deriving (Eq,Show,Data,Typeable,Generic)
appRestrictionsSchema
:: AppRestrictionsSchema
appRestrictionsSchema =
AppRestrictionsSchema'
{ _arsKind = "androidenterprise#appRestrictionsSchema"
, _arsRestrictions = Nothing
}
arsKind :: Lens' AppRestrictionsSchema Text
arsKind = lens _arsKind (\ s a -> s{_arsKind = a})
arsRestrictions :: Lens' AppRestrictionsSchema [AppRestrictionsSchemaRestriction]
arsRestrictions
= lens _arsRestrictions
(\ s a -> s{_arsRestrictions = a})
. _Default
. _Coerce
instance FromJSON AppRestrictionsSchema where
parseJSON
= withObject "AppRestrictionsSchema"
(\ o ->
AppRestrictionsSchema' <$>
(o .:? "kind" .!=
"androidenterprise#appRestrictionsSchema")
<*> (o .:? "restrictions" .!= mempty))
instance ToJSON AppRestrictionsSchema where
toJSON AppRestrictionsSchema'{..}
= object
(catMaybes
[Just ("kind" .= _arsKind),
("restrictions" .=) <$> _arsRestrictions])
data LocalizedText = LocalizedText'
{ _ltText :: !(Maybe Text)
, _ltLocale :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
localizedText
:: LocalizedText
localizedText =
LocalizedText'
{ _ltText = Nothing
, _ltLocale = Nothing
}
ltText :: Lens' LocalizedText (Maybe Text)
ltText = lens _ltText (\ s a -> s{_ltText = a})
ltLocale :: Lens' LocalizedText (Maybe Text)
ltLocale = lens _ltLocale (\ s a -> s{_ltLocale = a})
instance FromJSON LocalizedText where
parseJSON
= withObject "LocalizedText"
(\ o ->
LocalizedText' <$>
(o .:? "text") <*> (o .:? "locale"))
instance ToJSON LocalizedText where
toJSON LocalizedText'{..}
= object
(catMaybes
[("text" .=) <$> _ltText,
("locale" .=) <$> _ltLocale])
data UserToken = UserToken'
{ _utKind :: !Text
, _utToken :: !(Maybe Text)
, _utUserId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
userToken
:: UserToken
userToken =
UserToken'
{ _utKind = "androidenterprise#userToken"
, _utToken = Nothing
, _utUserId = Nothing
}
utKind :: Lens' UserToken Text
utKind = lens _utKind (\ s a -> s{_utKind = a})
utToken :: Lens' UserToken (Maybe Text)
utToken = lens _utToken (\ s a -> s{_utToken = a})
utUserId :: Lens' UserToken (Maybe Text)
utUserId = lens _utUserId (\ s a -> s{_utUserId = a})
instance FromJSON UserToken where
parseJSON
= withObject "UserToken"
(\ o ->
UserToken' <$>
(o .:? "kind" .!= "androidenterprise#userToken") <*>
(o .:? "token")
<*> (o .:? "userId"))
instance ToJSON UserToken where
toJSON UserToken'{..}
= object
(catMaybes
[Just ("kind" .= _utKind), ("token" .=) <$> _utToken,
("userId" .=) <$> _utUserId])
data DevicesListResponse = DevicesListResponse'
{ _dlrKind :: !Text
, _dlrDevice :: !(Maybe [Device])
} deriving (Eq,Show,Data,Typeable,Generic)
devicesListResponse
:: DevicesListResponse
devicesListResponse =
DevicesListResponse'
{ _dlrKind = "androidenterprise#devicesListResponse"
, _dlrDevice = Nothing
}
dlrKind :: Lens' DevicesListResponse Text
dlrKind = lens _dlrKind (\ s a -> s{_dlrKind = a})
dlrDevice :: Lens' DevicesListResponse [Device]
dlrDevice
= lens _dlrDevice (\ s a -> s{_dlrDevice = a}) .
_Default
. _Coerce
instance FromJSON DevicesListResponse where
parseJSON
= withObject "DevicesListResponse"
(\ o ->
DevicesListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#devicesListResponse")
<*> (o .:? "device" .!= mempty))
instance ToJSON DevicesListResponse where
toJSON DevicesListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _dlrKind),
("device" .=) <$> _dlrDevice])
data Enterprise = Enterprise'
{ _eKind :: !Text
, _ePrimaryDomain :: !(Maybe Text)
, _eName :: !(Maybe Text)
, _eId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
enterprise
:: Enterprise
enterprise =
Enterprise'
{ _eKind = "androidenterprise#enterprise"
, _ePrimaryDomain = Nothing
, _eName = Nothing
, _eId = Nothing
}
eKind :: Lens' Enterprise Text
eKind = lens _eKind (\ s a -> s{_eKind = a})
ePrimaryDomain :: Lens' Enterprise (Maybe Text)
ePrimaryDomain
= lens _ePrimaryDomain
(\ s a -> s{_ePrimaryDomain = a})
eName :: Lens' Enterprise (Maybe Text)
eName = lens _eName (\ s a -> s{_eName = a})
eId :: Lens' Enterprise (Maybe Text)
eId = lens _eId (\ s a -> s{_eId = a})
instance FromJSON Enterprise where
parseJSON
= withObject "Enterprise"
(\ o ->
Enterprise' <$>
(o .:? "kind" .!= "androidenterprise#enterprise") <*>
(o .:? "primaryDomain")
<*> (o .:? "name")
<*> (o .:? "id"))
instance ToJSON Enterprise where
toJSON Enterprise'{..}
= object
(catMaybes
[Just ("kind" .= _eKind),
("primaryDomain" .=) <$> _ePrimaryDomain,
("name" .=) <$> _eName, ("id" .=) <$> _eId])
data StoreLayout = StoreLayout'
{ _slKind :: !Text
, _slHomepageId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
storeLayout
:: StoreLayout
storeLayout =
StoreLayout'
{ _slKind = "androidenterprise#storeLayout"
, _slHomepageId = Nothing
}
slKind :: Lens' StoreLayout Text
slKind = lens _slKind (\ s a -> s{_slKind = a})
slHomepageId :: Lens' StoreLayout (Maybe Text)
slHomepageId
= lens _slHomepageId (\ s a -> s{_slHomepageId = a})
instance FromJSON StoreLayout where
parseJSON
= withObject "StoreLayout"
(\ o ->
StoreLayout' <$>
(o .:? "kind" .!= "androidenterprise#storeLayout")
<*> (o .:? "homepageId"))
instance ToJSON StoreLayout where
toJSON StoreLayout'{..}
= object
(catMaybes
[Just ("kind" .= _slKind),
("homepageId" .=) <$> _slHomepageId])
data Product = Product'
{ _pSmallIconURL :: !(Maybe Text)
, _pAuthorName :: !(Maybe Text)
, _pKind :: !Text
, _pWorkDetailsURL :: !(Maybe Text)
, _pRequiresContainerApp :: !(Maybe Bool)
, _pAppVersion :: !(Maybe [AppVersion])
, _pProductPricing :: !(Maybe Text)
, _pDistributionChannel :: !(Maybe Text)
, _pIconURL :: !(Maybe Text)
, _pTitle :: !(Maybe Text)
, _pProductId :: !(Maybe Text)
, _pDetailsURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
product
:: Product
product =
Product'
{ _pSmallIconURL = Nothing
, _pAuthorName = Nothing
, _pKind = "androidenterprise#product"
, _pWorkDetailsURL = Nothing
, _pRequiresContainerApp = Nothing
, _pAppVersion = Nothing
, _pProductPricing = Nothing
, _pDistributionChannel = Nothing
, _pIconURL = Nothing
, _pTitle = Nothing
, _pProductId = Nothing
, _pDetailsURL = Nothing
}
pSmallIconURL :: Lens' Product (Maybe Text)
pSmallIconURL
= lens _pSmallIconURL
(\ s a -> s{_pSmallIconURL = a})
pAuthorName :: Lens' Product (Maybe Text)
pAuthorName
= lens _pAuthorName (\ s a -> s{_pAuthorName = a})
pKind :: Lens' Product Text
pKind = lens _pKind (\ s a -> s{_pKind = a})
pWorkDetailsURL :: Lens' Product (Maybe Text)
pWorkDetailsURL
= lens _pWorkDetailsURL
(\ s a -> s{_pWorkDetailsURL = a})
pRequiresContainerApp :: Lens' Product (Maybe Bool)
pRequiresContainerApp
= lens _pRequiresContainerApp
(\ s a -> s{_pRequiresContainerApp = a})
pAppVersion :: Lens' Product [AppVersion]
pAppVersion
= lens _pAppVersion (\ s a -> s{_pAppVersion = a}) .
_Default
. _Coerce
pProductPricing :: Lens' Product (Maybe Text)
pProductPricing
= lens _pProductPricing
(\ s a -> s{_pProductPricing = a})
pDistributionChannel :: Lens' Product (Maybe Text)
pDistributionChannel
= lens _pDistributionChannel
(\ s a -> s{_pDistributionChannel = a})
pIconURL :: Lens' Product (Maybe Text)
pIconURL = lens _pIconURL (\ s a -> s{_pIconURL = a})
pTitle :: Lens' Product (Maybe Text)
pTitle = lens _pTitle (\ s a -> s{_pTitle = a})
pProductId :: Lens' Product (Maybe Text)
pProductId
= lens _pProductId (\ s a -> s{_pProductId = a})
pDetailsURL :: Lens' Product (Maybe Text)
pDetailsURL
= lens _pDetailsURL (\ s a -> s{_pDetailsURL = a})
instance FromJSON Product where
parseJSON
= withObject "Product"
(\ o ->
Product' <$>
(o .:? "smallIconUrl") <*> (o .:? "authorName") <*>
(o .:? "kind" .!= "androidenterprise#product")
<*> (o .:? "workDetailsUrl")
<*> (o .:? "requiresContainerApp")
<*> (o .:? "appVersion" .!= mempty)
<*> (o .:? "productPricing")
<*> (o .:? "distributionChannel")
<*> (o .:? "iconUrl")
<*> (o .:? "title")
<*> (o .:? "productId")
<*> (o .:? "detailsUrl"))
instance ToJSON Product where
toJSON Product'{..}
= object
(catMaybes
[("smallIconUrl" .=) <$> _pSmallIconURL,
("authorName" .=) <$> _pAuthorName,
Just ("kind" .= _pKind),
("workDetailsUrl" .=) <$> _pWorkDetailsURL,
("requiresContainerApp" .=) <$>
_pRequiresContainerApp,
("appVersion" .=) <$> _pAppVersion,
("productPricing" .=) <$> _pProductPricing,
("distributionChannel" .=) <$> _pDistributionChannel,
("iconUrl" .=) <$> _pIconURL,
("title" .=) <$> _pTitle,
("productId" .=) <$> _pProductId,
("detailsUrl" .=) <$> _pDetailsURL])
data EntitlementsListResponse = EntitlementsListResponse'
{ _entKind :: !Text
, _entEntitlement :: !(Maybe [Entitlement])
} deriving (Eq,Show,Data,Typeable,Generic)
entitlementsListResponse
:: EntitlementsListResponse
entitlementsListResponse =
EntitlementsListResponse'
{ _entKind = "androidenterprise#entitlementsListResponse"
, _entEntitlement = Nothing
}
entKind :: Lens' EntitlementsListResponse Text
entKind = lens _entKind (\ s a -> s{_entKind = a})
entEntitlement :: Lens' EntitlementsListResponse [Entitlement]
entEntitlement
= lens _entEntitlement
(\ s a -> s{_entEntitlement = a})
. _Default
. _Coerce
instance FromJSON EntitlementsListResponse where
parseJSON
= withObject "EntitlementsListResponse"
(\ o ->
EntitlementsListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#entitlementsListResponse")
<*> (o .:? "entitlement" .!= mempty))
instance ToJSON EntitlementsListResponse where
toJSON EntitlementsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _entKind),
("entitlement" .=) <$> _entEntitlement])
data ProductPermissions = ProductPermissions'
{ _ppKind :: !Text
, _ppPermission :: !(Maybe [ProductPermission])
, _ppProductId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
productPermissions
:: ProductPermissions
productPermissions =
ProductPermissions'
{ _ppKind = "androidenterprise#productPermissions"
, _ppPermission = Nothing
, _ppProductId = Nothing
}
ppKind :: Lens' ProductPermissions Text
ppKind = lens _ppKind (\ s a -> s{_ppKind = a})
ppPermission :: Lens' ProductPermissions [ProductPermission]
ppPermission
= lens _ppPermission (\ s a -> s{_ppPermission = a})
. _Default
. _Coerce
ppProductId :: Lens' ProductPermissions (Maybe Text)
ppProductId
= lens _ppProductId (\ s a -> s{_ppProductId = a})
instance FromJSON ProductPermissions where
parseJSON
= withObject "ProductPermissions"
(\ o ->
ProductPermissions' <$>
(o .:? "kind" .!=
"androidenterprise#productPermissions")
<*> (o .:? "permission" .!= mempty)
<*> (o .:? "productId"))
instance ToJSON ProductPermissions where
toJSON ProductPermissions'{..}
= object
(catMaybes
[Just ("kind" .= _ppKind),
("permission" .=) <$> _ppPermission,
("productId" .=) <$> _ppProductId])
data Permission = Permission'
{ _perKind :: !Text
, _perName :: !(Maybe Text)
, _perDescription :: !(Maybe Text)
, _perPermissionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
permission
:: Permission
permission =
Permission'
{ _perKind = "androidenterprise#permission"
, _perName = Nothing
, _perDescription = Nothing
, _perPermissionId = Nothing
}
perKind :: Lens' Permission Text
perKind = lens _perKind (\ s a -> s{_perKind = a})
perName :: Lens' Permission (Maybe Text)
perName = lens _perName (\ s a -> s{_perName = a})
perDescription :: Lens' Permission (Maybe Text)
perDescription
= lens _perDescription
(\ s a -> s{_perDescription = a})
perPermissionId :: Lens' Permission (Maybe Text)
perPermissionId
= lens _perPermissionId
(\ s a -> s{_perPermissionId = a})
instance FromJSON Permission where
parseJSON
= withObject "Permission"
(\ o ->
Permission' <$>
(o .:? "kind" .!= "androidenterprise#permission") <*>
(o .:? "name")
<*> (o .:? "description")
<*> (o .:? "permissionId"))
instance ToJSON Permission where
toJSON Permission'{..}
= object
(catMaybes
[Just ("kind" .= _perKind), ("name" .=) <$> _perName,
("description" .=) <$> _perDescription,
("permissionId" .=) <$> _perPermissionId])
newtype ProductsApproveRequest = ProductsApproveRequest'
{ _parApprovalURLInfo :: Maybe ApprovalURLInfo
} deriving (Eq,Show,Data,Typeable,Generic)
productsApproveRequest
:: ProductsApproveRequest
productsApproveRequest =
ProductsApproveRequest'
{ _parApprovalURLInfo = Nothing
}
parApprovalURLInfo :: Lens' ProductsApproveRequest (Maybe ApprovalURLInfo)
parApprovalURLInfo
= lens _parApprovalURLInfo
(\ s a -> s{_parApprovalURLInfo = a})
instance FromJSON ProductsApproveRequest where
parseJSON
= withObject "ProductsApproveRequest"
(\ o ->
ProductsApproveRequest' <$>
(o .:? "approvalUrlInfo"))
instance ToJSON ProductsApproveRequest where
toJSON ProductsApproveRequest'{..}
= object
(catMaybes
[("approvalUrlInfo" .=) <$> _parApprovalURLInfo])
data CollectionViewersListResponse = CollectionViewersListResponse'
{ _cvlrKind :: !Text
, _cvlrUser :: !(Maybe [User])
} deriving (Eq,Show,Data,Typeable,Generic)
collectionViewersListResponse
:: CollectionViewersListResponse
collectionViewersListResponse =
CollectionViewersListResponse'
{ _cvlrKind = "androidenterprise#collectionViewersListResponse"
, _cvlrUser = Nothing
}
cvlrKind :: Lens' CollectionViewersListResponse Text
cvlrKind = lens _cvlrKind (\ s a -> s{_cvlrKind = a})
cvlrUser :: Lens' CollectionViewersListResponse [User]
cvlrUser
= lens _cvlrUser (\ s a -> s{_cvlrUser = a}) .
_Default
. _Coerce
instance FromJSON CollectionViewersListResponse where
parseJSON
= withObject "CollectionViewersListResponse"
(\ o ->
CollectionViewersListResponse' <$>
(o .:? "kind" .!=
"androidenterprise#collectionViewersListResponse")
<*> (o .:? "user" .!= mempty))
instance ToJSON CollectionViewersListResponse where
toJSON CollectionViewersListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _cvlrKind),
("user" .=) <$> _cvlrUser])
data Entitlement = Entitlement'
{ _eeKind :: !Text
, _eeReason :: !(Maybe Text)
, _eeProductId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
entitlement
:: Entitlement
entitlement =
Entitlement'
{ _eeKind = "androidenterprise#entitlement"
, _eeReason = Nothing
, _eeProductId = Nothing
}
eeKind :: Lens' Entitlement Text
eeKind = lens _eeKind (\ s a -> s{_eeKind = a})
eeReason :: Lens' Entitlement (Maybe Text)
eeReason = lens _eeReason (\ s a -> s{_eeReason = a})
eeProductId :: Lens' Entitlement (Maybe Text)
eeProductId
= lens _eeProductId (\ s a -> s{_eeProductId = a})
instance FromJSON Entitlement where
parseJSON
= withObject "Entitlement"
(\ o ->
Entitlement' <$>
(o .:? "kind" .!= "androidenterprise#entitlement")
<*> (o .:? "reason")
<*> (o .:? "productId"))
instance ToJSON Entitlement where
toJSON Entitlement'{..}
= object
(catMaybes
[Just ("kind" .= _eeKind),
("reason" .=) <$> _eeReason,
("productId" .=) <$> _eeProductId])
data ProductsListResponse = ProductsListResponse'
{ _plrTokenPagination :: !(Maybe TokenPagination)
, _plrPageInfo :: !(Maybe PageInfo)
, _plrKind :: !Text
, _plrProduct :: !(Maybe [Product])
} deriving (Eq,Show,Data,Typeable,Generic)
productsListResponse
:: ProductsListResponse
productsListResponse =
ProductsListResponse'
{ _plrTokenPagination = Nothing
, _plrPageInfo = Nothing
, _plrKind = "androidenterprise#productsListResponse"
, _plrProduct = Nothing
}
plrTokenPagination :: Lens' ProductsListResponse (Maybe TokenPagination)
plrTokenPagination
= lens _plrTokenPagination
(\ s a -> s{_plrTokenPagination = a})
plrPageInfo :: Lens' ProductsListResponse (Maybe PageInfo)
plrPageInfo
= lens _plrPageInfo (\ s a -> s{_plrPageInfo = a})
plrKind :: Lens' ProductsListResponse Text
plrKind = lens _plrKind (\ s a -> s{_plrKind = a})
plrProduct :: Lens' ProductsListResponse [Product]
plrProduct
= lens _plrProduct (\ s a -> s{_plrProduct = a}) .
_Default
. _Coerce
instance FromJSON ProductsListResponse where
parseJSON
= withObject "ProductsListResponse"
(\ o ->
ProductsListResponse' <$>
(o .:? "tokenPagination") <*> (o .:? "pageInfo") <*>
(o .:? "kind" .!=
"androidenterprise#productsListResponse")
<*> (o .:? "product" .!= mempty))
instance ToJSON ProductsListResponse where
toJSON ProductsListResponse'{..}
= object
(catMaybes
[("tokenPagination" .=) <$> _plrTokenPagination,
("pageInfo" .=) <$> _plrPageInfo,
Just ("kind" .= _plrKind),
("product" .=) <$> _plrProduct])