Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 8 additions & 0 deletions src/communication/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Release History
===============
1.12.0
++++++
* Update azure-rooms-communication to 1.2.0 (collaborator role)
* Add new argument "collaborator-participants" to support collaborator role
* Add abbreviations for role-based participant arguments
* Update azure-core to 1.32.0
* Update azure-identity to 1.5.0

1.11.2
++++++
* Adding an error message for incorrect formats of inline attachments in Email communication send mail.
Expand Down
2 changes: 1 addition & 1 deletion src/communication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ 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" --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"
az communication rooms create --valid-from "2023-05-31T10:20:30" --valid-to "2025-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" --collaborator-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
```
##### Update-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 @@ -492,6 +492,9 @@
- name: Create a room with a list of participants with presenter and consumer roles
text: |-
az communication rooms create --presenter-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --consumer-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
- name: Create a room with a list of participants with attendee and collaborator roles
text: |-
az communication rooms create --attendee-participants "8:acs:xxxxxx" "8:acs:xxxxxx" --collaborator-participants "8:acs:xxxxxx" "8:acs:xxxxxx"
"""

helps['communication rooms get'] = """
Expand Down
16 changes: 10 additions & 6 deletions src/communication/azext_communication/manual/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,14 @@ def _load_rooms_arguments(self):
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'],
c.argument('presenters', options_list=['--presenter-participants', '--presenters'],
nargs='+', help='Collection of identities to be invited to the room as presenter. Optional.')
c.argument('attendees', options_list=['--attendee-participants'],
c.argument('attendees', options_list=['--attendee-participants', '--attendees'],
nargs='+', help='Collection of identities to be invited to the room as attendee. Optional.')
c.argument('consumers', options_list=['--consumer-participants'],
c.argument('consumers', options_list=['--consumer-participants', '--consumers'],
nargs='+', help='Collection of identities to be invited to the room as consumer. Optional.')
c.argument('collaborators', options_list=['--collaborator-participants', '--collaborators'],
nargs='+', help='Collection of identities to be invited to the room as collaborator. Optional.')

with self.argument_context('communication rooms delete') as c:
c.argument('room_id', options_list=['--room'],
Expand All @@ -243,12 +245,14 @@ def _load_rooms_arguments(self):
with self.argument_context('communication rooms participant add-or-update') as c:
c.argument('room_id', options_list=['--room'],
type=str, help='Room Id')
c.argument('presenters', options_list=['--presenter-participants'],
c.argument('presenters', options_list=['--presenter-participants', '--presenters'],
nargs='+', help='Collection of identities to be added to the room as presenter.')
c.argument('attendees', options_list=['--attendee-participants'],
c.argument('attendees', options_list=['--attendee-participants', '--attendees'],
nargs='+', help='Collection of identities to be added to the room as attendee.')
c.argument('consumers', options_list=['--consumer-participants'],
c.argument('consumers', options_list=['--consumer-participants', '--consumers'],
nargs='+', help='Collection of identities to be added to the room as consumer.')
c.argument('collaborators', options_list=['--collaborator-participants', '--collaborators'],
nargs='+', help='Collection of identities to be added to the room as collaborator.')

with self.argument_context('communication rooms participant remove') as c:
c.argument('room_id', options_list=['--room'],
Expand Down
17 changes: 12 additions & 5 deletions src/communication/azext_communication/manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def __to_communication_identifier(participants):
return [identifier_from_raw_id(p) for p in participants]


def __to_room_participant(presenters, attendees, consumers):
def __to_room_participant(presenters, attendees, consumers, collaborators):
from azure.communication.identity._shared.models import identifier_from_raw_id
from azure.communication.rooms import RoomParticipant, ParticipantRole

Expand All @@ -193,6 +193,11 @@ def __to_room_participant(presenters, attendees, consumers):
participants.extend([RoomParticipant(communication_identifier=i,
role=ParticipantRole.CONSUMER) for i in identifiers])

if collaborators is not None:
identifiers = [identifier_from_raw_id(p) for p in collaborators]
participants.extend([RoomParticipant(communication_identifier=i,
role=ParticipantRole.COLLABORATOR) for i in identifiers])

return participants


Expand Down Expand Up @@ -225,9 +230,10 @@ def communication_rooms_create_room(client,
pstn_dial_out_enabled=None,
presenters=None,
attendees=None,
consumers=None):
consumers=None,
collaborators=None):
try:
room_participants = __to_room_participant(presenters, attendees, consumers)
room_participants = __to_room_participant(presenters, attendees, consumers, collaborators)
pstn_dialed_out_enabled_str = __to_room_pstn_dial_out_enabled(pstn_dial_out_enabled)

if pstn_dialed_out_enabled_str is None:
Expand Down Expand Up @@ -298,11 +304,12 @@ def communication_rooms_get_participants(client, room_id):
def communication_rooms_add_or_update_participants(client, room_id,
presenters=None,
attendees=None,
consumers=None):
consumers=None,
collaborators=None):
try:
return client.add_or_update_participants(
room_id=room_id,
participants=__to_room_participant(presenters, attendees, consumers))
participants=__to_room_participant(presenters, attendees, consumers, collaborators))
except HttpResponseError:
raise
except Exception as ex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,37 @@ interactions:
Content-Type:
- application/json
Repeatability-First-Sent:
- Mon, 10 Jun 2024 13:06:37 GMT
- Tue, 25 Mar 2025 01:15:10 GMT
Repeatability-Request-Id:
- 4570f4f1-272a-11ef-80c9-00155d7acf01
- 98da4840-0916-11f0-81b2-8c3b4abe269c
User-Agent:
- AzureCli/1.9.2 azsdk-python-communication-rooms/1.1.0 Python/3.10.11 (Windows-10-10.0.19045-SP0)
- AzureCli/1.11.2 azsdk-python-communication-rooms/1.2.0 Python/3.9.13 (Windows-10-10.0.26100-SP0)
x-ms-content-sha256:
- 2xVVJJKx5brgL5bSWgeu9hhccJP/PkHHEzXUfUClsMI=
x-ms-date:
- Mon, 10 Jun 2024 13:06:37 GMT
- Tue, 25 Mar 2025 01:15:10 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://sanitized.communication.azure.com/rooms?api-version=2024-04-15
uri: https://sanitized.communication.azure.com/rooms?api-version=2025-03-13
response:
body:
string: '{"id": "sanitized", "createdAt": "2024-06-10T13:06:39.9796475+00:00",
"validFrom": "2024-06-10T13:06:39.2306092+00:00", "validUntil": "2024-12-07T13:06:39.2306092+00:00",
string: '{"id": "sanitized", "createdAt": "2025-03-25T01:15:12.0536235+00:00",
"validFrom": "2025-03-25T01:15:12.0210285+00:00", "validUntil": "2025-09-21T01:15:12.0210285+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-10-30-preview, 2024-04-15
- 2023-06-14, 2023-10-30-preview, 2024-04-15, 2025-03-13
connection:
- keep-alive
content-type:
- application/json; charset=utf-8
date:
- Mon, 10 Jun 2024 13:06:39 GMT
- Tue, 25 Mar 2025 01:15:12 GMT
location:
- '9943172807370859'
- '99411844121037446'
ms-cv:
- sXy+gN8b3UywtWPJzx1J5A.0
- BKfFMmL5KE2OG3PKab6xmg.0
repeatability-result:
- accepted
request-context:
Expand All @@ -53,7 +53,7 @@ interactions:
transfer-encoding:
- chunked
x-azure-ref:
- 0XvpmZgAAAAD3c+Hk4PbUT6aVmAs/b8BESEtCRURHRTA3MTAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx
- 20250325T011511Z-r1fff4c4b87llftchC1CO1mm9g00000001cg000000005ce2
x-cache:
- CONFIG_NOCACHE
status:
Expand All @@ -73,38 +73,38 @@ interactions:
Content-Type:
- application/merge-patch+json
User-Agent:
- AzureCli/1.9.2 azsdk-python-communication-rooms/1.1.0 Python/3.10.11 (Windows-10-10.0.19045-SP0)
- AzureCli/1.11.2 azsdk-python-communication-rooms/1.2.0 Python/3.9.13 (Windows-10-10.0.26100-SP0)
x-ms-content-sha256:
- GGeywqkmwEbmvIr+M7fYvPtgLYHCAoJWqoApBN7ZlcA=
x-ms-date:
- Mon, 10 Jun 2024 13:06:40 GMT
- Tue, 25 Mar 2025 01:15:11 GMT
x-ms-return-client-request-id:
- 'true'
method: PATCH
uri: https://sanitized.communication.azure.com/rooms/sanitized/participants?api-version=2024-04-15
uri: https://sanitized.communication.azure.com/rooms/sanitized/participants?api-version=2025-03-13
response:
body:
string: '{"error": {"code": "BadRequest", "message": "Invalid value for the
Participants."}}'
string: '{"error": {"code": "BadRequest", "message": "Communication identifier
8:acs:123456c is not supported."}}'
headers:
api-deprecated-versions:
- '2022-02-01'
api-supported-versions:
- 2023-03-31-preview, 2023-06-14, 2023-10-30-preview, 2024-04-15
- 2023-06-14, 2023-10-30-preview, 2024-04-15, 2025-03-13
connection:
- keep-alive
content-type:
- application/json; charset=utf-8
date:
- Mon, 10 Jun 2024 13:06:41 GMT
- Tue, 25 Mar 2025 01:15:12 GMT
ms-cv:
- JveHjdzH1EKQdF9fBDU7kg.0
- iwfOrOCE+0aA6nXyAB1gyw.0
request-context:
- appId=
strict-transport-security:
- max-age=31536000;includeSubDomains
transfer-encoding:
- chunked
x-azure-ref:
- 0YfpmZgAAAABR/nXT1bqdRbbragqCjEJxSEtCRURHRTA3MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx
- 20250325T011512Z-r1fff4c4b87f7jv2hC1CO11bzs00000001b0000000009pgp
x-cache:
- CONFIG_NOCACHE
x-ms-error-code:
Expand Down
Loading
Loading