File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
adminSDK/alertcenter/quickstart Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ repositories {
1414dependencies {
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}
Original file line number Diff line number Diff line change 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 =
"[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 }
You can’t perform that action at this time.
0 commit comments