docs: refresh root README and point to google-cloud-dart (#782) Direct Google Cloud users to `googleapis/google-cloud-dart` and refresh the root README for the current pub workspace and generator workflow. - Point Google Cloud developers to `googleapis/google-cloud-dart` for ongoing Cloud and authentication work, noting the Cloud APIs already deprecated in `package:googleapis` while clarifying that Workspace, YouTube, and other Discovery APIs remain here. - Replace legacy `Google Developers Console` walkthroughs, archived `dart-lang/googleapis_examples` links, and unused `images/` assets with links to `googleapis_auth/README.md`, `APIs & Services > Library`, the Flutter Google APIs guide, and an analyzed `package:googleapis/drive/v3.dart` ADC example. - Update contributor instructions for the root pub workspace, `googleapis_auth` Chrome tests, `./tool/download.sh`, `./tool/local_rebuild.sh`, `./tool/verify_examples_setup.sh`, and `discovery/<package>/<api>__<version>.json` override diffs.
Dart packages for accessing RESTful Google APIs described by the API Discovery Service, along with OAuth 2.0 authentication helpers.
[!IMPORTANT]
Most future Google API and Google Cloud client development for Dart is happening in googleapis/google-cloud-dart. If you are targeting Google Cloud services, check
google-cloud-dartfirst. Several Cloud APIs inpackage:googleapis(including Cloud Storage, Firestore, Secret Manager, Cloud Logging, IAM, Cloud Functions, Cloud Tasks, Compute Engine, and Natural Language) are already deprecated in favor ofgoogle_cloud_*packages.Use the packages in this repository for Google Workspace (Drive, Gmail, Calendar, Sheets, Docs), YouTube, and other Discovery-based Google APIs not yet covered by
google-cloud-dart.
| Package | Description | Version |
|---|---|---|
| googleapis | Generated Dart libraries for stable Google APIs described by the API Discovery Service. | |
| googleapis_beta | Generated Dart libraries for beta and preview Google APIs described by the API Discovery Service. | |
| googleapis_auth | Obtain OAuth 2.0 access credentials and authenticated HTTP clients for Google services. | |
| discoveryapis_generator | Generate Dart API client packages from API Discovery Service documents. | |
| _discoveryapis_commons | Shared runtime support used by generated Discovery API packages (not intended for direct use). |
package:googleapis_auth directly in Flutter apps. Use package:extension_google_sign_in_as_googleapis_auth and follow the Flutter Google APIs guide.Add googleapis and googleapis_auth to your package:
$ dart pub add googleapis googleapis_auth
import 'package:googleapis/drive/v3.dart'; import 'package:googleapis_auth/auth_io.dart'; Future<void> main() async { final httpClient = await clientViaApplicationDefaultCredentials( scopes: [DriveApi.driveMetadataReadonlyScope], ); try { final drive = DriveApi(httpClient); final fileList = await drive.files.list(pageSize: 10); for (final file in fileList.files ?? const <File>[]) { print('${file.name} (${file.id})'); } } finally { httpClient.close(); } }
Refer to CONTRIBUTING.md for Contributor License Agreement (CLA) and pull request guidelines.
This repository is configured as a Dart pub workspace. Resolve dependencies for all packages from the repository root:
$ dart pub get
When changing a standalone package such as googleapis_auth or discoveryapis_commons, run analysis, formatting checks, and tests inside that package directory:
$ cd googleapis_auth $ dart analyze --fatal-infos $ dart format --output=none --set-exit-if-changed . $ dart test
When changing browser authentication flows in googleapis_auth, also run the Chrome test matrix:
$ dart test -p chrome --compiler dart2js,dart2wasm
If you modify discoveryapis_generator, also regenerate the test fixture package from the repository root and verify there are no unexpected diffs:
$ ./tool/verify_examples_setup.sh $ git diff
googleapis and googleapis_betaFetch the latest discovery documents from the googleapis/discovery-artifact-manager submodule, apply patches from overrides/, and update config.yaml:
$ ./tool/download.sh
Review changes in config.yaml and discovery/ to decide whether a minor or major version bump is needed. Update version: in config.yaml and the corresponding changelog under resources/googleapis/CHANGELOG.md or resources/googleapis_beta/CHANGELOG.md.
Regenerate generated/googleapis and generated/googleapis_beta and refresh workspace resolution:
$ ./tool/local_rebuild.sh
Validate configuration, analysis, and tests:
$ (cd generator && dart analyze --fatal-infos && dart test) $ (cd generated/googleapis && dart analyze --fatal-infos && dart test) $ (cd generated/googleapis_beta && dart analyze --fatal-infos && dart test)
To patch an upstream discovery document in discovery/ (for example, to work around an upstream schema bug in discovery/googleapis/places__v1.json), edit the <api>__<version>.json file under discovery/ and write the unified diff to overrides/:
$ git diff discovery/<package>/<api>__<version>.json > overrides/<name>.diff
When the override corresponds to a GitHub issue, name the diff after the issue number (for example, overrides/i123.diff). ./tool/download.sh automatically applies all overrides/*.diff patches with git apply.