Class IMField

IMField

تمّت إزالة هذا العمود. بدلاً من ذلك، استخدِم خدمة People API المتقدّمة.

حقل الرسائل الفورية في جهة اتصال

الطُرق

الطريقةنوع القيمة التي يتم إرجاعهاوصف قصير
getAddress()Stringالحصول على عنوان هذا الحقل
getLabel()Objectتعرض هذه الطريقة تصنيف الحقل.
isPrimary()Booleanتعرض هذه السمة ما إذا كانت هذه القيمة هي قيمة الحقل الأساسية.
setAddress(address)IMFieldتُستخدَم لضبط عنوان هذا الحقل.
setAsPrimary()IMFieldيضبط هذا الحقل على أساسي.
setLabel(field)IMFieldتضبط هذه السمة تصنيف هذا الحقل.
setLabel(label)IMFieldتضبط هذه السمة تصنيف هذا الحقل.

مستندات مفصّلة

getAddress()

الحصول على عنوان هذا الحقل

// 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

getLabel()

تعرض هذه الطريقة تصنيف الحقل. قد يكون هذا النوع Field أو ExtendedField أو String.

// 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

isPrimary()

تعرض هذه السمة ما إذا كانت هذه القيمة هي قيمة الحقل الأساسية.

// 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

setAddress(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');

المعلمات

الاسمالنوعالوصف
addressStringالعنوان الجديد

الإرجاع

IMField: هذا الحقل مفيد للتسلسل

التفويض

تتطلّب النصوص البرمجية التي تستخدم هذه الطريقة الحصول على إذن باستخدام واحد أو أكثر من النطاقات التالية:

  • https://www.google.com/m8/feeds

setAsPrimary()

يضبط هذا الحقل على أساسي.

// 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();

الإرجاع

IMField: هذا FieldValue للسلسلة

التفويض

تتطلّب النصوص البرمجية التي تستخدم هذه الطريقة الحصول على إذن باستخدام واحد أو أكثر من النطاقات التالية:

  • https://www.google.com/m8/feeds

setLabel(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);

المعلمات

الاسمالنوعالوصف
fieldFieldالتصنيف العادي الجديد

الإرجاع

IMField: هذا FieldValue للسلسلة

التفويض

تتطلّب النصوص البرمجية التي تستخدم هذه الطريقة الحصول على إذن باستخدام واحد أو أكثر من النطاقات التالية:

  • https://www.google.com/m8/feeds

setLabel(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');

المعلمات

الاسمالنوعالوصف
labelStringالتصنيف الجديد لهذا الحقل

الإرجاع

IMField: هذا الحقل مفيد للتسلسل

التفويض

تتطلّب النصوص البرمجية التي تستخدم هذه الطريقة الحصول على إذن باستخدام واحد أو أكثر من النطاقات التالية:

  • https://www.google.com/m8/feeds

الطُرق المتوقّفة