

# 使用 AWS CLI 的 Amazon Chime 示例
<a name="cli_chime_code_examples"></a>

以下代码示例演示如何通过将 AWS Command Line Interface与 Amazon Chime 结合使用，来执行操作和实现常见场景。

*操作是大型程序的代码摘录*，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

每个示例都包含一个指向完整源代码的链接，您可以从中找到有关如何在上下文中设置和运行代码的说明。

**Topics**
+ [操作](#actions)

## 操作
<a name="actions"></a>

### `associate-phone-number-with-user`
<a name="chime_AssociatePhoneNumberWithUser_cli_topic"></a>

以下代码示例演示了如何使用 `associate-phone-number-with-user`。

**AWS CLI**  
**将电话号码与用户关联**  
以下 `associate-phone-number-with-user` 示例将指定电话号码与用户关联。  

```
aws chime associate-phone-number-with-user \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \
    --e164-phone-number "+12065550100"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户电话号码](https://docs.aws.amazon.com/chime/latest/ag/user-phone.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [AssociatePhoneNumberWithUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/associate-phone-number-with-user.html)。

### `associate-signin-delegate-groups-with-account`
<a name="chime_AssociateSigninDelegateGroupsWithAccount_cli_topic"></a>

以下代码示例演示了如何使用 `associate-signin-delegate-groups-with-account`。

**AWS CLI**  
**关联登录委托组**  
以下 `associate-signin-delegate-groups-with-account` 示例将指定的登录委托组与指定的 Amazon Chime 账户关联。  

```
aws chime associate-signin-delegate-groups-with-account \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --signin-delegate-groups GroupName=my_users
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户访问和权限](https://docs.aws.amazon.com/chime/latest/ag/manage-access.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [AssociateSigninDelegateGroupsWithAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/associate-signin-delegate-groups-with-account.html)。

### `batch-create-room-membership`
<a name="chime_BatchCreateRoomMembership_cli_topic"></a>

以下代码示例演示了如何使用 `batch-create-room-membership`。

**AWS CLI**  
**创建多个聊天室成员资格**  
以下 `batch-create-room-membership` 示例将多个用户作为聊天室成员添加到聊天室。它还会为用户分配管理员和成员角色。  

```
aws chime batch-create-room-membership \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
    --membership-item-list "MemberId=1ab2345c-67de-8901-f23g-45h678901j2k,Role=Administrator" "MemberId=2ab2345c-67de-8901-f23g-45h678901j2k,Role=Member"
```
输出：  

```
{
    "ResponseMetadata": {
        "RequestId": "169ba401-d886-475f-8b3f-e01eac6fadfb",
        "HTTPStatusCode": 201,
        "HTTPHeaders": {
            "x-amzn-requestid": "169ba401-d886-475f-8b3f-e01eac6fadfb",
            "content-type": "application/json",
            "content-length": "13",
            "date": "Mon, 02 Dec 2019 22:46:58 GMT",
            "connection": "keep-alive"
        },
        "RetryAttempts": 0
    },
    "Errors": []
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchCreateRoomMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-create-room-membership.html)。

### `batch-delete-phone-number`
<a name="chime_BatchDeletePhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `batch-delete-phone-number`。

**AWS CLI**  
**删除多个电话号码**  
以下 `batch-delete-phone-number` 示例删除所有指定的电话号码。  

```
aws chime batch-delete-phone-number \
    --phone-number-ids "%2B12065550100" "%2B12065550101"
```
此命令不生成任何输出。输出：  

```
{
    "PhoneNumberErrors": []
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchDeletePhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-delete-phone-number.html)。

### `batch-suspend-user`
<a name="chime_BatchSuspendUser_cli_topic"></a>

以下代码示例演示了如何使用 `batch-suspend-user`。

**AWS CLI**  
**暂停多个用户**  
以下 `batch-suspend-user` 示例暂停指定 Amazon Chime 账户中列出的用户。  

```
aws chime batch-suspend-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-id-list "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE" "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE"
```
输出：  

```
{
    "UserErrors": []
}
```
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchSuspendUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-suspend-user.html)。

### `batch-unsuspend-user`
<a name="chime_BatchUnsuspendUser_cli_topic"></a>

以下代码示例演示了如何使用 `batch-unsuspend-user`。

**AWS CLI**  
**取消暂停多个用户**  
以下 `batch-unsuspend-user` 示例移除指定 Amazon Chime 账户中所列用户之前的任何暂停。  

```
aws chime batch-unsuspend-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-id-list "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE" "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE"
```
输出：  

```
{
    "UserErrors": []
}
```
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchUnsuspendUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-unsuspend-user.html)。

### `batch-update-phone-number`
<a name="chime_BatchUpdatePhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `batch-update-phone-number`。

**AWS CLI**  
**同时更新多个电话号码产品类型**  
以下 `batch-update-phone-number` 示例更新所有指定电话号码的产品类型。  

```
aws chime batch-update-phone-number \
    --update-phone-number-request-items PhoneNumberId=%2B12065550100,ProductType=BusinessCalling PhoneNumberId=%2B12065550101,ProductType=BusinessCalling
```
输出：  

```
{
    "PhoneNumberErrors": []
}
```
**同时更新多个电话号码呼叫名称**  
以下 `batch-update-phone-number` 示例更新所有指定电话号码的呼叫名称。  

```
aws chime batch-update-phone-number \
    --update-phone-number-request-items PhoneNumberId=%2B14013143874,CallingName=phonenumber1 PhoneNumberId=%2B14013144061,CallingName=phonenumber2
```
输出：  

