ใช้งานพื้นที่ทํางานในการประชุม

API ของ REST สำหรับ Google Meet
ภาพ

สถานที่ประชุมเป็นตัวแทนของ สถานที่หรือวัตถุถาวร (เช่น ห้องประชุม) ที่จัดการประชุม พัก คุณสามารถจัดการประชุมที่ใช้งานอยู่ได้เพียง 1 รายการในพื้นที่ทำงานเดียวในแต่ละครั้ง การประชุม พื้นที่ทำงานยังช่วยให้ผู้ใช้สามารถพบปะและค้นหาทรัพยากรที่ใช้ร่วมกันได้อีกด้วย

ส่วนต่อไปนี้จะอธิบายวิธีสร้าง รับ และอัปเดตพื้นที่การประชุม

วิธีที่ Meet ระบุพื้นที่การประชุม

Google Meet REST API จะสร้าง spaces ทรัพยากรของพื้นที่การประชุมแต่ละแห่ง ฟิลด์ name คือชื่อทรัพยากรสำหรับ ทรัพยากร

วิธีระบุพื้นที่การประชุมที่สำคัญมี 2 วิธี ดังนี้ ช่อง name:

  • space คือตัวระบุทรัพยากรสำหรับพื้นที่ทำงาน โดยมีรูปแบบเป็น spaces/{space} ซึ่งเป็นรหัสที่ไม่ซ้ำกันที่เซิร์ฟเวอร์สร้างขึ้นและคำนึงถึงตัวพิมพ์เล็กและตัวพิมพ์ใหญ่ เช่น spaces/jQCFfuBOdN5z

  • meetingCode เป็นชื่อแทนของพื้นที่ทำงาน ซึ่งมีรูปแบบเป็น spaces/{meetingCode} ซึ่งเป็นสตริงอักขระที่ไม่ซ้ำกันที่พิมพ์ได้และ ไม่คำนึงถึงตัวพิมพ์เล็กและตัวพิมพ์ใหญ่ เช่น abc-mnop-xyz ความยาวสูงสุดคือ 128 อักขระ อักขระ ซึ่งเป็นส่วนหนึ่งของ meetingUri: https://meet.google.com/abc-mnop-xyz

หากต้องการจัดการพื้นที่การประชุม ให้ใช้ค่าต่อไปนี้สำหรับช่อง {name}

  • หากต้องการดูรายละเอียดเกี่ยวกับพื้นที่การประชุม คุณสามารถใช้ spaces/{space} หรือ ชื่อแทน spaces/{meetingCode} โปรดดูข้อมูลเพิ่มเติมที่หัวข้อนัดประชุม พื้นที่ทำงาน

  • หากต้องการอัปเดตรายละเอียดของพื้นที่การประชุม คุณจะใช้ได้เฉพาะ spaces/{space} เท่านั้น โปรดดูข้อมูลเพิ่มเติมที่หัวข้ออัปเดตพื้นที่การประชุม

  • หากต้องการจบการประชุมที่ทำงานอยู่ภายในพื้นที่ประชุม คุณจะใช้ได้เฉพาะ spaces/{space} โปรดดูข้อมูลเพิ่มเติมที่หัวข้อสิ้นสุดการใช้งาน การประชุม

สร้างพื้นที่การประชุม

หากต้องการสร้างพื้นที่ประชุม ให้ใช้ create ใน แหล่งข้อมูล spaces

เมธอดจะแสดงอินสแตนซ์ของทรัพยากร spaces ซึ่งมีเมธอด SpaceConfig ออบเจ็กต์ที่ การกำหนดค่าของพื้นที่ประชุม และยังมี ออบเจ็กต์ ActiveConference รายการ เป็นลิงก์ไปที่ แหล่งข้อมูล conferenceRecords ในพื้นที่ประชุม

ตัวอย่างโค้ดต่อไปนี้แสดงวิธีสร้างพื้นที่การประชุม

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/spacesservice/createspace/AsyncCreateSpace.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.CreateSpaceRequest;
import com.google.apps.meet.v2.Space;
import com.google.apps.meet.v2.SpacesServiceClient;

public class AsyncCreateSpace {

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

