File tree Expand file tree Collapse file tree
adminSDK/alertcenter/quickstart/src/main/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ public class AdminSDKAlertCenterQuickstart {
3737
3838 private static final String APPLICATION_NAME = "Google Admin SDK Alert Center API Java Quickstart" ;
3939 private static final JsonFactory JSON_FACTORY = JacksonFactory .getDefaultInstance ();
40+
41+ /**
42+ * Global instance of the scopes required by this quickstart.
43+ * If modifying these scopes, delete your previously saved tokens/folder.
44+ */
45+ private static final List <String > SCOPES =
46+ Collections .singletonList (AlertCenterScopes .APPS_ALERTS );
4047 private static final String CREDENTIALS_FILE_PATH = "/credentials.json" ;
4148 private static final String DELEGATED_ADMIN_EMAIL = "admin@xxx.com" ;
4249
@@ -56,7 +63,7 @@ private static Credentials getCredentials(String delegatedAdminEmail) throws IOE
5663 GoogleCredentials credentials = ServiceAccountCredentials
5764 .fromStream (in )
5865 .createDelegated (delegatedAdminEmail )
59- .createScoped (AlertCenterScopes . all () );
66+ .createScoped (SCOPES );
6067 // [END admin_sdk_alertcenter_get_credentials]
6168 return credentials ;
6269 }
You can’t perform that action at this time.
0 commit comments