channel_bans
Creates, updates, deletes, gets or lists a channel_bans resource.
Overview
| Name | channel_bans |
| Type | Resource |
| Id | aws.chime_sdk_messaging.channel_bans |
Fields
The following fields are returned by SELECT queries:
- describe_channel_ban
- list_channel_bans
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The ARN of the channel from which a member is being banned. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>) |
created_by | object | The details of a user or bot. |
created_timestamp | string (date-time) | The time at which the ban was created. |
member | object | The details of a user or bot. |
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The ARN of the channel. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>) |
channel_bans | array | The information for each requested ban. |
next_token | string | The token passed by previous API calls until all requested bans are returned. (pattern: <code>.*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_channel_ban | select | channel_arn, member_arn, x-amz-chime-bearer, region | Returns the full details of a channel ban. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. | |
list_channel_bans | select | channel_arn, x-amz-chime-bearer, region | max-results, next-token | Lists all the users and bots banned from a particular channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. |
create_channel_ban | insert | channel_arn, x-amz-chime-bearer, region, MemberArn | Permanently bans a member from a channel. Moderators can't add banned members to a channel. To undo a ban, you first have to DeleteChannelBan, and then CreateChannelMembership. Bans are cleaned up when you delete users or channels. If you ban a user who is already part of a channel, that user is automatically kicked from the channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. | |
delete_channel_ban | delete | channel_arn, member_arn, x-amz-chime-bearer, region | Removes a member from a channel's ban list. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The ARN of the channel from which the AppInstanceUser was banned. |
member_arn | string | The ARN of the AppInstanceUser that you want to reinstate. |
region | string | AWS region (default: us-east-1) |
x-amz-chime-bearer | string | The ARN of the AppInstanceUser or AppInstanceBot that makes the API call. |
max-results | integer | The maximum number of bans that you want returned. |
next-token | string | The token passed by previous API calls until all requested bans are returned. |
SELECT examples
- describe_channel_ban
- list_channel_bans
Returns the full details of a channel ban. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
SELECT
channel_arn,
created_by,
created_timestamp,
member
FROM aws.chime_sdk_messaging.channel_bans
WHERE channel_arn = '{{ channel_arn }}' -- required
AND member_arn = '{{ member_arn }}' -- required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' -- required
AND region = '{{ region }}' -- required
;
Lists all the users and bots banned from a particular channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
SELECT
channel_arn,
channel_bans,
next_token
FROM aws.chime_sdk_messaging.channel_bans
WHERE channel_arn = '{{ channel_arn }}' -- required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' -- required
AND region = '{{ region }}' -- required
AND `max-results` = '{{ max-results }}'
AND `next-token` = '{{ next-token }}'
;
INSERT examples
- create_channel_ban
- Manifest
Permanently bans a member from a channel. Moderators can't add banned members to a channel. To undo a ban, you first have to DeleteChannelBan, and then CreateChannelMembership. Bans are cleaned up when you delete users or channels. If you ban a user who is already part of a channel, that user is automatically kicked from the channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
INSERT INTO aws.chime_sdk_messaging.channel_bans (
MemberArn,
channel_arn,
`x-amz-chime-bearer`,
region
)
SELECT
'{{ MemberArn }}' /* required */,
'{{ channel_arn }}',
'{{ x-amz-chime-bearer }}',
'{{ region }}'
RETURNING
channel_arn,
member
;
# Description fields are for documentation purposes
- name: channel_bans
props:
- name: channel_arn
value: "{{ channel_arn }}"
description: Required parameter for the channel_bans resource.
- name: x-amz-chime-bearer
value: "{{ x-amz-chime-bearer }}"
description: Required parameter for the channel_bans resource.
- name: region
value: "{{ region }}"
description: Required parameter for the channel_bans resource.
- name: MemberArn
value: "{{ MemberArn }}"
DELETE examples
- delete_channel_ban
Removes a member from a channel's ban list. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
DELETE FROM aws.chime_sdk_messaging.channel_bans
WHERE channel_arn = '{{ channel_arn }}' --required
AND member_arn = '{{ member_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required
;