次の方法で共有


クイックスタート: ルーム リソースを作成して管理する

このクイックスタートは、Azure Communication Services ルームの使用を開始する際に役立ちます。 room は、事前に決められた期間に共同作業する、既知の固定された一連の参加者を対象とした、サーバー側で管理される通信領域です。 ルームの概念説明のドキュメントでは、rooms の詳細およびユース ケースについて説明します。

オブジェクト モデル

次の表は、room オブジェクトの主要なプロパティを示しています。

名前 説明
roomId 一意な room 識別子。
validFrom room を使用できる最も早い時刻。
validUntil room を使用できる最も遅い時刻。
pstnDialOutEnabled 部屋の PSTN 番号へのダイヤルアウトを有効または無効にします。
participants room への参加者の一覧。 CommunicationIdentifier として指定します。
roleType ルームへの参加者に割り当てられているロール。 これは、PresenterAttendee、または Consumer のいずれかです。

前提条件

設定

拡張機能の追加

az extension コマンドを使用して、Azure CLI の Azure Communication Services 拡張機能を追加します。

az extension add --name communication

Azure CLI へのサインイン

Azure CLI にサインインする必要があります。 ターミナルから az login コマンドを実行し、資格情報を入力してサインインできます。

環境変数に接続文字列を格納する

AZURE_COMMUNICATION_CONNECTION_STRING 環境変数を構成して Azure CLI のキー操作を使用できます。このとき、--connection_string を使用して接続文字列を渡す必要はありません。 環境変数を構成するには、コンソール ウィンドウを開き、以下のタブからお使いのオペレーティン グシステムを選択します。 <connectionString> は、実際の接続文字列に置き換えてください。

setx AZURE_COMMUNICATION_CONNECTION_STRING "<connectionString>"

環境変数を追加した後、コンソール ウィンドウを含め、環境変数を読み取る必要がある実行中のプログラムの再起動が必要になる場合があります。 たとえば、Visual Studio をエディターとして使用している場合、サンプルを実行する前に Visual Studio を再起動します。

操作

ルームを作成する

rooms create コマンドを使用して、ルームを作成します。

az communication rooms create --presenter-participants "<participantId>" --consumer-participants "<participantId>" --attendee-participant "<participantId>" --valid-from "<valid-from>" --valid-until "<valid-until>" --pstn-dial-out-enabled "<pstn-dial-out-enabled>" --connection-string "<connection-string>"
  • 必要に応じて <participantId> を使用して、参加者の種類として presenter-participants、consumer-participants、または attendee-participants を指定します。 値を指定しない場合、既定値は空です。
  • <connection-string> を Azure Communication Services 接続文字列に置き換えます。
  • 必要に応じて <valid-from> を使用して、ルームが参加のために公開されるときのタイムスタンプを ISO8601 形式で指定します (例: 2022-07-14T10:21)。
  • 必要に応じて <valid-until> を使用して、ルームに参加できなくなるときのタイムスタンプを ISO8601 形式で指定します (例: 2022-07-14T10:21)。
  • オプションで、このフラグ ("True" または "False") を設定して <pstn-dial-out-enabled> を使用することにより、ルームの PSTN ダイヤル発信を有効または無効にすることができます。 部屋を作成する場合、既定では、このフラグは "False" に設定されています。

前述のように接続文字列を環境変数に保存した場合、それらをコマンドに渡す必要はありません。

az communication rooms create 

ルームの PSTN ダイヤルアウト機能を有効にする

--pstn-dial-out-enabled パラメーターを "True" と定義することで、rooms create の間に PSTN ダイヤルアウトを有効にすることができます。 この機能は、rooms update の間に --pstn-dial-out-enabled パラメーターを指定して変更することもできます。

az communication rooms create --pstn-dial-out-enabled "<pstn-dial-out-enabled>" --connection-string "<connection-string>"
az communication rooms update --pstn-dial-out-enabled "<pstn-dial-out-enabled>" --room "<roomId>"
  • ルームの PSTN ダイヤル発信を有効または無効にするには、<pstn-dial-out-enabled> フラグ ("True" または "False") を設定します。

ルームを取得する

rooms get コマンドは、既存のルームの属性を返します。

az communication rooms get --room "<roomId>" 
  • <roomId> は、実際のルーム ID に置き換えてください。

ルームの期間を更新する

ルームのタイムスタンプを更新できます。 room update コマンドを呼び出す前に、期間が有効な新しいルームを取得したことを確認します。

az communication rooms update --valid-from "<valid-from>" --valid-until "<valid-until>" --pstn-dial-out-enabled "<pstn-dial-out-enabled>" --room "<roomId>"
  • <valid-from> は ISO8601 形式のタイムスタンプに置き換え (例: 2022-07-14T10:21)、ルームが参加のためにいつ公開されるかを指定します。 これは、--valid-until と共に使用する必要があります。
  • <valid-until> は ISO8601 形式のタイムスタンプに置き換え (例: 2022-07-14T10:21)、ルームにいつ参加できなくなるかを指定します。 これは、--valid-from と共に使用する必要があります。
  • このフラグ ("True" または "False") の <pstn-dial-out-enabled> 設定を置き換えることにより、部屋の PSTN ダイヤル発信を有効または無効にします。 これは、--pstn-dial-out-enabled と共に使用する必要があります。
  • <roomId> は、実際のルーム ID に置き換えてください。

すべてのアクティブなルームを一覧表示する

rooms list コマンドは、Azure Communication Services リソースに属するすべてのアクティブ ルームを返します。

az communication rooms list

新しい参加者を追加するか、既存の参加者を更新する

ルームを作成するときに、新しい参加者を追加するか、既存の参加者を更新することで、ルームを更新できます。 room participant add-or-update コマンドを呼び出す前に、新しいユーザーを取得したことを確認します。

identity user create コマンドを使用して、participantId で識別される新しい参加者を作成します。

az communication identity user create

ルームに参加者としてユーザーを追加します。

az communication rooms participant add-or-update --attendee-participant "<participantId>" --room "<roomId>"
  • <participantId> は、実際の参加者 ID に置き換えてください。 <participantId> がルームに存在しない場合、参加者は出席者ロールとしてルームに追加されます。 それ以外の場合は、参加者のロールが出席者ロールに更新されます。
  • <roomId> は、実際のルーム ID に置き換えてください。