```
{
    "PhoneNumberErrors": []
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchUpdatePhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-update-phone-number.html)。

### `batch-update-user`
<a name="chime_BatchUpdateUser_cli_topic"></a>

以下代码示例演示了如何使用 `batch-update-user`。

**AWS CLI**  
**使用单个命令更新多个用户**  
以下 `batch-update-user` 示例更新指定 Amazon Chime 账户中列出的每位用户的 `LicenseType`。  

```
aws chime batch-update-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
    --update-user-request-items "UserId=a1b2c3d4-5678-90ab-cdef-22222EXAMPLE,LicenseType=Basic" "UserId=a1b2c3d4-5678-90ab-cdef-33333EXAMPLE,LicenseType=Basic"
```
输出：  

```
{
    "UserErrors": []
}
```
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [BatchUpdateUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/batch-update-user.html)。

### `create-account`
<a name="chime_CreateAccount_cli_topic"></a>

以下代码示例演示了如何使用 `create-account`。

**AWS CLI**  
**创建账户**  
以下 `create-account` 示例在管理员的 AWS 账户中创建 Amazon Chime 账户。  

```
aws chime create-account \
    --name MyChimeAccount
```
输出：  

```
{
    "Account": {
        "AwsAccountId": "111122223333",
        "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "Name": "MyChimeAccount",
        "AccountType": "Team",
        "CreatedTimestamp": "2019-01-04T17:11:22.003Z",
        "DefaultLicense": "Pro",
        "SupportedLicenses": [
            "Basic",
            "Pro"
        ],
        "SigninDelegateGroups": [
            {
                "GroupName": "myGroup"
            },
        ]
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[入门](https://docs.aws.amazon.com/chime/latest/ag/getting-started.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-account.html)。

### `create-bot`
<a name="chime_CreateBot_cli_topic"></a>

以下代码示例演示了如何使用 `create-bot`。

**AWS CLI**  
**创建 Amazon Chime 机器人**  
以下 `create-bot` 示例为指定的 Amazon Chime Enterprise 账户创建一个机器人。  

```
aws chime create-bot \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --display-name "myBot" \
    --domain "example.com"
```
输出：  

```
{
    "Bot": {
        "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "DisplayName": "myBot (Bot)",
        "BotType": "ChatBot",
        "Disabled": false,
        "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
        "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
        "BotEmail": "myBot-chimebot@example.com",
        "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    }
}
```
有关更多信息，请参阅《Amazon Chime 开发人员指南》**中的[将聊天机器人与 Amazon Chime 集成](https://docs.aws.amazon.com/chime/latest/dg/integrate-bots.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateBot](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-bot.html)。

### `create-phone-number-order`
<a name="chime_CreatePhoneNumberOrder_cli_topic"></a>

以下代码示例演示了如何使用 `create-phone-number-order`。

**AWS CLI**  
**创建电话号码订单**  
以下 `create-phone-number-order` 示例为指定的电话号码创建电话号码订单。  

```
aws chime create-phone-number-order \
    --product-type VoiceConnector \
    --e164-phone-numbers "+12065550100" "+12065550101" "+12065550102"
```
输出：  

```
{
    "PhoneNumberOrder": {
        "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
        "ProductType": "VoiceConnector",
        "Status": "Processing",
        "OrderedPhoneNumbers": [
            {
                "E164PhoneNumber": "+12065550100",
                "Status": "Processing"
            },
            {
               "E164PhoneNumber": "+12065550101",
               "Status": "Processing"
            },
            {
              "E164PhoneNumber": "+12065550102",
              "Status": "Processing"
            }
        ],
        "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
        "UpdatedTimestamp": "2019-08-09T21:35:22.408Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreatePhoneNumberOrder](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-phone-number-order.html)。

### `create-room-membership`
<a name="chime_CreateRoomMembership_cli_topic"></a>

以下代码示例演示了如何使用 `create-room-membership`。

**AWS CLI**  
**创建聊天室成员资格**  
以下 `create-room-membership` 示例将指定用户作为聊天室成员添加到聊天室。  

```
aws chime create-room-membership \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
    --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
```
输出：  

```
{
    "RoomMembership": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Member": {
            "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
            "MemberType": "User",
            "Email": "janed@example.com",
            "FullName": "Jane Doe",
            "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
        },
        "Role": "Member",
        "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
        "UpdatedTimestamp": "2019-12-02T22:36:41.969Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateRoomMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-room-membership.html)。

### `create-room`
<a name="chime_CreateRoom_cli_topic"></a>

以下代码示例演示了如何使用 `create-room`。

**AWS CLI**  
**创建聊天室**  
以下 `create-room` 示例为指定的 Amazon Chime 账户创建一个聊天室。  

```
aws chime create-room \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --name chatRoom
```
输出：  

```
{
    "Room": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Name": "chatRoom",
        "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
        "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
        "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
        "UpdatedTimestamp": "2019-12-02T22:29:31.549Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateRoom](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-room.html)。

### `create-user`
<a name="chime_CreateUser_cli_topic"></a>

以下代码示例演示了如何使用 `create-user`。

**AWS CLI**  
**为共享设备创建用户配置文件**  
以下 `create-user` 示例为指定的电子邮件地址创建共享设备配置文件。  

```
aws chime create-user \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --email roomdevice@example.com \
    --user-type SharedDevice
```
输出：  

```
{
    "User": {
        "UserId": "1ab2345c-67de-8901-f23g-45h678901j2k",
        "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
        "PrimaryEmail": "roomdevice@example.com",
        "DisplayName": "Room Device",
        "LicenseType": "Pro",
        "UserType": "SharedDevice",
        "UserRegistrationStatus": "Registered",
        "RegisteredOn": "2020-01-15T22:38:09.806Z",
        "AlexaForBusinessMetadata": {
            "IsAlexaForBusinessEnabled": false
        }
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[设置准备](https://docs.aws.amazon.com/chime/latest/ag/prepare-setup.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/create-user.html)。

### `delete-account`
<a name="chime_DeleteAccount_cli_topic"></a>

以下代码示例演示了如何使用 `delete-account`。

**AWS CLI**  
**删除账户**  
以下 `delete-account` 示例删除指定账户。  

```
aws chime delete-account --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[删除您的账户](https://docs.aws.amazon.com/chime/latest/ag/enterprise-account.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/delete-account.html)。

### `delete-phone-number`
<a name="chime_DeletePhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `delete-phone-number`。

**AWS CLI**  
**删除电话号码**  
以下 `delete-phone-number` 示例将指定的电话号码移入删除队列。  

```
aws chime delete-phone-number \
    --phone-number-id "+12065550100"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeletePhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/delete-phone-number.html)。

### `delete-room-membership`
<a name="chime_DeleteRoomMembership_cli_topic"></a>

以下代码示例演示了如何使用 `delete-room-membership`。

**AWS CLI**  
**移除聊天室用户的成员资格**  
以下 `delete-room-membership` 示例从指定聊天室中移除指定成员。  

```
aws chime delete-room-membership \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
    --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteRoomMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/delete-room-membership.html)。

### `delete-room`
<a name="chime_DeleteRoom_cli_topic"></a>

以下代码示例演示了如何使用 `delete-room`。

**AWS CLI**  
**删除聊天室**  
以下 `delete-room` 示例删除指定聊天室，并删除聊天室成员资格。  

```
aws chime delete-room \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteRoom](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/delete-room.html)。

### `disassociate-phone-number-from-user`
<a name="chime_DisassociatePhoneNumberFromUser_cli_topic"></a>

以下代码示例演示了如何使用 `disassociate-phone-number-from-user`。

**AWS CLI**  
**取消电话号码与用户的关联**  
以下 `disassociate-phone-number-from-user` 示例取消电话号码与指定用户的关联。  

```
aws chime disassociate-phone-number-from-user \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --user-id 1ab2345c-67de-8901-f23g-45h678901j2k
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户电话号码](https://docs.aws.amazon.com/chime/latest/ag/user-phone.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DisassociatePhoneNumberFromUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/disassociate-phone-number-from-user.html)。

### `disassociate-signin-delegate-groups-from-account`
<a name="chime_DisassociateSigninDelegateGroupsFromAccount_cli_topic"></a>

以下代码示例演示了如何使用 `disassociate-signin-delegate-groups-from-account`。

**AWS CLI**  
**取消关联登录委托组**  
以下 `disassociate-signin-delegate-groups-from-account` 示例取消指定登录委托组与指定 Amazon Chime 账户的关联。  

```
aws chime disassociate-signin-delegate-groups-from-account \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --group-names "my_users"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户访问和权限](https://docs.aws.amazon.com/chime/latest/ag/manage-access.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DisassociateSigninDelegateGroupsFromAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/disassociate-signin-delegate-groups-from-account.html)。

### `get-account-settings`
<a name="chime_GetAccountSettings_cli_topic"></a>

以下代码示例演示了如何使用 `get-account-settings`。

**AWS CLI**  
**检索账户的设置**  
以下 `get-account-settings` 示例检索指定账户的账户设置。  

```
aws chime get-account-settings --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
```
输出：  

```
{
    "AccountSettings": {
        "DisableRemoteControl": false,
        "EnableDialOut": false
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理您的 Amazon Chime 账户](https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetAccountSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-account-settings.html)。

### `get-account`
<a name="chime_GetAccount_cli_topic"></a>

以下代码示例演示了如何使用 `get-account`。

**AWS CLI**  
**检索账户的详细信息**  
以下 `get-account` 示例检索指定 Amazon Chime 账户的详细信息。  

```
aws chime get-account \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
```
输出：  

```
{
    "Account": {
        "AwsAccountId": "111122223333",
        "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "Name": "EnterpriseDirectory",
        "AccountType": "EnterpriseDirectory",
        "CreatedTimestamp": "2018-12-20T18:38:02.181Z",
        "DefaultLicense": "Pro",
        "SupportedLicenses": [
            "Basic",
            "Pro"
        ],
        "SigninDelegateGroups": [
            {
                "GroupName": "myGroup"
            },
        ]
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理您的 Amazon Chime 账户](https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-account.html)。

### `get-bot`
<a name="chime_GetBot_cli_topic"></a>

以下代码示例演示了如何使用 `get-bot`。

**AWS CLI**  
**检索有关机器人的详细信息**  
以下 `get-bot` 示例显示指定机器人的详细信息。  

```
aws chime get-bot \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k
```
输出：  

```
{
    "Bot": {
        "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "DisplayName": "myBot (Bot)",
        "BotType": "ChatBot",
        "Disabled": false,
        "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
        "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
        "BotEmail": "myBot-chimebot@example.com",
        "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    }
}
```
有关更多信息，请参阅《Amazon Chime 开发人员指南》**中的[更新聊天机器人](https://docs.aws.amazon.com/chime/latest/dg/update-bots.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetBot](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-bot.html)。

### `get-global-settings`
<a name="chime_GetGlobalSettings_cli_topic"></a>

以下代码示例演示了如何使用 `get-global-settings`。

**AWS CLI**  
**获取全局设置**  
以下 `get-global-settings` 示例检索用于存储与管理员 AWS 账户关联的 Amazon Chime Business Calling 和 Amazon Chime Voice Connector 的调用详细记录的 S3 存储桶名称。  

```
aws chime get-global-settings
```
输出：  

```
{
    "BusinessCalling": {
        "CdrBucket": "s3bucket"
    },
    "VoiceConnector": {
        "CdrBucket": "s3bucket"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理全局设置](https://docs.aws.amazon.com/chime/latest/ag/manage-global.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetGlobalSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-global-settings.html)。

### `get-phone-number-order`
<a name="chime_GetPhoneNumberOrder_cli_topic"></a>

以下代码示例演示了如何使用 `get-phone-number-order`。

**AWS CLI**  
**获取电话号码订单的详细信息**  
以下 `get-phone-number-order` 示例显示指定电话号码订单的详细信息。  

```
aws chime get-phone-number-order \
    --phone-number-order-id abc12345-de67-89f0-123g-h45i678j9012
```
输出：  

```
{
    "PhoneNumberOrder": {
        "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
        "ProductType": "VoiceConnector",
        "Status": "Partial",
        "OrderedPhoneNumbers": [
            {
              "E164PhoneNumber": "+12065550100",
              "Status": "Acquired"
            },
            {
                "E164PhoneNumber": "+12065550101",
                "Status": "Acquired"
            },
            {
                "E164PhoneNumber": "+12065550102",
                "Status": "Failed"
            }
        ],
        "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
        "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetPhoneNumberOrder](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-phone-number-order.html)。

### `get-phone-number-settings`
<a name="chime_GetPhoneNumberSettings_cli_topic"></a>

以下代码示例演示了如何使用 `get-phone-number-settings`。

**AWS CLI**  
**检索出站呼叫名称**  
以下 `get-phone-number-settings` 示例检索呼叫用户 AWS 账户的默认出站呼叫名称。  

```
aws chime get-phone-number-settings
```
此命令不生成任何输出。输出：  

```
{
    "CallingName": "myName",
    "CallingNameUpdatedTimestamp": "2019-10-28T18:56:42.911Z"
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetPhoneNumberSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-phone-number-settings.html)。

### `get-phone-number`
<a name="chime_GetPhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `get-phone-number`。

**AWS CLI**  
**获取电话号码的详细信息**  
以下 `get-phone-number` 示例显示指定电话号码的详细信息。  

```
aws chime get-phone-number \
    --phone-number-id +12065550100
```
输出：  

```
{
    "PhoneNumber": {
        "PhoneNumberId": "%2B12065550100",
        "E164PhoneNumber": "+12065550100",
        "Type": "Local",
        "ProductType": "VoiceConnector",
        "Status": "Unassigned",
        "Capabilities": {
            "InboundCall": true,
            "OutboundCall": true,
            "InboundSMS": true,
            "OutboundSMS": true,
            "InboundMMS": true,
            "OutboundMMS": true
        },
       "Associations": [
            {
                "Value": "abcdef1ghij2klmno3pqr4",
                "Name": "VoiceConnectorId",
                "AssociatedTimestamp": "2019-10-28T18:40:37.453Z"
            }
        ],
        "CallingNameStatus": "UpdateInProgress",
        "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
        "UpdatedTimestamp": "2019-08-09T21:35:31.745Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetPhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-phone-number.html)。

### `get-room`
<a name="chime_GetRoom_cli_topic"></a>

以下代码示例演示了如何使用 `get-room`。

**AWS CLI**  
**获取有关聊天室的详细信息**  
以下 `get-room` 示例显示有关指定聊天室的详细信息。  

```
aws chime get-room \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
```
输出：  

```
{
    "Room": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Name": "chatRoom",
        "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
        "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
        "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
        "UpdatedTimestamp": "2019-12-02T22:29:31.549Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetRoom](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-room.html)。

### `get-user-settings`
<a name="chime_GetUserSettings_cli_topic"></a>

以下代码示例演示了如何使用 `get-user-settings`。

**AWS CLI**  
**检索用户设置**  
以下 `get-user-settings` 示例显示指定的用户设置。  

```
aws chime get-user-settings \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --user-id 1ab2345c-67de-8901-f23g-45h678901j2k
```
输出：  

```
{
    "UserSettings": {
        "Telephony": {
            "InboundCalling": true,
            "OutboundCalling": true,
            "SMS": true
        }
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户电话号码](https://docs.aws.amazon.com/chime/latest/ag/user-phone.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetUserSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-user-settings.html)。

### `get-user`
<a name="chime_GetUser_cli_topic"></a>

以下代码示例演示了如何使用 `get-user`。

**AWS CLI**  
**获取有关用户的详细信息**  
以下 `get-user` 示例检索指定用户的详细信息。  

```
aws chime get-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
```
输出：  

```
{
    "User": {
        "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
        "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "PrimaryEmail": "marthar@example.com",
        "DisplayName": "Martha Rivera",
        "LicenseType": "Pro",
        "UserRegistrationStatus": "Registered",
        "RegisteredOn": "2018-12-20T18:45:25.231Z",
        "InvitedOn": "2018-12-20T18:45:25.231Z",
        "AlexaForBusinessMetadata": {
            "IsAlexaForBusinessEnabled": False,
            "AlexaForBusinessRoomArn": "null"
        },
        "PersonalPIN": "XXXXXXXXXX"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户](https://docs.aws.amazon.com/chime/latest/ag/manage-users.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [GetUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/get-user.html)。

### `invite-users`
<a name="chime_InviteUsers_cli_topic"></a>

以下代码示例演示了如何使用 `invite-users`。

**AWS CLI**  
**邀请用户加入 Amazon Chime**  
以下 `invite-users` 示例发送一封电子邮件，邀请用户加入指定的 Amazon Chime 账户。  

```
aws chime invite-users \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-email-list "alejandror@example.com" "janed@example.com"
```
输出：  

```
{
    "Invites": [
        {
            "InviteId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
            "Status": "Pending",
            "EmailAddress": "alejandror@example.com",
            "EmailStatus": "Sent"
        }
        {
            "InviteId": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE",
            "Status": "Pending",
            "EmailAddress": "janed@example.com",
            "EmailStatus": "Sent"
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[邀请和暂停用户](https://docs.aws.amazon.com/chime/latest/ag/manage-access.html#invite-users-team)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [InviteUsers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/invite-users.html)。

### `list-accounts`
<a name="chime_ListAccounts_cli_topic"></a>

以下代码示例演示了如何使用 `list-accounts`。

**AWS CLI**  
**获取账户列表**  
以下 `list-accounts` 示例检索管理员 AWS 账户中的 Amazon Chime 账户列表。  

```
aws chime list-accounts
```
输出：  

```
{
    "Accounts": [
        {
            "AwsAccountId": "111122223333",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
            "Name": "First Chime Account",
            "AccountType": "EnterpriseDirectory",
            "CreatedTimestamp": "2018-12-20T18:38:02.181Z",
            "DefaultLicense": "Pro",
            "SupportedLicenses": [
                "Basic",
                "Pro"
            ],
            "SigninDelegateGroups": [
                {
                    "GroupName": "myGroup"
                },
            ]
        },
        {
            "AwsAccountId": "111122223333",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
            "Name": "Second Chime Account",
            "AccountType": "Team",
            "CreatedTimestamp": "2018-09-04T21:44:22.292Z",
            "DefaultLicense": "Pro",
            "SupportedLicenses": [
                "Basic",
                "Pro"
            ],
            "SigninDelegateGroups": [
                {
                    "GroupName": "myGroup"
                },
            ]
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理您的 Amazon Chime 账户](https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListAccounts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-accounts.html)。

### `list-bots`
<a name="chime_ListBots_cli_topic"></a>

以下代码示例演示了如何使用 `list-bots`。

**AWS CLI**  
**检索机器人列表**  
以下 `list-bots` 示例列出与指定 Amazon Chime Enterprise 账户关联的机器人。  

```
aws chime list-bots \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45
```
输出：  

```
{
    "Bot": {
        "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "DisplayName": "myBot (Bot)",
        "BotType": "ChatBot",
        "Disabled": false,
        "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
        "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
        "BotEmail": "myBot-chimebot@example.com",
        "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    }
}
```
有关更多信息，请参阅《Amazon Chime 开发人员指南》**中的[使用 Amazon Chime 聊天机器人](https://docs.aws.amazon.com/chime/latest/dg/use-bots.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListBots](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-bots.html)。

### `list-phone-number-orders`
<a name="chime_ListPhoneNumberOrders_cli_topic"></a>

以下代码示例演示了如何使用 `list-phone-number-orders`。

**AWS CLI**  
**列出电话号码订单**  
以下 `list-phone-number-orders` 示例列出与 Amazon Chime 管理员账户关联的电话号码订单。  

```
aws chime list-phone-number-orders
```
输出：  

```
{
    "PhoneNumberOrders": [
        {
            "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
            "ProductType": "VoiceConnector",
            "Status": "Partial",
            "OrderedPhoneNumbers": [
                {
                    "E164PhoneNumber": "+12065550100",
                    "Status": "Acquired"
                },
                {
                    "E164PhoneNumber": "+12065550101",
                    "Status": "Acquired"
                },
                {
                    "E164PhoneNumber": "+12065550102",
                    "Status": "Failed"
                }
            ],
            "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
            "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
        }
        {
            "PhoneNumberOrderId": "cba54321-ed76-09f5-321g-h54i876j2109",
            "ProductType": "BusinessCalling",
            "Status": "Partial",
            "OrderedPhoneNumbers": [
                {
                    "E164PhoneNumber": "+12065550103",
                    "Status": "Acquired"
                },
                {
                    "E164PhoneNumber": "+12065550104",
                    "Status": "Acquired"
                },
                {
                    "E164PhoneNumber": "+12065550105",
                    "Status": "Failed"
                }
            ],
            "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
            "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListPhoneNumberOrders](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-phone-number-orders.html)。

### `list-phone-numbers`
<a name="chime_ListPhoneNumbers_cli_topic"></a>

以下代码示例演示了如何使用 `list-phone-numbers`。

**AWS CLI**  
**列出 Amazon Chime 账户的电话号码**  
以下 `list-phone-numbers` 示例列出与管理员的 Amazon Chime 账户关联的电话号码。  

```
aws chime list-phone-numbers
```
此命令不生成任何输出。输出：  

```
{
    "PhoneNumbers": [
        {
            "PhoneNumberId": "%2B12065550100",
            "E164PhoneNumber": "+12065550100",
            "Type": "Local",
            "ProductType": "VoiceConnector",
            "Status": "Assigned",
            "Capabilities": {
                "InboundCall": true,
                "OutboundCall": true,
                "InboundSMS": true,
                "OutboundSMS": true,
                "InboundMMS": true,
                "OutboundMMS": true
            },
            "Associations": [
                {
                    "Value": "abcdef1ghij2klmno3pqr4",
                    "Name": "VoiceConnectorId",
                    "AssociatedTimestamp": "2019-10-28T18:40:37.453Z"
                }
            ],
            "CallingNameStatus": "UpdateInProgress",
            "CreatedTimestamp": "2019-08-12T22:10:20.521Z",
            "UpdatedTimestamp": "2019-10-28T18:42:07.964Z"
        },
        {
            "PhoneNumberId": "%2B12065550101",
            "E164PhoneNumber": "+12065550101",
            "Type": "Local",
            "ProductType": "VoiceConnector",
            "Status": "Assigned",
            "Capabilities": {
                "InboundCall": true,
                "OutboundCall": true,
                "InboundSMS": true,
                "OutboundSMS": true,
                "InboundMMS": true,
                "OutboundMMS": true
            },
            "Associations": [
                {
                    "Value": "abcdef1ghij2klmno3pqr4",
                    "Name": "VoiceConnectorId",
                    "AssociatedTimestamp": "2019-10-28T18:40:37.511Z"
                }
            ],
            "CallingNameStatus": "UpdateInProgress",
            "CreatedTimestamp": "2019-08-12T22:10:20.521Z",
            "UpdatedTimestamp": "2019-10-28T18:42:07.960Z"
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListPhoneNumbers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-phone-numbers.html)。

### `list-room-memberships`
<a name="chime_ListRoomMemberships_cli_topic"></a>

以下代码示例演示了如何使用 `list-room-memberships`。

**AWS CLI**  
**列出聊天室成员资格**  
以下 `list-room-memberships` 示例显示指定聊天室的成员资格详细信息列表。  

```
aws chime list-room-memberships \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
```
输出：  

```
{
    "RoomMemberships": [
        {
            "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
            "Member": {
                "MemberId": "2ab2345c-67de-8901-f23g-45h678901j2k",
                "MemberType": "User",
                "Email": "zhangw@example.com",
                "FullName": "Zhang Wei",
                "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
            },
            "Role": "Member",
            "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
            "UpdatedTimestamp": "2019-12-02T22:46:58.532Z"
        },
        {
            "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
            "Member": {
                "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
                "MemberType": "User",
                "Email": "janed@example.com",
                "FullName": "Jane Doe",
                "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
            },
            "Role": "Administrator",
            "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
            "UpdatedTimestamp": "2019-12-02T22:46:58.532Z"
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListRoomMemberships](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-room-memberships.html)。

### `list-rooms`
<a name="chime_ListRooms_cli_topic"></a>

以下代码示例演示了如何使用 `list-rooms`。

**AWS CLI**  
**列出聊天室**  
以下 `list-rooms` 示例显示指定账户中的聊天室列表。列表仅筛选指定成员所属的聊天室。  

```
aws chime list-rooms \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
```
输出：  

```
{
    "Room": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Name": "teamRoom",
        "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
        "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
        "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
        "UpdatedTimestamp": "2019-12-02T22:33:19.310Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListRooms](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-rooms.html)。

### `list-users`
<a name="chime_ListUsers_cli_topic"></a>

以下代码示例演示了如何使用 `list-users`。

**AWS CLI**  
**列出账户中的用户**  
以下 `list-users` 示例列出指定 Amazon Chime 账户的用户。  

```
aws chime list-users --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
```
输出：  

```
{
    "Users": [
        {
            "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
            "PrimaryEmail": "mariag@example.com",
            "DisplayName": "Maria Garcia",
            "LicenseType": "Pro",
            "UserType": "PrivateUser",
            "UserRegistrationStatus": "Registered",
            "RegisteredOn": "2018-12-20T18:45:25.231Z"
            "AlexaForBusinessMetadata": {
                "IsAlexaForBusinessEnabled": false
            }
        },
        {
            "UserId": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
            "PrimaryEmail": "richardr@example.com",
            "DisplayName": "Richard Roe",
            "LicenseType": "Pro",
            "UserType": "PrivateUser",
            "UserRegistrationStatus": "Registered",
            "RegisteredOn": "2018-12-20T18:45:45.415Z"
            "AlexaForBusinessMetadata": {
                "IsAlexaForBusinessEnabled": false
            }
        },
        {
            "UserId": "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
            "PrimaryEmail": "saanvis@example.com",
            "DisplayName": "Saanvi Sarkar",
            "LicenseType": "Basic",
            "UserType": "PrivateUser",
            "UserRegistrationStatus": "Registered",
            "RegisteredOn": "2018-12-20T18:46:57.747Z"
            "AlexaForBusinessMetadata": {
                "IsAlexaForBusinessEnabled": false
            }
        },
        {
            "UserId": "a1b2c3d4-5678-90ab-cdef-55555EXAMPLE",
            "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
            "PrimaryEmail": "wxiulan@example.com",
            "DisplayName": "Wang Xiulan",
            "LicenseType": "Basic",
            "UserType": "PrivateUser",
            "UserRegistrationStatus": "Registered",
            "RegisteredOn": "2018-12-20T18:47:15.390Z"
            "AlexaForBusinessMetadata": {
                "IsAlexaForBusinessEnabled": false
            }
        }
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户](https://docs.aws.amazon.com/chime/latest/ag/manage-users.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListUsers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/list-users.html)。

### `logout-user`
<a name="chime_LogoutUser_cli_topic"></a>

以下代码示例演示了如何使用 `logout-user`。

**AWS CLI**  
**注销用户**  
以下 `logout-user` 示例注销指定用户。  

```
aws chime logout-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
```
此命令不生成任何输出。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [LogoutUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/logout-user.html)。

### `regenerate-security-token`
<a name="chime_RegenerateSecurityToken_cli_topic"></a>

以下代码示例演示了如何使用 `regenerate-security-token`。

**AWS CLI**  
**重新生成安全令牌**  
以下 `regenerate-security-token` 示例为指定机器人重新生成安全令牌。  

```
aws chime regenerate-security-token \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k
```
输出：  

```
{
    "Bot": {
        "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "DisplayName": "myBot (Bot)",
        "BotType": "ChatBot",
        "Disabled": false,
        "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
        "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
        "BotEmail": "myBot-chimebot@example.com",
        "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"
    }
}
```
有关更多信息，请参阅《Amazon Chime 开发人员指南》**中的[验证聊天机器人请求](https://docs.aws.amazon.com/chime/latest/dg/auth-bots.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [RegenerateSecurityToken](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/regenerate-security-token.html)。

### `reset-personal-pin`
<a name="chime_ResetPersonalPin_cli_topic"></a>

以下代码示例演示了如何使用 `reset-personal-pin`。

**AWS CLI**  
**重置用户的个人会议 PIN**  
以下 `reset-personal-pin` 示例重置指定用户的个人会议 PIN。  

```
aws chime reset-personal-pin \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
    --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
```
输出：  

```
{
    "User": {
        "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
        "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "PrimaryEmail": "mateo@example.com",
        "DisplayName": "Mateo Jackson",
        "LicenseType": "Pro",
        "UserType": "PrivateUser",
        "UserRegistrationStatus": "Registered",
        "RegisteredOn": "2018-12-20T18:45:25.231Z",
        "AlexaForBusinessMetadata": {
            "IsAlexaForBusinessEnabled": False,
            "AlexaForBusinessRoomArn": "null"
        },
        "PersonalPIN": "XXXXXXXXXX"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[更改个人会议 PIN](https://docs.aws.amazon.com/chime/latest/ag/change-PINs.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ResetPersonalPin](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/reset-personal-pin.html)。

### `restore-phone-number`
<a name="chime_RestorePhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `restore-phone-number`。

**AWS CLI**  
**恢复电话号码**  
以下 `restore-phone-number` 示例从删除队列恢复指定电话号码。  

```
aws chime restore-phone-number \
    --phone-number-id "+12065550100"
```
输出：  

```
{
    "PhoneNumber": {
        "PhoneNumberId": "%2B12065550100",
        "E164PhoneNumber": "+12065550100",
        "Type": "Local",
        "ProductType": "BusinessCalling",
        "Status": "Unassigned",
        "Capabilities": {
            "InboundCall": true,
            "OutboundCall": true,
            "InboundSMS": true,
            "OutboundSMS": true,
            "InboundMMS": true,
            "OutboundMMS": true
        },
        "Associations": [],
        "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
        "UpdatedTimestamp": "2019-08-12T22:06:36.355Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [RestorePhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/restore-phone-number.html)。

### `search-available-phone-numbers`
<a name="chime_SearchAvailablePhoneNumbers_cli_topic"></a>

以下代码示例演示了如何使用 `search-available-phone-numbers`。

**AWS CLI**  
**搜索可用的电话号码**  
以下 `search-available-phone-numbers` 示例按区号搜索可用的电话号码。  

```
aws chime search-available-phone-numbers \
    --area-code "206"
```
输出：  

```
{
    "E164PhoneNumbers": [
        "+12065550100",
        "+12065550101",
        "+12065550102",
        "+12065550103",
        "+12065550104",
        "+12065550105",
        "+12065550106",
        "+12065550107",
        "+12065550108",
        "+12065550109",
    ]
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [SearchAvailablePhoneNumbers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/search-available-phone-numbers.html)。

### `update-account-settings`
<a name="chime_UpdateAccountSettings_cli_topic"></a>

以下代码示例演示了如何使用 `update-account-settings`。

**AWS CLI**  
**更新您的账户设置**  
以下 `update-account-settings` 示例禁用指定 Amazon Chime 账户的共享屏幕远程控制。  

```
aws chime update-account-settings \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --account-settings DisableRemoteControl=true
```
此命令不生成任何输出。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateAccountSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-account-settings.html)。

### `update-account`
<a name="chime_UpdateAccount_cli_topic"></a>

以下代码示例演示了如何使用 `update-account`。

**AWS CLI**  
**更新账户**  
以下 `update-account` 示例更新指定的账户名称。  

```
aws chime update-account \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --name MyAccountName
```
输出：  

```
{
    "Account": {
        "AwsAccountId": "111122223333",
        "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "Name": "MyAccountName",
        "AccountType": "Team",
        "CreatedTimestamp": "2018-09-04T21:44:22.292Z",
        "DefaultLicense": "Pro",
        "SupportedLicenses": [
            "Basic",
            "Pro"
        ],
        "SigninDelegateGroups": [
            {
                "GroupName": "myGroup"
            },
        ]
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[重命名账户](https://docs.aws.amazon.com/chime/latest/ag/rename-account.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-account.html)。

### `update-bot`
<a name="chime_UpdateBot_cli_topic"></a>

以下代码示例演示了如何使用 `update-bot`。

**AWS CLI**  
**更新机器人**  
以下 `update-bot` 示例更新指定机器人的状态，使其停止运行。  

```
aws chime update-bot \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k \
    --disabled
```
输出：  

```
{
    "Bot": {
        "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
        "DisplayName": "myBot (Bot)",
        "BotType": "ChatBot",
        "Disabled": true,
        "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
        "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
        "BotEmail": "myBot-chimebot@example.com",
        "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"
    }
}
```
有关更多信息，请参阅《Amazon Chime 开发人员指南》**中的[更新聊天机器人](https://docs.aws.amazon.com/chime/latest/dg/update-bots.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateBot](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-bot.html)。

### `update-global-settings`
<a name="chime_UpdateGlobalSettings_cli_topic"></a>

以下代码示例演示了如何使用 `update-global-settings`。

**AWS CLI**  
**更新全局设置**  
以下 `update-global-settings` 示例更新用于存储与管理员 AWS 账户关联的 Amazon Chime Business Calling 和 Amazon Chime Voice Connector 的呼叫详细记录的 S3 存储桶。  

```
aws chime update-global-settings \
    --business-calling CdrBucket="s3bucket" \
    --voice-connector CdrBucket="s3bucket"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理全局设置](https://docs.aws.amazon.com/chime/latest/ag/manage-global.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateGlobalSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-global-settings.html)。

### `update-phone-number-settings`
<a name="chime_UpdatePhoneNumberSettings_cli_topic"></a>

以下代码示例演示了如何使用 `update-phone-number-settings`。

**AWS CLI**  
**更新出站呼叫名称**  
以下 `update-phone-number-settings` 示例更新呼叫管理员 AWS 账户的默认出站呼叫名称。  

```
aws chime update-phone-number-settings \
    --calling-name "myName"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdatePhoneNumberSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-phone-number-settings.html)。

### `update-phone-number`
<a name="chime_UpdatePhoneNumber_cli_topic"></a>

以下代码示例演示了如何使用 `update-phone-number`。

**AWS CLI**  
**示例 1：更新电话号码的产品类型**  
以下 `update-phone-number` 示例更新指定电话号码的产品类型。  

```
aws chime update-phone-number \
    --phone-number-id "+12065550100" \
    --product-type "BusinessCalling"
```
输出：  

```
{
    "PhoneNumber": {
        "PhoneNumberId": "%2B12065550100",
        "E164PhoneNumber": "+12065550100",
        "Type": "Local",
        "ProductType": "BusinessCalling",
        "Status": "Unassigned",
        "Capabilities": {
            "InboundCall": true,
            "OutboundCall": true,
            "InboundSMS": true,
            "OutboundSMS": true,
            "InboundMMS": true,
            "OutboundMMS": true
        },
        "Associations": [],
        "CallingName": "phonenumber1",
        "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
        "UpdatedTimestamp": "2019-08-12T21:44:07.591Z"
    }
}
```
**示例 2：更新电话号码的出站呼叫名称**  
以下 `update-phone-number` 示例更新指定电话号码的出站呼叫名称。  
aws chime update-phone-number --phone-number-id "\$112065550100" --calling-name "phonenumber2"  
输出：  

```
{
    "PhoneNumber": {
        "PhoneNumberId": "%2B12065550100",
        "E164PhoneNumber": "+12065550100",
        "Type": "Local",
        "ProductType": "BusinessCalling",
        "Status": "Unassigned",
        "Capabilities": {
            "InboundCall": true,
            "OutboundCall": true,
            "InboundSMS": true,
            "OutboundSMS": true,
            "InboundMMS": true,
            "OutboundMMS": true
        },
        "Associations": [],
        "CallingName": "phonenumber2",
        "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
        "UpdatedTimestamp": "2019-08-12T21:44:07.591Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[使用电话号码](https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdatePhoneNumber](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-phone-number.html)。

### `update-room-membership`
<a name="chime_UpdateRoomMembership_cli_topic"></a>

以下代码示例演示了如何使用 `update-room-membership`。

**AWS CLI**  
**更新聊天室成员资格**  
以下 `update-room-membership` 示例会将指定聊天室成员的角色修改为 `Administrator`。  

```
aws chime update-room-membership \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
    --member-id 1ab2345c-67de-8901-f23g-45h678901j2k \
    --role Administrator
```
输出：  

```
{
    "RoomMembership": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Member": {
            "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
            "MemberType": "User",
            "Email": "sofiamartinez@example.com",
            "FullName": "Sofia Martinez",
            "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
        },
        "Role": "Administrator",
        "InvitedBy": "arn:aws:iam::111122223333:user/admin",
        "UpdatedTimestamp": "2019-12-02T22:40:22.931Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateRoomMembership](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-room-membership.html)。

### `update-room`
<a name="chime_UpdateRoom_cli_topic"></a>

以下代码示例演示了如何使用 `update-room`。

**AWS CLI**  
**更新聊天室**  
以下 `update-room` 示例修改指定聊天室的名称。  

```
aws chime update-room \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
    --name teamRoom
```
输出：  

```
{
    "Room": {
        "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
        "Name": "teamRoom",
        "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
        "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
        "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
        "UpdatedTimestamp": "2019-12-02T22:33:19.310Z"
    }
}
```
有关更多信息，请参阅《Amazon Chime 用户指南》**中的[创建聊天室](https://docs.aws.amazon.com/chime/latest/ug/chime-chat-room.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateRoom](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-room.html)。

### `update-user-settings`
<a name="chime_UpdateUserSettings_cli_topic"></a>

以下代码示例演示了如何使用 `update-user-settings`。

**AWS CLI**  
**更新用户设置**  
以下 `update-user-settings` 示例可以让指定用户进行入站和出站呼叫，并收发 SMS 消息。  

```
aws chime update-user-settings \
    --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
    --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \
    --user-settings "Telephony={InboundCalling=true,OutboundCalling=true,SMS=true}"
```
此命令不生成任何输出。  
有关更多信息，请参阅《Amazon Chime 管理指南》**中的[管理用户电话号码](https://docs.aws.amazon.com/chime/latest/ag/user-phone.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateUserSettings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-user-settings.html)。

### `update-user`
<a name="chime_UpdateUser_cli_topic"></a>

以下代码示例演示了如何使用 `update-user`。

**AWS CLI**  
**更新用户详细信息**  
此示例更新指定用户的指定详细信息。  
命令:  

```
aws chime update-user \
    --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
    --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE \
    --license-type "Basic"
```
输出：  

```
{
    "User": {
        "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE"
    }
}
```
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UpdateUser](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/chime/update-user.html)。