1818class AddCollaborator (AAZCommand ):
1919 """Adds a collaborator to a collaboration.
2020
21- :example: Add Collaborator
22- az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --email alice@example.com
21+ :example: Add Collaborator(User)
22+ az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --user-identifier "alice@contoso.com"
23+
24+ :example: Add Collaborator(Service Principal)
25+ az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --user-identifier "0d6b305c-85ee-419f-9c87-d3405c24aab6" --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47" --object-id "0f8fad5b-d9cb-469f-a165-70867728950e"
2326 """
2427
2528 _aaz_info = {
26- "version" : "2025-10 -31-preview" ,
29+ "version" : "2026-03 -31-preview" ,
2730 "resources" : [
28- ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator" , "2025-10 -31-preview" ],
31+ ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator" , "2026-03 -31-preview" ],
2932 ]
3033 }
3134
@@ -59,14 +62,23 @@ def _build_arguments_schema(cls, *args, **kwargs):
5962 required = True ,
6063 )
6164
62- # define Arg Group "Body "
65+ # define Arg Group "Collaborator "
6366
6467 _args_schema = cls ._args_schema
65- _args_schema .email = AAZStrArg (
66- options = ["--email" ],
67- arg_group = "Body" ,
68- help = "Email of the collaborator to be added." ,
69- required = True ,
68+ _args_schema .object_id = AAZStrArg (
69+ options = ["--object-id" ],
70+ arg_group = "Collaborator" ,
71+ help = "Object ID of the collaborator." ,
72+ )
73+ _args_schema .tenant_id = AAZStrArg (
74+ options = ["--tenant-id" ],
75+ arg_group = "Collaborator" ,
76+ help = "Tenant ID of the collaborator." ,
77+ )
78+ _args_schema .user_identifier = AAZStrArg (
79+ options = ["--user-identifier" ],
80+ arg_group = "Collaborator" ,
81+ help = "User identifier of the collaborator. This can be specified as an email (no OID/TID should be specified) or an SPN (OID/TID required)." ,
7082 )
7183 return cls ._args_schema
7284
@@ -151,7 +163,7 @@ def url_parameters(self):
151163 def query_parameters (self ):
152164 parameters = {
153165 ** self .serialize_query_param (
154- "api-version" , "2025-10 -31-preview" ,
166+ "api-version" , "2026-03 -31-preview" ,
155167 required = True ,
156168 ),
157169 }
@@ -176,7 +188,13 @@ def content(self):
176188 typ = AAZObjectType ,
177189 typ_kwargs = {"flags" : {"required" : True , "client_flatten" : True }}
178190 )
179- _builder .set_prop ("email" , AAZStrType , ".email" , typ_kwargs = {"flags" : {"required" : True }})
191+ _builder .set_prop ("collaborator" , AAZObjectType , "." , typ_kwargs = {"flags" : {"required" : True , "client_flatten" : True }})
192+
193+ collaborator = _builder .get (".collaborator" )
194+ if collaborator is not None :
195+ collaborator .set_prop ("objectId" , AAZStrType , ".object_id" )
196+ collaborator .set_prop ("tenantId" , AAZStrType , ".tenant_id" )
197+ collaborator .set_prop ("userIdentifier" , AAZStrType , ".user_identifier" )
180198
181199 return self .serialize_content (_content_value )
182200
@@ -225,14 +243,15 @@ def _build_schema_on_200(cls):
225243 serialized_name = "clusterEndpoint" ,
226244 flags = {"read_only" : True },
227245 )
246+ properties .collaboration_state = AAZStrType (
247+ serialized_name = "collaborationState" ,
248+ flags = {"read_only" : True },
249+ )
250+ properties .collaborators = AAZListType ()
228251 properties .consortium_arm_id = AAZStrType (
229252 serialized_name = "consortiumArmId" ,
230253 flags = {"read_only" : True },
231254 )
232- properties .consortium_type = AAZStrType (
233- serialized_name = "consortiumType" ,
234- flags = {"required" : True },
235- )
236255 properties .health = AAZObjectType (
237256 flags = {"read_only" : True },
238257 )
@@ -244,14 +263,28 @@ def _build_schema_on_200(cls):
244263 serialized_name = "provisioningState" ,
245264 flags = {"read_only" : True },
246265 )
247- properties .user_identity = AAZObjectType (
248- serialized_name = "userIdentity" ,
249- flags = {"required" : True },
250- )
251266 properties .workloads = AAZListType (
252267 flags = {"read_only" : True },
253268 )
254269
270+ collaborators = cls ._schema_on_200 .properties .collaborators
271+ collaborators .Element = AAZObjectType ()
272+
273+ _element = cls ._schema_on_200 .properties .collaborators .Element
274+ _element .is_collaboration_owner = AAZBoolType (
275+ serialized_name = "isCollaborationOwner" ,
276+ flags = {"read_only" : True },
277+ )
278+ _element .object_id = AAZStrType (
279+ serialized_name = "objectId" ,
280+ )
281+ _element .tenant_id = AAZStrType (
282+ serialized_name = "tenantId" ,
283+ )
284+ _element .user_identifier = AAZStrType (
285+ serialized_name = "userIdentifier" ,
286+ )
287+
255288 health = cls ._schema_on_200 .properties .health
256289 health .health_issues = AAZListType (
257290 serialized_name = "healthIssues" ,
@@ -283,20 +316,6 @@ def _build_schema_on_200(cls):
283316 _element = cls ._schema_on_200 .properties .managed_on_behalf_of_configuration .mobo_broker_resources .Element
284317 _element .id = AAZStrType ()
285318
286- user_identity = cls ._schema_on_200 .properties .user_identity
287- user_identity .account_type = AAZStrType (
288- serialized_name = "accountType" ,
289- flags = {"required" : True },
290- )
291- user_identity .object_id = AAZStrType (
292- serialized_name = "objectId" ,
293- flags = {"required" : True },
294- )
295- user_identity .tenant_id = AAZStrType (
296- serialized_name = "tenantId" ,
297- flags = {"required" : True },
298- )
299-
300319 workloads = cls ._schema_on_200 .properties .workloads
301320 workloads .Element = AAZObjectType ()
302321
0 commit comments