Class EventGuest
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
內容詳盡的說明文件
getAdditionalGuests()
取得這位房客表示會參加的額外人數。
回攻員
Integer
:這位客人表示會參加的額外人數
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權,或是相關 REST API 中的適當範圍:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
getEmail()
取得訪客的電子郵件地址。
回攻員
String
:訪客的電子郵件地址
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權,或是相關 REST API 中的適當範圍:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
getGuestStatus()
取得活動邀請對象的狀態。
回攻員
GuestStatus
:這位房客的狀態
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權,或是相關 REST API 中的適當範圍:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
getName()
取得訪客的名稱。如果無法取得訪客的名稱,這個方法會傳回訪客的電子郵件地址。
回攻員
String
:訪客的姓名,如果沒有姓名,則為電子郵件地址
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權,或是相關 REST API 中的適當範圍:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
已淘汰的方法
getStatus()
已淘汰。這個函式已淘汰,不建議在新指令碼中使用。
取得活動邀請對象的狀態。
回攻員
String
:這位房客的狀態
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權,或是相關 REST API 中的適當範圍:
-
https://www.googleapis.com/auth/calendar
-
https://www.googleapis.com/auth/calendar.readonly
-
https://www.google.com/calendar/feeds
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eEventGuest\u003c/code\u003e represents an event guest and provides methods to access their information.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve guest details such as the number of additional guests, email address, status, and name using the provided methods.\u003c/p\u003e\n"],["\u003cp\u003eAll methods require authorization with specific scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/calendar\u003c/code\u003e or \u003ccode\u003ehttps://www.google.com/calendar/feeds\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetStatus()\u003c/code\u003e method is deprecated and \u003ccode\u003egetGuestStatus()\u003c/code\u003e should be used instead to get the guest's status.\u003c/p\u003e\n"]]],[],null,["# Class EventGuest\n\nEventGuest\n\nRepresents a guest of an event. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------|-------------------------------------------------------------|------------------------------------------------------------------------------|\n| [getAdditionalGuests()](#getAdditionalGuests()) | `Integer` | Gets the number of additional people that this guest has said are attending. |\n| [getEmail()](#getEmail()) | `String` | Gets the email address of the guest. |\n| [getGuestStatus()](#getGuestStatus()) | [GuestStatus](/apps-script/reference/calendar/guest-status) | Gets the status of the guest for the event. |\n| [getName()](#getName()) | `String` | Gets the name of the guest. |\n\n### Deprecated methods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|---------------------------------------------|\n| [getStatus()](#getStatus()) | `String` | Gets the status of the guest for the event. |\n\nDetailed documentation\n----------------------\n\n### `get``Additional``Guests()`\n\nGets the number of additional people that this guest has said are attending.\n\n#### Return\n\n\n`Integer` --- the number of additional people this guest has said are attending\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes) or appropriate scopes from the [related REST API](/identity/protocols/googlescopes):\n\n- `https://www.googleapis.com/auth/calendar`\n- `https://www.googleapis.com/auth/calendar.readonly`\n- `https://www.google.com/calendar/feeds`\n\n*** ** * ** ***\n\n### `get``Email()`\n\nGets the email address of the guest.\n\n#### Return\n\n\n`String` --- the guest's email address\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes) or appropriate scopes from the [related REST API](/identity/protocols/googlescopes):\n\n- `https://www.googleapis.com/auth/calendar`\n- `https://www.googleapis.com/auth/calendar.readonly`\n- `https://www.google.com/calendar/feeds`\n\n*** ** * ** ***\n\n### `get``Guest``Status()`\n\nGets the status of the guest for the event.\n\n#### Return\n\n\n[GuestStatus](/apps-script/reference/calendar/guest-status) --- the status of this guest\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes) or appropriate scopes from the [related REST API](/identity/protocols/googlescopes):\n\n- `https://www.googleapis.com/auth/calendar`\n- `https://www.googleapis.com/auth/calendar.readonly`\n- `https://www.google.com/calendar/feeds`\n\n*** ** * ** ***\n\n### `get``Name()`\n\nGets the name of the guest. If the name of the guest is not available, this method returns the\nguest's email address.\n\n#### Return\n\n\n`String` --- the guest's name, or the guest's email address if the name is not available\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes) or appropriate scopes from the [related REST API](/identity/protocols/googlescopes):\n\n- `https://www.googleapis.com/auth/calendar`\n- `https://www.googleapis.com/auth/calendar.readonly`\n- `https://www.google.com/calendar/feeds`\n\nDeprecated methods\n------------------\n\n### `get``Status()`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nGets the status of the guest for the event.\n\n#### Return\n\n\n`String` --- the status of this guest\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes) or appropriate scopes from the [related REST API](/identity/protocols/googlescopes):\n\n- `https://www.googleapis.com/auth/calendar`\n- `https://www.googleapis.com/auth/calendar.readonly`\n- `https://www.google.com/calendar/feeds`"]]