Làm việc với hội nghị

Hướng dẫn này giải thích cách lấy thông tin chi tiết về một hội nghị hoặc tất cả hội nghị trên tài nguyên conferenceRecords của API Google Meet REST.

Hội nghị là một thực thể của cuộc gọi do máy chủ tạo trong không gian họp. Đây cũng là một phiên bản của cuộc họp.

Nếu là chủ sở hữu hoặc người tham gia không gian họp, bạn có thể gọi các phương thức get()list() để truy xuất bản ghi cuộc họp.

Việc xác thực và uỷ quyền bằng thông tin đăng nhập của người dùng cho phép các ứng dụng Google Meet truy cập vào dữ liệu người dùng và thực hiện các thao tác thay mặt cho người dùng đã xác thực. Việc xác thực bằng tính năng uỷ quyền trên toàn miền cho phép bạn uỷ quyền cho tài khoản dịch vụ của ứng dụng truy cập vào dữ liệu của người dùng mà không yêu cầu mỗi người dùng phải đồng ý.

Xem thông tin chi tiết về một hội nghị

Để biết thông tin chi tiết về một hội nghị cụ thể, hãy sử dụng phương thức get() trên tài nguyên conferenceRecords với tham số đường dẫn name của hội nghị. Nếu không biết tên hội nghị, bạn có thể liệt kê tất cả tên hội nghị bằng phương thức list().

Phương thức này trả về một hội nghị trước đây dưới dạng một thực thể của tài nguyên conferenceRecords.

Mã mẫu sau đây cho biết cách truy xuất một hội nghị cụ thể:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/getconferencerecord/AsyncGetConferenceRecord.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecord;
import com.google.apps.meet.v2.ConferenceRecordName;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.GetConferenceRecordRequest;

public class AsyncGetConferenceRecord {

  public static void main(String[] args) throws Exception {
    asyncGetConferenceRecord();
  }

  public static void asyncGetConferenceRecord() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (ConferenceRecordsServiceClient conferenceRecordsServiceClient =
        ConferenceRecordsServiceClient.create()) {
      GetConferenceRecordRequest request =
          GetConferenceRecordRequest.newBuilder()
              .setName(ConferenceRecordName.of("[CONFERENCE_RECORD]").toString())
              .build();
      ApiFuture<ConferenceRecord> future =
          conferenceRecordsServiceClient.getConferenceRecordCallable().futureCall(request);
      // Do something.
      ConferenceRecord response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js
/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. Resource name of the conference.
 */
// const name = 'abc123'

// Imports the Meet library
const {ConferenceRecordsServiceClient} = require('@google-apps/meet').v2;

// Instantiates a client
const meetClient = new ConferenceRecordsServiceClient();

async function callGetConferenceRecord() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const response = await meetClient.getConferenceRecord(request);
  console.log(response);
}

callGetConferenceRecord();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_get_conference_record_async.py
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.apps import meet_v2


async def sample_get_conference_record():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

    # Initialize request argument(s)
    request = meet_v2.GetConferenceRecordRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_conference_record(request=request)

    # Handle the response
    print(response)

Thay thế tên bản ghi hội nghị bằng tên của mã hội nghị cụ thể trong bản ghi hội nghị.

Liệt kê tất cả hội nghị

Để liệt kê thông tin chi tiết về tất cả hội nghị, hãy sử dụng phương thức list() trên tài nguyên conferenceRecords mà không cần tham số đường dẫn nào.

Phương thức này trả về danh sách các hội nghị trước đây dưới dạng một thực thể của tài nguyên conferenceRecords. Các cuộc họp này được lọc cho người tổ chức hội nghị và được sắp xếp theo startTime theo thứ tự giảm dần. Để điều chỉnh kích thước trang và lọc kết quả truy vấn, hãy xem phần Tuỳ chỉnh phân trang hoặc lọc danh sách.

Mã mẫu sau đây cho biết cách liệt kê tất cả hội nghị:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/listconferencerecords/AsyncListConferenceRecords.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecord;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.ListConferenceRecordsRequest;

public class AsyncListConferenceRecords {

  public static void main(String[] args) throws Exception {
    asyncListConferenceRecords();
  }

  public static void asyncListConferenceRecords() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (ConferenceRecordsServiceClient conferenceRecordsServiceClient =
        ConferenceRecordsServiceClient.create()) {
      ListConferenceRecordsRequest request =
          ListConferenceRecordsRequest.newBuilder()
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .build();
      ApiFuture<ConferenceRecord> future =
          conferenceRecordsServiceClient.listConferenceRecordsPagedCallable().futureCall(request);
      // Do something.
      for (ConferenceRecord element : future.get().iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js
/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Optional. Maximum number of conference records to return. The service might
 *  return fewer than this value. If unspecified, at most 25 conference records
 *  are returned. The maximum value is 100; values above 100 are coerced to
 *  100. Maximum might change in the future.
 */
// const pageSize = 1234
/**
 *  Optional. Page token returned from previous List Call.
 */
// const pageToken = 'abc123'
/**
 *  Optional. User specified filtering condition in EBNF
 *  format (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form).
 *  The following are the filterable fields:
 *  * `space.meeting_code`
 *  * `space.name`
 *  * `start_time`
 *  * `end_time`
 *  For example, consider the following filters:
 *  * `space.name = "spaces/NAME"`
 *  * `space.meeting_code = "abc-mnop-xyz"`
 *  * `start_time>="2024-01-01T00:00:00.000Z" AND
 *  start_time<="2024-01-02T00:00:00.000Z"`
 *  * `end_time IS NULL`
 */
// const filter = 'abc123'

// Imports the Meet library
const {ConferenceRecordsServiceClient} = require('@google-apps/meet').v2;

// Instantiates a client
const meetClient = new ConferenceRecordsServiceClient();

async function callListConferenceRecords() {
  // Construct request
  const request = {
  };

  // Run request
  const iterable = meetClient.listConferenceRecordsAsync(request);
  for await (const response of iterable) {
      console.log(response);
  }
}

callListConferenceRecords();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_list_conference_records_async.py
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.apps import meet_v2


async def sample_list_conference_records():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

    # Initialize request argument(s)
    request = meet_v2.ListConferenceRecordsRequest(
    )

    # Make the request
    page_result = client.list_conference_records(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Tuỳ chỉnh tính năng phân trang hoặc lọc danh sách

Truyền các tham số truy vấn không bắt buộc sau đây để tuỳ chỉnh tính năng phân trang hoặc lọc bản ghi hội nghị:

  • pageSize: Số bản ghi hội nghị tối đa cần trả về. Dịch vụ này có thể trả về ít hơn giá trị này. Nếu không chỉ định, hệ thống sẽ trả về tối đa 25 bản ghi cuộc họp. Giá trị tối đa là 100; các giá trị lớn hơn 100 sẽ tự động được thay đổi thành 100.

  • pageToken: Mã thông báo trang, nhận được từ một lệnh gọi danh sách trước đó. Cung cấp mã thông báo này để truy xuất trang tiếp theo.

  • filter: Bộ lọc truy vấn để truy xuất các mục cụ thể trong kết quả tài nguyên conferenceRecords. Để biết thông tin chi tiết về truy vấn được hỗ trợ, hãy xem phương thức list(). Để biết thêm thông tin về cách xác định không gian họp, hãy xem bài viết Cách Meet xác định không gian họp.