CalendarList: update
Requires authorization 承認が必要
Updates an existing calendar on the user's calendar list. Try it now or see an example. ユーザーのカレンダーリストにある既存のカレンダーを更新します。今すぐ試すか、例を見てください。
Request要求
HTTP requestHTTPリクエスト
PUT https://www.googleapis.com/calendar/v3/users/me/calendarList/calendarId
Parametersパラメーター
Parameter nameパラメータ名 | Value値 | Description説明 |
---|---|---|
Path parametersパスパラメータ | ||
calendarId |
string |
Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary " keyword.
カレンダーID カレンダーIDを取得するには、calendarList.listメソッドを呼び出します。現在ログインしているユーザーのメインカレンダーにアクセスしたい場合は、primary キーワード" "を使用してください。 |
Optional query parametersオプションのクエリパラメータ | ||
colorRgbFormat |
boolean |
Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.
foregroundColor とbackgroundColor フィールド
を使用してカレンダーの色(RGB)を書き込むかどうか。この機能を使用すると、インデックスベースのcolorId フィールドは自動的に最適なオプションに設定されます。オプションです。デフォルトはFalseです。 |
Authorization承認
This request requires authorization with the following scope (read more about authentication and authorization).この要求には、以下の範囲での承認が必要です(認証と承認についての詳細を読んでください)。
Scope範囲 |
---|
https://www.googleapis.com/auth/calendar |
Request bodyリクエストボディ
In the request body, supply a CalendarList resource with the following properties:リクエスト本文で、次のプロパティを持つCalendarListリソースを指定します。
Property nameプロパティ名 | Value値 | Description説明 | Notesノート |
---|---|---|---|
Optional Propertiesオプションのプロパティ | |||
backgroundColor |
string |
The main color of the calendar in the hexadecimal format "#0088aa ". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional.カレンダーのメインカラー(16進数形式 " #0088aa ")。このプロパティは、インデックスベースのプロパティよりも優先されcolorId ます。このプロパティを設定または変更するcolorRgbFormat=true には、insert、update、およびpatchメソッドのパラメータで指定する必要があります。オプションです。 |
writable 書き込み可能 |
colorId |
string |
The color of the calendar. This is an ID referring to an entry in the calendar section of the colors definition (see the colors endpoint). This property is superseded by the backgroundColor and foregroundColor properties and can be ignored when using these properties. Optional.カレンダーの色 これはcalendar 色の定義のセクションのエントリを参照するIDです(色の終点を参照)。このプロパティはbackgroundColor and foregroundColor プロパティに置き換えられており、これらのプロパティを使用する場合は無視できます。オプションです。 |
writable 書き込み可能 |
defaultReminders[] |
list |
The default reminders that the authenticated user has for this calendar.認証済みユーザーがこのカレンダーに対して持っていることを示すデフォルトの通知。 | writable 書き込み可能 |
defaultReminders[].method |
string |
The method used by this reminder. Possible values are:
Required when adding a reminder.アラームを追加するときに必要です。 |
writable 書き込み可能 |
defaultReminders[].minutes |
integer |
Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). Required when adding a reminder.アラームを追加するときに必要です。 |
writable 書き込み可能 |
foregroundColor |
string |
The foreground color of the calendar in the hexadecimal format "#ffffff ". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional.カレンダーの前景色(16進数形式 " #ffffff ")。このプロパティは、インデックスベースのプロパティよりも優先されcolorId ます。このプロパティを設定または変更するcolorRgbFormat=true には、insert、update、およびpatchメソッドのパラメータで指定する必要があります。オプションです。 |
writable 書き込み可能 |
notificationSettings |
object |
The notifications that the authenticated user is receiving for this calendar.認証済みユーザーがこのカレンダーに関して受信している通知。 | writable 書き込み可能 |
notificationSettings.notifications[].method |
string |
The method used to deliver the notification. Possible values are:
Required when adding a notification.通知を追加するときに必要です。 |
writable 書き込み可能 |
notificationSettings.notifications[].type |
string |
The type of notification. Possible values are:
Required when adding a notification.通知を追加するときに必要です。 |
writable 書き込み可能 |
selected |
boolean |
Whether the calendar content shows up in the calendar UI. Optional. The default is False.カレンダーのコンテンツがカレンダーのUIに表示されるかどうか。オプションです。デフォルトはFalseです。 | writable 書き込み可能 |
summaryOverride |
string |
The summary that the authenticated user has set for this calendar. Optional.認証済みユーザーがこのカレンダーに設定した要約。オプションです。 | writable 書き込み可能 |
Response応答
If successful, this method returns a CalendarList resource in the response body.成功した場合、このメソッドはレスポンス本文にCalendarListリソースを返します。
Examples例
Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).注:このメソッドで使用可能なコード例は、サポートされているすべてのプログラミング言語を表しているわけではありません(サポートされている言語のリストについては、クライアントライブラリのページを参照してください)。
Java
Uses the Java client library.Javaクライアントライブラリを使用します。
import com.google.api.services.calendar.Calendar; import com.google.api.services.calendar.model.CalendarListEntry; // ... // Initialize Calendar service with valid OAuth credentials Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials) .setApplicationName("applicationName").build(); // Retrieve the calendar list entry CalendarListEntry calendarListEntry = service.calendarList().get("calendarId").execute(); // Make a change calendarListEntry.setColorId("newColorId"); // Update the altered entry CalendarListEntry updatedCalendarListEntry = service.calendarList().update(calendarListEntry.getId(), calendarListEntry).execute(); System.out.println(updatedCalendarListEntry.getEtag());
Python
Uses the Python client library.Pythonクライアントライブラリを使用します。
# First retrieve the calendarListEntry from the API. calendar_list_entry = service.calendarList().get(calendarId='calendarId').execute() calendar_list_entry['colorId'] = 'newColorId' updated_calendar_list_entry = service.calendarList().update( calendarId=calendar_list_entry['id'], body=calendar_list_entry).execute() print created_calendar_list_entry['etag']
PHP
Uses the PHP client library.PHPクライアントライブラリを使用します。
// First retrieve the calendarListEntry from the API. $calendarListEntry = $service->calendarList->get('calendarId'); $calendarListEntry->setColorId('newColorId'); $updatedCalendarListEntry = service->calendarList->update($calendarListEntry->getId(), $calendarListEntry); echo $updatedCalendarListEntry->getEtag();
Rubyルビー
Uses the Ruby client library.Rubyクライアントライブラリを使用します。
calendar_list_entry = client.get_calendar_list('calendarId') calendar_list_entry.colorId = 'newColorId' result = client.update_calendar_list(calendar_list_entry.id, calendar_list_entry) print result.etag
Try it!それを試してみてください!
Use the APIs Explorer below to call this method on live data and see the response. 以下のAPI Explorerを使用して、ライブデータに対してこのメ??ソッドを呼び出して応答を確認してください。
関連記事
- CalendarList: watch
- CalendarList: patch
- CalendarList: list
- CalendarList: insert
- CalendarList: get
- CalendarList: delete
スポンサーリンク