ルーム内の参加者の一覧を取得する

az communication rooms participant get --room "<roomId>"
  • <roomId> は、実際のルーム ID に置き換えてください。

ルームから参加者を削除する

rooms participant -remove を使用して、ルームからルーム参加者を削除できます。

az communication rooms participant remove --room "<roomId>" --participants "<participant1>" "<participant2>" "<participant3>"
  • <roomId> は、実際のルーム ID に置き換えてください。
  • <participant1><participant2><participant3> は、前に identity user create コマンドを実行して取得した実際のユーザー ID に置き換えてください。

ルームを削除する

ルームの作成と同様に、ルームを削除することもできます。

既存のルームを削除するには、room delete コマンドを使用します。

az communication rooms delete --room "<roomId>"
  • <roomId> は、実際のルーム ID に置き換えてください。

このクイックスタートは、Azure Communication Services ルームの使用を開始する際に役立ちます。 room は、事前に決められた期間に共同作業する、既知の固定された一連の参加者を対象とした、サーバー側で管理される通信領域です。 ルームの概念説明のドキュメントでは、rooms の詳細およびユース ケースについて説明します。

前提条件

サンプル コード

このクイック スタートのサンプル コードは、GitHub で確認してダウンロードできます。

設定

新しい C# アプリケーションを作成する

コンソール ウィンドウ (cmd、PowerShell、Bash など) で、dotnet new コマンドを使用し、RoomsQuickstart という名前で新しいコンソール アプリを作成します。 このコマンドにより、1 つのソース ファイルを使用する単純な "Hello World" C# プロジェクトが作成されます。Program.cs

dotnet new console -o RoomsQuickstart

新しく作成したアプリ フォルダーにディレクトリを変更し、dotnet build コマンドを使用してアプリケーションをコンパイルします。

cd RoomsQuickstart
dotnet build

パッケージをインストールする

