Work with meeting spaces

A meeting space represents a virtual place or a persistent object (such as a meeting room) where conferences are held. Only one active conference can be held in one space at any time. A meeting space also helps users meet and find shared resources.

The following sections detail how to create, get, and update a meeting space.

Create a meeting space

To create a meeting space, use the create method on the spaces resource.

The method returns an instance of a spaces resource, which includes the SpaceConfig object that's the configuration for the meeting space. It also contains the ActiveConference object that's a link to the current conferenceRecords resource within the meeting space.

The following code sample shows how to create a meeting space:

Java

import com.google.apps.meet.v2.Space;
import com.google.apps.meet.v2.SpacesServiceClient;

public class CreateSpace {
  public static void main(String[] args) throws Exception {
    syncCreateSpaceSpace();
  }

  public static void syncCreateSpace() throws Exception {
    try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      Space space = Space.newBuilder().build();
      Space response = spacesServiceClient.createSpace(space);
    }
  }
}

Node.js


const {SpacesServiceClient} = require('@google-cloud/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

from google.apps import meet_v2

def sample_create_space():
    # Create a client
    client = meet_v2.SpacesServiceClient()

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

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

    # Handle the response
    print(response)

Get a meeting space

To get details about a meeting space, use the get method on the spaces resource with a specified name, such as a meeting code formatted like spaces/abc-mnop-xyz.

The method returns a meeting space as an instance of the space resource.

The following code sample shows how to retrieve a meeting space:

Java

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 SyncGetSpace {

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

  public static void syncGetSpace() throws Exception {
    try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
      GetSpaceRequest request =
          GetSpaceRequest.newBuilder().setName(SpaceName.of("NAME").toString()).build();
      Space response = spacesServiceClient.getSpace(request);
    }
  }
}

Node.js


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

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

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

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

callCreateSpace();

Python


from google.apps import meet_v2

def sample_get_space():
    # Create a client
    client = meet_v2.SpacesServiceClient()

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

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

    # Handle the response
    print(response)

Replace NAME with the unique server-generated ID for the meeting space.

Update a meeting space

To update the details of a meeting space, use the patch method on the spaces resource with a specified space.name.

The patch method also takes an optional updateMask parameter. The field is of type FieldMask. This is a comma-delimited list of fields you want to update in the space.

The method returns a meeting space as an instance of the spaces resource.

End active conference

To end an active conference within a meeting space, use the spaces.endActiveConference method on the spaces resource. Both the request and response body are empty.