Làm việc với người tham gia

Người tham gia là người đã tham gia một cuộc gọi hoặc sử dụng Chế độ đồng hành, xem với tư cách là người xem hoặc một thiết bị trong phòng đã kết nối với cuộc gọi. Có một tài nguyên conferenceRecords.participants cho mỗi người.

Phiên của người tham gia là mã phiên duy nhất được tạo cho mỗi cặp thiết bị của người tham gia tham gia cuộc gọi. Có một tài nguyên conferenceRecords.participants.participantSessions cho mỗi phiên hoạt động. Nếu người tham gia tham gia cùng một cuộc gọi nhiều lần từ cùng một cặp thiết bị của người tham gia, thì mỗi người tham gia sẽ được chỉ định mã phiên duy nhất.

Trang này mô tả cách lấy thông tin về tất cả những người tham gia đã tham dự hoặc đang tham gia một hội nghị hoặc về chỉ một người tham gia, cùng với thông tin về phiên của họ.

Người tham gia

Các phần sau đây trình bày chi tiết cách lấy thông tin về người tham gia.

Tài nguyên conferenceRecords.participants bao gồm trường user. user chỉ có thể là một trong các đối tượng sau:

  • signedinUser là:

    • Một cá nhân tham gia từ máy tính cá nhân, thiết bị di động hoặc thông qua Chế độ đồng hành.

    • Tài khoản robot được các thiết bị trong phòng hội nghị sử dụng.

  • anonymousUser là người dùng không xác định và chưa đăng nhập vào Tài khoản Google.

  • phoneUser là người dùng gọi điện từ điện thoại mà danh tính của người dùng không xác định được vì họ chưa đăng nhập bằng Tài khoản Google.

Tìm kiếm tất cả người tham gia

Để biết thông tin chi tiết về tất cả người tham gia trong một bản ghi hội nghị, hãy sử dụng phương thức list() trên tài nguyên conferenceRecords.participants với tham số đường dẫn parent.

