منسوخ شده است. در عوض، از سرویس پیشرفته People API استفاده کنید
فیلد آدرس در یک مخاطب
روش ها
روش | نوع برگشت | شرح مختصر |
---|---|---|
get Address() | String | آدرس این فیلد را دریافت کنید. |
get Label() | Object | برچسب این فیلد را دریافت می کند. |
is Primary() | Boolean | دریافت می کند که آیا این مقدار فیلد اصلی است یا خیر. |
set Address(address) |
| آدرس این فیلد را تنظیم می کند. |
set As Primary() |
| این فیلد را روی اولیه قرار می دهد. |
set Label(field) |
| برچسب این فیلد را تنظیم می کند. |
set Label(label) |
| برچسب این فیلد را تنظیم می کند. |
مستندات دقیق
get Address()
آدرس این فیلد را دریافت کنید.
// Logs the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); Logger.log(homeAddress[0].getAddress());
بازگشت
String
- آدرس به عنوان یک رشته
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
get Label()
برچسب این فیلد را دریافت می کند. این ممکن است یک فیلد، ExtendedField یا یک رشته باشد.
// Logs the label for all the address fields associated with contact // 'John Doe'. This method can be similarly called for any field that has // a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); for (let i = 0; i < addressFields.length; i++) { Logger.log(addressFields[i].getLabel()); }
بازگشت
Object
- برچسب این فیلد
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
is Primary()
دریافت می کند که آیا این مقدار فیلد اصلی است یا خیر.
// Logs whether or not the first address field associated with contact // 'John Doe' is labeled as primary. This method can be similarly called // for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); Logger.log(addressFields[0].isPrimary());
بازگشت
Boolean
- آیا این اولیه است
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
set Address(address)
آدرس این فیلد را تنظیم می کند.
// Sets the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
پارامترها
نام | تایپ کنید | توضیحات |
---|---|---|
address | String | آدرس جدید |
بازگشت
- این فیلد برای زنجیره زدن مفید استAddress Field
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
set As Primary()
این فیلد را روی اولیه قرار می دهد.
// Sets the first address field associated with contact 'John Doe' // as primary. This method can be similarly called for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setAsPrimary();
بازگشت
- این FieldValue برای زنجیره زدنAddress Field
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
set Label(field)
برچسب این فیلد را تنظیم می کند.
// Sets the label to 'Work' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);
پارامترها
نام | تایپ کنید | توضیحات |
---|---|---|
field |
| برچسب استاندارد جدید |
بازگشت
- این FieldValue برای زنجیره زدنAddress Field
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds
set Label(label)
برچسب این فیلد را تنظیم می کند.
// Sets the label to 'Apartment' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel('Apartment');
پارامترها
نام | تایپ کنید | توضیحات |
---|---|---|
label | String | برچسب جدید برای این زمینه |
بازگشت
- این فیلد برای زنجیره زدن مفید استAddress Field
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.google.com/m8/feeds