Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/communication/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
1.8.0b1
++++++
* Update ACS Rooms to use 1.1.0b1 version

1.7.2b1
++++++
Expand Down
4 changes: 2 additions & 2 deletions src/communication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ az communication rooms get --room "roomId"
```
##### Create-Room #####
```
az communication rooms create --valid-from "2023-03-31T10:20:30" --valid-to "2023-06-31T10:20:30" --presenter-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --attendee-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --consumer-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
az communication rooms create --valid-from "2023-03-31T10:20:30" --valid-to "2023-06-31T10:20:30" --pstn-dial-out-enabled "True" --presenter-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --attendee-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --consumer-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
```
##### Update-Room #####
```
az communication rooms update --room "roomId" --valid-from "2023-03-31T10:20:30" --valid-to "2023-06-31T10:20:30"
az communication rooms update --room "roomId" --valid-from "2023-03-31T10:20:30" --valid-to "2023-06-31T10:20:30" --pstn-dial-out-enabled "True"
```
##### Delete-Room #####
```
Expand Down
3 changes: 3 additions & 0 deletions src/communication/azext_communication/manual/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,9 @@
- name: Create a room with valid-from and valid-until date/times
text: |-
az communication rooms create --valid-from "2022-07-14T10:21" --valid-until "2022-08-14T10:21"
- name: Create a room with valid-from, valid-until date/times and pstn-dial-out-enabled
text: |-
az communication rooms create --valid-from "2022-07-14T10:21" --valid-until "2022-08-14T10:21" --pstn-dial-out-enabled "True"
- name: Create a room with a list of participants with presenter role
text: |-
az communication rooms create --presenter-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
Expand Down
20 changes: 16 additions & 4 deletions src/communication/azext_communication/manual/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def _load_rooms_arguments(self):
c.argument('valid_until',
help='The timestamp from when the room can no longer be joined,'
' in ISO8601 format, ex: 2023-06-31T10:21. Optional.')
c.argument('pstn_dial_out_enabled',
help='Set this flag to true if, at the time of the call, '
'dial out to a PSTN number is enabled in a particular room. '
'By default, this flag is set to false. Optional.')
c.argument('presenters', options_list=['--presenter-participants'],
nargs='+', help='Collection of identities to be invited to the room as presenter. Optional.')
c.argument('attendees', options_list=['--attendee-participants'],
Expand All @@ -227,6 +231,10 @@ def _load_rooms_arguments(self):
c.argument('valid_until',
help='The timestamp from when the room can no longer be joined, in ISO8601 format, '
'ex: 2023-06-31T10:21. Should be used together with --valid-from. Optional.')
c.argument('pstn_dial_out_enabled',
help='Set this flag to true if, at the time of the call, '
'dial out to a PSTN number is enabled in a particular room. '
'By default, this flag is set to false. Optional.')

with self.argument_context('communication rooms participant get') as c:
c.argument('room_id', options_list=['--room'],
Expand Down Expand Up @@ -254,17 +262,21 @@ def _load_email_arguments(self):
c.argument('sender', options_list=['--sender'], type=str, help='Sender email address from a verified domain.')
c.argument('subject', options_list=['--subject'], type=str, help='Subject of the email message.')
c.argument('text', options_list=['--text'], type=str, help='Plain text version of the email message. Optional.')
c.argument('html', options_list=['--html'], type=str, help='Html version of the email message. Optional.')
c.argument('recipients_to', options_list=['--to'], nargs='+', help='Recepients email addresses comma seperated if more than one.')
c.argument('html', options_list=['--html'], type=str,
help='Html version of the email message. Optional.')
c.argument('recipients_to', options_list=['--to'], nargs='+',
help='Recepients email addresses comma seperated if more than one.')
c.argument('importance', options_list=['--importance'], arg_type=get_enum_type(['normal', 'low', 'high']),
help='The importance type for the email. Known values are: high,'
' normal, and low. Default is normal. Optional')
c.argument('recipients_cc', options_list=['--cc'], nargs='+', help='Carbon copy email addresses.')
c.argument('recipients_bcc', options_list=['--bcc'], nargs='+', help='Blind carbon copy email addresses.')
c.argument('reply_to', options_list=['--reply-to'], type=str, help='Reply-to email address. Optional.')
c.argument('disable_tracking', options_list=['--disable-tracking'], arg_type=get_three_state_flag(),
c.argument('disable_tracking', options_list=['--disable-tracking'],
arg_type=get_three_state_flag(),
help='Indicates whether user engagement tracking should be disabled for this specific request. '
'This is only applicable if the resource-level user engagement tracking setting was already enabled in control plane. Optional.')
'This is only applicable if the resource-level user engagement '
'tracking setting was already enabled in control plane. Optional.')
c.argument('attachments', options_list=['--attachments'], nargs='+',
help='List of email attachments. Optional.')
c.argument('attachment_types', options_list=['--attachment-types'], nargs='+',
Expand Down
47 changes: 41 additions & 6 deletions src/communication/azext_communication/manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


import sys
import ast
from azure.core.exceptions import HttpResponseError


Expand Down Expand Up @@ -189,6 +190,20 @@ def __to_room_participant(presenters, attendees, consumers):
return participants


def __to_room_pstn_dial_out_enabled(pstn_dial_out_enabled):
pstn_enabled_str = pstn_dial_out_enabled

if pstn_enabled_str is None:
return pstn_enabled_str

if pstn_dial_out_enabled.lower() == "false":
pstn_enabled_str = "False"
elif pstn_dial_out_enabled.lower() == "true":
pstn_enabled_str = "True"

return pstn_enabled_str


def communication_rooms_get_room(client, room_id):
try:
return client.get_room(room_id)
Expand All @@ -201,15 +216,23 @@ def communication_rooms_get_room(client, room_id):
def communication_rooms_create_room(client,
valid_from=None,
valid_until=None,
pstn_dial_out_enabled=None,
presenters=None,
attendees=None,
consumers=None):
try:
room_participants = __to_room_participant(presenters, attendees, consumers)
pstn_dialed_out_enabled_str = __to_room_pstn_dial_out_enabled(pstn_dial_out_enabled)

if pstn_dialed_out_enabled_str is None:
pstn_dialed_out_enabled_str = "False"

pstn_enabled = ast.literal_eval(pstn_dialed_out_enabled_str)

return client.create_room(
valid_from=valid_from,
valid_until=valid_until,
pstn_dial_out_enabled=pstn_enabled,
participants=room_participants)
except HttpResponseError:
raise
Expand All @@ -228,12 +251,20 @@ def communication_rooms_delete_room(client, room_id):

def communication_rooms_update_room(client, room_id,
valid_from=None,
valid_until=None):
valid_until=None,
pstn_dial_out_enabled=None):
try:
pstn_dialed_out_enabled_str = __to_room_pstn_dial_out_enabled(pstn_dial_out_enabled)
pstn_enabled = None

if pstn_dialed_out_enabled_str is not None:
pstn_enabled = ast.literal_eval(pstn_dialed_out_enabled_str)

return client.update_room(
room_id=room_id,
valid_from=valid_from,
valid_until=valid_until)
valid_until=valid_until,
pstn_dial_out_enabled=pstn_enabled)
except HttpResponseError:
raise
except Exception as ex:
Expand Down Expand Up @@ -352,12 +383,16 @@ def communication_email_send(client,
"html": html
},
"recipients": {
"to": None if recipients_to is None else [{"address": recipient} for recipient in recipients_to[0].split(',')],
"cc": None if recipients_cc is None else [{"address": recipient} for recipient in recipients_cc[0].split(',')],
"bcc": None if recipients_bcc is None else [{"address": recipient} for recipient in recipients_bcc[0].split(',')]
"to": None if recipients_to is None else [{"address": recipient}
for recipient in recipients_to[0].split(',')],
"cc": None if recipients_cc is None else [{"address": recipient}
for recipient in recipients_cc[0].split(',')],
"bcc": None if recipients_bcc is None else [{"address": recipient}
for recipient in recipients_bcc[0].split(',')]
},
"replyTo": None if reply_to is None else [{"address": reply_to}],
"attachments": None if attachments_list is None else [json.loads(attachment) for attachment in attachments_list],
"attachments": None if attachments_list is None else [json.loads(attachment)
for attachment in attachments_list],
"senderAddress": sender,
"userEngagementTrackingDisabled": disable_tracking,
"headers": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interactions:
- request:
body: '{"validFrom": null, "validUntil": null}'
body: '{"validFrom": null, "validUntil": null, "pstnDialOutEnabled": false}'
headers:
Accept:
- application/json
Expand All @@ -9,48 +9,49 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '39'
- '68'
Content-Type:
- application/json
Repeatability-First-Sent:
- Wed, 19 Jul 2023 21:09:39 GMT
Repeatability-Request-ID:
- 92e25404-2678-11ee-9d01-8cf8c5abc371
- Mon, 16 Oct 2023 16:13:36 GMT
Repeatability-Request-Id:
- f617c7f0-6c3e-11ee-8059-8cf8c5abc371
User-Agent:
- AzureCli/1.7.1b1 azsdk-python-communication-rooms/1.0.0 Python/3.8.0 (Windows-10-10.0.22621-SP0)
- AzureCli/1.7.2b1 azsdk-python-communication-rooms/1.1.0b1 Python/3.11.5 (Windows-10-10.0.22621-SP0)
x-ms-content-sha256:
- vBTkhrLFogng0nIWoP6/XqO3xl87GjFK9aShkzc8E3g=
- 2xVVJJKx5brgL5bSWgeu9hhccJP/PkHHEzXUfUClsMI=
x-ms-date:
- Wed, 19 Jul 2023 21:09:39 GMT
- Mon, 16 Oct 2023 16:13:36 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://sanitized.communication.azure.com/rooms?api-version=2023-06-14
uri: https://sanitized.communication.azure.com/rooms?api-version=2023-10-30-preview
response:
body:
string: '{"id": "sanitized", "createdAt": "2023-07-19T21:09:41.9846054+00:00",
"validFrom": "2023-07-19T21:09:41.2998083+00:00", "validUntil": "2024-01-15T21:09:41.2998083+00:00"}'
string: '{"id": "sanitized", "createdAt": "2023-10-16T16:13:39.5922465+00:00",
"validFrom": "2023-10-16T16:13:39.2550799+00:00", "validUntil": "2024-04-13T16:13:39.2550799+00:00",
"pstnDialOutEnabled": false}'
headers:
api-deprecated-versions:
- 2021-04-07, 2022-02-01
api-supported-versions:
- 2023-03-31-preview, 2023-06-14
- 2023-03-31-preview, 2023-06-14, 2023-10-30-preview
content-type:
- application/json; charset=utf-8
date:
- Wed, 19 Jul 2023 21:09:41 GMT
- Mon, 16 Oct 2023 16:13:39 GMT
location:
- '99439417689810246'
- '9946018372970179'
ms-cv:
- d31L5jNaTU2GwPUm9IfaKg.0
- 7n6m/xDiAUSvx9rSclWs4w.0
repeatability-result:
- accepted
request-context:
- appId=
transfer-encoding:
- chunked
x-azure-ref:
- 0FFG4ZAAAAAB7BrKX1/cnS6X1zSJyd3NvWVZSMzExMDAwMTE1MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==
- 0MmEtZQAAAACFL4nXt0BNSoDK5AhRiKupWVZSMzExMDAwMTE1MDM1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==
x-cache:
- CONFIG_NOCACHE
status:
Expand All @@ -70,15 +71,15 @@ interactions:
Content-Type:
- application/merge-patch+json
User-Agent:
- AzureCli/1.7.1b1 azsdk-python-communication-rooms/1.0.0 Python/3.8.0 (Windows-10-10.0.22621-SP0)
- AzureCli/1.7.2b1 azsdk-python-communication-rooms/1.1.0b1 Python/3.11.5 (Windows-10-10.0.22621-SP0)
x-ms-content-sha256:
- GGeywqkmwEbmvIr+M7fYvPtgLYHCAoJWqoApBN7ZlcA=
x-ms-date:
- Wed, 19 Jul 2023 21:09:41 GMT
- Mon, 16 Oct 2023 16:13:40 GMT
x-ms-return-client-request-id:
- 'true'
method: PATCH
uri: https://sanitized.communication.azure.com/rooms/sanitized/participants?api-version=2023-06-14
uri: https://sanitized.communication.azure.com/rooms/sanitized/participants?api-version=2023-10-30-preview
response:
body:
string: '{"error": {"code": "BadRequest", "message": "Invalid value for the
Expand All @@ -87,19 +88,19 @@ interactions:
api-deprecated-versions:
- '2022-02-01'
api-supported-versions:
- 2023-03-31-preview, 2023-06-14
- 2023-03-31-preview, 2023-06-14, 2023-10-30-preview
content-type:
- application/json; charset=utf-8
date:
- Wed, 19 Jul 2023 21:09:42 GMT
- Mon, 16 Oct 2023 16:13:41 GMT
ms-cv:
- 6OLlxKXrpUWqhwuJkyEdwQ.0
- qPBzbbrBbk+F5631gTZgzg.0
request-context:
- appId=
transfer-encoding:
- chunked
x-azure-ref:
- 0FlG4ZAAAAACJYT+FnN3sSYDi9IjNpQAaWVZSMzExMDAwMTE1MDIxADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==
- 0NWEtZQAAAADLK5auIM7XT4Y3+82hBVlFWVZSMzExMDAwMTE1MDUxADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==
x-cache:
- CONFIG_NOCACHE
x-ms-error-code:
Expand Down
Loading