Google Picker API のリソースの概要
Google Picker API は、PickerBuilder
と Picker
を含むビルダー パターンを使用します。
const picker = new google.picker.PickerBuilder()
.setOAuthtoken('TOKEN_FOR_USER')
.setAppId('1234567890') // Cloud Project number
.addView(google.picker.ViewId.DOCS)
.setCallback((data) => {
console.log(data);
})
.build();
picker.setVisible(true);
クラス
名前 |
説明 |
DocsUploadView |
DocsUploadView を使用して Google ドライブにファイルをアップロードします。 |
DocsView |
DocsView を使用して Google ドライブからファイルを選択します。 |
Picker |
Picker は、ユーザーとの UI アクションを表す最上位オブジェクトです。これらのオブジェクトは直接作成されず、代わりに PickerBuilder クラスが使用されます。 |
PickerBuilder |
PickerBuilder は Picker オブジェクトの作成に使用されます。特に明記されていない限り、以下のメソッドの戻り値の型は PickerBuilder 型です。これにより、呼び出しを連結できます。 |
ResourceId |
ResourceId は、ドキュメントのリソース ID を生成するユーティリティ クラスです。 |
View |
すべてのビューの抽象クラス。 |
ViewGroup |
ViewGroup は、ナビゲーション パネル内のビューの視覚的なグループ化です。 |
列挙型
名前 |
説明 |
Action |
ResponseObject のアクション タイプ。 |
Audience |
Audience は、DocumentObject のオーディエンスを記述するために使用される列挙型です。 |
DocsViewMode |
DocsViewMode は、DocsView 内にデータを表示するための列挙型です。これらの値は、DocsView.setMode の呼び出しで使用します。 |
Document |
Document は、DocumentObject のフィールドの記述に使用される列挙型です。 |
Feature |
Feature は、さまざまなビューの機能をオンまたはオフにするための列挙型です。これらの値は、PickerBuilder.enableFeature と PickerBuilder.disableFeature の呼び出しで使用します。 |
Response |
Response は、ResponseObject のフィールドの記述に使用される列挙型です。 |
ServiceId |
ServiceId は、アイテムが選択されたサービスを記述するために使用される列挙型です。 |
Thumbnail |
Thumbnail は、ThumbnailObject のフィールドを記述する列挙型です。 |
Type |
選択したアイテムのタイプ。 |
ViewId |
ViewId は、Picker で使用できるさまざまなビューの列挙型です。これらの値は、DocsView と PickerBuilder の呼び出しで使用します。 |
ViewToken |
ViewToken は、ResponseObject.viewToken の要素を記述するために使用される列挙型です。 |
インターフェース
タイプ エイリアス
名前 |
説明 |
Locales |
PickerBuilder.setLocale でサポートされている ISO 639 言語コード。 |
ParentDocumentObject |
ParentDocumentObject は、選択したアイテムの親フォルダの属性を記述するインターフェースです。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-09 UTC。
[null,null,["最終更新日 2024-11-09 UTC。"],[[["The Google Picker API enables users to select files from Google Drive and upload files using a builder pattern with `PickerBuilder` and `Picker` classes."],["The API provides various views like `DocsView` for file selection and `DocsUploadView` for uploads, customizable through `PickerBuilder` methods."],["Developers can utilize enums such as `ViewId` and `DocsViewMode` to configure the picker's appearance and functionality."],["Callback functions handle user selections, providing access to selected item details via objects like `DocumentObject` and `ResponseObject`."],["The API offers features like resource ID generation with `ResourceId`, view grouping with `ViewGroup`, and language localization with `Locales`."]]],["The Google Picker API utilizes `PickerBuilder` to construct `Picker` objects, which manage the user interface. You configure the picker by setting parameters such as OAuth token, app ID, and views (e.g., `DocsView`) using `PickerBuilder`. The `setCallback` function process selected files. Different views are available like uploading or selecting files, and the API provides various enums to describe the item and action selected by the user, like `ViewId` and `Action`. Additionally, interfaces such as `DocumentObject` and `ResponseObject` represent data related to the user's selection.\n"]]