  public static void asyncCreateSpace() 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 (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      CreateSpaceRequest request =
          CreateSpaceRequest.newBuilder().setSpace(Space.newBuilder().build()).build();
      ApiFuture<Space> future = spacesServiceClient.createSpaceCallable().futureCall(request);
      // Do something.
      Space response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/spaces_service.create_space.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.
 */
/**
 *  Space to be created. As of May 2023, the input space can be empty. Later on
 *  the input space can be non-empty when space configuration is introduced.
 */
// const space = {}

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

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

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

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

callCreateSpace();

Python

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

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

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

    # Handle the response
    print(response)

เลือกพื้นที่จัดประชุม

หากต้องการดูรายละเอียดเกี่ยวกับพื้นที่การประชุม ให้ใช้ get ใน ทรัพยากร spaces ที่มี name ที่ระบุ โปรดดูข้อมูลเพิ่มเติมที่หัวข้อวิธีที่ Meet ระบุการประชุม พื้นที่ทำงาน

เมธอดจะแสดงพื้นที่การประชุมเป็นอินสแตนซ์ของ แหล่งข้อมูล space

ตัวอย่างโค้ดต่อไปนี้แสดงวิธีเรียกข้อมูลพื้นที่การประชุม

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/spacesservice/getspace/AsyncGetSpace.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.GetSpaceRequest;
import com.google.apps.meet.v2.Space;
import com.google.apps.meet.v2.SpaceName;
import com.google.apps.meet.v2.SpacesServiceClient;

public class AsyncGetSpace {

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

  public static void asyncGetSpace() 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 (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      GetSpaceRequest request =
          GetSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
      ApiFuture<Space> future = spacesServiceClient.getSpaceCallable().futureCall(request);
      // Do something.
      Space response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/spaces_service.get_space.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 space.
 */
// const name = 'abc123'

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

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

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

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

callGetSpace();

Python

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

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

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

    # Handle the response
    print(response)

เปลี่ยนชื่อพื้นที่ทำงานด้วยรหัสเฉพาะที่เซิร์ฟเวอร์สร้างสำหรับการประชุม พื้นที่ทำงาน

อัปเดตพื้นที่การประชุม

หากต้องการอัปเดตรายละเอียดของพื้นที่การประชุม ให้ใช้ patch ใน ทรัพยากร spaces ที่มี name ที่ระบุ โปรดดูข้อมูลเพิ่มเติมที่หัวข้อวิธีที่ Meet ระบุการประชุม พื้นที่ทำงาน

เมธอด patch ยังใส่พารามิเตอร์ updateMask ที่ไม่บังคับด้วย ช่องนี้คือ ของประเภท FieldMask ซึ่งเป็นรายการช่องที่คั่นด้วยคอมมาที่คุณต้องการอัปเดตในพื้นที่ทำงาน

เมธอดจะแสดงพื้นที่การประชุมเป็นอินสแตนซ์ของ แหล่งข้อมูล spaces

ตัวอย่างโค้ดต่อไปนี้แสดงวิธีอัปเดตพื้นที่การประชุม

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/spacesservice/updatespace/AsyncUpdateSpace.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.Space;
import com.google.apps.meet.v2.SpacesServiceClient;
import com.google.apps.meet.v2.UpdateSpaceRequest;
import com.google.protobuf.FieldMask;

public class AsyncUpdateSpace {

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

  public static void asyncUpdateSpace() 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 (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      UpdateSpaceRequest request =
          UpdateSpaceRequest.newBuilder()
              .setSpace(Space.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .build();
      ApiFuture<Space> future = spacesServiceClient.updateSpaceCallable().futureCall(request);
      // Do something.
      Space response = future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/spaces_service.update_space.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. Space to be updated.
 */
// const space = {}
/**
 *  Optional. Field mask used to specify the fields to be updated in the space.
 *  If update_mask isn't provided, it defaults to '*' and updates all
 *  fields provided in the request, including deleting fields not set in the
 *  request.
 */
// const updateMask = {}

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

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

async function callUpdateSpace() {
  // Construct request
  const request = {
    space,
  };

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

callUpdateSpace();

Python

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

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

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

    # Handle the response
    print(response)

เปลี่ยนชื่อพื้นที่ทำงานด้วยรหัสเฉพาะที่เซิร์ฟเวอร์สร้างสำหรับการประชุม พื้นที่ทำงาน

สิ้นสุดการประชุมที่ใช้งานอยู่

หากต้องการจบการประชุมที่กำลังดำเนินอยู่ในพื้นที่จัดประชุม ให้ใช้ spaces.endActiveConference ในทรัพยากร spaces ทั้ง ไม่มีข้อมูลคำขอและเนื้อหาการตอบกลับ สำหรับข้อมูลเพิ่มเติม โปรดดู วิธีการ Meet จะระบุพื้นที่การประชุม

ตัวอย่างโค้ดต่อไปนี้แสดงวิธีจบการประชุมที่ใช้งานอยู่

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/spacesservice/endactiveconference/AsyncEndActiveConference.java
import com.google.api.core.ApiFuture;
import com.google.apps.meet.v2.EndActiveConferenceRequest;
import com.google.apps.meet.v2.SpaceName;
import com.google.apps.meet.v2.SpacesServiceClient;
import com.google.protobuf.Empty;

public class AsyncEndActiveConference {

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

  public static void asyncEndActiveConference() 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 (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      EndActiveConferenceRequest request =
          EndActiveConferenceRequest.newBuilder()
              .setName(SpaceName.of("[SPACE]").toString())
              .build();
      ApiFuture<Empty> future =
          spacesServiceClient.endActiveConferenceCallable().futureCall(request);
      // Do something.
      future.get();
    }
  }
}

Node.js

packages/google-apps-meet/samples/generated/v2/spaces_service.end_active_conference.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 space.
 */
// const name = 'abc123'

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

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

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

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

callEndActiveConference();

Python

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

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

    # Make the request
    await client.end_active_conference(request=request)

เปลี่ยนชื่อพื้นที่ทำงานด้วยรหัสเฉพาะที่เซิร์ฟเวอร์สร้างสำหรับการประชุม พื้นที่ทำงาน