- googleapisとは
- 使い方
- googleapisとは
- 使い方
- Binary Authorization
- Blockchain Node Engine API – blockchainnodeengine/v1
- Blogger API – blogger/v3
- Books API – books/v1
- Business Profile Performance API – businessprofileperformance/v1
- Calendar API – calendar/v3
- Certificate Manager API – certificatemanager/v1
- Google Chat API – chat/v1
- Chrome Management API – chromemanagement/v1
- Chrome Policy API – chromepolicy/v1
- Chrome UX Report API – chromeuxreport/v1
- Google Civic Information API – civicinfo/v2
- Google Classroom API – classroom/v1
- Cloud Asset API – cloudasset/v1
- Cloud Billing API – cloudbilling/v1
- Cloud Build API – cloudbuild/v1
- Cloud Build API – cloudbuild/v2
- Cloud Channel API – cloudchannel/v1
- Cloud Commerce Partner Procurement API – cloudcommerceprocurement/v1
- Cloud Controls Partner API – cloudcontrolspartner/v1
- Cloud Deploy API – clouddeploy/v1
- Cloud Deployment Manager API – deploymentmanager/v2
- Cloud Document AI API – documentai/v1
- Cloud Domains API – domains/v1
- Cloud Functions API – cloudfunctions/v1
- Cloud Functions API – cloudfunctions/v2
- Cloud Talent Solution – jobs/v3
- Google Keep API – keep/v1
- Knowledge Graph Search API – kgsearch/v1
- KMS Inventory API – kmsinventory/v1
- Cloud Natural Language API – language/v1
- Cloud Natural Language API – language/v2
- Library Agent API – libraryagent/v1
- Enterprise License Manager API – licensing/v1
- Local Services API – localservices/v1
- Cloud Logging API – logging/v2
- Looker (Google Cloud core) API – looker/v1
- Managed Service for Microsoft Active Directory API – managedidentities/v1
- Manufacturer Center API – manufacturers/v1
- Cloud Memorystore for Memcached API – memcache/v1
- Dataproc Metastore API – metastore/v1
- Migration Center API – migrationcenter/v1
- AI Platform Training & Prediction API – ml/v1
- Cloud Monitoring API – monitoring/v3
- My Business Account Management API – mybusinessaccountmanagement/v1
- My Business Business Information API – mybusinessbusinessinformation/v1
- My Business Lodging API – mybusinesslodging/v1
- My Business Notifications API – mybusinessnotifications/v1
- My Business Place Actions API – mybusinessplaceactions/v1
- My Business Q&A API – mybusinessqanda/v1
googleapisとは
googleapis
は、GoogleのAPIをDartとFlutterアプリケーションで利用するためのパッケージです。
Googleのさまざまなサービス(例えば、Google Drive、Google Sheets、Google Cloud Storageなど)にアクセスし、操作を行うことができます。
使い方
インストール
dependencies:
googleapis: ^13.2.0
googleapis_auth: ^1.0.0
認証の設定
Google APIを使用するには認証が必要です。以下の手順で認証を設定します。
- Google Cloud Consoleにアクセスし、プロジェクトを作成または選択します。
- 「APIとサービス」セクションで「認証情報」を選択し、新しいOAuth 2.0 クライアントIDを作成します。
- クライアントIDとクライアントシークレットを取得します。
使用例
以下にGoogle Drive APIを使用する例を示します。
import 'package:googleapis/drive/v3.dart' as drive;
import 'package:googleapis_auth/auth_io.dart';
void main() async {
final _clientId = ClientId("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
final _scopes = [drive.DriveApi.driveScope];
await clientViaUserConsent(_clientId, _scopes, (url) {
print("Please go to the following URL and grant access:");
print(" => $url");
print("");
}).then((AuthClient client) async {
var driveApi = drive.DriveApi(client);
// ファイルのリストを取得
var fileList = await driveApi.files.list();
fileList.files?.forEach((file) {
print('Found file: ${file.name} (${file.id})');
});
client.close();
});
}
パラメータの説明
- ClientId:
- clientId: Google Cloud Consoleで取得したクライアントIDを指定します。
- clientSecret: Google Cloud Consoleで取得したクライアントシークレットを指定します。
- Scopes:
- driveScope: Google Drive APIにアクセスするためのスコープです。必要なスコープに応じて変更します。
- clientViaUserConsent:
- _clientId: 認証に使用するクライアントIDを指定します。
- _scopes: アクセスするAPIのスコープを指定します。
- urlCallback: 認証URLをユーザーに表示するためのコールバック関数です。
- DriveApi:
- files.list(): Google Driveに保存されているファイルのリストを取得します。
これで、FlutterアプリケーションからGoogle APIを利用する準備が整いました。必要に応じて、他のGoogle API(例えば、Google Sheets APIやGoogle Cloud Storage API)も同様に利用できます。
googleapisとは
googleapis
は、GoogleのAPIをDartとFlutterアプリケーションで利用するためのパッケージです。このパッケージを使用すると、Googleのさまざまなサービス(例えば、Google Drive、Google Sheets、Google Cloud Storageなど)にアクセスし、操作を行うことができます。
使い方
インストール
まず、pubspec.yaml
ファイルにgoogleapis
パッケージを追加します。
dependencies:
googleapis: ^13.2.0
googleapis_auth: ^1.0.0
次に、パッケージをインストールします。
flutter pub get
認証の設定
Google APIを使用するには認証が必要です。以下の手順で認証を設定します。
- Google Cloud Consoleにアクセスし、プロジェクトを作成または選択します。
- 「APIとサービス」セクションで「認証情報」を選択し、新しいOAuth 2.0 クライアントIDを作成します。
- クライアントIDとクライアントシークレットを取得します。
使用例
以下にGoogle Drive APIを使用する例を示します。
import 'package:googleapis/drive/v3.dart' as drive;
import 'package:googleapis_auth/auth_io.dart';
void main() async {
final _clientId = ClientId("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
final _scopes = [drive.DriveApi.driveScope];
await clientViaUserConsent(_clientId, _scopes, (url) {
print("Please go to the following URL and grant access:");
print(" => $url");
print("");
}).then((AuthClient client) async {
var driveApi = drive.DriveApi(client);
// ファイルのリストを取得
var fileList = await driveApi.files.list();
fileList.files?.forEach((file) {
print('Found file: ${file.name} (${file.id})');
});
client.close();
});
}
パラメータの説明
- ClientId:
- clientId: Google Cloud Consoleで取得したクライアントIDを指定します。
- clientSecret: Google Cloud Consoleで取得したクライアントシークレットを指定します。
- Scopes:
- driveScope: Google Drive APIにアクセスするためのスコープです。必要なスコープに応じて変更します。
- clientViaUserConsent:
- _clientId: 認証に使用するクライアントIDを指定します。
- _scopes: アクセスするAPIのスコープを指定します。
- urlCallback: 認証URLをユーザーに表示するためのコールバック関数です。
- DriveApi:
- files.list(): Google Driveに保存されているファイルのリストを取得します。
これで、FlutterアプリケーションからGoogle APIを利用する準備が整いました。必要に応じて、他のGoogle API(例えば、Google Sheets APIやGoogle Cloud Storage API)も同様に利用できます。
Binary Authorization
説明
Binary Authorizationは、Google Kubernetes Engine (GKE)、Anthos Service Mesh、Anthos Clusters、およびCloud Runにデプロイされるイメージのポリシーベースのデプロイメント検証と制御を提供するサービスの管理インターフェースです。
ドキュメント
Dartパッケージ
Blockchain Node Engine API – blockchainnodeengine/v1
説明
Blockchain Node Engine APIは、ブロックチェーンノードの管理を行うためのAPIです。
ドキュメント
Dartパッケージ
Blogger API – blogger/v3
説明
Blogger APIは、Bloggerブログの投稿、コメント、ページにアクセスするためのAPIです。
ドキュメント
Dartパッケージ
Books API – books/v1
説明
Google Books APIは、Google BooksリポジトリにアクセスするためのAPIです。
ドキュメント
Dartパッケージ
Business Profile Performance API – businessprofileperformance/v1
説明
Business Profile Performance APIは、Google上のビジネスプロファイルに関するパフォーマンスレポートを取得するためのAPIです。
ドキュメント
Dartパッケージ
Calendar API – calendar/v3
説明
Calendar APIは、イベントやその他のカレンダーデータを操作するためのAPIです。
ドキュメント
Dartパッケージ
Certificate Manager API – certificatemanager/v1
説明
Certificate Manager APIは、証明書の管理を行うためのAPIです。
ドキュメント
Dartパッケージ
Google Chat API – chat/v1
説明
Google Chat APIは、Google Chatにサービスを統合し、スペース、メンバー、メッセージなどのChatリソースを管理するためのAPIです。
ドキュメント
Dartパッケージ
Chrome Management API – chromemanagement/v1
説明
Chrome Management APIは、Chrome OSおよびChromeブラウザデバイスの管理とインサイトを提供するサービスのスイートです。
ドキュメント
Dartパッケージ
Chrome Policy API – chromepolicy/v1
説明
Chrome Policy APIは、管理対象のChrome OSデバイスおよびChromeブラウザに適用されるポリシーを制御するためのサービスのスイートです。
ドキュメント
Dartパッケージ
Chrome UX Report API – chromeuxreport/v1
説明
Chrome UX Report APIは、数百万のウェブサイトの実際のユーザーエクスペリエンスデータを表示するためのAPIです。
ドキュメント
Dartパッケージ
Google Civic Information API – civicinfo/v2
説明
Google Civic Information APIは、米国の住宅住所に対する投票所、早期投票場所、コンテストデータ、選挙管理者、および政府代表者を提供します。
ドキュメント
Dartパッケージ
Google Classroom API – classroom/v1
説明
Google Classroom APIは、クラス、名簿、招待状を管理するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Asset API – cloudasset/v1
説明
Cloud Asset APIは、Google Cloudリソースの履歴とインベントリを管理するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Billing API – cloudbilling/v1
説明
Cloud Billing APIは、Google Cloud Platformプロジェクトの課金をプログラムで管理するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Build API – cloudbuild/v1
説明
Cloud Build APIは、Google Cloud Platformでビルドを作成および管理するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Build API – cloudbuild/v2
説明
Cloud Build APIのv2バージョンは、Google Cloud Platformでビルドを作成および管理するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Channel API – cloudchannel/v1
説明
Cloud Channel APIは、Google CloudパートナーがGCP、Workspace、Maps、Chromeを含むすべてのGoogle Cloud製品の単一の統合再販プラットフォームおよびAPIを提供します。
ドキュメント
Dartパッケージ
Cloud Commerce Partner Procurement API – cloudcommerceprocurement/v1
説明
Cloud Commerce Partner Procurement APIは、Cloud Commerce Procurement ServiceのためのパートナーAPIです。
ドキュメント
Dartパッケージ
Cloud Controls Partner API – cloudcontrolspartner/v1
説明
Cloud Controls Partner APIは、Sovereign Controls by Partnersの提供に基づいて、顧客とそのAssured Workloadsに関する洞察を提供します。
ドキュメント
Dartパッケージ
Cloud Deploy API – clouddeploy/v1
説明
Cloud Deploy APIは、継続的デプロイメントパイプラインの作成および管理を行うためのAPIです。
ドキュメント
Dartパ
ッケージ
Cloud Deployment Manager API – deploymentmanager/v2
説明
Cloud Deployment Manager APIは、Google Cloud Platform上のクラウドリソースの管理と展開を自動化するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Document AI API – documentai/v1
説明
Cloud Document AI APIは、Google Cloud Platform上で文書処理ソリューションを提供します。
ドキュメント
Dartパッケージ
Cloud Domains API – domains/v1
説明
Cloud Domains APIは、Google Cloud上でドメインの登録、管理、転送を行うためのAPIです。
ドキュメント
Dartパッケージ
Cloud Functions API – cloudfunctions/v1
説明
Cloud Functions APIは、Google Cloud Platformでイベント駆動型のサーバーレスコンピューティングを提供するためのAPIです。
ドキュメント
Dartパッケージ
Cloud Functions API – cloudfunctions/v2
説明
Cloud Functions APIのv2バージョンは、Google Cloud Platformでイベント駆動型のサーバーレスコンピューティングを提供するためのAPIです。
ドキュメント
Dartパッケージ
次は、他のGoogle APIsの紹介に進みます。
Cloud Talent Solution – jobs/v3
説明
Cloud Talent Solutionは、ジョブの作成、読み取り、更新、削除、キーワードやフィルタに基づくジョブの検索機能を提供します。
ドキュメント
Dartパッケージ
Google Keep API – keep/v1
説明
Google Keep APIは、エンタープライズ環境でGoogle Keepのコンテンツを管理し、クラウドセキュリティソフトウェアで特定された問題を解決するために使用されます。
ドキュメント
Dartパッケージ
Knowledge Graph Search API – kgsearch/v1
説明
Google Knowledge Graphでエンティティを検索します。
ドキュメント
Dartパッケージ
KMS Inventory API – kmsinventory/v1
説明
KMS Inventory APIについての詳細は、公式ドキュメントで確認してください。
ドキュメント
Dartパッケージ
Cloud Natural Language API – language/v1
説明
自然言語処理技術(感情分析、エンティティ認識、エンティティ感情分析、その他のテキスト注釈)を開発者に提供します。
ドキュメント
Dartパッケージ
Cloud Natural Language API – language/v2
説明
自然言語処理技術(感情分析、エンティティ認識、エンティティ感情分析、その他のテキスト注釈)を開発者に提供します。
ドキュメント
Dartパッケージ
Library Agent API – libraryagent/v1
説明
Googleのシンプルな例のライブラリAPIです。
ドキュメント
Dartパッケージ
Enterprise License Manager API – licensing/v1
説明
Google Enterprise License Manager APIは、管理している顧客のGoogle Workspaceおよび関連ライセンスを管理するためのAPIです。
ドキュメント
Dartパッケージ
Local Services API – localservices/v1
説明
Local Services APIについての詳細は、公式ドキュメントで確認してください。
ドキュメント
Dartパッケージ
Cloud Logging API – logging/v2
説明
ログエントリを記述し、Cloud Logging構成を管理します。
ドキュメント
Dartパッケージ
Looker (Google Cloud core) API – looker/v1
説明
Looker APIの詳細は、公式ドキュメントで確認してください。
ドキュメント
Dartパッケージ
Managed Service for Microsoft Active Directory API – managedidentities/v1
説明
Managed Service for Microsoft Active Directory APIは、Microsoft Active Directory(AD)を実行する高可用性の強化されたサービスを管理するために使用されます。
ドキュメント
Dartパッケージ
Manufacturer Center API – manufacturers/v1
説明
Manufacturer Center関連データを管理するためのパブリックAPIです。
ドキュメント
Dartパッケージ
Cloud Memorystore for Memcached API – memcache/v1
説明
Google Cloud Memorystore for Memcached APIは、GCPでMemcachedインスタンスを作成および管理するために使用されます。
ドキュメント
Dartパッケージ
Dataproc Metastore API – metastore/v1
説明
Dataproc Metastore APIは、メタストアサービスのライフサイクルと構成を管理するために使用されます。
ドキュメント
Dartパッケージ
Migration Center API – migrationcenter/v1
説明
現在のオンプレミスまたはクラウド環境からGoogle Cloudへのエンドツーエンドのクラウドジャーニーを加速する統合プラットフォームです。
ドキュメント
Dartパッケージ
AI Platform Training & Prediction API – ml/v1
説明
機械学習モデルの作成および使用を可能にするAPIです。
ドキュメント
Dartパッケージ
Cloud Monitoring API – monitoring/v3
説明
Cloud Monitoringのデータと構成を管理します。
ドキュメント
Dartパッケージ
My Business Account Management API – mybusinessaccountmanagement/v1
説明
My Business Account Management APIは、Google上のロケーションへのアクセスを管理するためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。
ドキュメント
Dartパッケージ
My Business Business Information API – mybusinessbusinessinformation/v1
説明
My Business Business Information APIは、ビジネス情報を管理するためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。
ドキュメント
Dartパッケージ
My Business Lodging API – mybusinesslodging/v1
説明
My Business Lodging APIは、Google上の宿泊業のビジネス情報を管理するためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。
ドキュメント
Dartパッケージ
My Business Notifications API – mybusinessnotifications/v1
説明
My Business Notifications APIは、Googleマイビジネス上で通知の設定と管理を行うためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。
ドキュメント
Dartパッケージ
My Business Place Actions API – mybusinessplaceactions/v1
説明
My Business Place Actions APIは、Googleマイビジネス上でアクションリンクの設定と管理を行うためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。
ドキュメント
Dartパッケージ
My Business Q&A API – mybusinessqanda/v1
説明
My Business Q&A APIは、Googleマイビジネス上でQ&Aの管理を行うためのインターフェースを提供します。注意 – APIを有効にした後にクォータが0の場合、GBP APIアクセスをリクエストしてください。