Skip to content

Commit f979dc8

Browse files
committed
Replace scope all() with an explicit list of scopes.
1 parent ae49084 commit f979dc8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)