Skip to content

Commit e6ecca2

Browse files
author
Jingnan Xu
committed
gen with 0901
1 parent 0191298 commit e6ecca2

File tree

40 files changed

+1585
-2358
lines changed

40 files changed

+1585
-2358
lines changed

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/_create.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,30 @@ def _build_arguments_schema(cls, *args, **kwargs):
7777
)
7878

7979
identity = cls._args_schema.identity
80+
identity.mi_system_assigned = AAZStrArg(
81+
options=["system-assigned", "mi-system-assigned"],
82+
help="Set the system managed identity.",
83+
blank="True",
84+
)
8085
identity.type = AAZStrArg(
8186
options=["type"],
8287
help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
8388
required=True,
8489
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"},
8590
)
91+
identity.mi_user_assigned = AAZListArg(
92+
options=["user-assigned", "mi-user-assigned"],
93+
help="Set the user managed identities.",
94+
blank=[],
95+
)
8696
identity.user_assigned_identities = AAZDictArg(
8797
options=["user-assigned-identities"],
8898
help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.",
8999
)
90100

101+
mi_user_assigned = cls._args_schema.identity.mi_user_assigned
102+
mi_user_assigned.Element = AAZStrArg()
103+
91104
user_assigned_identities = cls._args_schema.identity.user_assigned_identities
92105
user_assigned_identities.Element = AAZObjectArg(
93106
blank={},
@@ -267,7 +280,7 @@ def content(self):
267280
typ=AAZObjectType,
268281
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
269282
)
270-
_builder.set_prop("identity", AAZObjectType, ".identity")
283+
_builder.set_prop("identity", AAZIdentityObjectType, ".identity")
271284
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
272285
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
273286
_builder.set_prop("sku", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
@@ -277,11 +290,17 @@ def content(self):
277290
if identity is not None:
278291
identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}})
279292
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
293+
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
294+
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})
280295

281296
user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
282297
if user_assigned_identities is not None:
283298
user_assigned_identities.set_elements(AAZObjectType, ".")
284299

300+
user_assigned = _builder.get(".identity.userAssigned")
301+
if user_assigned is not None:
302+
user_assigned.set_elements(AAZStrType, ".")
303+
285304
properties = _builder.get(".properties")
286305
if properties is not None:
287306
properties.set_prop("logScrubbing", AAZObjectType, ".log_scrubbing")
@@ -360,7 +379,7 @@ def _build_schema_profile_read(cls, _schema):
360379
profile_read.id = AAZStrType(
361380
flags={"read_only": True},
362381
)
363-
profile_read.identity = AAZObjectType()
382+
profile_read.identity = AAZIdentityObjectType()
364383
profile_read.kind = AAZStrType(
365384
flags={"read_only": True},
366385
)

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/_list.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
5151

5252
def _execute_operations(self):
5353
self.pre_operations()
54-
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
55-
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
54+
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
55+
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
5656
if condition_0:
57-
self.ProfilesListByResourceGroup(ctx=self.ctx)()
58-
if condition_1:
5957
self.ProfilesList(ctx=self.ctx)()
58+
if condition_1:
59+
self.ProfilesListByResourceGroup(ctx=self.ctx)()
6060
self.post_operations()
6161

6262
@register_callback
@@ -72,7 +72,7 @@ def _output(self, *args, **kwargs):
7272
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7373
return result, next_link
7474

75-
class ProfilesListByResourceGroup(AAZHttpOperation):
75+
class ProfilesList(AAZHttpOperation):
7676
CLIENT_TYPE = "MgmtClient"
7777

7878
def __call__(self, *args, **kwargs):
@@ -86,7 +86,7 @@ def __call__(self, *args, **kwargs):
8686
@property
8787
def url(self):
8888
return self.client.format_url(
89-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles",
89+
"/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles",
9090
**self.url_parameters
9191
)
9292

