Class AddressField

AdresAlanı

Kullanımdan kaldırıldı. Bunun yerine People API ileri seviye hizmetini kullanın.

Kişideki adres alanı.

Yöntemler

YöntemDönüş türüKısa açıklama
getAddress()StringBu alanın adresini alın.
getLabel()ObjectBu alanın etiketini alır.
isPrimary()BooleanBunun birincil alan değeri olup olmadığını alır.
setAddress(address)AddressFieldBu alanın adresini belirler.
setAsPrimary()AddressFieldBu alanı birincil olarak ayarlar.
setLabel(field)AddressFieldBu alanın etiketini ayarlar.
setLabel(label)AddressFieldBu alanın etiketini ayarlar.

Ayrıntılı dokümanlar

getAddress()

Bu alanın adresini alın.

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

Return

String: Adres, dize olarak

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

getLabel()

Bu alanın etiketini alır. Bu bir Alan, Genişletilmiş Alan veya Dize olabilir.

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

Return

Object: Bu alanın etiketi

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

isPrimary()

Bunun birincil alan değeri olup olmadığını alır.

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

Return

Boolean: Bu cihazın birincil olup olmadığı

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

setAddress(address)

Bu alanın adresini belirler.

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

Parametreler

AdTürAçıklama
addressStringyeni adres

Return

AddressField: zincirleme için yararlı olan bu alan

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

setAsPrimary()

Bu alanı birincil olarak ayarlar.

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

Return

AddressField: zincirleme için bu FieldValue

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

setLabel(field)

Bu alanın etiketini ayarlar.

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

Parametreler

AdTürAçıklama
fieldFieldyeni standart etiket

Return

AddressField: zincirleme için bu FieldValue

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

setLabel(label)

Bu alanın etiketini ayarlar.

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

Parametreler

AdTürAçıklama
labelStringbu alanın yeni etiketi

Return

AddressField: zincirleme için yararlı olan bu alan

Yetkilendirme

Bu yöntemi kullanan komut dosyalarının aşağıdaki kapsamlardan bir veya daha fazlası için yetkilendirilmesi gerekir:

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

Kullanımdan kaldırılan yöntemler