1919import com .google .api .client .json .JsonFactory ;
2020import com .google .api .client .json .jackson2 .JacksonFactory ;
2121import com .google .api .services .alertcenter .v1beta1 .AlertCenter ;
22+ import com .google .api .services .alertcenter .v1beta1 .AlertCenterScopes ;
2223import com .google .api .services .alertcenter .v1beta1 .model .Alert ;
2324import com .google .api .services .alertcenter .v1beta1 .model .AlertFeedback ;
2425import com .google .api .services .alertcenter .v1beta1 .model .ListAlertsResponse ;
@@ -36,12 +37,6 @@ public class AdminSDKAlertCenterQuickstart {
3637
3738 private static final String APPLICATION_NAME = "Google Admin SDK Alert Center API Java Quickstart" ;
3839 private static final JsonFactory JSON_FACTORY = JacksonFactory .getDefaultInstance ();
39- /**
40- * Global instance of the scopes required by this quickstart. If modifying these scopes, delete
41- * your previously saved tokens/ folder.
42- */
43- private static final List <String > SCOPES = Collections
44- .singletonList ("https://www.googleapis.com/auth/apps.alerts" );
4540 private static final String CREDENTIALS_FILE_PATH = "/credentials.json" ;
4641 private static final String DELEGATED_ADMIN_EMAIL = "admin@xxx.com" ;
4742
@@ -61,7 +56,7 @@ private static Credentials getCredentials(String delegatedAdminEmail) throws IOE
6156 GoogleCredentials credentials = ServiceAccountCredentials
6257 .fromStream (in )
6358 .createDelegated (delegatedAdminEmail )
64- .createScoped (SCOPES );
59+ .createScoped (AlertCenterScopes . all () );
6560 // [END admin_sdk_alertcenter_get_credentials]
6661 return credentials ;
6762 }
0 commit comments