Mark a number of libraries deprecated
diff --git a/config.yaml b/config.yaml index ae24e71..6e303c2 100644 --- a/config.yaml +++ b/config.yaml
@@ -332,6 +332,17 @@ - youtube:v3 - youtubeAnalytics:v2 - youtubereporting:v1 # https://developers.google.com/youtube/reporting/v1/reports/ + deprecation_map: + cloudfunctions:v1: google_cloud_functions_v2 + cloudfunctions:v2: google_cloud_functions_v2 + iam:v1: google_cloud_iam_v1 + iam:v2: google_cloud_iam_v1 + iamcredentials:v1: google_cloud_iam_v1 + language:v1: google_cloud_language_v2 + language:v2: google_cloud_language_v2 + logging:v2: google_cloud_logging_v2 + secretmanager:v1: google_cloud_secretmanager_v1 + storage:v1: google_cloud_storage googleapis_beta: version: 9.1.0-wip
diff --git a/discoveryapis_generator/lib/discoveryapis_generator.dart b/discoveryapis_generator/lib/discoveryapis_generator.dart index 0285d98..e86c1b9 100644 --- a/discoveryapis_generator/lib/discoveryapis_generator.dart +++ b/discoveryapis_generator/lib/discoveryapis_generator.dart
@@ -24,6 +24,7 @@ Pubspec pubspec, { bool deleteExisting = true, required Set<String> skipTests, + Map<String, String> deprecationMap = const {}, }) { final apisPackageGenerator = ApisPackageGenerator( descriptions, @@ -31,6 +32,7 @@ outputDirectory, deleteExisting: deleteExisting, skipTests: skipTests, + deprecationMap: deprecationMap, ); return apisPackageGenerator.generateApiPackage(); @@ -42,6 +44,7 @@ Pubspec pubspec, { bool deleteExisting = true, required Set<String> skipTests, + Map<String, String> deprecationMap = const {}, }) { final apiDescriptions = Directory(inputDirectory) .listSync() @@ -59,6 +62,7 @@ pubspec, deleteExisting: deleteExisting, skipTests: skipTests, + deprecationMap: deprecationMap, ); }
diff --git a/discoveryapis_generator/lib/src/apis_package_generator.dart b/discoveryapis_generator/lib/src/apis_package_generator.dart index 4d0fa44..822c133 100644 --- a/discoveryapis_generator/lib/src/apis_package_generator.dart +++ b/discoveryapis_generator/lib/src/apis_package_generator.dart
@@ -34,6 +34,7 @@ final Pubspec pubspec; final bool deleteExisting; final Set<String> skipTests; + final Map<String, String> deprecationMap; /// [descriptions] is a list of API descriptions we want to generate code for. /// @@ -48,6 +49,7 @@ this.packageFolderPath, { this.deleteExisting = true, required this.skipTests, + this.deprecationMap = const {}, }); /// Starts generating the API package with all the APIs given in the @@ -113,7 +115,11 @@ try { // Create API itself. Directory(apiFolderPath).createSync(); - final apiLibrary = _generateApiLibrary(apiVersionFile, description); + final apiLibrary = _generateApiLibrary( + apiVersionFile, + description, + deprecationTargetPackage: deprecationMap[description.id], + ); // Create Test for API. Directory(apiTestFolderPath).createSync(); @@ -167,9 +173,14 @@ DartApiLibrary _generateApiLibrary( String outputFile, - RestDescription description, - ) => libraryDeduplicateLogic(() { - final lib = DartApiLibrary.build(description, isPackage: true); + RestDescription description, { + String? deprecationTargetPackage, + }) => libraryDeduplicateLogic(() { + final lib = DartApiLibrary.build( + description, + isPackage: true, + deprecationTargetPackage: deprecationTargetPackage, + ); writeDartSource(outputFile, lib.librarySource); return lib; });
diff --git a/discoveryapis_generator/lib/src/dart_api_library.dart b/discoveryapis_generator/lib/src/dart_api_library.dart index 53362f6..0db5d20 100644 --- a/discoveryapis_generator/lib/src/dart_api_library.dart +++ b/discoveryapis_generator/lib/src/dart_api_library.dart
@@ -82,12 +82,14 @@ final bool isPackage; late final bool exposeMedia; late final String libraryName; + final String? deprecationTargetPackage; /// Generates a API library for [description]. DartApiLibrary.build( RestDescription description, { required this.isPackage, super.useCorePrefixes, + this.deprecationTargetPackage, }) : super(description, 'Api') { libraryName = ApiLibraryNamer.libraryName( description.name, @@ -114,8 +116,31 @@ apiClass, ).asDartDoc(0).trim(); + if (deprecationTargetPackage != null) { + final warningBlock = + ''' +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:$deprecationTargetPackage`](https://pub.dev/packages/$deprecationTargetPackage) +/// > instead. +///'''; + if (libraryComments.isEmpty) { + libraryComments = warningBlock; + } else { + libraryComments = '$warningBlock\n$libraryComments'; + } + } + if (libraryComments.isNotEmpty) { - libraryComments = '$libraryComments\nlibrary;'; + if (deprecationTargetPackage != null) { + libraryComments = + '$libraryComments\n' + '@${imports.core.ref()}Deprecated(' + '\'Use package:$deprecationTargetPackage\')\n' + 'library;'; + } else { + libraryComments = '$libraryComments\nlibrary;'; + } } final result = [
diff --git a/generated/googleapis/README.md b/generated/googleapis/README.md index eb20fd9..7af436e 100644 --- a/generated/googleapis/README.md +++ b/generated/googleapis/README.md
@@ -22,7 +22,7 @@ #### Accelerated Mobile Pages (AMP) URL API - `acceleratedmobilepageurl/v1` -Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s). +Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s). - [Original documentation](https://developers.google.com/amp/cache/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/acceleratedmobilepageurl_v1/acceleratedmobilepageurl_v1-library.html) @@ -78,7 +78,7 @@ #### AdMob API - `admob/v1` -The AdMob API allows publishers to programmatically get information about their AdMob account. +The AdMob API allows publishers to programmatically get information about their AdMob account. - [Original documentation](https://developers.google.com/admob/api/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/admob_v1/admob_v1-library.html) @@ -118,7 +118,7 @@ #### AlloyDB API - `alloydb/v1` -AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. +AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. - [Original documentation](https://cloud.google.com/alloydb/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/alloydb_v1/alloydb_v1-library.html) @@ -160,7 +160,7 @@ #### Google Play Android Developer API - `androidpublisher/v3` -Lets Android application developers access their Google Play accounts. At a high level, the expected workflow is to "insert" an Edit, make changes as necessary, and then "commit" it. +Lets Android application developers access their Google Play accounts. At a high level, the expected workflow is to "insert" an Edit, make changes as necessary, and then "commit" it. - [Original documentation](https://developers.google.com/android-publisher) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/androidpublisher_v3/androidpublisher_v3-library.html) @@ -210,7 +210,7 @@ #### Google Workspace Marketplace API - `appsmarket/v2` -Lets your Google Workspace Marketplace applications integrate with Google's installtion and licensing services. +Lets your Google Workspace Marketplace applications integrate with Google's installtion and licensing services. - [Original documentation](https://developers.google.com/workspace/marketplace) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/appsmarket_v2/appsmarket_v2-library.html) @@ -332,7 +332,7 @@ #### Binary Authorization API - `binaryauthorization/v1` -The management interface for Binary Authorization, a service that provides policy-based deployment validation and control for images deployed to Google Kubernetes Engine (GKE), Anthos Service Mesh, Anthos Clusters, and Cloud Run. +The management interface for Binary Authorization, a service that provides policy-based deployment validation and control for images deployed to Google Kubernetes Engine (GKE), Anthos Service Mesh, Anthos Clusters, and Cloud Run. - [Original documentation](https://cloud.google.com/binary-authorization/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/binaryauthorization_v1/binaryauthorization_v1-library.html) @@ -403,7 +403,7 @@ #### Chrome UX Report API - `chromeuxreport/v1` -The Chrome UX Report API lets you view real user experience data for millions of websites. +The Chrome UX Report API lets you view real user experience data for millions of websites. - [Original documentation](https://developers.google.com/web/tools/chrome-user-experience-report/api/reference) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/chromeuxreport_v1/chromeuxreport_v1-library.html) @@ -492,6 +492,11 @@ #### Cloud Functions API - `cloudfunctions/v1` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_functions_v2`](https://pub.dev/packages/google_cloud_functions_v2) +> instead. + Manages lightweight user-provided functions executed in response to events. - [Original documentation](https://cloud.google.com/functions) @@ -499,6 +504,11 @@ #### Cloud Functions API - `cloudfunctions/v2` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_functions_v2`](https://pub.dev/packages/google_cloud_functions_v2) +> instead. + Manages lightweight user-provided functions executed in response to events. - [Original documentation](https://cloud.google.com/functions) @@ -513,7 +523,7 @@ #### Cloud Key Management Service (KMS) API - `cloudkms/v1` -Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. +Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. - [Original documentation](https://cloud.google.com/kms/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/cloudkms_v1/cloudkms_v1-library.html) @@ -567,14 +577,14 @@ #### Cloud Shell API - `cloudshell/v1` -Allows users to start, configure, and connect to interactive shell sessions running in the cloud. +Allows users to start, configure, and connect to interactive shell sessions running in the cloud. - [Original documentation](https://cloud.google.com/shell/docs/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/cloudshell_v1/cloudshell_v1-library.html) #### Google Cloud Support API - `cloudsupport/v2` -Manages Google Cloud technical support cases for Customer Care support offerings. +Manages Google Cloud technical support cases for Customer Care support offerings. - [Original documentation](https://cloud.google.com/support/docs/apis) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/cloudsupport_v2/cloudsupport_v2-library.html) @@ -588,7 +598,7 @@ #### Cloud Trace API - `cloudtrace/v2` -Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenTelemetry. +Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenTelemetry. - [Original documentation](https://cloud.google.com/trace/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/cloudtrace_v2/cloudtrace_v2-library.html) @@ -649,7 +659,7 @@ #### Content API for Shopping - `content/v2_1` -This API is deprecated. Please use Merchant API instead: https://developers.google.com/merchant/api. +This API is deprecated. Please use Merchant API instead: https://developers.google.com/merchant/api. - [Original documentation](https://developers.google.com/shopping-content/v2/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/content_v2_1/content_v2_1-library.html) @@ -675,7 +685,7 @@ #### Google Cloud Data Catalog API - `datacatalog/v1` -A fully managed and highly scalable data discovery and metadata management service. +A fully managed and highly scalable data discovery and metadata management service. - [Original documentation](https://cloud.google.com/data-catalog/docs/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/datacatalog_v1/datacatalog_v1-library.html) @@ -743,7 +753,7 @@ #### Cloud Datastore API - `datastore/v1` -Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. +Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. - [Original documentation](https://cloud.google.com/datastore/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/datastore_v1/datastore_v1-library.html) @@ -959,7 +969,7 @@ #### Firebase App Hosting API - `firebaseapphosting/v1` -Firebase App Hosting streamlines the development and deployment of dynamic Next.js and Angular applications, offering built-in framework support, GitHub integration, and integration with other Firebase products. You can use this API to intervene in the Firebase App Hosting build process and add custom functionality not supported in our default Console & CLI flows, including triggering builds from external CI/CD workflows or deploying from pre-built container images. +Firebase App Hosting streamlines the development and deployment of dynamic Next.js and Angular applications, offering built-in framework support, GitHub integration, and integration with other Firebase products. You can use this API to intervene in the Firebase App Hosting build process and add custom functionality not supported in our default Console & CLI flows, including triggering builds from external CI/CD workflows or deploying from pre-built container images. - [Original documentation](https://firebase.google.com/docs/app-hosting) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/firebaseapphosting_v1/firebaseapphosting_v1-library.html) @@ -994,14 +1004,14 @@ #### Firebase Rules API - `firebaserules/v1` -Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request. +Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request. - [Original documentation](https://firebase.google.com/docs/storage/security) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/firebaserules_v1/firebaserules_v1-library.html) #### Cloud Firestore API - `firestore/v1` -Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. +Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. - [Original documentation](https://cloud.google.com/firestore) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/firestore_v1/firestore_v1-library.html) @@ -1126,21 +1136,36 @@ #### Identity and Access Management (IAM) API - `iam/v1` -Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +> instead. + +Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. - [Original documentation](https://cloud.google.com/iam/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/iam_v1/iam_v1-library.html) #### Identity and Access Management (IAM) API - `iam/v2` -Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +> instead. + +Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. - [Original documentation](https://cloud.google.com/iam/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/iam_v2/iam_v2-library.html) #### IAM Service Account Credentials API - `iamcredentials/v1` -Creates short-lived credentials for impersonating IAM service accounts. Disabling this API also disables the IAM API (iam.googleapis.com). However, enabling this API doesn't enable the IAM API. +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +> instead. + +Creates short-lived credentials for impersonating IAM service accounts. Disabling this API also disables the IAM API (iam.googleapis.com). However, enabling this API doesn't enable the IAM API. - [Original documentation](https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/iamcredentials_v1/iamcredentials_v1-library.html) @@ -1194,14 +1219,14 @@ #### Cloud Talent Solution API - `jobs/v3` -Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. +Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. - [Original documentation](https://cloud.google.com/talent-solution/job-search/docs/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/jobs_v3/jobs_v3-library.html) #### Cloud Talent Solution API - `jobs/v4` -Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. +Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. - [Original documentation](https://cloud.google.com/talent-solution/job-search/docs/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/jobs_v4/jobs_v4-library.html) @@ -1227,6 +1252,11 @@ #### Cloud Natural Language API - `language/v1` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_language_v2`](https://pub.dev/packages/google_cloud_language_v2) +> instead. + Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers. - [Original documentation](https://cloud.google.com/natural-language/) @@ -1234,6 +1264,11 @@ #### Cloud Natural Language API - `language/v2` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_language_v2`](https://pub.dev/packages/google_cloud_language_v2) +> instead. + Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers. - [Original documentation](https://cloud.google.com/natural-language/) @@ -1260,6 +1295,11 @@ #### Cloud Logging API - `logging/v2` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_logging_v2`](https://pub.dev/packages/google_cloud_logging_v2) +> instead. + Writes log entries and manages your Cloud Logging configuration. - [Original documentation](https://cloud.google.com/logging/docs/) @@ -1279,7 +1319,7 @@ #### Managed Service for Apache Kafka API - `managedkafka/v1` -Manage Apache Kafka clusters and resources. +Manage Apache Kafka clusters and resources. - [Original documentation](https://cloud.google.com/managed-service-for-apache-kafka/docs) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/managedkafka_v1/managedkafka_v1-library.html) @@ -1569,7 +1609,7 @@ #### PageSpeed Insights API - `pagespeedonline/v5` -The PageSpeed Insights API lets you analyze the performance of your website with a simple API. It offers tailored suggestions for how you can optimize your site, and lets you easily integrate PageSpeed Insights analysis into your development tools and workflow. +The PageSpeed Insights API lets you analyze the performance of your website with a simple API. It offers tailored suggestions for how you can optimize your site, and lets you easily integrate PageSpeed Insights analysis into your development tools and workflow. - [Original documentation](https://developers.google.com/speed/docs/insights/v5/about) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/pagespeedonline_v5/pagespeedonline_v5-library.html) @@ -1641,28 +1681,28 @@ #### Pollen API - `pollen/v1` -The Pollen API. +The Pollen API. - [Original documentation](https://developers.google.com/maps/documentation/pollen) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/pollen_v1/pollen_v1-library.html) #### Certificate Authority API - `privateca/v1` -The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys. +The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys. - [Original documentation](https://cloud.google.com/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/privateca_v1/privateca_v1-library.html) #### Public Certificate Authority API - `publicca/v1` -The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. +The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. - [Original documentation](https://cloud.google.com/public-certificate-authority/docs) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/publicca_v1/publicca_v1-library.html) #### Cloud Pub/Sub API - `pubsub/v1` -Provides reliable, many-to-many, asynchronous messaging between applications. +Provides reliable, many-to-many, asynchronous messaging between applications. - [Original documentation](https://cloud.google.com/pubsub/docs) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/pubsub_v1/pubsub_v1-library.html) @@ -1749,7 +1789,7 @@ #### App Lifecycle Manager API - `saasservicemgmt/v1` -Model, deploy, and operate your SaaS at scale. +Model, deploy, and operate your SaaS at scale. - [Original documentation](https://cloud.google.com/saas-runtime/docs) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/saasservicemgmt_v1/saasservicemgmt_v1-library.html) @@ -1770,7 +1810,7 @@ #### Apps Script API - `script/v1` -Manages and executes Google Apps Script projects. +Manages and executes Google Apps Script projects. - [Original documentation](https://developers.google.com/apps-script/api/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/script_v1/script_v1-library.html) @@ -1784,7 +1824,12 @@ #### Secret Manager API - `secretmanager/v1` -Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_secretmanager_v1`](https://pub.dev/packages/google_cloud_secretmanager_v1) +> instead. + +Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. - [Original documentation](https://cloud.google.com/secret-manager/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/secretmanager_v1/secretmanager_v1-library.html) @@ -1805,7 +1850,7 @@ #### Security Posture API - `securityposture/v1` -Defines, assesses, and monitors the overall status of your security in Google Cloud. You can use security postures to evaluate your current cloud security against defined benchmarks and help maintain the level of security that your organization requires. +Defines, assesses, and monitors the overall status of your security in Google Cloud. You can use security postures to evaluate your current cloud security against defined benchmarks and help maintain the level of security that your organization requires. - [Original documentation](https://cloud.google.com/security-command-center) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/securityposture_v1/securityposture_v1-library.html) @@ -1819,21 +1864,21 @@ #### Service Control API - `servicecontrol/v1` -Provides admission control and telemetry reporting for services integrated with Service Infrastructure. +Provides admission control and telemetry reporting for services integrated with Service Infrastructure. - [Original documentation](https://cloud.google.com/service-control/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/servicecontrol_v1/servicecontrol_v1-library.html) #### Service Control API - `servicecontrol/v2` -Provides admission control and telemetry reporting for services integrated with Service Infrastructure. +Provides admission control and telemetry reporting for services integrated with Service Infrastructure. - [Original documentation](https://cloud.google.com/service-control/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/servicecontrol_v2/servicecontrol_v2-library.html) #### Service Directory API - `servicedirectory/v1` -Service Directory is a platform for discovering, publishing, and connecting services. +Service Directory is a platform for discovering, publishing, and connecting services. - [Original documentation](https://cloud.google.com/service-directory) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/servicedirectory_v1/servicedirectory_v1-library.html) @@ -1910,6 +1955,11 @@ ####  Cloud Storage JSON API - `storage/v1` +> [!WARNING] +> This API is deprecated. Use +> [`package:google_cloud_storage`](https://pub.dev/packages/google_cloud_storage) +> instead. + Stores and retrieves potentially large, immutable data objects. - [Original documentation](https://developers.google.com/storage/docs/json_api/) @@ -1922,14 +1972,14 @@ #### Storage Transfer API - `storagetransfer/v1` -Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets. +Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets. - [Original documentation](https://cloud.google.com/storage-transfer/docs) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/storagetransfer_v1/storagetransfer_v1-library.html) #### Street View Publish API - `streetviewpublish/v1` -Publishes 360 photos to Google Maps, along with position, orientation, and connectivity metadata. Apps can offer an interface for positioning, connecting, and uploading user-generated Street View images. +Publishes 360 photos to Google Maps, along with position, orientation, and connectivity metadata. Apps can offer an interface for positioning, connecting, and uploading user-generated Street View images. - [Original documentation](https://developers.google.com/streetview/publish/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/streetviewpublish_v1/streetviewpublish_v1-library.html) @@ -2002,7 +2052,7 @@ #### Transcoder API - `transcoder/v1` -This API converts video files into formats suitable for consumer distribution. For more information, see the Transcoder API overview. +This API converts video files into formats suitable for consumer distribution. For more information, see the Transcoder API overview. - [Original documentation](https://cloud.google.com/transcoder/docs/) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/transcoder_v1/transcoder_v1-library.html) @@ -2023,7 +2073,7 @@ #### Google Vault API - `vault/v1` -Retention and eDiscovery for Google Workspace. To work with Vault resources, the account must have the [required Vault privileges](https://support.google.com/vault/answer/2799699) and access to the matter. To access a matter, the account must have created the matter, have the matter shared with them, or have the **View All Matters** privilege. For example, to download an export, an account needs the **Manage Exports** privilege and the matter shared with them. +Retention and eDiscovery for Google Workspace. To work with Vault resources, the account must have the [required Vault privileges](https://support.google.com/vault/answer/2799699) and access to the matter. To access a matter, the account must have created the matter, have the matter shared with them, or have the **View All Matters** privilege. For example, to download an export, an account needs the **Manage Exports** privilege and the matter shared with them. - [Original documentation](https://developers.google.com/workspace/vault) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/vault_v1/vault_v1-library.html) @@ -2065,7 +2115,7 @@ #### VM Migration API - `vmmigration/v1` -Use the Migrate to Virtual Machines API to programmatically migrate workloads. +Use the Migrate to Virtual Machines API to programmatically migrate workloads. - [Original documentation](https://cloud.google.com/migrate/virtual-machines) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/vmmigration_v1/vmmigration_v1-library.html) @@ -2140,7 +2190,7 @@ #### Cloud Workstations API - `workstations/v1` -Allows administrators to create managed developer environments in the cloud. +Allows administrators to create managed developer environments in the cloud. - [Original documentation](https://cloud.google.com/workstations) - [Dart package details](https://pub.dev/documentation/googleapis/17.0.0-wip/workstations_v1/workstations_v1-library.html)
diff --git a/generated/googleapis/example/main.dart b/generated/googleapis/example/main.dart index 6946ab9..2983dcf 100644 --- a/generated/googleapis/example/main.dart +++ b/generated/googleapis/example/main.dart
@@ -9,6 +9,7 @@ // For details of how to use this package in Flutter, see // https://flutter.dev/docs/development/data-and-backend/google-apis +// ignore: deprecated_member_use import 'package:googleapis/storage/v1.dart'; import 'package:googleapis_auth/auth_io.dart';
diff --git a/generated/googleapis/lib/cloudfunctions/v1.dart b/generated/googleapis/lib/cloudfunctions/v1.dart index afb62b3..aced8d0 100644 --- a/generated/googleapis/lib/cloudfunctions/v1.dart +++ b/generated/googleapis/lib/cloudfunctions/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_functions_v2`](https://pub.dev/packages/google_cloud_functions_v2) +/// > instead. +/// /// Cloud Functions API - v1 /// /// Manages lightweight user-provided functions executed in response to events. @@ -30,6 +35,7 @@ /// - [ProjectsResource] /// - [ProjectsLocationsResource] /// - [ProjectsLocationsFunctionsResource] +@core.Deprecated('Use package:google_cloud_functions_v2') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/cloudfunctions/v2.dart b/generated/googleapis/lib/cloudfunctions/v2.dart index 002c7b0..14e0c70 100644 --- a/generated/googleapis/lib/cloudfunctions/v2.dart +++ b/generated/googleapis/lib/cloudfunctions/v2.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_functions_v2`](https://pub.dev/packages/google_cloud_functions_v2) +/// > instead. +/// /// Cloud Functions API - v2 /// /// Manages lightweight user-provided functions executed in response to events. @@ -31,6 +36,7 @@ /// - [ProjectsLocationsFunctionsResource] /// - [ProjectsLocationsOperationsResource] /// - [ProjectsLocationsRuntimesResource] +@core.Deprecated('Use package:google_cloud_functions_v2') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/iam/v1.dart b/generated/googleapis/lib/iam/v1.dart index a3f4b92..43e0e17 100644 --- a/generated/googleapis/lib/iam/v1.dart +++ b/generated/googleapis/lib/iam/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +/// > instead. +/// /// Identity and Access Management (IAM) API - v1 /// /// Manages identity and access control for Google Cloud resources, including @@ -69,6 +74,7 @@ /// - [ProjectsServiceAccountsResource] /// - [ProjectsServiceAccountsKeysResource] /// - [RolesResource] +@core.Deprecated('Use package:google_cloud_iam_v1') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/iam/v2.dart b/generated/googleapis/lib/iam/v2.dart index eedd0bf..1395fb3 100644 --- a/generated/googleapis/lib/iam/v2.dart +++ b/generated/googleapis/lib/iam/v2.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +/// > instead. +/// /// Identity and Access Management (IAM) API - v2 /// /// Manages identity and access control for Google Cloud resources, including @@ -32,6 +37,7 @@ /// /// - [PoliciesResource] /// - [PoliciesOperationsResource] +@core.Deprecated('Use package:google_cloud_iam_v1') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/iamcredentials/v1.dart b/generated/googleapis/lib/iamcredentials/v1.dart index 5d4f299..159d488 100644 --- a/generated/googleapis/lib/iamcredentials/v1.dart +++ b/generated/googleapis/lib/iamcredentials/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_iam_v1`](https://pub.dev/packages/google_cloud_iam_v1) +/// > instead. +/// /// IAM Service Account Credentials API - v1 /// /// Creates short-lived credentials for impersonating IAM service accounts. @@ -35,6 +40,7 @@ /// - [ProjectsLocationsResource] /// - [ProjectsLocationsWorkloadIdentityPoolsResource] /// - [ProjectsServiceAccountsResource] +@core.Deprecated('Use package:google_cloud_iam_v1') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/language/v1.dart b/generated/googleapis/lib/language/v1.dart index 88f604c..ef2c9db 100644 --- a/generated/googleapis/lib/language/v1.dart +++ b/generated/googleapis/lib/language/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_language_v2`](https://pub.dev/packages/google_cloud_language_v2) +/// > instead. +/// /// Cloud Natural Language API - v1 /// /// Provides natural language understanding technologies, such as sentiment @@ -29,6 +34,7 @@ /// Create an instance of [CloudNaturalLanguageApi] to access these resources: /// /// - [DocumentsResource] +@core.Deprecated('Use package:google_cloud_language_v2') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/language/v2.dart b/generated/googleapis/lib/language/v2.dart index 00cf443..f2a1db5 100644 --- a/generated/googleapis/lib/language/v2.dart +++ b/generated/googleapis/lib/language/v2.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_language_v2`](https://pub.dev/packages/google_cloud_language_v2) +/// > instead. +/// /// Cloud Natural Language API - v2 /// /// Provides natural language understanding technologies, such as sentiment @@ -29,6 +34,7 @@ /// Create an instance of [CloudNaturalLanguageApi] to access these resources: /// /// - [DocumentsResource] +@core.Deprecated('Use package:google_cloud_language_v2') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/logging/v2.dart b/generated/googleapis/lib/logging/v2.dart index ef5f884..d222cce 100644 --- a/generated/googleapis/lib/logging/v2.dart +++ b/generated/googleapis/lib/logging/v2.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_logging_v2`](https://pub.dev/packages/google_cloud_logging_v2) +/// > instead. +/// /// Cloud Logging API - v2 /// /// Writes log entries and manages your Cloud Logging configuration. @@ -89,6 +94,7 @@ /// - [ProjectsSinksResource] /// - [SinksResource] /// - [V2Resource] +@core.Deprecated('Use package:google_cloud_logging_v2') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/secretmanager/v1.dart b/generated/googleapis/lib/secretmanager/v1.dart index cc7bf28..ba7395d 100644 --- a/generated/googleapis/lib/secretmanager/v1.dart +++ b/generated/googleapis/lib/secretmanager/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_secretmanager_v1`](https://pub.dev/packages/google_cloud_secretmanager_v1) +/// > instead. +/// /// Secret Manager API - v1 /// /// Stores sensitive data such as API keys, passwords, and certificates. @@ -33,6 +38,7 @@ /// - [ProjectsLocationsSecretsVersionsResource] /// - [ProjectsSecretsResource] /// - [ProjectsSecretsVersionsResource] +@core.Deprecated('Use package:google_cloud_secretmanager_v1') library; import 'dart:async' as async;
diff --git a/generated/googleapis/lib/storage/v1.dart b/generated/googleapis/lib/storage/v1.dart index a7ae307..ac0521f 100644 --- a/generated/googleapis/lib/storage/v1.dart +++ b/generated/googleapis/lib/storage/v1.dart
@@ -18,6 +18,11 @@ // ignore_for_file: unnecessary_lambdas // ignore_for_file: unnecessary_string_interpolations +/// > [!WARNING] +/// > This API is deprecated. Use +/// > [`package:google_cloud_storage`](https://pub.dev/packages/google_cloud_storage) +/// > instead. +/// /// Cloud Storage JSON API - v1 /// /// Stores and retrieves potentially large, immutable data objects. @@ -41,6 +46,7 @@ /// - [ProjectsResource] /// - [ProjectsHmacKeysResource] /// - [ProjectsServiceAccountResource] +@core.Deprecated('Use package:google_cloud_storage') library; import 'dart:async' as async;
diff --git a/generated/googleapis_beta/README.md b/generated/googleapis_beta/README.md index d85ac9e..800ad7a 100644 --- a/generated/googleapis_beta/README.md +++ b/generated/googleapis_beta/README.md
@@ -22,7 +22,7 @@ #### Google Workspace Alert Center API - `alertcenter/v1beta1` -Manages alerts on issues affecting your domain. Note: The current version of this API (v1beta1) is available to all Google Workspace customers. +Manages alerts on issues affecting your domain. Note: The current version of this API (v1beta1) is available to all Google Workspace customers. - [Original documentation](https://developers.google.com/workspace/admin/alertcenter/) - [Dart package details](https://pub.dev/documentation/googleapis_beta/9.1.0-wip/alertcenter_v1beta1/alertcenter_v1beta1-library.html) @@ -43,7 +43,7 @@ #### Google Analytics Data API - `analyticsdata/v1beta` -Accesses report data in Google Analytics. Warning: Creating multiple Customer Applications, Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively) or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination of your GCP project(s) without any warning. +Accesses report data in Google Analytics. Warning: Creating multiple Customer Applications, Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively) or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination of your GCP project(s) without any warning. - [Original documentation](https://developers.google.com/analytics/devguides/reporting/data/v1/) - [Dart package details](https://pub.dev/documentation/googleapis_beta/9.1.0-wip/analyticsdata_v1beta/analyticsdata_v1beta-library.html) @@ -57,14 +57,14 @@ #### Error Reporting API - `clouderrorreporting/v1beta1` -Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors. +Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors. - [Original documentation](https://cloud.google.com/error-reporting/) - [Dart package details](https://pub.dev/documentation/googleapis_beta/9.1.0-wip/clouderrorreporting_v1beta1/clouderrorreporting_v1beta1-library.html) #### Google Cloud Support API - `cloudsupport/v2beta` -Manages Google Cloud technical support cases for Customer Care support offerings. +Manages Google Cloud technical support cases for Customer Care support offerings. - [Original documentation](https://cloud.google.com/support/docs/apis) - [Dart package details](https://pub.dev/documentation/googleapis_beta/9.1.0-wip/cloudsupport_v2beta/cloudsupport_v2beta-library.html)
diff --git a/generator/lib/src/package_configuration.dart b/generator/lib/src/package_configuration.dart index 2914a8a..6158d9f 100644 --- a/generator/lib/src/package_configuration.dart +++ b/generator/lib/src/package_configuration.dart
@@ -26,6 +26,7 @@ final String changelog; final String? example; final String? monoPkg; + final Map<String, String> deprecationMap; Package( this.name, @@ -36,6 +37,7 @@ this.changelog, this.example, this.monoPkg, + this.deprecationMap, ); } @@ -247,6 +249,7 @@ package.pubspec, deleteExisting: deleteExisting, skipTests: skipTests, + deprecationMap: package.deprecationMap, ); for (final result in results) { if (!result.success) { @@ -322,15 +325,16 @@ String packageName, List<RestDescription?> items, { String? packageVersion, + Map<String, String> deprecationMap = const {}, }) { final sb = StringBuffer(); if (readmeFile != null) { sb.write(File(readmeFile).readAsStringSync()); } sb.writeln(''' - + ## Available Google APIs - + The following is a list of APIs that are currently available inside this package. '''); @@ -347,6 +351,16 @@ ..writeln('${item.title} - `$libraryName`') ..writeln(); + final deprecationTarget = deprecationMap[item.id]; + if (deprecationTarget != null) { + sb.writeln(''' +> [!WARNING] +> This API is deprecated. Use +> [`package:$deprecationTarget`](https://pub.dev/packages/$deprecationTarget) +> instead. +'''); + } + if (item.description != null && item.description!.isNotEmpty) { sb ..writeln(item.description) @@ -367,7 +381,7 @@ } sb.writeln(); } - return sb.toString(); + return sb.toString().split('\n').map((line) => line.trimRight()).join('\n'); } static Map<String, Package> _packagesFromYaml( @@ -406,6 +420,14 @@ .cast<String, String>(); } + final deprecationMap = <String, String>{}; + if (values.containsKey('deprecation_map')) { + final map = values['deprecation_map'] as YamlMap; + map.forEach((key, value) { + deprecationMap[key as String] = value as String; + }); + } + final configUri = Uri.file(configFile); allApis.sort((RestDescription? a, RestDescription? b) { @@ -455,6 +477,7 @@ name, apiDescriptions, packageVersion: version, + deprecationMap: deprecationMap, ); // Read the LICENSE @@ -482,6 +505,7 @@ changelog, example, monoPkg, + deprecationMap, ); }
diff --git a/resources/googleapis/examples/main.dart b/resources/googleapis/examples/main.dart index 6946ab9..2983dcf 100644 --- a/resources/googleapis/examples/main.dart +++ b/resources/googleapis/examples/main.dart
@@ -9,6 +9,7 @@ // For details of how to use this package in Flutter, see // https://flutter.dev/docs/development/data-and-backend/google-apis +// ignore: deprecated_member_use import 'package:googleapis/storage/v1.dart'; import 'package:googleapis_auth/auth_io.dart';
diff --git a/test_integration/test/storage_test.dart b/test_integration/test/storage_test.dart index a2da81e..87808fa 100644 --- a/test_integration/test/storage_test.dart +++ b/test_integration/test/storage_test.dart
@@ -7,6 +7,7 @@ import 'dart:async'; import 'dart:math'; +// ignore: deprecated_member_use import 'package:googleapis/storage/v1.dart'; import 'package:test/test.dart'; import 'package:test_integration/test_integration.dart';