Class LinkPreview

LinkPreview

호스트 앱에 링크 미리보기 카드와 스마트 칩을 표시하는 카드 작업입니다. 자세한 내용은 스마트 칩으로 링크 미리보기를 참고하세요.

const decoratedText = CardService.newDecoratedText()
    .setTopLabel('Hello')
    .setText('Hi!');

const cardSection = CardService.newCardSection()
    .addWidget(decoratedText);

const card = CardService.newCardBuilder()
    .addSection(cardSection)
    .build();

const linkPreview = CardService.newLinkPreview()
    .setPreviewCard(card)
    .setTitle('Smart chip title');

방법

메서드반환 유형간략한 설명
printJson()String이 객체의 JSON 표현을 출력합니다.
setLinkPreviewTitle(title)LinkPreview미리보기 카드 위의 링크 미리보기에 표시되는 제목을 설정합니다.
setPreviewCard(previewCard)LinkPreview서드 파티 또는 Google 이외의 서비스와의 링크에 대한 정보를 표시하는 카드를 설정합니다.
setTitle(title)LinkPreview링크 미리보기의 스마트 칩에 표시되는 제목을 설정합니다.

자세한 문서

printJson()

이 객체의 JSON 표현을 출력합니다. 디버깅 전용입니다.

리턴

String


setLinkPreviewTitle(title)

미리보기 카드 위의 링크 미리보기에 표시되는 제목을 설정합니다. 설정하지 않으면 링크 미리보기에 PreviewCard의 헤더가 표시됩니다.

const linkPreview = CardService.newLinkPreview()
    .setLinkPreviewTitle("Link preview title");

매개변수

이름유형설명
titleString링크 미리보기의 제목입니다.

리턴

LinkPreview: 체이닝용 객체입니다.


setPreviewCard(previewCard)

서드 파티 또는 Google 이외의 서비스와의 링크에 대한 정보를 표시하는 카드를 설정합니다.

const decoratedText = CardService.newDecoratedText()
    .setTopLabel('Hello')
    .setText('Hi!');

const cardSection = CardService.newCardSection()
    .addWidget(decoratedText);

const card = CardService.newCardBuilder()
    .addSection(cardSection)
    .build();

const linkPreview = CardService.newLinkPreview()
    .setPreviewCard(card)
    .setTitle('Smart chip title');

매개변수

이름유형설명
previewCardCard미리보기 카드입니다.

리턴

LinkPreview: 체이닝용 객체입니다.


setTitle(title)

링크 미리보기의 스마트 칩에 표시되는 제목을 설정합니다. 설정되지 않으면 스마트 칩에 PreviewCard의 헤더가 표시됩니다.

const linkPreview = CardService.newLinkPreview()
    .setTitle('Smart chip title');

매개변수

이름유형설명
titleString스마트 칩의 제목입니다.

리턴

LinkPreview: 체이닝용 객체입니다.