@@ -600,6 +600,127 @@ instance ToJSON ApprovalURLInfo where
600600 [("approvalUrl" .=) <$> _auiApprovalURL,
601601 Just ("kind" .= _auiKind)])
602602
603+-- | A managed property of a managed configuration. The property must match
604+-- one of the properties in the app restrictions schema of the product.
605+-- Exactly one of the value fields must be populated, and it must match the
606+-- property\'s type in the app restrictions schema.
607+--
608+-- /See:/ 'managedProperty' smart constructor.
609+data ManagedProperty = ManagedProperty'
610+ { _mpValueStringArray :: !(Maybe [Text])
611+ , _mpValueBool :: !(Maybe Bool)
612+ , _mpKey :: !(Maybe Text)
613+ , _mpValueBundle :: !(Maybe ManagedPropertyBundle)
614+ , _mpValueInteger :: !(Maybe (Textual Int32))
615+ , _mpValueBundleArray :: !(Maybe [ManagedPropertyBundle])
616+ , _mpValueString :: !(Maybe Text)
617+ } deriving (Eq,Show,Data,Typeable,Generic)
618+
619+-- | Creates a value of 'ManagedProperty' with the minimum fields required to make a request.
620+--
621+-- Use one of the following lenses to modify other fields as desired:
622+--
623+-- * 'mpValueStringArray'
624+--
625+-- * 'mpValueBool'
626+--
627+-- * 'mpKey'
628+--
629+-- * 'mpValueBundle'
630+--
631+-- * 'mpValueInteger'
632+--
633+-- * 'mpValueBundleArray'
634+--
635+-- * 'mpValueString'
636+managedProperty
637+ :: ManagedProperty
638+managedProperty =
639+ ManagedProperty'
640+ { _mpValueStringArray = Nothing
641+ , _mpValueBool = Nothing
642+ , _mpKey = Nothing
643+ , _mpValueBundle = Nothing
644+ , _mpValueInteger = Nothing
645+ , _mpValueBundleArray = Nothing
646+ , _mpValueString = Nothing
647+ }
648+
649+-- | The list of string values - this will only be present if type of the
650+-- property is multiselect.
651+mpValueStringArray :: Lens' ManagedProperty [Text]
652+mpValueStringArray
653+ = lens _mpValueStringArray
654+ (\ s a -> s{_mpValueStringArray = a})
655+ . _Default
656+ . _Coerce
657+
658+-- | The boolean value - this will only be present if type of the property is
659+-- bool.
660+mpValueBool :: Lens' ManagedProperty (Maybe Bool)
661+mpValueBool
662+ = lens _mpValueBool (\ s a -> s{_mpValueBool = a})
663+
664+-- | The unique key that identifies the property.
665+mpKey :: Lens' ManagedProperty (Maybe Text)
666+mpKey = lens _mpKey (\ s a -> s{_mpKey = a})
667+
668+-- | The bundle of managed properties - this will only be present if type of
669+-- the property is bundle.
670+mpValueBundle :: Lens' ManagedProperty (Maybe ManagedPropertyBundle)
671+mpValueBundle
672+ = lens _mpValueBundle
673+ (\ s a -> s{_mpValueBundle = a})
674+
675+-- | The integer value - this will only be present if type of the property is
676+-- integer.
677+mpValueInteger :: Lens' ManagedProperty (Maybe Int32)
678+mpValueInteger
679+ = lens _mpValueInteger
680+ (\ s a -> s{_mpValueInteger = a})
681+ . mapping _Coerce
682+
683+-- | The list of bundles of properties - this will only be present if type of
684+-- the property is bundle_array.
685+mpValueBundleArray :: Lens' ManagedProperty [ManagedPropertyBundle]
686+mpValueBundleArray
687+ = lens _mpValueBundleArray
688+ (\ s a -> s{_mpValueBundleArray = a})
689+ . _Default
690+ . _Coerce
691+
692+-- | The string value - this will only be present if type of the property is
693+-- string, choice or hidden.
694+mpValueString :: Lens' ManagedProperty (Maybe Text)
695+mpValueString
696+ = lens _mpValueString
697+ (\ s a -> s{_mpValueString = a})
698+
699+instance FromJSON ManagedProperty where
700+ parseJSON
701+ = withObject "ManagedProperty"
702+ (\ o ->
703+ ManagedProperty' <$>
704+ (o .:? "valueStringArray" .!= mempty) <*>
705+ (o .:? "valueBool")
706+ <*> (o .:? "key")
707+ <*> (o .:? "valueBundle")
708+ <*> (o .:? "valueInteger")
709+ <*> (o .:? "valueBundleArray" .!= mempty)
710+ <*> (o .:? "valueString"))
711+
712+instance ToJSON ManagedProperty where
713+ toJSON ManagedProperty'{..}
714+ = object
715+ (catMaybes
716+ [("valueStringArray" .=) <$> _mpValueStringArray,
717+ ("valueBool" .=) <$> _mpValueBool,
718+ ("key" .=) <$> _mpKey,
719+ ("valueBundle" .=) <$> _mpValueBundle,
720+ ("valueInteger" .=) <$> _mpValueInteger,
721+ ("valueBundleArray" .=) <$> _mpValueBundleArray,
722+ ("valueString" .=) <$> _mpValueString])
723+
603724-- | The store page resources for the enterprise.
604725--
605726-- /See:/ 'storeLayoutClustersListResponse' smart constructor.
@@ -653,6 +774,73 @@ instance ToJSON StoreLayoutClustersListResponse where
653774 [("cluster" .=) <$> _slclrCluster,
654775 Just ("kind" .= _slclrKind)])
655776
777+-- | A managed configuration resource contains the set of managed properties
778+-- that have been configured for an Android app. The app\'s developer would
779+-- have defined configurable properties in the managed configurations
780+-- schema.
781+--
782+-- /See:/ 'managedConfiguration' smart constructor.
783+data ManagedConfiguration = ManagedConfiguration'
784+ { _mcManagedProperty :: !(Maybe [ManagedProperty])
785+ , _mcKind :: !Text
786+ , _mcProductId :: !(Maybe Text)
787+ } deriving (Eq,Show,Data,Typeable,Generic)
788+
789+-- | Creates a value of 'ManagedConfiguration' with the minimum fields required to make a request.
790+--
791+-- Use one of the following lenses to modify other fields as desired:
792+--
793+-- * 'mcManagedProperty'
794+--
795+-- * 'mcKind'
796+--
797+-- * 'mcProductId'
798+managedConfiguration
799+ :: ManagedConfiguration
800+managedConfiguration =
801+ ManagedConfiguration'
802+ { _mcManagedProperty = Nothing
803+ , _mcKind = "androidenterprise#managedConfiguration"
804+ , _mcProductId = Nothing
805+ }
806+
807+-- | The set of managed properties for this configuration.
808+mcManagedProperty :: Lens' ManagedConfiguration [ManagedProperty]
809+mcManagedProperty
810+ = lens _mcManagedProperty
811+ (\ s a -> s{_mcManagedProperty = a})
812+ . _Default
813+ . _Coerce
814+
815+-- | Identifies what kind of resource this is. Value: the fixed string
816+-- \"androidenterprise#managedConfiguration\".
817+mcKind :: Lens' ManagedConfiguration Text
818+mcKind = lens _mcKind (\ s a -> s{_mcKind = a})
819+
820+-- | The ID of the product that the managed configuration is for, e.g.
821+-- \"app:com.google.android.gm\".
822+mcProductId :: Lens' ManagedConfiguration (Maybe Text)
823+mcProductId
824+ = lens _mcProductId (\ s a -> s{_mcProductId = a})
825+
826+instance FromJSON ManagedConfiguration where
827+ parseJSON
828+ = withObject "ManagedConfiguration"
829+ (\ o ->
830+ ManagedConfiguration' <$>
831+ (o .:? "managedProperty" .!= mempty) <*>
832+ (o .:? "kind" .!=
833+ "androidenterprise#managedConfiguration")
834+ <*> (o .:? "productId"))
835+
836+instance ToJSON ManagedConfiguration where
837+ toJSON ManagedConfiguration'{..}
838+ = object
839+ (catMaybes
840+ [("managedProperty" .=) <$> _mcManagedProperty,
841+ Just ("kind" .= _mcKind),
842+ ("productId" .=) <$> _mcProductId])
843+
656844-- | Definition of a Google Play for Work store cluster, a list of products
657845-- displayed as part of a store page.
658846--
@@ -746,6 +934,202 @@ instance ToJSON StoreCluster where
746934 ("id" .=) <$> _scId,
747935 ("productId" .=) <$> _scProductId])
748936
937+-- | Specification for a token used to generate iframes. The token specifies
938+-- what data the admin is allowed to modify and the URI the iframe is
939+-- allowed to communiate with.
940+--
941+-- /See:/ 'administratorWebTokenSpec' smart constructor.
942+data AdministratorWebTokenSpec = AdministratorWebTokenSpec'
943+ { _awtsParent :: !(Maybe Text)
944+ , _awtsKind :: !Text
945+ , _awtsPermission :: !(Maybe [Text])
946+ } deriving (Eq,Show,Data,Typeable,Generic)
947+
948+-- | Creates a value of 'AdministratorWebTokenSpec' with the minimum fields required to make a request.
949+--
950+-- Use one of the following lenses to modify other fields as desired:
951+--
952+-- * 'awtsParent'
953+--
954+-- * 'awtsKind'
955+--
956+-- * 'awtsPermission'
957+administratorWebTokenSpec
958+ :: AdministratorWebTokenSpec
959+administratorWebTokenSpec =
960+ AdministratorWebTokenSpec'
961+ { _awtsParent = Nothing
962+ , _awtsKind = "androidenterprise#administratorWebTokenSpec"
963+ , _awtsPermission = Nothing
964+ }
965+
966+-- | The URI of the parent frame hosting the iframe. To prevent XSS, the
967+-- iframe may not be hosted at other URIs. This URI must be https.
968+awtsParent :: Lens' AdministratorWebTokenSpec (Maybe Text)
969+awtsParent
970+ = lens _awtsParent (\ s a -> s{_awtsParent = a})
971+
972+-- | Identifies what kind of resource this is. Value: the fixed string
973+-- \"androidenterprise#administratorWebTokenSpec\".
974+awtsKind :: Lens' AdministratorWebTokenSpec Text
975+awtsKind = lens _awtsKind (\ s a -> s{_awtsKind = a})
976+
977+-- | The list of permissions the admin is granted within the iframe. The
978+-- admin will only be allowed to view an iframe if they have all of the
979+-- permissions associated with it.
980+awtsPermission :: Lens' AdministratorWebTokenSpec [Text]
981+awtsPermission
982+ = lens _awtsPermission
983+ (\ s a -> s{_awtsPermission = a})
984+ . _Default
985+ . _Coerce
986+
987+instance FromJSON AdministratorWebTokenSpec where
988+ parseJSON
989+ = withObject "AdministratorWebTokenSpec"
990+ (\ o ->
991+ AdministratorWebTokenSpec' <$>
992+ (o .:? "parent") <*>
993+ (o .:? "kind" .!=
994+ "androidenterprise#administratorWebTokenSpec")
995+ <*> (o .:? "permission" .!= mempty))
996+
997+instance ToJSON AdministratorWebTokenSpec where
998+ toJSON AdministratorWebTokenSpec'{..}
999+ = object
1000+ (catMaybes
1001+ [("parent" .=) <$> _awtsParent,
1002+ Just ("kind" .= _awtsKind),
1003+ ("permission" .=) <$> _awtsPermission])
1004+
1005+-- | A notification of one event relating to an enterprise.
1006+--
1007+-- /See:/ 'notification' smart constructor.
1008+data Notification = Notification'
1009+ { _nEnterpriseId :: !(Maybe Text)
1010+ , _nNewPermissionsEvent :: !(Maybe NewPermissionsEvent)
1011+ , _nProductApprovalEvent :: !(Maybe ProductApprovalEvent)
1012+ , _nProductAvailabilityChangeEvent :: !(Maybe ProductAvailabilityChangeEvent)
1013+ , _nAppUpdateEvent :: !(Maybe AppUpdateEvent)
1014+ , _nInstallFailureEvent :: !(Maybe InstallFailureEvent)
1015+ , _nAppRestrictionsSchemaChangeEvent :: !(Maybe AppRestrictionsSchemaChangeEvent)
1016+ , _nTimestampMillis :: !(Maybe (Textual Int64))
1017+ } deriving (Eq,Show,Data,Typeable,Generic)
1018+
1019+-- | Creates a value of 'Notification' with the minimum fields required to make a request.
1020+--
1021+-- Use one of the following lenses to modify other fields as desired:
1022+--
1023+-- * 'nEnterpriseId'
1024+--
1025+-- * 'nNewPermissionsEvent'
1026+--
1027+-- * 'nProductApprovalEvent'
1028+--
1029+-- * 'nProductAvailabilityChangeEvent'
1030+--
1031+-- * 'nAppUpdateEvent'
1032+--
1033+-- * 'nInstallFailureEvent'
1034+--
1035+-- * 'nAppRestrictionsSchemaChangeEvent'
1036+--
1037+-- * 'nTimestampMillis'
1038+notification
1039+ :: Notification
1040+notification =
1041+ Notification'
1042+ { _nEnterpriseId = Nothing
1043+ , _nNewPermissionsEvent = Nothing
1044+ , _nProductApprovalEvent = Nothing
1045+ , _nProductAvailabilityChangeEvent = Nothing
1046+ , _nAppUpdateEvent = Nothing
1047+ , _nInstallFailureEvent = Nothing
1048+ , _nAppRestrictionsSchemaChangeEvent = Nothing
1049+ , _nTimestampMillis = Nothing
1050+ }
1051+
1052+-- | The ID of the enterprise for which the notification is sent. This will
1053+-- always be present.
1054+nEnterpriseId :: Lens' Notification (Maybe Text)
1055+nEnterpriseId
1056+ = lens _nEnterpriseId
1057+ (\ s a -> s{_nEnterpriseId = a})
1058+
1059+-- | Notifications about new app permissions.
1060+nNewPermissionsEvent :: Lens' Notification (Maybe NewPermissionsEvent)
1061+nNewPermissionsEvent
1062+ = lens _nNewPermissionsEvent
1063+ (\ s a -> s{_nNewPermissionsEvent = a})
1064+
1065+-- | Notifications about changes to a product\'s approval status.
1066+nProductApprovalEvent :: Lens' Notification (Maybe ProductApprovalEvent)
1067+nProductApprovalEvent
1068+ = lens _nProductApprovalEvent
1069+ (\ s a -> s{_nProductApprovalEvent = a})
1070+
1071+-- | Notifications about product availability changes.
1072+nProductAvailabilityChangeEvent :: Lens' Notification (Maybe ProductAvailabilityChangeEvent)
1073+nProductAvailabilityChangeEvent
1074+ = lens _nProductAvailabilityChangeEvent
1075+ (\ s a -> s{_nProductAvailabilityChangeEvent = a})
1076+
1077+-- | Notifications about app updates.
1078+nAppUpdateEvent :: Lens' Notification (Maybe AppUpdateEvent)
1079+nAppUpdateEvent
1080+ = lens _nAppUpdateEvent
1081+ (\ s a -> s{_nAppUpdateEvent = a})
1082+
1083+-- | Notifications about an app installation failure.
1084+nInstallFailureEvent :: Lens' Notification (Maybe InstallFailureEvent)
1085+nInstallFailureEvent
1086+ = lens _nInstallFailureEvent
1087+ (\ s a -> s{_nInstallFailureEvent = a})
1088+
1089+-- | Notifications about new app restrictions schema changes.
1090+nAppRestrictionsSchemaChangeEvent :: Lens' Notification (Maybe AppRestrictionsSchemaChangeEvent)
1091+nAppRestrictionsSchemaChangeEvent
1092+ = lens _nAppRestrictionsSchemaChangeEvent
1093+ (\ s a -> s{_nAppRestrictionsSchemaChangeEvent = a})
1094+
1095+-- | The time when the notification was published in milliseconds since
1096+-- 1970-01-01T00:00:00Z. This will always be present.
1097+nTimestampMillis :: Lens' Notification (Maybe Int64)
1098+nTimestampMillis
1099+ = lens _nTimestampMillis
1100+ (\ s a -> s{_nTimestampMillis = a})
1101+ . mapping _Coerce
1102+
1103+instance FromJSON Notification where
1104+ parseJSON
1105+ = withObject "Notification"
1106+ (\ o ->
1107+ Notification' <$>
1108+ (o .:? "enterpriseId") <*>
1109+ (o .:? "newPermissionsEvent")
1110+ <*> (o .:? "productApprovalEvent")
1111+ <*> (o .:? "productAvailabilityChangeEvent")
1112+ <*> (o .:? "appUpdateEvent")
1113+ <*> (o .:? "installFailureEvent")
1114+ <*> (o .:? "appRestrictionsSchemaChangeEvent")
1115+ <*> (o .:? "timestampMillis"))
1116+
1117+instance ToJSON Notification where
1118+ toJSON Notification'{..}
1119+ = object
1120+ (catMaybes
1121+ [("enterpriseId" .=) <$> _nEnterpriseId,
1122+ ("newPermissionsEvent" .=) <$> _nNewPermissionsEvent,
1123+ ("productApprovalEvent" .=) <$>
1124+ _nProductApprovalEvent,
1125+ ("productAvailabilityChangeEvent" .=) <$>
1126+ _nProductAvailabilityChangeEvent,
1127+ ("appUpdateEvent" .=) <$> _nAppUpdateEvent,
1128+ ("installFailureEvent" .=) <$> _nInstallFailureEvent,
1129+ ("appRestrictionsSchemaChangeEvent" .=) <$>
1130+ _nAppRestrictionsSchemaChangeEvent,
1131+ ("timestampMillis" .=) <$> _nTimestampMillis])
1132+
7491133--
7501134-- /See:/ 'pageInfo' smart constructor.
7511135data PageInfo = PageInfo'
@@ -856,6 +1240,179 @@ instance ToJSON ProductPermission where
8561240 [("state" .=) <$> _ppState,
8571241 ("permissionId" .=) <$> _ppPermissionId])
8581242
1243+-- | An event generated when new permissions are added to an app.
1244+--
1245+-- /See:/ 'newPermissionsEvent' smart constructor.
1246+data NewPermissionsEvent = NewPermissionsEvent'
1247+ { _npeRequestedPermissions :: !(Maybe [Text])
1248+ , _npeApprovedPermissions :: !(Maybe [Text])
1249+ , _npeProductId :: !(Maybe Text)
1250+ } deriving (Eq,Show,Data,Typeable,Generic)
1251+
1252+-- | Creates a value of 'NewPermissionsEvent' with the minimum fields required to make a request.
1253+--
1254+-- Use one of the following lenses to modify other fields as desired:
1255+--
1256+-- * 'npeRequestedPermissions'
1257+--
1258+-- * 'npeApprovedPermissions'
1259+--
1260+-- * 'npeProductId'
1261+newPermissionsEvent
1262+ :: NewPermissionsEvent
1263+newPermissionsEvent =
1264+ NewPermissionsEvent'
1265+ { _npeRequestedPermissions = Nothing
1266+ , _npeApprovedPermissions = Nothing
1267+ , _npeProductId = Nothing
1268+ }
1269+
1270+-- | The set of permissions that the app is currently requesting. Use
1271+-- Permissions.Get on the EMM API to retrieve details about these
1272+-- permissions.
1273+npeRequestedPermissions :: Lens' NewPermissionsEvent [Text]
1274+npeRequestedPermissions
1275+ = lens _npeRequestedPermissions
1276+ (\ s a -> s{_npeRequestedPermissions = a})
1277+ . _Default
1278+ . _Coerce
1279+
1280+-- | The set of permissions that the enterprise admin has already approved
1281+-- for this application. Use Permissions.Get on the EMM API to retrieve
1282+-- details about these permissions.
1283+npeApprovedPermissions :: Lens' NewPermissionsEvent [Text]
1284+npeApprovedPermissions
1285+ = lens _npeApprovedPermissions
1286+ (\ s a -> s{_npeApprovedPermissions = a})
1287+ . _Default
1288+ . _Coerce
1289+
1290+-- | The id of the product (e.g. \"app:com.google.android.gm\") for which new
1291+-- permissions were added. This field will always be present.
1292+npeProductId :: Lens' NewPermissionsEvent (Maybe Text)
1293+npeProductId
1294+ = lens _npeProductId (\ s a -> s{_npeProductId = a})
1295+
1296+instance FromJSON NewPermissionsEvent where
1297+ parseJSON
1298+ = withObject "NewPermissionsEvent"
1299+ (\ o ->
1300+ NewPermissionsEvent' <$>
1301+ (o .:? "requestedPermissions" .!= mempty) <*>
1302+ (o .:? "approvedPermissions" .!= mempty)
1303+ <*> (o .:? "productId"))
1304+
1305+instance ToJSON NewPermissionsEvent where
1306+ toJSON NewPermissionsEvent'{..}
1307+ = object
1308+ (catMaybes
1309+ [("requestedPermissions" .=) <$>
1310+ _npeRequestedPermissions,
1311+ ("approvedPermissions" .=) <$>
1312+ _npeApprovedPermissions,
1313+ ("productId" .=) <$> _npeProductId])
1314+
1315+-- | An event generated whenever a product\'s availability changes.
1316+--
1317+-- /See:/ 'productAvailabilityChangeEvent' smart constructor.
1318+data ProductAvailabilityChangeEvent = ProductAvailabilityChangeEvent'
1319+ { _paceAvailabilityStatus :: !(Maybe Text)
1320+ , _paceProductId :: !(Maybe Text)
1321+ } deriving (Eq,Show,Data,Typeable,Generic)
1322+
1323+-- | Creates a value of 'ProductAvailabilityChangeEvent' with the minimum fields required to make a request.
1324+--
1325+-- Use one of the following lenses to modify other fields as desired:
1326+--
1327+-- * 'paceAvailabilityStatus'
1328+--
1329+-- * 'paceProductId'
1330+productAvailabilityChangeEvent
1331+ :: ProductAvailabilityChangeEvent
1332+productAvailabilityChangeEvent =
1333+ ProductAvailabilityChangeEvent'
1334+ { _paceAvailabilityStatus = Nothing
1335+ , _paceProductId = Nothing
1336+ }
1337+
1338+-- | The new state of the product. This field will always be present.
1339+paceAvailabilityStatus :: Lens' ProductAvailabilityChangeEvent (Maybe Text)
1340+paceAvailabilityStatus
1341+ = lens _paceAvailabilityStatus
1342+ (\ s a -> s{_paceAvailabilityStatus = a})
1343+
1344+-- | The id of the product (e.g. \"app:com.google.android.gm\") for which the
1345+-- product availability changed. This field will always be present.
1346+paceProductId :: Lens' ProductAvailabilityChangeEvent (Maybe Text)
1347+paceProductId
1348+ = lens _paceProductId
1349+ (\ s a -> s{_paceProductId = a})
1350+
1351+instance FromJSON ProductAvailabilityChangeEvent
1352+ where
1353+ parseJSON
1354+ = withObject "ProductAvailabilityChangeEvent"
1355+ (\ o ->
1356+ ProductAvailabilityChangeEvent' <$>
1357+ (o .:? "availabilityStatus") <*> (o .:? "productId"))
1358+
1359+instance ToJSON ProductAvailabilityChangeEvent where
1360+ toJSON ProductAvailabilityChangeEvent'{..}
1361+ = object
1362+ (catMaybes
1363+ [("availabilityStatus" .=) <$>
1364+ _paceAvailabilityStatus,
1365+ ("productId" .=) <$> _paceProductId])
1366+
1367+-- | An event generated when a product\'s approval status is changed.
1368+--
1369+-- /See:/ 'productApprovalEvent' smart constructor.
1370+data ProductApprovalEvent = ProductApprovalEvent'
1371+ { _paeApproved :: !(Maybe Text)
1372+ , _paeProductId :: !(Maybe Text)
1373+ } deriving (Eq,Show,Data,Typeable,Generic)
1374+
1375+-- | Creates a value of 'ProductApprovalEvent' with the minimum fields required to make a request.
1376+--
1377+-- Use one of the following lenses to modify other fields as desired:
1378+--
1379+-- * 'paeApproved'
1380+--
1381+-- * 'paeProductId'
1382+productApprovalEvent
1383+ :: ProductApprovalEvent
1384+productApprovalEvent =
1385+ ProductApprovalEvent'
1386+ { _paeApproved = Nothing
1387+ , _paeProductId = Nothing
1388+ }
1389+
1390+-- | Whether the product was approved or unapproved. This field will always
1391+-- be present.
1392+paeApproved :: Lens' ProductApprovalEvent (Maybe Text)
1393+paeApproved
1394+ = lens _paeApproved (\ s a -> s{_paeApproved = a})
1395+
1396+-- | The id of the product (e.g. \"app:com.google.android.gm\") for which the
1397+-- approval status has changed. This field will always be present.
1398+paeProductId :: Lens' ProductApprovalEvent (Maybe Text)
1399+paeProductId
1400+ = lens _paeProductId (\ s a -> s{_paeProductId = a})
1401+
1402+instance FromJSON ProductApprovalEvent where
1403+ parseJSON
1404+ = withObject "ProductApprovalEvent"
1405+ (\ o ->
1406+ ProductApprovalEvent' <$>
1407+ (o .:? "approved") <*> (o .:? "productId"))
1408+
1409+instance ToJSON ProductApprovalEvent where
1410+ toJSON ProductApprovalEvent'{..}
1411+ = object
1412+ (catMaybes
1413+ [("approved" .=) <$> _paeApproved,
1414+ ("productId" .=) <$> _paeProductId])
1415+
8591416-- | A device resource represents a mobile device managed by the EMM and
8601417-- belonging to a specific enterprise user. This collection cannot be
8611418-- modified via the API; it is automatically populated as devices are set
@@ -891,13 +1448,17 @@ device =
8911448dKind :: Lens' Device Text
8921449dKind = lens _dKind (\ s a -> s{_dKind = a})
8931450
894−-- | The mechanism by which this device is managed by the EMM.
895−-- \"managedDevice\" means that the EMM\'s app is a device owner.
896−-- \"managedProfile\" means that the EMM\'s app is the profile owner (and
897−-- there is a separate personal profile which is not managed).
898−-- \"containerApp\" means that the EMM\'s app is managing the Android for
899−-- Work container app on the device. ?unmanagedProfile? means that the
900−-- EMM?s app is managing a managed user on an unmanaged device
1451+-- | Identifies the extent to which the device is controlled by an Android
1452+-- for Work EMM in various deployment configurations. Possible values
1453+-- include: - \"managedDevice\", a device that has the EMM\'s device policy
1454+-- controller (DPC) as the device owner, - \"managedProfile\", a device
1455+-- that has a work profile managed by the DPC (DPC is profile owner) in
1456+-- addition to a separate, personal profile that is unavailable to the DPC,
1457+-- - \"containerApp\", a device running the Android for Work App. The
1458+-- Android for Work App is managed by the DPC, - \"unmanagedProfile\", a
1459+-- device that has been allowed (by the domain\'s admin, using the Admin
1460+-- Console to enable the privilege) to use Android for Work apps or Google
1461+-- Apps for Work, but the profile is itself not owned by a DPC.
9011462dManagementType :: Lens' Device (Maybe Text)
9021463dManagementType
9031464 = lens _dManagementType
@@ -926,6 +1487,75 @@ instance ToJSON Device where
9261487 ("managementType" .=) <$> _dManagementType,
9271488 ("androidId" .=) <$> _dAndroidId])
9281489
1490+-- | Credentials that can be used to authenticate as a service account.
1491+--
1492+-- /See:/ 'serviceAccountKey' smart constructor.
1493+data ServiceAccountKey = ServiceAccountKey'
1494+ { _sakKind :: !Text
1495+ , _sakData :: !(Maybe Text)
1496+ , _sakId :: !(Maybe Text)
1497+ , _sakType :: !(Maybe Text)
1498+ } deriving (Eq,Show,Data,Typeable,Generic)
1499+
1500+-- | Creates a value of 'ServiceAccountKey' with the minimum fields required to make a request.
1501+--
1502+-- Use one of the following lenses to modify other fields as desired:
1503+--
1504+-- * 'sakKind'
1505+--
1506+-- * 'sakData'
1507+--
1508+-- * 'sakId'
1509+--
1510+-- * 'sakType'
1511+serviceAccountKey
1512+ :: ServiceAccountKey
1513+serviceAccountKey =
1514+ ServiceAccountKey'
1515+ { _sakKind = "androidenterprise#serviceAccountKey"
1516+ , _sakData = Nothing
1517+ , _sakId = Nothing
1518+ , _sakType = Nothing
1519+ }
1520+
1521+-- | Identifies what kind of resource this is. Value: the fixed string
1522+-- \"androidenterprise#serviceAccountKey\".
1523+sakKind :: Lens' ServiceAccountKey Text
1524+sakKind = lens _sakKind (\ s a -> s{_sakKind = a})
1525+
1526+-- | The body of the private key credentials file, in string format. This is
1527+-- only populated when the ServiceAccountKey is created, and is not stored
1528+-- by Google.
1529+sakData :: Lens' ServiceAccountKey (Maybe Text)
1530+sakData = lens _sakData (\ s a -> s{_sakData = a})
1531+
1532+-- | An opaque, unique identifier for this ServiceAccountKey. Assigned by the
1533+-- server.
1534+sakId :: Lens' ServiceAccountKey (Maybe Text)
1535+sakId = lens _sakId (\ s a -> s{_sakId = a})
1536+
1537+-- | The file format of the generated key data.
1538+sakType :: Lens' ServiceAccountKey (Maybe Text)
1539+sakType = lens _sakType (\ s a -> s{_sakType = a})
1540+
1541+instance FromJSON ServiceAccountKey where
1542+ parseJSON
1543+ = withObject "ServiceAccountKey"
1544+ (\ o ->
1545+ ServiceAccountKey' <$>
1546+ (o .:? "kind" .!=
1547+ "androidenterprise#serviceAccountKey")
1548+ <*> (o .:? "data")
1549+ <*> (o .:? "id")
1550+ <*> (o .:? "type"))
1551+
1552+instance ToJSON ServiceAccountKey where
1553+ toJSON ServiceAccountKey'{..}
1554+ = object
1555+ (catMaybes
1556+ [Just ("kind" .= _sakKind), ("data" .=) <$> _sakData,
1557+ ("id" .=) <$> _sakId, ("type" .=) <$> _sakType])
1558+
9291559-- | The install resources for the device.
9301560--
9311561-- /See:/ 'installsListResponse' smart constructor.
@@ -983,13 +1613,14 @@ instance ToJSON InstallsListResponse where
9831613--
9841614-- /See:/ 'appRestrictionsSchemaRestriction' smart constructor.
9851615data AppRestrictionsSchemaRestriction = AppRestrictionsSchemaRestriction'
986− { _arsrRestrictionType :: !(Maybe Text)
987− , _arsrEntry :: !(Maybe [Text])
988− , _arsrKey :: !(Maybe Text)
989− , _arsrEntryValue :: !(Maybe [Text])
990− , _arsrDefaultValue :: !(Maybe AppRestrictionsSchemaRestrictionRestrictionValue)
991− , _arsrTitle :: !(Maybe Text)
992− , _arsrDescription :: !(Maybe Text)
1616+ { _arsrRestrictionType :: !(Maybe Text)
1617+ , _arsrEntry :: !(Maybe [Text])
1618+ , _arsrKey :: !(Maybe Text)
1619+ , _arsrEntryValue :: !(Maybe [Text])
1620+ , _arsrDefaultValue :: !(Maybe AppRestrictionsSchemaRestrictionRestrictionValue)
1621+ , _arsrTitle :: !(Maybe Text)
1622+ , _arsrDescription :: !(Maybe Text)
1623+ , _arsrNestedRestriction :: !(Maybe [AppRestrictionsSchemaRestriction])
9931624 } deriving (Eq,Show,Data,Typeable,Generic)
9941625
9951626-- | Creates a value of 'AppRestrictionsSchemaRestriction' with the minimum fields required to make a request.
@@ -1009,6 +1640,8 @@ data AppRestrictionsSchemaRestriction = AppRestrictionsSchemaRestriction'
10091640-- * 'arsrTitle'
10101641--
10111642-- * 'arsrDescription'
1643+--
1644+-- * 'arsrNestedRestriction'
10121645appRestrictionsSchemaRestriction
10131646 :: AppRestrictionsSchemaRestriction
10141647appRestrictionsSchemaRestriction =
@@ -1020,6 +1653,7 @@ appRestrictionsSchemaRestriction =
10201653 , _arsrDefaultValue = Nothing
10211654 , _arsrTitle = Nothing
10221655 , _arsrDescription = Nothing
1656+ , _arsrNestedRestriction = Nothing
10231657 }
10241658
10251659-- | The type of the restriction.
@@ -1042,7 +1676,9 @@ arsrKey :: Lens' AppRestrictionsSchemaRestriction (Maybe Text)
10421676arsrKey = lens _arsrKey (\ s a -> s{_arsrKey = a})
10431677
10441678-- | For choice or multiselect restrictions, the list of possible entries\'
1045−-- machine-readable values.
1679+-- machine-readable values. These values should be used in the
1680+-- configuration, either as a single string value for a choice restriction
1681+-- or in a stringArray for a multiselect restriction.
10461682arsrEntryValue :: Lens' AppRestrictionsSchemaRestriction [Text]
10471683arsrEntryValue
10481684 = lens _arsrEntryValue
@@ -1050,7 +1686,8 @@ arsrEntryValue
10501686 . _Default
10511687 . _Coerce
10521688
1053−-- | The default value of the restriction.
1689+-- | The default value of the restriction. bundle and bundleArray
1690+-- restrictions never have a default value.
10541691arsrDefaultValue :: Lens' AppRestrictionsSchemaRestriction (Maybe AppRestrictionsSchemaRestrictionRestrictionValue)
10551692arsrDefaultValue
10561693 = lens _arsrDefaultValue
@@ -1068,6 +1705,16 @@ arsrDescription
10681705 = lens _arsrDescription
10691706 (\ s a -> s{_arsrDescription = a})
10701707
1708+-- | For bundle or bundleArray restrictions, the list of nested restrictions.
1709+-- A bundle restriction is always nested within a bundleArray restriction,
1710+-- and a bundleArray restriction is at most two levels deep.
1711+arsrNestedRestriction :: Lens' AppRestrictionsSchemaRestriction [AppRestrictionsSchemaRestriction]
1712+arsrNestedRestriction
1713+ = lens _arsrNestedRestriction
1714+ (\ s a -> s{_arsrNestedRestriction = a})
1715+ . _Default
1716+ . _Coerce
1717+
10711718instance FromJSON AppRestrictionsSchemaRestriction
10721719 where
10731720 parseJSON
@@ -1080,7 +1727,8 @@ instance FromJSON AppRestrictionsSchemaRestriction
10801727 <*> (o .:? "entryValue" .!= mempty)
10811728 <*> (o .:? "defaultValue")
10821729 <*> (o .:? "title")
1083− <*> (o .:? "description"))
1730+ <*> (o .:? "description")
1731+ <*> (o .:? "nestedRestriction" .!= mempty))
10841732
10851733instance ToJSON AppRestrictionsSchemaRestriction
10861734 where
@@ -1092,7 +1740,41 @@ instance ToJSON AppRestrictionsSchemaRestriction
10921740 ("entryValue" .=) <$> _arsrEntryValue,
10931741 ("defaultValue" .=) <$> _arsrDefaultValue,
10941742 ("title" .=) <$> _arsrTitle,
1095− ("description" .=) <$> _arsrDescription])
1743+ ("description" .=) <$> _arsrDescription,
1744+ ("nestedRestriction" .=) <$> _arsrNestedRestriction])
1745+
1746+-- | This represents an enterprise administrator who can manage the
1747+-- enterprise in the Google Play for Work Store.
1748+--
1749+-- /See:/ 'administrator' smart constructor.
1750+newtype Administrator = Administrator'
1751+ { _aEmail :: Maybe Text
1752+ } deriving (Eq,Show,Data,Typeable,Generic)
1753+
1754+-- | Creates a value of 'Administrator' with the minimum fields required to make a request.
1755+--
1756+-- Use one of the following lenses to modify other fields as desired:
1757+--
1758+-- * 'aEmail'
1759+administrator
1760+ :: Administrator
1761+administrator =
1762+ Administrator'
1763+ { _aEmail = Nothing
1764+ }
1765+
1766+-- | The administrator\'s email address.
1767+aEmail :: Lens' Administrator (Maybe Text)
1768+aEmail = lens _aEmail (\ s a -> s{_aEmail = a})
1769+
1770+instance FromJSON Administrator where
1771+ parseJSON
1772+ = withObject "Administrator"
1773+ (\ o -> Administrator' <$> (o .:? "email"))
1774+
1775+instance ToJSON Administrator where
1776+ toJSON Administrator'{..}
1777+ = object (catMaybes [("email" .=) <$> _aEmail])
10961778
10971779-- | The matching user resources.
10981780--
@@ -1144,6 +1826,57 @@ instance ToJSON UsersListResponse where
11441826 [Just ("kind" .= _ulrKind),
11451827 ("user" .=) <$> _ulrUser])
11461828
1829+-- | An AuthenticationToken is used by the EMM\'s device policy client on a
1830+-- device to provision the given EMM-managed user on that device.
1831+--
1832+-- /See:/ 'authenticationToken' smart constructor.
1833+data AuthenticationToken = AuthenticationToken'
1834+ { _atKind :: !Text
1835+ , _atToken :: !(Maybe Text)
1836+ } deriving (Eq,Show,Data,Typeable,Generic)
1837+
1838+-- | Creates a value of 'AuthenticationToken' with the minimum fields required to make a request.
1839+--
1840+-- Use one of the following lenses to modify other fields as desired:
1841+--
1842+-- * 'atKind'
1843+--
1844+-- * 'atToken'
1845+authenticationToken
1846+ :: AuthenticationToken
1847+authenticationToken =
1848+ AuthenticationToken'
1849+ { _atKind = "androidenterprise#authenticationToken"
1850+ , _atToken = Nothing
1851+ }
1852+
1853+-- | Identifies what kind of resource this is. Value: the fixed string
1854+-- \"androidenterprise#authenticationToken\".
1855+atKind :: Lens' AuthenticationToken Text
1856+atKind = lens _atKind (\ s a -> s{_atKind = a})
1857+
1858+-- | The authentication token to be passed to the device policy client on the
1859+-- device where it can be used to provision the account for which this
1860+-- token was generated.
1861+atToken :: Lens' AuthenticationToken (Maybe Text)
1862+atToken = lens _atToken (\ s a -> s{_atToken = a})
1863+
1864+instance FromJSON AuthenticationToken where
1865+ parseJSON
1866+ = withObject "AuthenticationToken"
1867+ (\ o ->
1868+ AuthenticationToken' <$>
1869+ (o .:? "kind" .!=
1870+ "androidenterprise#authenticationToken")
1871+ <*> (o .:? "token"))
1872+
1873+instance ToJSON AuthenticationToken where
1874+ toJSON AuthenticationToken'{..}
1875+ = object
1876+ (catMaybes
1877+ [Just ("kind" .= _atKind),
1878+ ("token" .=) <$> _atToken])
1879+
11471880-- | This represents a single version of the app.
11481881--
11491882-- /See:/ 'appVersion' smart constructor.
@@ -1196,6 +1929,46 @@ instance ToJSON AppVersion where
11961929 [("versionCode" .=) <$> _avVersionCode,
11971930 ("versionString" .=) <$> _avVersionString])
11981931
1932+-- | A bundle of managed properties.
1933+--
1934+-- /See:/ 'managedPropertyBundle' smart constructor.
1935+newtype ManagedPropertyBundle = ManagedPropertyBundle'
1936+ { _mpbManagedProperty :: Maybe [ManagedProperty]
1937+ } deriving (Eq,Show,Data,Typeable,Generic)
1938+
1939+-- | Creates a value of 'ManagedPropertyBundle' with the minimum fields required to make a request.
1940+--
1941+-- Use one of the following lenses to modify other fields as desired:
1942+--
1943+-- * 'mpbManagedProperty'
1944+managedPropertyBundle
1945+ :: ManagedPropertyBundle
1946+managedPropertyBundle =
1947+ ManagedPropertyBundle'
1948+ { _mpbManagedProperty = Nothing
1949+ }
1950+
1951+-- | The list of managed properties.
1952+mpbManagedProperty :: Lens' ManagedPropertyBundle [ManagedProperty]
1953+mpbManagedProperty
1954+ = lens _mpbManagedProperty
1955+ (\ s a -> s{_mpbManagedProperty = a})
1956+ . _Default
1957+ . _Coerce
1958+
1959+instance FromJSON ManagedPropertyBundle where
1960+ parseJSON
1961+ = withObject "ManagedPropertyBundle"
1962+ (\ o ->
1963+ ManagedPropertyBundle' <$>
1964+ (o .:? "managedProperty" .!= mempty))
1965+
1966+instance ToJSON ManagedPropertyBundle where
1967+ toJSON ManagedPropertyBundle'{..}
1968+ = object
1969+ (catMaybes
1970+ [("managedProperty" .=) <$> _mpbManagedProperty])
1971+
11991972-- | The grouplicense resources for the enterprise.
12001973--
12011974-- /See:/ 'groupLicensesListResponse' smart constructor.
@@ -1353,8 +2126,9 @@ instance ToJSON Collection where
13532126--
13542127-- /See:/ 'productSet' smart constructor.
13552128data ProductSet = ProductSet'
1356− { _psKind :: !Text
1357− , _psProductId :: !(Maybe [Text])
2129+ { _psKind :: !Text
2130+ , _psProductSetBehavior :: !(Maybe Text)
2131+ , _psProductId :: !(Maybe [Text])
13582132 } deriving (Eq,Show,Data,Typeable,Generic)
13592133
13602134-- | Creates a value of 'ProductSet' with the minimum fields required to make a request.
@@ -1363,12 +2137,15 @@ data ProductSet = ProductSet'
13632137--
13642138-- * 'psKind'
13652139--
2140+-- * 'psProductSetBehavior'
2141+--
13662142-- * 'psProductId'
13672143productSet
13682144 :: ProductSet
13692145productSet =
13702146 ProductSet'
13712147 { _psKind = "androidenterprise#productSet"
2148+ , _psProductSetBehavior = Nothing
13722149 , _psProductId = Nothing
13732150 }
13742151
@@ -1377,6 +2154,17 @@ productSet =
13772154psKind :: Lens' ProductSet Text
13782155psKind = lens _psKind (\ s a -> s{_psKind = a})
13792156
2157+-- | The interpretation of this product set. \"unknown\" should never be sent
2158+-- and ignored if received. \"whitelist\" means that this product set
2159+-- constitutes a whitelist. \"includeAll\" means that all products are
2160+-- accessible (the value of the productId field is therefore ignored). If a
2161+-- value is not supplied, it is interpreted to be \"whitelist\" for
2162+-- backwards compatibility.
2163+psProductSetBehavior :: Lens' ProductSet (Maybe Text)
2164+psProductSetBehavior
2165+ = lens _psProductSetBehavior
2166+ (\ s a -> s{_psProductSetBehavior = a})
2167+
13802168-- | The list of product IDs making up the set of products.
13812169psProductId :: Lens' ProductSet [Text]
13822170psProductId
@@ -1390,13 +2178,15 @@ instance FromJSON ProductSet where
13902178 (\ o ->
13912179 ProductSet' <$>
13922180 (o .:? "kind" .!= "androidenterprise#productSet") <*>
1393− (o .:? "productId" .!= mempty))
2181+ (o .:? "productSetBehavior")
2182+ <*> (o .:? "productId" .!= mempty))
13942183
13952184instance ToJSON ProductSet where
13962185 toJSON ProductSet'{..}
13972186 = object
13982187 (catMaybes
13992188 [Just ("kind" .= _psKind),
2189+ ("productSetBehavior" .=) <$> _psProductSetBehavior,
14002190 ("productId" .=) <$> _psProductId])
14012191
14022192-- | The existence of an install resource indicates that an app is installed
@@ -1494,71 +2284,233 @@ instance ToJSON Install where
14942284 ("installState" .=) <$> _iInstallState,
14952285 ("productId" .=) <$> _iProductId])
14962286
1497−-- | A user resource represents an individual user within the enterprise\'s
1498−-- domain. Note that each user is associated with a Google account based on
1499−-- the user\'s corporate email address (which must be in one of the
1500−-- enterprise\'s domains). As part of installing the EMM\'s DPC app to
1501−-- manage a device the Google account must be provisioned to the device,
1502−-- and so the user resource must be created before that. This can be done
1503−-- using the Google Admin SDK Directory API. The ID for a user is an opaque
1504−-- string. It can be retrieved using the list method queried by the user\'s
1505−-- primary email address.
2287+--
2288+-- /See:/ 'serviceAccountKeysListResponse' smart constructor.
2289+newtype ServiceAccountKeysListResponse = ServiceAccountKeysListResponse'
2290+ { _saklrServiceAccountKey :: Maybe [ServiceAccountKey]
2291+ } deriving (Eq,Show,Data,Typeable,Generic)
2292+
2293+-- | Creates a value of 'ServiceAccountKeysListResponse' with the minimum fields required to make a request.
2294+--
2295+-- Use one of the following lenses to modify other fields as desired:
2296+--
2297+-- * 'saklrServiceAccountKey'
2298+serviceAccountKeysListResponse
2299+ :: ServiceAccountKeysListResponse
2300+serviceAccountKeysListResponse =
2301+ ServiceAccountKeysListResponse'
2302+ { _saklrServiceAccountKey = Nothing
2303+ }
2304+
2305+-- | The service account credentials.
2306+saklrServiceAccountKey :: Lens' ServiceAccountKeysListResponse [ServiceAccountKey]
2307+saklrServiceAccountKey
2308+ = lens _saklrServiceAccountKey
2309+ (\ s a -> s{_saklrServiceAccountKey = a})
2310+ . _Default
2311+ . _Coerce
2312+
2313+instance FromJSON ServiceAccountKeysListResponse
2314+ where
2315+ parseJSON
2316+ = withObject "ServiceAccountKeysListResponse"
2317+ (\ o ->
2318+ ServiceAccountKeysListResponse' <$>
2319+ (o .:? "serviceAccountKey" .!= mempty))
2320+
2321+instance ToJSON ServiceAccountKeysListResponse where
2322+ toJSON ServiceAccountKeysListResponse'{..}
2323+ = object
2324+ (catMaybes
2325+ [("serviceAccountKey" .=) <$>
2326+ _saklrServiceAccountKey])
2327+
2328+-- | A Users resource represents an account associated with an enterprise.
2329+-- The account may be specific to a device or to an individual user (who
2330+-- can then use the account across multiple devices). The account may
2331+-- provide access to Google Play for Work only, or to other Google
2332+-- services, depending on the identity model: - Google managed domain
2333+-- identity model requires synchronization to Google account sources (via
2334+-- primaryEmail). - Android for Work Accounts identity model provides a
2335+-- dynamic means for enterprises to create user or device accounts as
2336+-- needed. These accounts provide access to Google Play for Work only.
15062337--
15072338-- /See:/ 'user' smart constructor.
15082339data User = User'
1509− { _uKind :: !Text
1510− , _uId :: !(Maybe Text)
1511− , _uPrimaryEmail :: !(Maybe Text)
2340+ { _uAccountIdentifier :: !(Maybe Text)
2341+ , _uKind :: !Text
2342+ , _uDisplayName :: !(Maybe Text)
2343+ , _uId :: !(Maybe Text)
2344+ , _uPrimaryEmail :: !(Maybe Text)
2345+ , _uManagementType :: !(Maybe Text)
2346+ , _uAccountType :: !(Maybe Text)
15122347 } deriving (Eq,Show,Data,Typeable,Generic)
15132348
15142349-- | Creates a value of 'User' with the minimum fields required to make a request.
15152350--
15162351-- Use one of the following lenses to modify other fields as desired:
15172352--
2353+-- * 'uAccountIdentifier'
2354+--
15182355-- * 'uKind'
15192356--
2357+-- * 'uDisplayName'
2358+--
15202359-- * 'uId'
15212360--
15222361-- * 'uPrimaryEmail'
2362+--
2363+-- * 'uManagementType'
2364+--
2365+-- * 'uAccountType'
15232366user
15242367 :: User
15252368user =
15262369 User'
1527− { _uKind = "androidenterprise#user"
2370+ { _uAccountIdentifier = Nothing
2371+ , _uKind = "androidenterprise#user"
2372+ , _uDisplayName = Nothing
15282373 , _uId = Nothing
15292374 , _uPrimaryEmail = Nothing
2375+ , _uManagementType = Nothing
2376+ , _uAccountType = Nothing
15302377 }
15312378
2379+-- | A unique identifier you create for this user, such as \"user342\" or
2380+-- \"asset#44418\". Do not use personally identifiable information (PII)
2381+-- for this property. Must always be set for EMM-managed users. Not set for
2382+-- Google-managed users.
2383+uAccountIdentifier :: Lens' User (Maybe Text)
2384+uAccountIdentifier
2385+ = lens _uAccountIdentifier
2386+ (\ s a -> s{_uAccountIdentifier = a})
2387+
15322388-- | Identifies what kind of resource this is. Value: the fixed string
15332389-- \"androidenterprise#user\".
15342390uKind :: Lens' User Text
15352391uKind = lens _uKind (\ s a -> s{_uKind = a})
15362392
2393+-- | The name that will appear in user interfaces. Setting this property is
2394+-- optional when creating EMM-managed users. If you do set this property,
2395+-- use something generic about the organization (such as \"Example, Inc.\")
2396+-- or your name (as EMM). Not used for Google-managed user accounts.
2397+uDisplayName :: Lens' User (Maybe Text)
2398+uDisplayName
2399+ = lens _uDisplayName (\ s a -> s{_uDisplayName = a})
2400+
15372401-- | The unique ID for the user.
15382402uId :: Lens' User (Maybe Text)
15392403uId = lens _uId (\ s a -> s{_uId = a})
15402404
1541−-- | The user\'s primary email, e.g. \"jsmith\'example.com\".
2405+-- | The user\'s primary email address, for example, \"jsmith\'example.com\".
2406+-- Will always be set for Google managed users and not set for EMM managed
2407+-- users.
15422408uPrimaryEmail :: Lens' User (Maybe Text)
15432409uPrimaryEmail
15442410 = lens _uPrimaryEmail
15452411 (\ s a -> s{_uPrimaryEmail = a})
15462412
2413+-- | The entity that manages the user. With googleManaged users, the source
2414+-- of truth is Google so EMMs have to make sure a Google Account exists for
2415+-- the user. With emmManaged users, the EMM is in charge.
2416+uManagementType :: Lens' User (Maybe Text)
2417+uManagementType
2418+ = lens _uManagementType
2419+ (\ s a -> s{_uManagementType = a})
2420+
2421+-- | The type of account that this user represents. A userAccount can be
2422+-- installed on multiple devices, but a deviceAccount is specific to a
2423+-- single device. An EMM-managed user (emmManaged) can be either type
2424+-- (userAccount, deviceAccount), but a Google-managed user (googleManaged)
2425+-- is always a userAccount.
2426+uAccountType :: Lens' User (Maybe Text)
2427+uAccountType
2428+ = lens _uAccountType (\ s a -> s{_uAccountType = a})
2429+
15472430instance FromJSON User where
15482431 parseJSON
15492432 = withObject "User"
15502433 (\ o ->
15512434 User' <$>
1552− (o .:? "kind" .!= "androidenterprise#user") <*>
1553− (o .:? "id")
1554− <*> (o .:? "primaryEmail"))
2435+ (o .:? "accountIdentifier") <*>
2436+ (o .:? "kind" .!= "androidenterprise#user")
2437+ <*> (o .:? "displayName")
2438+ <*> (o .:? "id")
2439+ <*> (o .:? "primaryEmail")
2440+ <*> (o .:? "managementType")
2441+ <*> (o .:? "accountType"))
15552442
15562443instance ToJSON User where
15572444 toJSON User'{..}
15582445 = object
15592446 (catMaybes
1560− [Just ("kind" .= _uKind), ("id" .=) <$> _uId,
1561− ("primaryEmail" .=) <$> _uPrimaryEmail])
2447+ [("accountIdentifier" .=) <$> _uAccountIdentifier,
2448+ Just ("kind" .= _uKind),
2449+ ("displayName" .=) <$> _uDisplayName,
2450+ ("id" .=) <$> _uId,
2451+ ("primaryEmail" .=) <$> _uPrimaryEmail,
2452+ ("managementType" .=) <$> _uManagementType,
2453+ ("accountType" .=) <$> _uAccountType])
2454+
2455+-- | The managed configuration resources for the device.
2456+--
2457+-- /See:/ 'managedConfigurationsForDeviceListResponse' smart constructor.
2458+data ManagedConfigurationsForDeviceListResponse = ManagedConfigurationsForDeviceListResponse'
2459+ { _mcfdlrKind :: !Text
2460+ , _mcfdlrManagedConfigurationForDevice :: !(Maybe [ManagedConfiguration])
2461+ } deriving (Eq,Show,Data,Typeable,Generic)
2462+
2463+-- | Creates a value of 'ManagedConfigurationsForDeviceListResponse' with the minimum fields required to make a request.
2464+--
2465+-- Use one of the following lenses to modify other fields as desired:
2466+--
2467+-- * 'mcfdlrKind'
2468+--
2469+-- * 'mcfdlrManagedConfigurationForDevice'
2470+managedConfigurationsForDeviceListResponse
2471+ :: ManagedConfigurationsForDeviceListResponse
2472+managedConfigurationsForDeviceListResponse =
2473+ ManagedConfigurationsForDeviceListResponse'
2474+ { _mcfdlrKind = "androidenterprise#managedConfigurationsForDeviceListResponse"
2475+ , _mcfdlrManagedConfigurationForDevice = Nothing
2476+ }
2477+
2478+-- | Identifies what kind of resource this is. Value: the fixed string
2479+-- \"androidenterprise#managedConfigurationsForDeviceListResponse\".
2480+mcfdlrKind :: Lens' ManagedConfigurationsForDeviceListResponse Text
2481+mcfdlrKind
2482+ = lens _mcfdlrKind (\ s a -> s{_mcfdlrKind = a})
2483+
2484+-- | A managed configuration for an app on a specific device.
2485+mcfdlrManagedConfigurationForDevice :: Lens' ManagedConfigurationsForDeviceListResponse [ManagedConfiguration]
2486+mcfdlrManagedConfigurationForDevice
2487+ = lens _mcfdlrManagedConfigurationForDevice
2488+ (\ s a ->
2489+ s{_mcfdlrManagedConfigurationForDevice = a})
2490+ . _Default
2491+ . _Coerce
2492+
2493+instance FromJSON
2494+ ManagedConfigurationsForDeviceListResponse where
2495+ parseJSON
2496+ = withObject
2497+ "ManagedConfigurationsForDeviceListResponse"
2498+ (\ o ->
2499+ ManagedConfigurationsForDeviceListResponse' <$>
2500+ (o .:? "kind" .!=
2501+ "androidenterprise#managedConfigurationsForDeviceListResponse")
2502+ <*>
2503+ (o .:? "managedConfigurationForDevice" .!= mempty))
2504+
2505+instance ToJSON
2506+ ManagedConfigurationsForDeviceListResponse where
2507+ toJSON
2508+ ManagedConfigurationsForDeviceListResponse'{..}
2509+ = object
2510+ (catMaybes
2511+ [Just ("kind" .= _mcfdlrKind),
2512+ ("managedConfigurationForDevice" .=) <$>
2513+ _mcfdlrManagedConfigurationForDevice])
15622514
15632515--
15642516-- /See:/ 'productsGenerateApprovalURLResponse' smart constructor.
@@ -1733,6 +2685,102 @@ instance ToJSON
17332685 [("topicName" .=) <$> _estpnrTopicName,
17342686 ("messageId" .=) <$> _estpnrMessageId])
17352687
2688+-- | A service account identity, including the name and credentials that can
2689+-- be used to authenticate as the service account.
2690+--
2691+-- /See:/ 'serviceAccount' smart constructor.
2692+data ServiceAccount = ServiceAccount'
2693+ { _saKind :: !Text
2694+ , _saKey :: !(Maybe ServiceAccountKey)
2695+ , _saName :: !(Maybe Text)
2696+ } deriving (Eq,Show,Data,Typeable,Generic)
2697+
2698+-- | Creates a value of 'ServiceAccount' with the minimum fields required to make a request.
2699+--
2700+-- Use one of the following lenses to modify other fields as desired:
2701+--
2702+-- * 'saKind'
2703+--
2704+-- * 'saKey'
2705+--
2706+-- * 'saName'
2707+serviceAccount
2708+ :: ServiceAccount
2709+serviceAccount =
2710+ ServiceAccount'
2711+ { _saKind = "androidenterprise#serviceAccount"
2712+ , _saKey = Nothing
2713+ , _saName = Nothing
2714+ }
2715+
2716+-- | Identifies what kind of resource this is. Value: the fixed string
2717+-- \"androidenterprise#serviceAccount\".
2718+saKind :: Lens' ServiceAccount Text
2719+saKind = lens _saKind (\ s a -> s{_saKind = a})
2720+
2721+-- | Credentials that can be used to authenticate as this ServiceAccount.
2722+saKey :: Lens' ServiceAccount (Maybe ServiceAccountKey)
2723+saKey = lens _saKey (\ s a -> s{_saKey = a})
2724+
2725+-- | The account name of the service account, in the form of an email
2726+-- address. Assigned by the server.
2727+saName :: Lens' ServiceAccount (Maybe Text)
2728+saName = lens _saName (\ s a -> s{_saName = a})
2729+
2730+instance FromJSON ServiceAccount where
2731+ parseJSON
2732+ = withObject "ServiceAccount"
2733+ (\ o ->
2734+ ServiceAccount' <$>
2735+ (o .:? "kind" .!= "androidenterprise#serviceAccount")
2736+ <*> (o .:? "key")
2737+ <*> (o .:? "name"))
2738+
2739+instance ToJSON ServiceAccount where
2740+ toJSON ServiceAccount'{..}
2741+ = object
2742+ (catMaybes
2743+ [Just ("kind" .= _saKind), ("key" .=) <$> _saKey,
2744+ ("name" .=) <$> _saName])
2745+
2746+-- | An event generated when a new version of an app is uploaded to Google
2747+-- Play. Notifications are sent for new public versions only: alpha, beta,
2748+-- or canary versions do not generate this event. To fetch up-to-date
2749+-- version history for an app, use Products.Get on the EMM API.
2750+--
2751+-- /See:/ 'appUpdateEvent' smart constructor.
2752+newtype AppUpdateEvent = AppUpdateEvent'
2753+ { _aueProductId :: Maybe Text
2754+ } deriving (Eq,Show,Data,Typeable,Generic)
2755+
2756+-- | Creates a value of 'AppUpdateEvent' with the minimum fields required to make a request.
2757+--
2758+-- Use one of the following lenses to modify other fields as desired:
2759+--
2760+-- * 'aueProductId'
2761+appUpdateEvent
2762+ :: AppUpdateEvent
2763+appUpdateEvent =
2764+ AppUpdateEvent'
2765+ { _aueProductId = Nothing
2766+ }
2767+
2768+-- | The id of the product (e.g. \"app:com.google.android.gm\") that was
2769+-- updated. This field will always be present.
2770+aueProductId :: Lens' AppUpdateEvent (Maybe Text)
2771+aueProductId
2772+ = lens _aueProductId (\ s a -> s{_aueProductId = a})
2773+
2774+instance FromJSON AppUpdateEvent where
2775+ parseJSON
2776+ = withObject "AppUpdateEvent"
2777+ (\ o -> AppUpdateEvent' <$> (o .:? "productId"))
2778+
2779+instance ToJSON AppUpdateEvent where
2780+ toJSON AppUpdateEvent'{..}
2781+ = object
2782+ (catMaybes [("productId" .=) <$> _aueProductId])
2783+
17362784-- | The matching enterprise resources.
17372785--
17382786-- /See:/ 'enterprisesListResponse' smart constructor.
@@ -1785,6 +2833,75 @@ instance ToJSON EnterprisesListResponse where
17852833 [Just ("kind" .= _elrKind),
17862834 ("enterprise" .=) <$> _elrEnterprise])
17872835
2836+-- | A resource returned by the PullNotificationSet API, which contains a
2837+-- collection of notifications for enterprises associated with the service
2838+-- account authenticated for the request.
2839+--
2840+-- /See:/ 'notificationSet' smart constructor.
2841+data NotificationSet = NotificationSet'
2842+ { _nsNotificationSetId :: !(Maybe Text)
2843+ , _nsNotification :: !(Maybe [Notification])
2844+ , _nsKind :: !Text
2845+ } deriving (Eq,Show,Data,Typeable,Generic)
2846+
2847+-- | Creates a value of 'NotificationSet' with the minimum fields required to make a request.
2848+--
2849+-- Use one of the following lenses to modify other fields as desired:
2850+--
2851+-- * 'nsNotificationSetId'
2852+--
2853+-- * 'nsNotification'
2854+--
2855+-- * 'nsKind'
2856+notificationSet
2857+ :: NotificationSet
2858+notificationSet =
2859+ NotificationSet'
2860+ { _nsNotificationSetId = Nothing
2861+ , _nsNotification = Nothing
2862+ , _nsKind = "androidenterprise#notificationSet"
2863+ }
2864+
2865+-- | The notification set ID, required to mark the notification as received
2866+-- with the Enterprises.AcknowledgeNotification API. This will be omitted
2867+-- if no notifications are present.
2868+nsNotificationSetId :: Lens' NotificationSet (Maybe Text)
2869+nsNotificationSetId
2870+ = lens _nsNotificationSetId
2871+ (\ s a -> s{_nsNotificationSetId = a})
2872+
2873+-- | The notifications received, or empty if no notifications are present.
2874+nsNotification :: Lens' NotificationSet [Notification]
2875+nsNotification
2876+ = lens _nsNotification
2877+ (\ s a -> s{_nsNotification = a})
2878+ . _Default
2879+ . _Coerce
2880+
2881+-- | Identifies what kind of resource this is. Value: the fixed string
2882+-- \"androidenterprise#notificationSet\".
2883+nsKind :: Lens' NotificationSet Text
2884+nsKind = lens _nsKind (\ s a -> s{_nsKind = a})
2885+
2886+instance FromJSON NotificationSet where
2887+ parseJSON
2888+ = withObject "NotificationSet"
2889+ (\ o ->
2890+ NotificationSet' <$>
2891+ (o .:? "notificationSetId") <*>
2892+ (o .:? "notification" .!= mempty)
2893+ <*>
2894+ (o .:? "kind" .!=
2895+ "androidenterprise#notificationSet"))
2896+
2897+instance ToJSON NotificationSet where
2898+ toJSON NotificationSet'{..}
2899+ = object
2900+ (catMaybes
2901+ [("notificationSetId" .=) <$> _nsNotificationSetId,
2902+ ("notification" .=) <$> _nsNotification,
2903+ Just ("kind" .= _nsKind)])
2904+
17882905-- | Represents the list of app restrictions available to be pre-configured
17892906-- for the product.
17902907--
@@ -1994,33 +3111,23 @@ instance ToJSON DevicesListResponse where
19943111 [Just ("kind" .= _dlrKind),
19953112 ("device" .=) <$> _dlrDevice])
19963113
1997−-- | An enterprise resource represents a binding between an organization and
1998−-- their EMM. To create an enterprise, an admin of the enterprise must
1999−-- first go through a Play for Work sign-up flow. At the end of this the
2000−-- admin will be presented with a token (a short opaque alphanumeric
2001−-- string). They must then present this to the EMM, who then supplies it to
2002−-- the enroll method. Until this is done the EMM will not have any access
2003−-- to the enterprise. After calling enroll the EMM should call setAccount
2004−-- to specify the service account that will be allowed to act on behalf of
2005−-- the enterprise, which will be required for access to the enterprise\'s
2006−-- data through this API. Only one call of setAccount is allowed for a
2007−-- given enterprise; the only way to change the account later is to
2008−-- unenroll the enterprise and enroll it again (obtaining a new token). The
2009−-- EMM can unenroll an enterprise in order to sever the binding between
2010−-- them. Re-enrolling an enterprise is possible, but requires a new token
2011−-- to be retrieved. Enterprises.unenroll requires the EMM\'s credentials
2012−-- (as enroll does), not the enterprise\'s. Enterprises.unenroll can only
2013−-- be used for enterprises that were previously enrolled with the enroll
2014−-- call. Any enterprises that were enrolled using the (deprecated)
2015−-- Enterprises.insert call must be unenrolled with Enterprises.delete and
2016−-- can then be re-enrolled using the Enterprises.enroll call. The ID for an
2017−-- enterprise is an opaque string. It is returned by insert and enroll and
2018−-- can also be retrieved if the enterprise\'s primary domain is known using
2019−-- the list method.
3114+-- | An Enterprises resource represents the binding between an EMM and a
3115+-- specific organization. That binding can be instantiated in one of two
3116+-- different ways using this API as follows: - For Google managed domain
3117+-- customers, the process involves using Enterprises.enroll and
3118+-- Enterprises.setAccount (in conjunction with artifacts obtained from the
3119+-- Admin console and the Google API Console) and submitted to the EMM
3120+-- through a more-or-less manual process. - For Android for Work Accounts
3121+-- customers, the process involves using Enterprises.generateSignupUrl and
3122+-- Enterprises.completeSignup in conjunction with the Android for Work
3123+-- Sign-up UI (Google-provided mechanism) to create the binding without
3124+-- manual steps. As an EMM, you can support either or both approaches in
3125+-- your EMM console. See Create an Enterprise for details.
20203126--
20213127-- /See:/ 'enterprise' smart constructor.
20223128data Enterprise = Enterprise'
20233129 { _eKind :: !Text
3130+ , _eAdministrator :: !(Maybe [Administrator])
20243131 , _ePrimaryDomain :: !(Maybe Text)
20253132 , _eName :: !(Maybe Text)
20263133 , _eId :: !(Maybe Text)
@@ -2032,6 +3139,8 @@ data Enterprise = Enterprise'
20323139--
20333140-- * 'eKind'
20343141--
3142+-- * 'eAdministrator'
3143+--
20353144-- * 'ePrimaryDomain'
20363145--
20373146-- * 'eName'
@@ -2042,6 +3151,7 @@ enterprise
20423151enterprise =
20433152 Enterprise'
20443153 { _eKind = "androidenterprise#enterprise"
3154+ , _eAdministrator = Nothing
20453155 , _ePrimaryDomain = Nothing
20463156 , _eName = Nothing
20473157 , _eId = Nothing
@@ -2052,13 +3162,22 @@ enterprise =
20523162eKind :: Lens' Enterprise Text
20533163eKind = lens _eKind (\ s a -> s{_eKind = a})
20543164
2055−-- | The enterprise\'s primary domain, e.g. \"example.com\".
3165+-- | Administrators of the enterprise. This is only supported for enterprises
3166+-- created via the EMM-initiated flow.
3167+eAdministrator :: Lens' Enterprise [Administrator]
3168+eAdministrator
3169+ = lens _eAdministrator
3170+ (\ s a -> s{_eAdministrator = a})
3171+ . _Default
3172+ . _Coerce
3173+
3174+-- | The enterprise\'s primary domain, such as \"example.com\".
20563175ePrimaryDomain :: Lens' Enterprise (Maybe Text)
20573176ePrimaryDomain
20583177 = lens _ePrimaryDomain
20593178 (\ s a -> s{_ePrimaryDomain = a})
20603179
2061−-- | The name of the enterprise, e.g. \"Example Inc\".
3180+-- | The name of the enterprise, for example, \"Example, Inc\".
20623181eName :: Lens' Enterprise (Maybe Text)
20633182eName = lens _eName (\ s a -> s{_eName = a})
20643183
@@ -2072,7 +3191,8 @@ instance FromJSON Enterprise where
20723191 (\ o ->
20733192 Enterprise' <$>
20743193 (o .:? "kind" .!= "androidenterprise#enterprise") <*>
2075− (o .:? "primaryDomain")
3194+ (o .:? "administrator" .!= mempty)
3195+ <*> (o .:? "primaryDomain")
20763196 <*> (o .:? "name")
20773197 <*> (o .:? "id"))
20783198
@@ -2081,22 +3201,167 @@ instance ToJSON Enterprise where
20813201 = object
20823202 (catMaybes
20833203 [Just ("kind" .= _eKind),
3204+ ("administrator" .=) <$> _eAdministrator,
20843205 ("primaryDomain" .=) <$> _ePrimaryDomain,
20853206 ("name" .=) <$> _eName, ("id" .=) <$> _eId])
20863207
3208+-- | An event generated when an app installation failed on a device
3209+--
3210+-- /See:/ 'installFailureEvent' smart constructor.
3211+data InstallFailureEvent = InstallFailureEvent'
3212+ { _ifeFailureReason :: !(Maybe Text)
3213+ , _ifeFailureDetails :: !(Maybe Text)
3214+ , _ifeUserId :: !(Maybe Text)
3215+ , _ifeDeviceId :: !(Maybe Text)
3216+ , _ifeProductId :: !(Maybe Text)
3217+ } deriving (Eq,Show,Data,Typeable,Generic)
3218+
3219+-- | Creates a value of 'InstallFailureEvent' with the minimum fields required to make a request.
3220+--
3221+-- Use one of the following lenses to modify other fields as desired:
3222+--
3223+-- * 'ifeFailureReason'
3224+--
3225+-- * 'ifeFailureDetails'
3226+--
3227+-- * 'ifeUserId'
3228+--
3229+-- * 'ifeDeviceId'
3230+--
3231+-- * 'ifeProductId'
3232+installFailureEvent
3233+ :: InstallFailureEvent
3234+installFailureEvent =
3235+ InstallFailureEvent'
3236+ { _ifeFailureReason = Nothing
3237+ , _ifeFailureDetails = Nothing
3238+ , _ifeUserId = Nothing
3239+ , _ifeDeviceId = Nothing
3240+ , _ifeProductId = Nothing
3241+ }
3242+
3243+-- | The reason for the installation failure. This field will always be
3244+-- present.
3245+ifeFailureReason :: Lens' InstallFailureEvent (Maybe Text)
3246+ifeFailureReason
3247+ = lens _ifeFailureReason
3248+ (\ s a -> s{_ifeFailureReason = a})
3249+
3250+-- | Additional details on the failure if applicable.
3251+ifeFailureDetails :: Lens' InstallFailureEvent (Maybe Text)
3252+ifeFailureDetails
3253+ = lens _ifeFailureDetails
3254+ (\ s a -> s{_ifeFailureDetails = a})
3255+
3256+-- | The ID of the user. This field will always be present.
3257+ifeUserId :: Lens' InstallFailureEvent (Maybe Text)
3258+ifeUserId
3259+ = lens _ifeUserId (\ s a -> s{_ifeUserId = a})
3260+
3261+-- | The Android ID of the device. This field will always be present.
3262+ifeDeviceId :: Lens' InstallFailureEvent (Maybe Text)
3263+ifeDeviceId
3264+ = lens _ifeDeviceId (\ s a -> s{_ifeDeviceId = a})
3265+
3266+-- | The id of the product (e.g. \"app:com.google.android.gm\") for which the
3267+-- install failure event occured. This field will always be present.
3268+ifeProductId :: Lens' InstallFailureEvent (Maybe Text)
3269+ifeProductId
3270+ = lens _ifeProductId (\ s a -> s{_ifeProductId = a})
3271+
3272+instance FromJSON InstallFailureEvent where
3273+ parseJSON
3274+ = withObject "InstallFailureEvent"
3275+ (\ o ->
3276+ InstallFailureEvent' <$>
3277+ (o .:? "failureReason") <*> (o .:? "failureDetails")
3278+ <*> (o .:? "userId")
3279+ <*> (o .:? "deviceId")
3280+ <*> (o .:? "productId"))
3281+
3282+instance ToJSON InstallFailureEvent where
3283+ toJSON InstallFailureEvent'{..}
3284+ = object
3285+ (catMaybes
3286+ [("failureReason" .=) <$> _ifeFailureReason,
3287+ ("failureDetails" .=) <$> _ifeFailureDetails,
3288+ ("userId" .=) <$> _ifeUserId,
3289+ ("deviceId" .=) <$> _ifeDeviceId,
3290+ ("productId" .=) <$> _ifeProductId])
3291+
3292+-- | The managed configuration resources for the user.
3293+--
3294+-- /See:/ 'managedConfigurationsForUserListResponse' smart constructor.
3295+data ManagedConfigurationsForUserListResponse = ManagedConfigurationsForUserListResponse'
3296+ { _mcfulrManagedConfigurationForUser :: !(Maybe [ManagedConfiguration])
3297+ , _mcfulrKind :: !Text
3298+ } deriving (Eq,Show,Data,Typeable,Generic)
3299+
3300+-- | Creates a value of 'ManagedConfigurationsForUserListResponse' with the minimum fields required to make a request.
3301+--
3302+-- Use one of the following lenses to modify other fields as desired:
3303+--
3304+-- * 'mcfulrManagedConfigurationForUser'
3305+--
3306+-- * 'mcfulrKind'
3307+managedConfigurationsForUserListResponse
3308+ :: ManagedConfigurationsForUserListResponse
3309+managedConfigurationsForUserListResponse =
3310+ ManagedConfigurationsForUserListResponse'
3311+ { _mcfulrManagedConfigurationForUser = Nothing
3312+ , _mcfulrKind = "androidenterprise#managedConfigurationsForUserListResponse"
3313+ }
3314+
3315+-- | A managed configuration for an app for a specific user.
3316+mcfulrManagedConfigurationForUser :: Lens' ManagedConfigurationsForUserListResponse [ManagedConfiguration]
3317+mcfulrManagedConfigurationForUser
3318+ = lens _mcfulrManagedConfigurationForUser
3319+ (\ s a -> s{_mcfulrManagedConfigurationForUser = a})
3320+ . _Default
3321+ . _Coerce
3322+
3323+-- | Identifies what kind of resource this is. Value: the fixed string
3324+-- \"androidenterprise#managedConfigurationsForUserListResponse\".
3325+mcfulrKind :: Lens' ManagedConfigurationsForUserListResponse Text
3326+mcfulrKind
3327+ = lens _mcfulrKind (\ s a -> s{_mcfulrKind = a})
3328+
3329+instance FromJSON
3330+ ManagedConfigurationsForUserListResponse where
3331+ parseJSON
3332+ = withObject
3333+ "ManagedConfigurationsForUserListResponse"
3334+ (\ o ->
3335+ ManagedConfigurationsForUserListResponse' <$>
3336+ (o .:? "managedConfigurationForUser" .!= mempty) <*>
3337+ (o .:? "kind" .!=
3338+ "androidenterprise#managedConfigurationsForUserListResponse"))
3339+
3340+instance ToJSON
3341+ ManagedConfigurationsForUserListResponse where
3342+ toJSON ManagedConfigurationsForUserListResponse'{..}
3343+ = object
3344+ (catMaybes
3345+ [("managedConfigurationForUser" .=) <$>
3346+ _mcfulrManagedConfigurationForUser,
3347+ Just ("kind" .= _mcfulrKind)])
3348+
20873349-- | General setting for the Google Play for Work store layout, currently
20883350-- only specifying the page to display the first time the store is opened.
20893351--
20903352-- /See:/ 'storeLayout' smart constructor.
20913353data StoreLayout = StoreLayout'
2092− { _slKind :: !Text
2093− , _slHomepageId :: !(Maybe Text)
3354+ { _slStoreLayoutType :: !(Maybe Text)
3355+ , _slKind :: !Text
3356+ , _slHomepageId :: !(Maybe Text)
20943357 } deriving (Eq,Show,Data,Typeable,Generic)
20953358
20963359-- | Creates a value of 'StoreLayout' with the minimum fields required to make a request.
20973360--
20983361-- Use one of the following lenses to modify other fields as desired:
20993362--
3363+-- * 'slStoreLayoutType'
3364+--
21003365-- * 'slKind'
21013366--
21023367-- * 'slHomepageId'
@@ -2104,20 +3369,34 @@ storeLayout
21043369 :: StoreLayout
21053370storeLayout =
21063371 StoreLayout'
2107− { _slKind = "androidenterprise#storeLayout"
3372+ { _slStoreLayoutType = Nothing
3373+ , _slKind = "androidenterprise#storeLayout"
21083374 , _slHomepageId = Nothing
21093375 }
21103376
3377+-- | Sets a store layout type. If set to \"custom\", \"homepageId\" must be
3378+-- specified. If set to \"basic\", the layout will consist of all approved
3379+-- apps accessible by the user, split in pages of 100 each; in this case,
3380+-- \"homepageId\" must not be specified. The \"basic\" setting takes
3381+-- precedence over any existing collections setup for this enterprise (if
3382+-- any). Should the enterprise use collectionViewers for controlling access
3383+-- rights, these will still be respected.
3384+slStoreLayoutType :: Lens' StoreLayout (Maybe Text)
3385+slStoreLayoutType
3386+ = lens _slStoreLayoutType
3387+ (\ s a -> s{_slStoreLayoutType = a})
3388+
21113389-- | Identifies what kind of resource this is. Value: the fixed string
21123390-- \"androidenterprise#storeLayout\".
21133391slKind :: Lens' StoreLayout Text
21143392slKind = lens _slKind (\ s a -> s{_slKind = a})
21153393
21163394-- | The ID of the store page to be used as the homepage. The homepage will
2117−-- be used as the first page shown in the Google Play for Work store. If
2118−-- there is no homepage set, an empty store is shown. The homepage can be
2119−-- unset (by not specifying it) to empty the store. If there exists at
2120−-- least one page, this field must be set to the ID of a valid page.
3395+-- be used as the first page shown in the Google Play for Work store. If a
3396+-- homepage has not been set, the Play store shown on devices will be
3397+-- empty. Not specifying a homepage on a store layout effectively empties
3398+-- the store. If there exists at least one page, this field must be set to
3399+-- the ID of a valid page.
21213400slHomepageId :: Lens' StoreLayout (Maybe Text)
21223401slHomepageId
21233402 = lens _slHomepageId (\ s a -> s{_slHomepageId = a})
@@ -2127,23 +3406,177 @@ instance FromJSON StoreLayout where
21273406 = withObject "StoreLayout"
21283407 (\ o ->
21293408 StoreLayout' <$>
2130− (o .:? "kind" .!= "androidenterprise#storeLayout")
3409+ (o .:? "storeLayoutType") <*>
3410+ (o .:? "kind" .!= "androidenterprise#storeLayout")
21313411 <*> (o .:? "homepageId"))
21323412
21333413instance ToJSON StoreLayout where
21343414 toJSON StoreLayout'{..}
21353415 = object
21363416 (catMaybes
2137− [Just ("kind" .= _slKind),
3417+ [("storeLayoutType" .=) <$> _slStoreLayoutType,
3418+ Just ("kind" .= _slKind),
21383419 ("homepageId" .=) <$> _slHomepageId])
21393420
2140−-- | A product represents an app in the Google Play Store that is available
2141−-- to at least some users in the enterprise. (Some apps are restricted to a
2142−-- single enterprise, and no information about them is made available
2143−-- outside that enterprise.) The information provided for each product
2144−-- (localized name, icon, link to the full Google Play details page) is
2145−-- intended to allow a basic representation of the product within an EMM
2146−-- user interface.
3421+-- | An event generated when a new app version is uploaded to Google Play and
3422+-- its app restrictions schema changed. To fetch the app restrictions
3423+-- schema for an app, use Products.getAppRestrictionsSchema on the EMM API.
3424+--
3425+-- /See:/ 'appRestrictionsSchemaChangeEvent' smart constructor.
3426+newtype AppRestrictionsSchemaChangeEvent = AppRestrictionsSchemaChangeEvent'
3427+ { _arsceProductId :: Maybe Text
3428+ } deriving (Eq,Show,Data,Typeable,Generic)
3429+
3430+-- | Creates a value of 'AppRestrictionsSchemaChangeEvent' with the minimum fields required to make a request.
3431+--
3432+-- Use one of the following lenses to modify other fields as desired:
3433+--
3434+-- * 'arsceProductId'
3435+appRestrictionsSchemaChangeEvent
3436+ :: AppRestrictionsSchemaChangeEvent
3437+appRestrictionsSchemaChangeEvent =
3438+ AppRestrictionsSchemaChangeEvent'
3439+ { _arsceProductId = Nothing
3440+ }
3441+
3442+-- | The id of the product (e.g. \"app:com.google.android.gm\") for which the
3443+-- app restriction schema changed. This field will always be present.
3444+arsceProductId :: Lens' AppRestrictionsSchemaChangeEvent (Maybe Text)
3445+arsceProductId
3446+ = lens _arsceProductId
3447+ (\ s a -> s{_arsceProductId = a})
3448+
3449+instance FromJSON AppRestrictionsSchemaChangeEvent
3450+ where
3451+ parseJSON
3452+ = withObject "AppRestrictionsSchemaChangeEvent"
3453+ (\ o ->
3454+ AppRestrictionsSchemaChangeEvent' <$>
3455+ (o .:? "productId"))
3456+
3457+instance ToJSON AppRestrictionsSchemaChangeEvent
3458+ where
3459+ toJSON AppRestrictionsSchemaChangeEvent'{..}
3460+ = object
3461+ (catMaybes [("productId" .=) <$> _arsceProductId])
3462+
3463+-- | A token authorizing an administrator to access an iframe.
3464+--
3465+-- /See:/ 'administratorWebToken' smart constructor.
3466+data AdministratorWebToken = AdministratorWebToken'
3467+ { _awtKind :: !Text
3468+ , _awtToken :: !(Maybe Text)
3469+ } deriving (Eq,Show,Data,Typeable,Generic)
3470+
3471+-- | Creates a value of 'AdministratorWebToken' with the minimum fields required to make a request.
3472+--
3473+-- Use one of the following lenses to modify other fields as desired:
3474+--
3475+-- * 'awtKind'
3476+--
3477+-- * 'awtToken'
3478+administratorWebToken
3479+ :: AdministratorWebToken
3480+administratorWebToken =
3481+ AdministratorWebToken'
3482+ { _awtKind = "androidenterprise#administratorWebToken"
3483+ , _awtToken = Nothing
3484+ }
3485+
3486+-- | Identifies what kind of resource this is. Value: the fixed string
3487+-- \"androidenterprise#administratorWebToken\".
3488+awtKind :: Lens' AdministratorWebToken Text
3489+awtKind = lens _awtKind (\ s a -> s{_awtKind = a})
3490+
3491+-- | An opaque token to be passed to the Play front-end to generate an
3492+-- iframe.
3493+awtToken :: Lens' AdministratorWebToken (Maybe Text)
3494+awtToken = lens _awtToken (\ s a -> s{_awtToken = a})
3495+
3496+instance FromJSON AdministratorWebToken where
3497+ parseJSON
3498+ = withObject "AdministratorWebToken"
3499+ (\ o ->
3500+ AdministratorWebToken' <$>
3501+ (o .:? "kind" .!=
3502+ "androidenterprise#administratorWebToken")
3503+ <*> (o .:? "token"))
3504+
3505+instance ToJSON AdministratorWebToken where
3506+ toJSON AdministratorWebToken'{..}
3507+ = object
3508+ (catMaybes
3509+ [Just ("kind" .= _awtKind),
3510+ ("token" .=) <$> _awtToken])
3511+
3512+-- | A resource returned by the GenerateSignupUrl API, which contains the
3513+-- Signup URL and Completion Token.
3514+--
3515+-- /See:/ 'signupInfo' smart constructor.
3516+data SignupInfo = SignupInfo'
3517+ { _siCompletionToken :: !(Maybe Text)
3518+ , _siKind :: !Text
3519+ , _siURL :: !(Maybe Text)
3520+ } deriving (Eq,Show,Data,Typeable,Generic)
3521+
3522+-- | Creates a value of 'SignupInfo' with the minimum fields required to make a request.
3523+--
3524+-- Use one of the following lenses to modify other fields as desired:
3525+--
3526+-- * 'siCompletionToken'
3527+--
3528+-- * 'siKind'
3529+--
3530+-- * 'siURL'
3531+signupInfo
3532+ :: SignupInfo
3533+signupInfo =
3534+ SignupInfo'
3535+ { _siCompletionToken = Nothing
3536+ , _siKind = "androidenterprise#signupInfo"
3537+ , _siURL = Nothing
3538+ }
3539+
3540+-- | An opaque token that will be required, along with the Enterprise Token,
3541+-- for obtaining the enterprise resource from CompleteSignup.
3542+siCompletionToken :: Lens' SignupInfo (Maybe Text)
3543+siCompletionToken
3544+ = lens _siCompletionToken
3545+ (\ s a -> s{_siCompletionToken = a})
3546+
3547+-- | Identifies what kind of resource this is. Value: the fixed string
3548+-- \"androidenterprise#signupInfo\".
3549+siKind :: Lens' SignupInfo Text
3550+siKind = lens _siKind (\ s a -> s{_siKind = a})
3551+
3552+-- | A URL under which the Admin can sign up for an enterprise. The page
3553+-- pointed to cannot be rendered in an iframe.
3554+siURL :: Lens' SignupInfo (Maybe Text)
3555+siURL = lens _siURL (\ s a -> s{_siURL = a})
3556+
3557+instance FromJSON SignupInfo where
3558+ parseJSON
3559+ = withObject "SignupInfo"
3560+ (\ o ->
3561+ SignupInfo' <$>
3562+ (o .:? "completionToken") <*>
3563+ (o .:? "kind" .!= "androidenterprise#signupInfo")
3564+ <*> (o .:? "url"))
3565+
3566+instance ToJSON SignupInfo where
3567+ toJSON SignupInfo'{..}
3568+ = object
3569+ (catMaybes
3570+ [("completionToken" .=) <$> _siCompletionToken,
3571+ Just ("kind" .= _siKind), ("url" .=) <$> _siURL])
3572+
3573+-- | A Products resource represents an app in the Google Play Store that is
3574+-- available to at least some users in the enterprise. (Some apps are
3575+-- restricted to a single enterprise, and no information about them is made
3576+-- available outside that enterprise.) The information provided for each
3577+-- product (localized name, icon, link to the full Google Play details
3578+-- page) is intended to allow a basic representation of the product within
3579+-- an EMM user interface.
21473580--
21483581-- /See:/ 'product' smart constructor.
21493582data Product = Product'
@@ -2245,7 +3678,10 @@ pAppVersion
22453678 _Default
22463679 . _Coerce
22473680
2248−-- | Whether this product is free, free with in-app purchases, or paid.
3681+-- | Whether this product is free, free with in-app purchases, or paid. If
3682+-- the pricing is unknown, this means the product is not generally
3683+-- available anymore (even though it might still be available to people who
3684+-- own it).
22493685pProductPricing :: Lens' Product (Maybe Text)
22503686pProductPricing
22513687 = lens _pProductPricing