@@ -101,10 +101,6 @@ def error_format(self):
101101
@property
102102
def url_parameters(self):
103103
parameters = {
104-
**self.serialize_url_param(
105-
"resourceGroupName", self.ctx.args.resource_group,
106-
required=True,
107-
),
108104
**self.serialize_url_param(
109105
"subscriptionId", self.ctx.subscription_id,
110106
required=True,
@@ -163,7 +159,7 @@ def _build_schema_on_200(cls):
163159
_element.id = AAZStrType(
164160
flags={"read_only": True},
165161
)
166-
_element.identity = AAZObjectType()
162+
_element.identity = AAZIdentityObjectType()
167163
_element.kind = AAZStrType(
168164
flags={"read_only": True},
169165
)
@@ -293,7 +289,7 @@ def _build_schema_on_200(cls):
293289

294290
return cls._schema_on_200
295291

296-
class ProfilesList(AAZHttpOperation):
292+
class ProfilesListByResourceGroup(AAZHttpOperation):
297293
CLIENT_TYPE = "MgmtClient"
298294

299295
def __call__(self, *args, **kwargs):
@@ -307,7 +303,7 @@ def __call__(self, *args, **kwargs):
307303
@property
308304
def url(self):
309305
return self.client.format_url(
310-
"/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles",
306+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles",
311307
**self.url_parameters
312308
)
313309

@@ -322,6 +318,10 @@ def error_format(self):
322318
@property
323319
def url_parameters(self):
324320
parameters = {
321+
**self.serialize_url_param(
322+
"resourceGroupName", self.ctx.args.resource_group,
323+
required=True,
324+
),
325325
**self.serialize_url_param(
326326
"subscriptionId", self.ctx.subscription_id,
327327
required=True,
@@ -380,7 +380,7 @@ def _build_schema_on_200(cls):
380380
_element.id = AAZStrType(
381381
flags={"read_only": True},
382382
)
383-
_element.identity = AAZObjectType()
383+
_element.identity = AAZIdentityObjectType()
384384
_element.kind = AAZStrType(
385385
flags={"read_only": True},
386386
)

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _build_schema_on_200(cls):
156156
_schema_on_200.id = AAZStrType(
157157
flags={"read_only": True},
158158
)
159-
_schema_on_200.identity = AAZObjectType()
159+
_schema_on_200.identity = AAZIdentityObjectType()
160160
_schema_on_200.kind = AAZStrType(
161161
flags={"read_only": True},
162162
)

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/_update.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def _update_instance(self, instance):
410410
value=instance,
411411
typ=AAZObjectType
412412
)
413-
_builder.set_prop("identity", AAZObjectType, ".identity")
413+
_builder.set_prop("identity", AAZIdentityObjectType, ".identity")
414414
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
415415
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
416416
_builder.set_prop("sku", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
@@ -491,7 +491,7 @@ def _build_schema_profile_read(cls, _schema):
491491
profile_read.id = AAZStrType(
492492
flags={"read_only": True},
493493
)
494-
profile_read.identity = AAZObjectType()
494+
profile_read.identity = AAZIdentityObjectType()
495495
profile_read.kind = AAZStrType(
496496
flags={"read_only": True},
497497
)

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/_wait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _build_schema_on_200(cls):
152152
_schema_on_200.id = AAZStrType(
153153
flags={"read_only": True},
154154
)
155-
_schema_on_200.identity = AAZObjectType()
155+
_schema_on_200.identity = AAZIdentityObjectType()
156156
_schema_on_200.kind = AAZStrType(
157157
flags={"read_only": True},
158158
)

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/profile/log_scrubbing/_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _build_schema_profile_read(cls, _schema):
190190
profile_read.id = AAZStrType(
191191
flags={"read_only": True},
192192
)
193-
profile_read.identity = AAZObjectType()
193+
profile_read.identity = AAZIdentityObjectType()
194194
profile_read.kind = AAZStrType(
195195
flags={"read_only": True},
196196
)

0 commit comments

Comments
 (0)