Class AddressField

AddressField

지원 중단되었습니다. 대신 People API 고급 서비스를 사용하세요.

연락처의 주소 필드입니다.

방법

메서드반환 유형간략한 설명
getAddress()String이 필드의 주소를 가져옵니다.
getLabel()Object이 필드의 라벨을 가져옵니다.
isPrimary()Boolean이 값이 기본 필드 값인지 확인합니다.
setAddress(address)AddressField이 필드의 주소를 설정합니다.
setAsPrimary()AddressField이 필드를 기본으로 설정합니다.
setLabel(field)AddressField이 필드의 라벨을 설정합니다.
setLabel(label)AddressField이 필드의 라벨을 설정합니다.

자세한 문서

getAddress()

이 필드의 주소를 가져옵니다.

// Logs the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
var contacts = ContactsApp.getContactsByName('John Doe');
var homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
Logger.log(homeAddress[0].getAddress());

리턴

String: 문자열로 된 주소

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

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

getLabel()

이 필드의 라벨을 가져옵니다. 필드, 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
for (var 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');

매개변수

이름유형설명
addressString새 주소

리턴

AddressField: 이 필드로, 연결하는 데 유용합니다.

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

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

setAsPrimary()

이 필드를 기본으로 설정합니다.

// Sets the the first address field associated with contact 'John Doe'
// as primary. This method can be similarly called for any field.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setAsPrimary();

리턴

AddressField: 연결을 위한 이 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);

매개변수

이름유형설명
fieldField새 표준 라벨을

리턴

AddressField: 연결을 위한 이 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.
var contacts = ContactsApp.getContactsByName('John Doe');
var addressFields = contacts[0].getAddresses();
addressFields[0].setLabel('Apartment');

매개변수

이름유형설명
labelString이 필드의 새 라벨

리턴

AddressField: 이 필드로, 연결하는 데 유용합니다.

승인

이 방법을 사용하는 스크립트는 다음 범위 중 하나 이상을 승인해야 합니다.

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

지원 중단된 메서드