Bạn có thể sử dụng các trường earliestStartTime hoặc latestEndTime để lọc tìm những người dùng đã tham gia trước hoặc đã rời khỏi sau một khoảng thời gian nhất định. Cả hai trường đều sử dụng định dạng Timestamp (Dấu thời gian) ở định dạng UTC "Zulu" RFC 3339, với độ phân giải nano giây và tối đa 9 phân số: {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z. Ví dụ:

  • earliestStartTime < 2023-10-01T15:01:23Z
  • latestEndTime < 2023-10-01T15:01:23Z

Để mời người tham gia đang hoạt động trong một hội nghị truyền hình hiện có, hãy sử dụng latestEndTime IS NULL.

Phương thức này sẽ trả về một danh sách những người tham gia hội nghị, được sắp xếp theo thời gian tham gia giảm dần, dưới dạng một thực thể của tài nguyên conferenceRecords.participants.

Mã mẫu sau đây cho biết cách liệt kê tất cả người tham gia trong một bản ghi hội nghị truyền hình:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/listparticipants/AsyncListParticipants.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecordName;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.ListParticipantsRequest;
import com.google.apps.meet.v2.Participant;

public class AsyncListParticipants {

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

  public static void asyncListParticipants() 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()) {
      ListParticipantsRequest request =
          ListParticipantsRequest.newBuilder()
              .setParent(ConferenceRecordName.of("[CONFERENCE_RECORD]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .build();
      ApiFuture<Participant> future =
          conferenceRecordsServiceClient.listParticipantsPagedCallable().futureCall(request);
      // Do something.
      for (Participant element : future.get().iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participants.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. Format: `conferenceRecords/{conference_record}`
 */
// const parent = 'abc123'
/**
 *  Maximum number of participants to return. The service might return fewer
 *  than this value.
 *  If unspecified, at most 100 participants are returned.
 *  The maximum value is 250; values above 250 are coerced to 250.
 *  Maximum might change in the future.
 */
// const pageSize = 1234
/**
 *  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:
 *  * `earliest_start_time`
 *  * `latest_end_time`
 *  For example, `latest_end_time IS NULL` returns active participants in
 *  the conference.
 */
// const filter = 'abc123'

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

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

async function callListParticipants() {
  // Construct request
  const request = {
    parent,
  };

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

callListParticipants();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_list_participants_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_participants():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

    # Initialize request argument(s)
    request = meet_v2.ListParticipantsRequest(
        parent="parent_value",
    )

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

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

Thay thế giá trị gốc bằng tên của bản ghi hội nghị truyền hình.

Tìm người tham gia cụ thể

Để tìm kiếm một người tham gia cụ thể, hãy sử dụng phương thức get() trên tài nguyên conferenceRecords.participants bằng tham số đường dẫn name. Để truy xuất tên của người tham gia, hãy sử dụng phương thức conferenceRecords.participants.list.

Phương thức này sẽ trả về tên người tham gia dưới dạng thực thể của tài nguyên conferenceRecords.participants.

Mã mẫu sau đây cho biết cách truy xuất một người tham gia cụ thể:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/getparticipant/AsyncGetParticipant.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.GetParticipantRequest;
import com.google.apps.meet.v2.Participant;
import com.google.apps.meet.v2.ParticipantName;

public class AsyncGetParticipant {

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

  public static void asyncGetParticipant() 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()) {
      GetParticipantRequest request =
          GetParticipantRequest.newBuilder()
              .setName(ParticipantName.of("[CONFERENCE_RECORD]", "[PARTICIPANT]").toString())
              .build();
      ApiFuture<Participant> future =
          conferenceRecordsServiceClient.getParticipantCallable().futureCall(request);
      // Do something.
      Participant response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant.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 participant.
 */
// const name = 'abc123'

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

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

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

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

callGetParticipant();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_get_participant_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_participant():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

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

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

    # Handle the response
    print(response)

Thay thế tên người tham gia bằng tên của người tham gia cụ thể đó để tìm.

Phiên có sự tham gia của người tham gia

Các phần sau đây trình bày chi tiết cách lấy thông tin về các phiên của người tham gia.

Tìm kiếm tất cả phiên của người tham gia

Để biết thông tin chi tiết về tất cả phiên người tham gia của một người tham gia trong bản ghi hội nghị, hãy sử dụng phương thức list() trên tài nguyên conferenceRecords.participants.participantSessions với tham số đường dẫn parent.

Bạn có thể sử dụng các trường startTime hoặc endTime để lọc những người dùng đã tham gia trước hoặc đã rời khỏi sau một khoảng thời gian nhất định. Cả hai trường đều sử dụng định dạng Timestamp (Dấu thời gian) ở định dạng "Zulu" RFC 3339 (UTC), với độ phân giải nano giây và tối đa chín chữ số phân số: {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z. Ví dụ:

  • startTime < 2023-10-01T15:01:23Z
  • endTime < 2023-10-01T15:01:23Z

Phương thức này trả về một danh sách các phiên của người tham gia, được sắp xếp theo thời gian tham gia giảm dần, dưới dạng một thực thể của tài nguyên conferenceRecords.participants.participantSession.

Mã mẫu sau đây cho biết cách liệt kê tất cả các phiên của người tham gia trong một bản ghi hội nghị:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/listparticipantsessions/AsyncListParticipantSessions.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.ListParticipantSessionsRequest;
import com.google.apps.meet.v2.ParticipantName;
import com.google.apps.meet.v2.ParticipantSession;

public class AsyncListParticipantSessions {

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

  public static void asyncListParticipantSessions() 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()) {
      ListParticipantSessionsRequest request =
          ListParticipantSessionsRequest.newBuilder()
              .setParent(ParticipantName.of("[CONFERENCE_RECORD]", "[PARTICIPANT]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .build();
      ApiFuture<ParticipantSession> future =
          conferenceRecordsServiceClient.listParticipantSessionsPagedCallable().futureCall(request);
      // Do something.
      for (ParticipantSession element : future.get().iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participant_sessions.js
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(parent) {
  /**
   * 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. Format:
   *  `conferenceRecords/{conference_record}/participants/{participant}`
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of participant sessions to return. The service
   *  might return fewer than this value. If unspecified, at most 100
   *  participants are returned. The maximum value is 250; values above 250 are
   *  coerced to 250. 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:
   *  * `start_time`
   *  * `end_time`
   *  For example, `end_time IS NULL` returns active participant sessions in
   *  the conference record.
   */
  // const filter = 'abc123'

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

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

  async function callListParticipantSessions() {
    // Construct request
    const request = {
      parent,
    };

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

  callListParticipantSessions();
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_list_participant_sessions_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_participant_sessions():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

    # Initialize request argument(s)
    request = meet_v2.ListParticipantSessionsRequest(
        parent="parent_value",
    )

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

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

Thay thế giá trị gốc bằng tên của bản ghi hội nghị và tên người tham gia.

Tìm kiếm phiên của người tham gia cụ thể

Để tìm kiếm một phiên hoạt động cụ thể của người tham gia, hãy sử dụng phương thức get() trên tài nguyên conferenceRecords.participants.participantSessions với tham số đường dẫn name. Để truy xuất tên của người tham gia, hãy sử dụng phương thức list().

Phương thức này sẽ trả về tên người tham gia dưới dạng thực thể của tài nguyên conferenceRecords.participants.participantSessions.

Mã mẫu sau đây cho biết cách truy xuất một phiên hoạt động cụ thể của người tham gia:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/getparticipantsession/AsyncGetParticipantSession.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.ConferenceRecordsServiceClient;
import com.google.apps.meet.v2.GetParticipantSessionRequest;
import com.google.apps.meet.v2.ParticipantSession;
import com.google.apps.meet.v2.ParticipantSessionName;

public class AsyncGetParticipantSession {

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

  public static void asyncGetParticipantSession() 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()) {
      GetParticipantSessionRequest request =
          GetParticipantSessionRequest.newBuilder()
              .setName(
                  ParticipantSessionName.of(
                          "[CONFERENCE_RECORD]", "[PARTICIPANT]", "[PARTICIPANT_SESSION]")
                      .toString())
              .build();
      ApiFuture<ParticipantSession> future =
          conferenceRecordsServiceClient.getParticipantSessionCallable().futureCall(request);
      // Do something.
      ParticipantSession response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant_session.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 participant.
 */
// const name = 'abc123'

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

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

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

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

callGetParticipantSession();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_get_participant_session_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_participant_session():
    # Create a client
    client = meet_v2.ConferenceRecordsServiceAsyncClient()

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

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

    # Handle the response
    print(response)

Thay thế tên người tham gia bằng tên của người tham gia cụ thể đó để tìm.