use of com.google.api.services.servicemanagement.model.EnableServiceRequest in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudApiManager method enableApi.
private static void enableApi(CloudLibrary library, CloudProject cloudProject, CredentialedUser user) throws IOException {
UsageTrackerProvider.getInstance().trackEvent(GctTracking.CLIENT_LIBRARY_ENABLE_API).addMetadata(GctTracking.METADATA_LABEL_KEY, library.getName()).ping();
ServiceManagement serviceManagement = GoogleApiClientFactory.getInstance().getServiceManagementClient(user.getCredential());
serviceManagement.services().enable(library.getServiceName(), new EnableServiceRequest().setConsumerId(String.format(SERVICE_REQUEST_PROJECT_FORMAT, cloudProject.projectId()))).execute();
}
Aggregations