class Media extends Resource (View source)

The "media" collection of methods.

Typical usage is:

 $chatService = new Google\Service\HangoutsChat(...);
 $media = $chatService->media;

Methods

download(string $resourceName, array $optParams = [])

Downloads media. Download is supported on the URI /v1/media/{+name}?alt=media. (media.download)

upload(string $parent, UploadAttachmentRequest $postBody, array $optParams = [])

Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication. You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat. (media.upload)

Details

Media download(string $resourceName, array $optParams = [])

Downloads media. Download is supported on the URI /v1/media/{+name}?alt=media. (media.download)

Parameters

string $resourceName

Name of the media that is being downloaded. See ReadRequest.resource_name.

array $optParams

Optional parameters.

Return Value

Media

Exceptions

Exception

UploadAttachmentResponse upload(string $parent, UploadAttachmentRequest $postBody, array $optParams = [])

Uploads an attachment. For an example, see Upload media as a file attachment. Requires user authentication. You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see File types blocked by Google Chat. (media.upload)

Parameters

string $parent

Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}".

UploadAttachmentRequest $postBody
array $optParams

Optional parameters.

Return Value

UploadAttachmentResponse

Exceptions

Exception