[NuGet][https://www.nuget.org/] で .NET 用 Azure Communication Rooms クライアント ライブラリをインストールします。

dotnet add package Azure.Communication.Rooms

.NET バージョン 1.1.0 以降の Azure Communication Rooms クライアント ライブラリを使用する必要があります。

アプリのフレームワークを設定する

Program.cs ファイルに、次のコードを追加して、必要な名前空間をインポートし、基本的なプログラム構造を作成します。


using System;
using Azure;
using Azure.Core;
using Azure.Communication.Rooms;

namespace RoomsQuickstart
{
    class Program
    {
        static async System.Threading.Tasks.Task Main(string[] args)
        {
            Console.WriteLine("Azure Communication Services - Rooms Quickstart");

            // Quickstart code goes here
        }
    }
}

ルーム クライアントを初期化する

新しい RoomsClient オブジェクトを作成します。このオブジェクトは、新しい rooms を作成し、そのプロパティとライフサイクルを管理するために使用されます。 Communications Service の接続文字列は、要求を認証するために使用されます。 接続文字列の詳細については、このページを参照してください。


// Find your Communication Services resource in the Azure portal
var connectionString = "<connection_string>";
RoomsClient roomsClient = new RoomsClient(connectionString);

ルームを作成する

ルーム参加者を設定する

ルームに参加できるユーザーを設定するには、それらのユーザーの ID の一覧が必要です。 ユーザーの作成とアクセス トークンの発行については、こちらの手順に従ってください。 または、オンデマンドでユーザーを作成する場合は、CommunicationIdentityClient を使用してユーザーを作成できます。

CommunicationIdentityClient を使用するには、次のパッケージをインストールします。

dotnet add package Azure.Communication.Identity

また、Program.cs ファイルの先頭にあるパッケージの名前空間をインポートします。

using Azure.Communication.Identity;

これで、CommunicationIdentityClient を初期化し、ユーザーの作成に使用できます。

// Create identities for users who will join the room
CommunicationIdentityClient identityClient = new CommunicationIdentityClient(connectionString);
CommunicationUserIdentifier user1 = identityClient.CreateUser();
CommunicationUserIdentifier user2 = identityClient.CreateUser();

次に、これらのユーザーを参照して、ルーム参加者の一覧を作成します。

List<RoomParticipant> participants = new List<RoomParticipant>()
{
    new RoomParticipant(user1) { Role = ParticipantRole.Presenter },
    new RoomParticipant(user2) // The default participant role is ParticipantRole.Attendee
};

ルームを初期化する

上記のコード スニペットで定義されている participants を使用して、新しい room を作成します。

// Create a room
DateTimeOffset validFrom = DateTimeOffset.UtcNow;
DateTimeOffset validUntil = validFrom.AddDays(1);
CancellationToken cancellationToken = new CancellationTokenSource().Token;

CommunicationRoom createdRoom = await roomsClient.CreateRoomAsync(validFrom, validUntil, participants, cancellationToken);

// CreateRoom or CreateRoomAsync methods can take CreateRoomOptions type as an input parameter.
bool pstnDialOutEnabled = false;
CreateRoomOptions createRoomOptions = new CreateRoomOptions()
{
    ValidFrom = validFrom,
    ValidUntil = validUntil,
    PstnDialOutEnabled = pstnDialOutEnabled,
    Participants = participants
};

createdRoom = await roomsClient.CreateRoomAsync(createRoomOptions, cancellationToken);
string roomId = createdRoom.Id;
Console.WriteLine("\nCreated room with id: " + roomId);

rooms はサーバー側のエンティティであるため、選択したストレージ メディアの roomId を追跡して保持することができます。 roomId を参照して、room オブジェクトのプロパティを表示または更新することができます。

ルームの PSTN ダイヤルアウト機能を有効にする

room では、既定で PSTN ダイヤルアウトが無効になっています。 pstnDialOutEnabled パラメーターを true と定義することで、作成時に room に対して PSTN ダイヤルアウトを有効にすることができます。 この機能を room に対して変更するには、pstnDialOutEnabled パラメーターに対して更新要求を発行します。

// Create a room
CancellationToken cancellationToken = new CancellationTokenSource().Token;

// CreateRoom or CreateRoomAsync methods to create a room with PSTN dial out capability
bool pstnDialOutEnabled = true;
CreateRoomOptions createRoomOptions = new CreateRoomOptions()
{
    PstnDialOutEnabled = pstnDialOutEnabled,
};

CommunicationRoom createdRoom = await roomsClient.CreateRoomAsync(createRoomOptions, cancellationToken);
Console.WriteLine("\nCreated a room with PSTN dial out enabled: " + createdRoom.PstnDialOutEnabled);

// UpdateRoom or UpdateRoomAsync methods can take UpdateRoomOptions to enable or disable PSTN dial out capability
pstnDialOutEnabled = false;
UpdateRoomOptions updateRoomOptions = new UpdateRoomOptions()
{
    PstnDialOutEnabled = pstnDialOutEnabled,
};

CommunicationRoom updatedRoom = await roomsClient.UpdateRoomAsync(roomId, updateRoomOptions, cancellationToken);
Console.WriteLine("\nUpdated a room with PSTN dial out enabled: " + updatedRoom.PstnDialOutEnabled);

既存のルームのプロパティを取得する

roomId を参照して、既存の room の詳細を取得します。


// Retrieve the room with corresponding ID
CommunicationRoom room = await roomsClient.GetRoomAsync(roomId);
Console.WriteLine("\nRetrieved room with id: " + room.Id);

ルームの有効期間を更新する

room の有効期間は、ValidFrom および ValidUntil パラメーターの更新要求を発行することによって変更できます。 ルームの有効期限は最大 6 か月です。


// Update room lifetime
DateTimeOffset updatedValidFrom = DateTimeOffset.UtcNow;
DateTimeOffset updatedValidUntil = DateTimeOffset.UtcNow.AddDays(10);
CommunicationRoom updatedRoom = await roomsClient.UpdateRoomAsync(roomId, updatedValidFrom, updatedValidUntil, cancellationToken);

// UpdateRoom or UpdateRoomAsync methods can take UpdateRoomOptions type as an input parameter.
bool pstnDialOutEnabled = true;
UpdateRoomOptions updateRoomOptions = new UpdateRoomOptions()
{
    ValidFrom = validFrom,
    ValidUntil = validUntil,
    PstnDialOutEnabled = pstnDialOutEnabled,
};

updatedRoom = await roomsClient.UpdateRoomAsync(roomId, updateRoomOptions, cancellationToken);
Console.WriteLine("\nUpdated room with validFrom: " + updatedRoom.ValidFrom + ", validUntil: " + updatedRoom.ValidUntil + " and pstnDialOutEnabled: " + updatedRoom.PstnDialOutEnabled);

すべてのアクティブなルームを一覧表示する

すべてのアクティブなルームを取得するには、クライアント上で公開されている GetRoomsAsync メソッドを使います。


// List all active rooms
AsyncPageable<CommunicationRoom> allRooms = roomsClient.GetRoomsAsync();
await foreach (CommunicationRoom currentRoom in allRooms)
{
    Console.WriteLine("\nFirst room id in all active rooms: " + currentRoom.Id);
    break;
}

新しい参加者を追加するか、既存の参加者を更新する

新しい参加者を room に追加するには、クライアントで公開されている AddParticipantsAsync メソッドを使用します。


List<RoomParticipant> addOrUpdateParticipants = new List<RoomParticipant>();
// Update participant2 from Attendee to Consumer
RoomParticipant participant2 = new RoomParticipant(user2) { Role = ParticipantRole.Consumer };
// Add participant3
CommunicationUserIdentifier user3 = identityClient.CreateUser();
RoomParticipant participant3 = new RoomParticipant(user3) { Role = ParticipantRole.Attendee };
addOrUpdateParticipants.Add(participant2);
addOrUpdateParticipants.Add(participant3);

Response addOrUpdateParticipantsResponse = await roomsClient.AddOrUpdateParticipantsAsync(roomId, addOrUpdateParticipants);
Console.WriteLine("\nAdded or updated participants to room");

room に追加された参加者は、通話への参加の対象となります。 更新された参加者には、通話内に新しい role が表示されます。

参加者の一覧を取得する

roomId を参照して、既存の room の参加者一覧を取得します。


// Get list of participants in room
AsyncPageable<RoomParticipant> existingParticipants = roomsClient.GetParticipantsAsync(roomId);
Console.WriteLine("\nRetrieved participants from room: ");
await foreach (RoomParticipant participant in existingParticipants)
{
    Console.WriteLine($"{participant.CommunicationIdentifier.ToString()},  {participant.Role.ToString()}");
}

参加者を削除する

room から参加者を削除し、アクセスを取り消すには、RemoveParticipantsAsync メソッドを使用します。


// Remove user from room
List<CommunicationIdentifier> removeParticipants = new List<CommunicationIdentifier>();
removeParticipants.Add(user2);

Response removeParticipantsResponse = await roomsClient.RemoveParticipantsAsync(roomId, removeParticipants);
Console.WriteLine("\nRemoved participants from room");

[ルームを削除]

既存の room を解除する場合は、明示的な削除要求を発行する必要があります。 すべての rooms リソースとその関連リソースは、有効期限の終わりと猶予期間に自動的に削除されます。


// Deletes the specified room
Response deleteRoomResponse = await roomsClient.DeleteRoomAsync(roomId);
Console.WriteLine("\nDeleted room with id: " + roomId);

コードの実行

コードを実行するには、Program.cs ファイルがあるディレクトリにいることを確認します。


dotnet run

想定される出力には、完了した各アクションが表示されます。


Azure Communication Services - Rooms Quickstart

Created a room with id: 99445276259151407

Retrieved room with id: 99445276259151407

Updated room with validFrom: 2023-05-11T22:11:46.784Z, validUntil: 2023-05-21T22:16:46.784Z and pstnDialOutEnabled: true

First room id in all active rooms: 99445276259151407

Added or updated participants to room

Retrieved participants from room:
8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-ac89-7c76-35f3-343a0d00e901, Presenter
8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-f00d-aa4b-0cf9-9c3a0d00543e, Consumer
8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-f00d-aaf2-0cf9-9c3a0d00543f, Attendee

Removed participants from room

Deleted room with id: 99445276259151407

リファレンス ドキュメント

Azure Communication Services のルームが備える全機能については、.NET SDK リファレンスまたは REST API リファレンスを参照してください。

このクイックスタートは、Azure Communication Services ルームの使用を開始する際に役立ちます。 room は、事前に決められた期間に共同作業する、既知の固定された一連の参加者を対象とした、サーバー側で管理される通信領域です。 ルームの概念説明のドキュメントでは、rooms の詳細およびユース ケースについて説明します。

前提条件

サンプル コード

このクイック スタートのサンプル コードは、GitHub で確認してダウンロードできます。

設定

新しい Java アプリケーションを作成する

コンソール ウィンドウ (cmd、PowerShell、Bash など) で、mvn コマンドを使用し、rooms-quickstart という名前で新しいコンソール アプリを作成します。 このコマンドにより、1 つのソース ファイル (App.java) を含む単純な "Hello World" Java プロジェクトが作成されます。

mvn archetype:generate -DgroupId=com.communication.quickstart -DartifactId=communication-quickstart -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

パッケージを組み込む

Java バージョン 1.1.0 以降の Azure Communication Rooms クライアント ライブラリを使用する必要があります。

BOM ファイルを含める

azure-sdk-bomをプロジェクトに追加して、ライブラリの一般提供 (GA) バージョンに依存するようにします。 次のスニペットでは、{bom_version_to_target} プレースホルダーをバージョン番号に置き換えます。 BOM の詳細については、 AZURE SDK BOM の readmeを参照してください。

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-sdk-bom</artifactId>
            <version>{bom_version_to_target}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

次に、バージョン タグのない依存関係セクションに直接依存関係を含めます。

<dependencies>
  <dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-communication-rooms</artifactId>
  </dependency>
</dependencies>

直接依存関係を含める

BOM に存在しない特定のバージョンのライブラリに依存関係を持たせる場合は、次のようにプロジェクトに直接依存関係を追加します。

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-communication-rooms</artifactId>
  <version>1.0.0-beta.1</version>
</dependency>

アプリのフレームワークを設定する

/src/main/java/com/communication/quickstart ディレクトリに移動し、App.java ファイルを開きます。 次のコードを追加します。


package com.communication.rooms.quickstart;

import com.azure.communication.common.*;
import com.azure.communication.identity.*;
import com.azure.communication.identity.models.*;
import com.azure.core.credential.*;
import com.azure.communication.rooms.*;

import java.io.IOException;
import java.time.*;
import java.util.*;

public class App
{
    public static void main( String[] args ) throws IOException
    {
        System.out.println("Azure Communication Services - Rooms Quickstart");
        // Quickstart code goes here
    }
}

ルーム クライアントを初期化する

新しい RoomsClient オブジェクトを作成します。このオブジェクトは、新しい rooms を作成し、そのプロパティとライフサイクルを管理するために使用されます。 Communications Service の接続文字列は、要求を認証するために使用されます。 接続文字列の詳細については、このページを参照してください。


// Initialize the rooms client
// Find your Communication Services resource in the Azure portal
String connectionString = "<connection string>";
RoomsClient roomsClient = new RoomsClientBuilder().connectionString(connectionString).buildClient();

ルームを作成する

ルーム参加者を設定する

ルームに参加できるユーザーを設定するには、それらのユーザーの ID のリストが必要です。 ユーザーの作成とアクセス トークンの発行については、こちらの手順に従ってください。 または、オンデマンドでユーザーを作成する場合は、CommunicationIdentityClient を使用してユーザーを作成できます。

CommunicationIdentityClient を使用するには、次のパッケージを追加します。

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-communication-identity</artifactId>
</dependency>

App.java ファイルの先頭でパッケージをインポートします。

import com.azure.communication.identity.CommunicationIdentityClient;
import com.azure.communication.identity.CommunicationIdentityClientBuilder;

これで、CommunicationIdentityClient を初期化し、ユーザーの作成に使用できます。

CommunicationIdentityClient communicationIdentityClient = new CommunicationIdentityClientBuilder()
    .connectionString(connectionString)
    .buildClient();

CommunicationUserIdentifier user1 = communicationClient.createUser();
CommunicationUserIdentifier user2 = communicationClient.createUser();
CommunicationUserIdentifier user3 = communicationClient.createUser();

次に、これらのユーザーを参照して、ルーム参加者の一覧を作成します。

//The default participant role is ParticipantRole.Attendee
RoomParticipant participant_1 = new RoomParticipant(user1);
RoomParticipant participant_2 = new RoomParticipant(user2);
RoomParticipant participant_3 = new RoomParticipant(user3);

List<RoomParticipant> roomParticipants = new ArrayList<RoomParticipant>();

roomParticipants.add(participant_1);
roomParticipants.add(participant_2.setRole(ParticipantRole.CONSUMER));

ルームを初期化する

上記のコード スニペットで定義されている roomParticipants を使用して、新しい room を作成します。

OffsetDateTime validFrom = OffsetDateTime.now();
OffsetDateTime validUntil = validFrom.plusDays(30);
boolean pstnDialOutEnabled = false;

CreateRoomOptions createRoomOptions = new CreateRoomOptions()
    .setValidFrom(validFrom)
    .setValidUntil(validUntil)
    .setPstnDialOutEnabled(pstnDialOutEnabled)
    .setParticipants(roomParticipants);

CommunicationRoom roomCreated = roomsClient.createRoom(createRoomOptions);

System.out.println("\nCreated a room with id: " + roomCreated.getRoomId());

rooms はサーバー側のエンティティであるため、選択したストレージ メディアの roomId を追跡して保持することができます。 roomId を参照して、room オブジェクトのプロパティを表示または更新することができます。

ルームの PSTN ダイヤルアウト機能を有効にする

room では、既定で PSTN ダイヤルアウトが無効になっています。 pstnDialOutEnabled パラメーターを true と定義することで、作成時に room に対して PSTN ダイヤルアウトを有効にすることができます。 この機能を room に対して変更するには、pstnDialOutEnabled パラメーターに対して更新要求を発行します。

boolean pstnDialOutEnabled = true;
// Create a room with PSTN dial out capability
CreateRoomOptions createRoomOptions = new CreateRoomOptions()
    .setPstnDialOutEnabled(pstnDialOutEnabled)

CommunicationRoom roomCreated = roomsClient.createRoom(createRoomOptions);
System.out.println("\nCreated a room with PSTN dial out enabled: " + roomCreated.getPstnDialOutEnabled());

// Update a room to enable or disable PSTN dial out capability
pstnDialOutEnabled = false;
UpdateRoomOptions updateRoomOptions = new UpdateRoomOptions()
    .setPstnDialOutEnabled(pstnDialOutEnabled);

CommunicationRoom roomUpdated = roomsClient.updateRoom(roomId, updateRoomOptions);
System.out.println("\nUpdated a room with PSTN dial out enabled: " + roomUpdated.getPstnDialOutEnabled());

既存のルームのプロパティを取得する

roomId を参照して、既存の room の詳細を取得します。


// Retrieve the room with corresponding ID
CommunicationRoom roomResult = roomsClient.getRoom(roomId);

System.out.println("Retrieved room with id: " + roomResult.getRoomId());

ルームの有効期間を更新する

room の有効期間は、ValidFrom および ValidUntil パラメーターの更新要求を発行することによって変更できます。 ルームの有効期限は最大 6 か月です。


OffsetDateTime validFrom = OffsetDateTime.now().plusDays(1);
OffsetDateTime validUntil = validFrom.plusDays(1);
boolean pstnDialOutEnabled = true;

UpdateRoomOptions updateRoomOptions = new UpdateRoomOptions()
    .setValidFrom(validFrom)
    .setValidUntil(validUntil)
    .setPstnDialOutEnabled(pstnDialOutEnabled);

CommunicationRoom roomResult = roomsClient.updateRoom(roomId, updateRoomOptions);

System.out.println("Updated room with validFrom: " + roomResult.getValidFrom() + ", validUntil: " + roomResult.getValidUntil() + " and pstnDialOutEnabled: " + roomResult.getPstnDialOutEnabled());

参加者の追加または更新

参加者を room に追加または更新するには、クライアントで公開されている addOrUpdateParticipants メソッドを使います。


List<RoomParticipant> participantsToAddAOrUpdate = new ArrayList<>();

// Adding new participant
 participantsToAddAOrUpdate.add(participant_3.setRole(ParticipantRole.CONSUMER));

// Updating current participant
participantsToAddAOrUpdate.add(participant_2.setRole(ParticipantRole.PRESENTER));

AddOrUpdateParticipantsResult addOrUpdateParticipantsResult = roomsClient.addOrUpdateParticipants(roomId, participantsToAddAOrUpdate);

System.out.println("Participant(s) added/updated");

room に追加された参加者は、通話への参加の対象となります。

参加者の一覧を取得する

roomId を参照して、既存の room の参加者一覧を取得します。


// Get list of participants
try {

PagedIterable<RoomParticipant> participants = roomsClient.listParticipants(roomId);

System.out.println("Participants:/n");

for (RoomParticipant participant : participants) {
    System.out.println(participant.getCommunicationIdentifier().getRawId() + " (" + participant.getRole() + ")");
   }
} catch (Exception ex) {
    System.out.println(ex);
}

参加者を削除する

room から参加者を削除し、アクセスを取り消すには、removeParticipants メソッドを使用します。


// Remove a participant from the room
List<CommunicationIdentifier> participantsToRemove = new ArrayList<>();

participantsToRemove.add(participant_3.getCommunicationIdentifier());

RemoveParticipantsResult removeParticipantsResult = roomsClient.removeParticipants(roomId,participantsToRemove);

System.out.println("Participant(s) removed");

すべてのアクティブなルームを一覧表示する

Azure Communication Services リソースの下にあるアクティブな rooms をすべて取得します。

try {
    Iterable<PagedResponse<CommunicationRoom>> roomPages = roomsClient.listRooms().iterableByPage();

    System.out.println("Listing all the rooms IDs in the first two pages of the list of rooms:");

    int count = 0;
    for (PagedResponse<CommunicationRoom> page : roomPages) {
        for (CommunicationRoom room : page.getElements()) {
            System.out.println("\n" + room.getRoomId());
        }

        count++;
        if (count >= 2) {
            break;
        }
    }
} catch (Exception ex) {
    System.out.println(ex);
}

[ルームを削除]

既存の room を解除する場合は、明示的な削除要求を発行する必要があります。 すべての rooms リソースとその関連リソースは、有効期限の終わりと猶予期間に自動的に削除されます。


// Deletes the specified room
roomsClient.deleteRoomWithResponse(roomId, Context.NONE);
System.out.println("\nDeleted the room with ID: " + roomId);

コードの実行

コードを実行するには、pom.xml ファイルを含むディレクトリに移動し、プログラムをコンパイルします。


mvn compile

次に、パッケージをビルドします


mvn package

アプリを実行します。

mvn exec:java -D"exec.mainClass"="com.communication.rooms.quickstart" -D"exec.cleanupDaemonThreads"="false"

想定される出力には、完了した各アクションが表示されます。


Azure Communication Services - Rooms Quickstart

Created a room with id:  99445276259151407

Retrieved room with id:  99445276259151407

Updated room with validFrom: 2023-05-11T22:11:46.784Z, validUntil: 2023-05-11T22:16:46.784Z and pstnDialOutEnabled: true

Participant(s) added/updated

Participants:
8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-ac89-7c76-35f3-343a0d00e901 (Attendee)
8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-ac89-7c76-35f3-343a0d00e902 (Consumer)

Participant(s) removed

Listing all the rooms IDs in the first two pages of the list of rooms: 
99445276259151407
99445276259151408
99445276259151409

Deleted the room with ID:  99445276259151407

リファレンス ドキュメント

Azure Communication Services のルームが備える全機能については、Java SDK リファレンスまたは REST API リファレンスを参照してください。

このクイックスタートは、Azure Communication Services ルームの使用を開始する際に役立ちます。 room は、事前に決められた期間に共同作業する、既知の固定された一連の参加者を対象とした、サーバー側で管理される通信領域です。 ルームの概念説明のドキュメントでは、rooms の詳細およびユース ケースについて説明します。

前提条件

サンプル コード

このクイック スタートのサンプル コードは、GitHub で確認してダウンロードできます。

設定

新しい Python アプリケーションを作成する

ターミナルまたはコンソール ウィンドウで、アプリケーション用の新しいフォルダーを作成し、そこに移動します。

mkdir acs-rooms-quickstart
cd acs-rooms-quickstart

パッケージをインストールする

Python バージョン 1.1.0 以降の Azure Communication Rooms クライアント ライブラリを使用する必要があります。

コンソール プロンプトから、rooms.py ファイルが格納されているディレクトリに移動し、次のコマンドを実行します。

pip install azure-communication-rooms

アプリのフレームワークを設定する

rooms-quickstart.py という名前の新しいファイルを作成し、基本的なプログラム構造を追加します。

import os
from datetime import datetime, timedelta
from azure.core.exceptions import HttpResponseError
from azure.communication.rooms import (
    RoomsClient,
    RoomParticipant,
    ParticipantRole
)

class RoomsQuickstart(object):
    print("Azure Communication Services - Rooms Quickstart")
    #room method implementations goes here

if __name__ == '__main__':
    rooms = RoomsQuickstart()

ルーム クライアントを初期化する

新しい RoomsClient オブジェクトを作成します。このオブジェクトは、新しい rooms を作成し、そのプロパティとライフサイクルを管理するために使用されます。 Communications Service の接続文字列は、要求を認証するために使用されます。 接続文字列の詳細については、このページを参照してください。

#Find your Communication Services resource in the Azure portal
connection_string = '<connection_string>'
rooms_client = RoomsClient.from_connection_string(connection_string)

ルームを作成する

ルーム参加者を設定する

ルームに参加できるユーザーを設定するには、それらのユーザーの ID の一覧が必要です。 ユーザーの作成とアクセス トークンの発行については、こちらの手順に従ってください。 または、オンデマンドでユーザーを作成する場合は、CommunicationIdentityClient を使用してユーザーを作成できます。

CommunicationIdentityClient を使用するには、次のパッケージをインストールします。

pip install azure-communication-identity

また、rooms-quickstart.py ファイルの先頭にあるパッケージの名前空間をインポートします。

from azure.communication.identity import (
    CommunicationIdentityClient
)

これで、CommunicationIdentityClient を初期化し、ユーザーの作成に使用できます。

# Create identities for users who will join the room
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
user1 = identity_client.create_user()
user2 = identity_client.create_user()
user3 = identity_client.create_user()

次に、これらのユーザーを参照して、ルーム参加者の一覧を作成します。

participant_1 = RoomParticipant(communication_identifier=user1, role=ParticipantRole.PRESENTER)
participant_2 = RoomParticipant(communication_identifier=user2, role=ParticipantRole.CONSUMER)
participants = [participant_1, participant_2]

ルームを初期化する

上記のコード スニペットで定義されている participants を使用して、新しい room を作成します。

# Create a room
valid_from = datetime.now()
valid_until = valid_from + timedelta(weeks=4)
pstn_dial_out_enabled = False

try:
    create_room = rooms_client.create_room(
        valid_from=valid_from,
        valid_until=valid_until,
        pstn_dial_out_enabled=pstn_dial_out_enabled,
        participants=participants
    )
    print("\nCreated a room with id: " + create_room.id)
except HttpResponseError as ex:
    print(ex)

rooms はサーバー側のエンティティであるため、選択したストレージ メディアの room.id を追跡して保持することができます。 id を参照して、room オブジェクトのプロパティを表示または更新することができます。

ルームの PSTN ダイヤルアウト機能を有効にする

room では、既定で PSTN ダイヤルアウトが無効になっています。 pstn_dial_out_enabled パラメーターを true と定義することで、作成時に room に対して PSTN ダイヤルアウトを有効にすることができます。 この機能を room に対して変更するには、pstn_dial_out_enabled パラメーターに対して更新要求を発行します。

# Create a room with PSTN dial out capability
pstn_dial_out_enabled = True
create_room = rooms_client.create_room(pstn_dial_out_enabled=pstn_dial_out_enabled)
print("\nCreated room with pstn_dial_out_enabled: " + updated_room.pstn_dial_out_enabled)

# Update a room to enable or disable PSTN dial out capability
pstn_dial_out_enabled= False
updated_room = rooms_client.update_room(room_id=room_id, pstn_dial_out_enabled=pstn_dial_out_enabled)
print("\nUpdated room with pstn_dial_out_enabled: " + updated_room.pstn_dial_out_enabled)

既存のルームのプロパティを取得する

id を参照して、既存の room の詳細を取得します。

# Retrieves the room with corresponding ID
room_id = create_room.id
try:
    get_room = rooms_client.get_room(room_id=room_id)
    print("\nRetrieved room with id: ", get_room.id)
except HttpResponseError as ex:
    print(ex)

ルームの有効期間を更新する

room の有効期間は、valid_from および valid_until パラメーターの更新要求を発行することによって変更できます。 ルームの有効期限は最大 6 か月です。

# Update the lifetime of a room
valid_from =  datetime.now()
valid_until = valid_from + timedelta(weeks=7)
pstn_dial_out_enabled=True

try:
    updated_room = rooms_client.update_room(room_id=room_id, valid_from=valid_from, valid_until=valid_until, pstn_dial_out_enabled=pstn_dial_out_enabled)
     print("\nUpdated room with validFrom: " + updated_room.valid_from + ", validUntil: " + updated_room.valid_until + " and pstn_dial_out_enabled: " + updated_room.pstn_dial_out_enabled)
except HttpResponseError as ex:
    print(ex)

すべてのアクティブなルームを一覧表示する

自分のリソースに作成したすべてのアクティブなルームを取得するには、クライアントで公開されている list_rooms メソッドを使います。

# List all active rooms
try:
    rooms = rooms_client.list_rooms()
    count = 0
    for room in rooms:
        if count == 1:
            break
        print("\nPrinting the first room in list"
            "\nRoom Id: " + room.id +
            "\nCreated date time: " + str(room.created_at) +
            "\nValid From: " + str(room.valid_from) + 
            "\nValid Until: " + str(room.valid_until) +
            "\nPSTN Dial-Out Enabled: " + str(room.pstn_dial_out_enabled))
        count += 1
except HttpResponseError as ex:
    print(ex)

参加者の追加または更新

room に新しい参加者を追加したり、既存の参加者を更新したりするには、クライアントで公開されている add_or_update_participants メソッドを使います。

# Add or update participants in a room
try:
    # Update existing user2 from consumer to attendee
    participants = []
    participants.append(RoomParticipant(communication_identifier=user2, role=ParticipantRole.ATTENDEE))

    # Add new participant user3
    participants.append(RoomParticipant(communication_identifier=user3, role=ParticipantRole.CONSUMER))
    rooms_client.add_or_update_participants(room_id=room_id, participants=participants)
    print("\nAdd or update participants in room")

except HttpResponseError as ex:
    print('Error in adding or updating participants to room.', ex)

room に追加された参加者は、通話への参加の対象となります。

ルームの参加者を一覧表示する

room_id を参照して、既存の room の参加者一覧を取得します。

# Get list of participants in room
try:
    participants = rooms_client.list_participants(room_id)
    print('\nParticipants in Room Id :', room_id)
    for p in participants:
        print(p.communication_identifier.properties['id'], p.role)
except HttpResponseError as ex:
    print(ex)

参加者を削除する

room から参加者を削除し、アクセスを取り消すには、remove_participants メソッドを使用します。

# Remove Participants
try:
    participants = [user2]
    rooms_client.remove_participants(room_id=room_id, participants=participants)
    print("\nRemoved participants from room")

except HttpResponseError as ex:
    print(ex)

[ルームを削除]

既存の room を解除する場合は、明示的な削除要求を発行する必要があります。 すべての rooms リソースとその関連リソースは、有効期限の終わりと猶予期間に自動的に削除されます。

# Delete Room

rooms_client.delete_room(room_id=room_id)
print("\nDeleted room with id: " + room_id)

コードの実行

コードを実行するには、rooms-quickstart.py ファイルがあるディレクトリにいることを確認します。


python rooms-quickstart.py

想定される出力には、完了した各アクションが表示されます。


Azure Communication Services - Rooms Quickstart

Created a room with id:  99445276259151407

Retrieved room with id:  99445276259151407

Updated room with validFrom: 2023-05-03T00:00:00+00:00, validUntil: 2023-06-23T00:00:00+00:00 and pstn_dial_out_enabled: True

Printing the first room in list
Room Id: 99445276259151407
Created date time: 2023-05-03T00:00:00+00:00
Valid From: 2023-05-03T00:00:00+00:00
Valid Until: 2023-06-23T00:00:00+00:00
PSTN Dial-Out Enabled: True

Add or update participants in room

Participants in Room Id : 99445276259151407
8:acs:42a0ff0c-356d-4487-a288-ad0aad95d504_00000018-ef00-6042-a166-563a0d0051c1 Presenter
8:acs:42a0ff0c-356d-4487-a288-ad0aad95d504_00000018-ef00-6136-a166-563a0d0051c2 Consumer
8:acs:42a0ff0c-356d-4487-a288-ad0aad95d504_00000018-ef00-61fd-a166-563a0d0051c3 Attendee

Removed participants from room

Deleted room with id: 99445276259151407

リファレンス ドキュメント

Azure Communication Services のルームが備える全機能については、Python SDK リファレンスまたは REST API リファレンスを参照してください。

このクイックスタートは、Azure Communication Services ルームの使用を開始する際に役立ちます。 room は、事前に決められた期間に共同作業する、既知の固定された一連の参加者を対象とした、サーバー側で管理される通信領域です。 ルームの概念説明のドキュメントでは、rooms の詳細およびユース ケースについて説明します。

前提条件

サンプル コード

このクイック スタートのサンプル コードは、GitHub で確認してダウンロードできます。

設定

新しい Web アプリケーションを作成する

ターミナルまたはコンソール ウィンドウで、アプリケーション用の新しいフォルダーを作成し、そこに移動します。

mkdir acs-rooms-quickstart && cd acs-rooms-quickstart

既定の設定で npm init を実行して、package.json ファイルを作成します。

npm init -y

このクイックスタートのコードが追加される新しいファイル index.js を作成します。

パッケージのインストール

JavaScript バージョン 1.1.0 以降の Azure Communication Rooms クライアント ライブラリを使用する必要があります。

npm install コマンドを使用して、次に示した JavaScript 用の Communication Services SDK をインストールします。

npm install @azure/communication-rooms --save

アプリのフレームワークを設定する

index.js ファイルに、次のコードを追加します。 main 関数にクイックスタートのコードを追加します。

const { RoomsClient } = require('@azure/communication-rooms');

const main = async () => {
  console.log("Azure Communication Services - Rooms Quickstart")

  // Quickstart code goes here

};

main().catch((error) => {
  console.log("Encountered an error");
  console.log(error);
})

ルーム クライアントを初期化する

新しい RoomsClient オブジェクトを作成します。このオブジェクトは、新しい rooms を作成し、そのプロパティとライフサイクルを管理するために使用されます。 Communications Service の接続文字列は、要求を認証するために使用されます。 接続文字列の詳細については、このページを参照してください。

index.jsmain 関数内に次のコードを追加します。

const connectionString =
    process.env["COMMUNICATION_CONNECTION_STRING"] ||
    "endpoint=https://<resource-name>.communication.azure.com/;<access-key>";

// create RoomsClient
const roomsClient = new RoomsClient(connectionString);

ルームを作成する

ルーム参加者を設定する

ルームに参加できるユーザーを設定するには、それらのユーザーの ID のリストが必要です。 ユーザーの作成とアクセス トークンの発行については、こちらの手順に従ってください。 または、オンデマンドでユーザーを作成する場合は、CommunicationIdentityClient を使用してユーザーを作成できます。

CommunicationIdentityClient を使用するには、次の npm パッケージをインストールします。

npm install @azure/communication-identity --save

また、index.js ファイルの先頭に次の必須パッケージを追加します。

const { CommunicationIdentityClient } = require('@azure/communication-identity');

これで、CommunicationIdentityClient を初期化し、ユーザーの作成に使用できます。

// create identities for users
const identityClient = new CommunicationIdentityClient(connectionString);
const user1 = await identityClient.createUserAndToken(["voip"]);
const user2 = await identityClient.createUserAndToken(["voip"]);

次に、これらのユーザーを参照して、ルーム参加者の一覧を作成します。

const participants = [
  {
      id: user1.user,
      role: "Presenter",
  },
  {
    id: user2.user,
    role: "Consumer",
  }
]

ルームを初期化する

上記のコード スニペットで定義されている participants を使用して、新しい room を作成します。

// Create a room
var validFrom = new Date(Date.now());
var validUntil = new Date(validFrom.getTime() + 60 * 60 * 1000);
var pstnDialOutEnabled = false;

const createRoomOptions = {
  validFrom,
  validUntil,
  pstnDialOutEnabled,
  participants
};

const createRoom = await roomsClient.createRoom(createRoomOptions);
const roomId = createRoom.id;
console.log("\nCreated a room with id: ", roomId);

rooms はサーバー側のエンティティであるため、選択したストレージ メディアの roomId を追跡して保持することができます。 roomId を参照して、room オブジェクトのプロパティを表示または更新することができます。

ルームの PSTN ダイヤルアウト機能を有効にする

room では、既定で PSTN ダイヤルアウトが無効になっています。 pstnDialOutEnabled パラメーターを true と定義することで、作成時に room に対して PSTN ダイヤルアウトを有効にすることができます。 この機能を room に対して変更するには、pstnDialOutEnabled パラメーターに対して更新要求を発行します。

// Create a room with PSTN dial out capability
var pstnDialOutEnabled = true;
const createRoomOptions = {
  pstnDialOutEnabled,
};

const createRoom = await roomsClient.createRoom(createRoomOptions);
console.log("\nCreated a room with PSTN dial out enabled: ", createRoom.pstnDialOutEnabled);

// Update a room to enable or disable PSTN dial out capability
pstnDialOutEnabled = false;
const updateRoomOptions = {
  pstnDialOutEnabled,
};

const updateRoom = await roomsClient.updateRoom(roomId, updateRoomOptions);
console.log("\nUpdated a room with PSTN dial out enabled: ", updateRoom.pstnDialOutEnabled);

既存のルームのプロパティを取得する

roomId を参照して、既存の room の詳細を取得します。

// Retrieve the room with corresponding ID
const getRoom = await roomsClient.getRoom(roomId);
console.log("\nRetrieved room with id: ", getRoom.id);

ルームの有効期間を更新する

room の有効期間は、validFrom および validUntil パラメーターの更新要求を発行することによって変更できます。 ルームの有効期限は最大 6 か月です。

// Update room lifetime
validFrom.setTime(validUntil.getTime());
validUntil.setTime(validFrom.getTime() + 5 * 60 * 1000);
pstnDialOutEnabled = true;
// request payload to update a room
const updateRoomOptions = {
  validFrom,
  validUntil,
  pstnDialOutEnabled,
};

const updateRoom = await roomsClient.updateRoom(roomId, updateRoomOptions);
console.log("\nUpdated room with validFrom: ", updateRoom.validFrom, ", validUntil: ", updateRoom.validUntil, " and pstnDialOutEnabled: ", updateRoom.pstnDialOutEnabled);

ルームの一覧を取得する

ルームの一覧を取得するには、listRooms メソッドを使います。

const roomsList = await roomsClient.listRooms();
console.log("\nRetrieved list of rooms; printing first room:");
for await (const currentRoom of roomsList) {
  // access room data here
  console.log(currentRoom);
  break;
}

参加者の追加または更新

新しい参加者を room に追加するには、クライアントで公開されている addOrUpdateParticipants メソッドを使用します。 このメソッドを使って、ルームに既に存在する場合に参加者を更新することもできます。

// Add and update participants
// request payload to add and update participants
const addOUpdateParticipantsList = [
  {
      id: user1.user,
      role: "Presenter",
  },
  {
    id: user2.user,
    role: "Consumer",
  }
]

// add user2 to the room and update user1 to Presenter role
await roomsClient.addOrUpdateParticipants(roomId, addOUpdateParticipantsList);
console.log("\nAdded and updated participants in the room");

room に追加された参加者は、通話への参加の対象となります。

参加者の一覧を取得する

roomId を参照して、既存の room の参加者一覧を取得します。

const participantsList = await roomsClient.listParticipants(roomId);
console.log("\nRetrieved participants for room:");
for await (const participant of participantsList) {
  // access participant data here
  console.log(participant);
}

参加者を削除する

room から参加者を削除し、アクセスを取り消すには、removeParticipants メソッドを使用します。

// Remove both users from the room
const removeParticipantsList = [user1.user, user2.user]

// remove both users from the room with the request payload
await roomsClient.removeParticipants(roomId, removeParticipantsList);
console.log("\nRemoved participants from room");

[ルームを削除]

既存の room を解除する場合は、明示的な削除要求を発行する必要があります。 すべての rooms リソースとその関連リソースは、有効期限の終わりと猶予期間に自動的に削除されます。

// Deletes the specified room
await roomsClient.deleteRoom(roomId);
console.log("\nDeleted room with id: ", roomId)

コードの実行

コードを実行するには、index.js ファイルがあるディレクトリにいることを確認します。

node index.js

想定される出力には、完了した各アクションが表示されます。

Azure Communication Services - Rooms QuickStart

Created a room with id:  99445276259151407

Retrieved room with id:  99445276259151407

Updated room with validFrom:  2023-05-11T22:11:46.784Z, validUntil:  2023-05-11T22:16:46.784Z and pstnDialOutEnabled: true

Retrieved list of rooms; printing first room:

{
  id: "99445276259151407",
  createdAt: "2023-05-11T22:11:50.784Z",
  validFrom: "2023-05-11T22:11:46.784Z",
  validUntil: "2023-05-11T22:16:46.784Z"
}

Added and updated participants in the room

Retrieved participants for room:
{
  id: {
    kind: 'communicationUser',
    communicationUserId: '8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-ac89-7c76-35f3-343a0d00e901'
  },
  role: 'Presenter'
}
{
  id: {
    kind: 'communicationUser',
    communicationUserId: '8:acs:b6aada1f-0b1d-47ac-866f-91aae00a1d01_00000018-ac89-7ccc-35f3-343a0d00e902'
  },
  role: 'Consumer'
}

Removed participants from room

Deleted room with id:  99445276259151407

リファレンス ドキュメント

Azure Communication Services のルームが備える全機能については、JavaScript SDK リファレンスまたは REST API リファレンスを参照してください。

次のステップ

ルームを作成して構成した後にルームの通話に参加する方法について説明します。

このセクションでは、次の方法について学習しました。

  • 新しいルームを作成する
  • ルームのプロパティを取得する
  • ルームのプロパティを更新する
  • ルームを削除する

次のことも実行できます。