Toplantı alanlarıyla çalışma

Google Meet REST API resmi

Toplantı alanı, konferansların düzenlendiği sanal bir yeri veya kalıcı nesneyi (ör. toplantı odası) temsil eder. Tek bir alanda aynı anda yalnızca bir etkin konferans düzenlenebilir. Toplantı alanı, kullanıcıların bir araya gelerek ortak kaynakları bulmalarına da yardımcı olur.

Aşağıdaki bölümlerde, toplantı alanının nasıl oluşturulacağı, alınacağı ve güncelleneceği açıklanmaktadır.

Meet bir toplantı alanını nasıl tanımlar?

Google Meet REST API, her toplantı alanı için bir spaces kaynağı oluşturur. name alanı, kaynağın kaynak adıdır.

Aşağıda, name alanını kullanarak toplantı alanı belirlemenin iki önemli yöntemi açıklanmıştır:

  • space, alanın spaces/{space} biçimindeki kaynak tanımlayıcısıdır. Bu, sunucu tarafından oluşturulan benzersiz bir kimliktir ve büyük/küçük harfe duyarlıdır. Örneğin, spaces/jQCFfuBOdN5z.

  • meetingCode, alanın takma adı olup spaces/{meetingCode} biçimindedir. Yazılabilir, benzersiz bir karakter dizesidir ve büyük/küçük harfe duyarlı değildir. Örneğin, abc-mnop-xyz. Maksimum uzunluk 128 karakterdir. meetingUri kapsamındadır: https://meet.google.com/abc-mnop-xyz.

Bir toplantı alanını yönetmek üzere {name} alanı için aşağıdaki değerleri kullanın:

  • Bir toplantı alanı hakkında ayrıntılı bilgi almak için spaces/{space} adresini veya spaces/{meetingCode} takma adını kullanabilirsiniz. Daha fazla bilgi için Toplantı alanı alma başlıklı makaleyi inceleyin.

  • Bir toplantı alanının ayrıntılarını güncellemek için yalnızca spaces/{space} kullanabilirsiniz. Daha fazla bilgi edinmek için Toplantı alanını güncelleme başlıklı makaleyi inceleyin.

  • Bir toplantı alanındaki etkin bir konferansı sonlandırmak için yalnızca spaces/{space} kullanabilirsiniz. Daha fazla bilgi için Etkin konferansı sonlandırma bölümüne bakın.

Toplantı alanı oluşturun

Toplantı alanı oluşturmak için spaces kaynağında create yöntemini kullanın.

Yöntem, toplantı alanının yapılandırması olan SpaceConfig nesnesini içeren bir spaces kaynağının örneğini döndürür. Ayrıca, toplantı alanı içindeki mevcut conferenceRecords kaynağının bağlantısı olan ActiveConference nesnesini de içerir.

Aşağıdaki kod örneğinde bir toplantı alanının nasıl oluşturulacağı gösterilmektedir:

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)

Toplantı alanı edinin

Bir toplantı alanıyla ilgili ayrıntıları almak için spaces kaynağında belirtilen name ile get yöntemini kullanın. Daha fazla bilgi için Meet toplantı alanını nasıl tanımlar? bölümüne bakın.

Yöntem, space kaynağının örneği olarak bir toplantı alanı döndürür.

Aşağıdaki kod örneğinde, toplantı alanının nasıl alınacağı gösterilmektedir:

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)

Alan adını, toplantı alanı için sunucu tarafından oluşturulan benzersiz kimlikle değiştirin.

Toplantı alanını güncelleme

Bir toplantı alanının ayrıntılarını güncellemek için spaces kaynağında, belirtilen bir name ile patch yöntemini kullanın. Daha fazla bilgi için Meet toplantı alanını nasıl tanımlar? bölümüne bakın.

patch yöntemi, isteğe bağlı bir updateMask parametresi de alır. Bu alan FieldMask türündedir. Bu, alanda güncellemek istediğiniz alanların virgülle ayrılmış bir listesidir.

Yöntem, spaces kaynağının örneği olarak bir toplantı alanı döndürür.

Aşağıdaki kod örneğinde, bir toplantı alanının nasıl güncelleneceği gösterilmektedir:

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)

Alan adını, toplantı alanı için sunucu tarafından oluşturulan benzersiz kimlikle değiştirin.

Etkin konferansı sonlandır

Bir toplantı alanındaki etkin bir konferansı sonlandırmak için spaces kaynağında spaces.endActiveConference yöntemini kullanın. Hem istek hem de yanıt gövdesi boş. Daha fazla bilgi için Meet toplantı alanını nasıl belirler? bölümüne bakın.

Aşağıdaki kod örneğinde, etkin bir konferansın nasıl sonlandırılacağı gösterilmektedir:

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)

Alan adını, toplantı alanı için sunucu tarafından oluşturulan benzersiz kimlikle değiştirin.