Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae49084

Browse files
committed
Update Alert Center scopes for using constant.
1 parent ab48f20 commit ae49084

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

adminSDK/alertcenter/quickstart/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ repositories {
1414
dependencies {
1515
compile 'com.google.api-client:google-api-client:1.20.0'
1616
compile 'com.google.auth:google-auth-library-oauth2-http:0.11.0'
17-
compile 'com.google.apis:google-api-services-alertcenter:v1beta1-rev7-1.25.0'
17+
compile 'com.google.apis:google-api-services-alertcenter:v1beta1-rev20190221-1.28.0'
1818
}

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.api.client.json.JsonFactory;
2020
import com.google.api.client.json.jackson2.JacksonFactory;
2121
import com.google.api.services.alertcenter.v1beta1.AlertCenter;
22+
import com.google.api.services.alertcenter.v1beta1.AlertCenterScopes;
2223
import com.google.api.services.alertcenter.v1beta1.model.Alert;
2324
import com.google.api.services.alertcenter.v1beta1.model.AlertFeedback;
2425
import 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 = "[email protected]";
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

Comments
 (0)