이 가이드에서는 Google Meet REST API의 spaces
리소스에서 회의 공간을 만들고 가져오고 업데이트하는 방법과 활성 회의를 종료하는 방법을 설명합니다.
회의 공간 만들기
회의 공간을 만들려면 spaces
리소스에서 create
메서드를 사용합니다.
이 메서드는 회의 공간의 구성인 SpaceConfig
객체가 포함된 spaces
리소스의 인스턴스를 반환합니다. 또한 회의 공간 내의 현재 conferenceRecords
리소스로 연결되는 링크인 ActiveConference
객체도 포함되어 있습니다.
다음 코드 샘플은 회의 공간을 만드는 방법을 보여줍니다.
자바
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
/** * 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
# 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)
회의 공간에 대한 세부정보 가져오기
활성 회의 공간 및 설정에 관한 세부정보를 가져오려면 지정된 name
과 함께 spaces
리소스의 get
메서드를 사용합니다. 자세한 내용은 Meet에서 회의 공간을 식별하는 방법을 참고하세요.
이 메서드는 회의 공간을 spaces
리소스의 인스턴스로 반환합니다. 활성 회의가 있는지 확인하려면 activeConference
필드를 검사합니다.
다음 코드 샘플은 회의 공간을 검색하는 방법을 보여줍니다.
자바
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
/** * 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. * Format: `spaces/{space}` or `spaces/{meetingCode}`. * `{space}` is the resource identifier for the space. It's a unique, * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. * `{meetingCode}` is an alias for the space. It's a typeable, unique * character string and is non-case sensitive. For example, `abc-mnop-xyz`. * The maximum length is 128 characters. * A `meetingCode` shouldn't be stored long term as it can become * dissociated from a meeting space and can be reused for different meeting * spaces in the future. Generally, a `meetingCode` expires 365 days after * last use. For more information, see Learn about meeting codes in Google * Meet (https://support.google.com/meet/answer/10710509). * For more information, see How Meet identifies a meeting * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-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
# 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)
스페이스 이름 값을 회의 스페이스의 고유한 서버 생성 ID로 바꿉니다.
회의 공간 업데이트
회의 공간의 세부정보를 업데이트하려면 지정된 name
를 사용하여 spaces
리소스의 patch
메서드를 사용합니다. 자세한 내용은 Meet에서 회의 공간을 식별하는 방법을 참고하세요.
patch
메서드는 선택적 updateMask
쿼리 매개변수도 사용합니다. 이 필드는 FieldMask
유형입니다.
스페이스에서 업데이트하려는 필드의 쉼표로 구분된 목록입니다.
이 메서드는 회의 공간을 spaces
리소스의 인스턴스로 반환합니다.
다음 코드 샘플은 회의 공간을 업데이트하는 방법을 보여줍니다.
자바
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
/** * 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(not set, set with empty paths, or only has "" * as paths), it defaults to update all fields provided with values in the * request. * Using "*" as update_mask will update all fields, 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
# 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)
스페이스 이름 값을 회의 스페이스의 고유한 서버 생성 ID로 바꿉니다.
진행 중인 회의 종료
회의 공간 (있는 경우) 내에서 진행 중인 회의를 종료하려면 spaces
리소스에서 endActiveConference
메서드를 사용합니다.
요청 본문과 응답 본문이 모두 비어 있습니다. 자세한 내용은 Meet에서 회의 공간을 식별하는 방법을 참고하세요.
다음 코드 샘플은 진행 중인 회의를 종료하는 방법을 보여줍니다.
자바
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
/** * 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. * Format: `spaces/{space}`. * `{space}` is the resource identifier for the space. It's a unique, * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. * For more information, see How Meet identifies a meeting * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-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
# 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)
스페이스 이름 값을 회의 스페이스의 고유한 서버 생성 ID로 바꿉니다.