1212
1313
1414@register_command (
15- "changesafety changestate create" ,
15+ "changesafety changerecord create" ,
1616)
1717class Create (AAZCommand ):
1818 """Create a ChangeRecord
1919 """
2020
2121 _aaz_info = {
22- "version" : "2025-09 -01-preview" ,
22+ "version" : "2026-01 -01-preview" ,
2323 "resources" : [
24- ["mgmt-plane" , "/subscriptions/{}/providers/Microsoft.ChangeSafety/changestates /{}" , "2025-09 -01-preview" ],
25- ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/Microsoft.ChangeSafety/changestates /{}" , "2025-09 -01-preview" ],
24+ ["mgmt-plane" , "/subscriptions/{}/providers/microsoft.changesafety/changerecords /{}" , "2026-01 -01-preview" ],
25+ ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.changesafety/changerecords /{}" , "2026-01 -01-preview" ],
2626 ]
2727 }
2828
@@ -42,7 +42,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4242 # define Arg Group ""
4343
4444 _args_schema = cls ._args_schema
45- _args_schema .change_state_name = AAZStrArg (
45+ _args_schema .change_record_name = AAZStrArg (
4646 options = ["-n" , "--name" , "--change-record-name" ],
4747 help = "The name of the ChangeRecord resource." ,
4848 required = True ,
@@ -79,6 +79,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
7979 protocol = "iso" ,
8080 ),
8181 )
82+ _args_schema .change_definition = AAZObjectArg (
83+ options = ["--change-definition" ],
84+ arg_group = "Properties" ,
85+ help = "Change request body and/or resource selection criteria used to identify the targeted resources." ,
86+ )
8287 _args_schema .change_type = AAZStrArg (
8388 options = ["--change-type" ],
8489 arg_group = "Properties" ,
@@ -133,6 +138,25 @@ def _build_arguments_schema(cls, *args, **kwargs):
133138 help = "Reference to the StageMap, defining progression." ,
134139 )
135140
141+ change_definition = cls ._args_schema .change_definition
142+ change_definition .details = AAZObjectArg (
143+ options = ["details" ],
144+ help = "Free form object containing additional details for the change definition." ,
145+ required = True ,
146+ blank = {},
147+ )
148+ change_definition .kind = AAZStrArg (
149+ options = ["kind" ],
150+ help = "Kind of the change definition." ,
151+ required = True ,
152+ enum = {"ApiOperations" : "ApiOperations" , "Targets" : "Targets" },
153+ )
154+ change_definition .name = AAZStrArg (
155+ options = ["name" ],
156+ help = "Name of the change definition." ,
157+ required = True ,
158+ )
159+
136160 links = cls ._args_schema .links
137161 links .Element = AAZObjectArg ()
138162
@@ -254,12 +278,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
254278
255279 def _execute_operations (self ):
256280 self .pre_operations ()
257- condition_0 = has_value (self .ctx .args .change_state_name ) and has_value (self .ctx .subscription_id ) and has_value (self .ctx .args .resource_group ) is not True
258- condition_1 = has_value (self .ctx .args .change_state_name ) and has_value (self .ctx .args .resource_group ) and has_value (self .ctx .subscription_id )
281+ condition_0 = has_value (self .ctx .args .change_record_name ) and has_value (self .ctx .subscription_id ) and has_value (self .ctx .args .resource_group ) is not True
282+ condition_1 = has_value (self .ctx .args .change_record_name ) and has_value (self .ctx .args .resource_group ) and has_value (self .ctx .subscription_id )
259283 if condition_0 :
260- self .ChangeStatesCreateOrUpdateAtSubscriptionLevel (ctx = self .ctx )()
284+ self .ChangeRecordsCreateOrUpdateAtSubscriptionLevel (ctx = self .ctx )()
261285 if condition_1 :
262- self .ChangeStatesCreateOrUpdate (ctx = self .ctx )()
286+ self .ChangeRecordsCreateOrUpdate (ctx = self .ctx )()
263287 self .post_operations ()
264288
265289 @register_callback
@@ -274,7 +298,7 @@ def _output(self, *args, **kwargs):
274298 result = self .deserialize_output (self .ctx .vars .instance , client_flatten = True )
275299 return result
276300
277- class ChangeStatesCreateOrUpdateAtSubscriptionLevel (AAZHttpOperation ):
301+ class ChangeRecordsCreateOrUpdateAtSubscriptionLevel (AAZHttpOperation ):
278302 CLIENT_TYPE = "MgmtClient"
279303
280304 def __call__ (self , * args , ** kwargs ):
@@ -288,7 +312,7 @@ def __call__(self, *args, **kwargs):
288312 @property
289313 def url (self ):
290314 return self .client .format_url (
291- "/subscriptions/{subscriptionId}/providers/Microsoft.ChangeSafety/changeStates/{changeStateName }" ,
315+ "/subscriptions/{subscriptionId}/providers/Microsoft.ChangeSafety/changeRecords/{changeRecordName }" ,
292316 ** self .url_parameters
293317 )
294318
@@ -304,7 +328,7 @@ def error_format(self):
304328 def url_parameters (self ):
305329 parameters = {
306330 ** self .serialize_url_param (
307- "changeStateName " , self .ctx .args .change_state_name ,
331+ "changeRecordName " , self .ctx .args .change_record_name ,
308332 required = True ,
309333 ),
310334 ** self .serialize_url_param (
@@ -318,7 +342,7 @@ def url_parameters(self):
318342 def query_parameters (self ):
319343 parameters = {
320344 ** self .serialize_query_param (
321- "api-version" , "2025-09 -01-preview" ,
345+ "api-version" , "2026-01 -01-preview" ,
322346 required = True ,
323347 ),
324348 }
@@ -350,6 +374,7 @@ def content(self):
350374 properties .set_prop ("additionalData" , AAZObjectType , ".additional_data" )
351375 properties .set_prop ("anticipatedEndTime" , AAZStrType , ".anticipated_end_time" , typ_kwargs = {"flags" : {"required" : True }})
352376 properties .set_prop ("anticipatedStartTime" , AAZStrType , ".anticipated_start_time" , typ_kwargs = {"flags" : {"required" : True }})
377+ properties .set_prop ("changeDefinition" , AAZObjectType , ".change_definition" , typ_kwargs = {"flags" : {"required" : True }})
353378 properties .set_prop ("changeType" , AAZStrType , ".change_type" , typ_kwargs = {"flags" : {"required" : True }})
354379 properties .set_prop ("comments" , AAZStrType , ".comments" )
355380 properties .set_prop ("description" , AAZStrType , ".description" )
@@ -360,6 +385,12 @@ def content(self):
360385 properties .set_prop ("rolloutType" , AAZStrType , ".rollout_type" , typ_kwargs = {"flags" : {"required" : True }})
361386 properties .set_prop ("stageMap" , AAZObjectType , ".stage_map" )
362387
388+ change_definition = _builder .get (".properties.changeDefinition" )
389+ if change_definition is not None :
390+ change_definition .set_prop ("details" , AAZObjectType , ".details" , typ_kwargs = {"flags" : {"required" : True }})
391+ change_definition .set_prop ("kind" , AAZStrType , ".kind" , typ_kwargs = {"flags" : {"required" : True }})
392+ change_definition .set_prop ("name" , AAZStrType , ".name" , typ_kwargs = {"flags" : {"required" : True }})
393+
363394 links = _builder .get (".properties.links" )
364395 if links is not None :
365396 links .set_elements (AAZObjectType , "." )
@@ -646,7 +677,7 @@ def _build_schema_on_200_201(cls):
646677
647678 return cls ._schema_on_200_201
648679
649- class ChangeStatesCreateOrUpdate (AAZHttpOperation ):
680+ class ChangeRecordsCreateOrUpdate (AAZHttpOperation ):
650681 CLIENT_TYPE = "MgmtClient"
651682
652683 def __call__ (self , * args , ** kwargs ):
@@ -660,7 +691,7 @@ def __call__(self, *args, **kwargs):
660691 @property
661692 def url (self ):
662693 return self .client .format_url (
663- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeSafety/changeStates/{changeStateName }" ,
694+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeSafety/changeRecords/{changeRecordName }" ,
664695 ** self .url_parameters
665696 )
666697
@@ -676,7 +707,7 @@ def error_format(self):
676707 def url_parameters (self ):
677708 parameters = {
678709 ** self .serialize_url_param (
679- "changeStateName " , self .ctx .args .change_state_name ,
710+ "changeRecordName " , self .ctx .args .change_record_name ,
680711 required = True ,
681712 ),
682713 ** self .serialize_url_param (
@@ -694,7 +725,7 @@ def url_parameters(self):
694725 def query_parameters (self ):
695726 parameters = {
696727 ** self .serialize_query_param (
697- "api-version" , "2025-09 -01-preview" ,
728+ "api-version" , "2026-01 -01-preview" ,
698729 required = True ,
699730 ),
700731 }
@@ -726,6 +757,7 @@ def content(self):
726757 properties .set_prop ("additionalData" , AAZObjectType , ".additional_data" )
727758 properties .set_prop ("anticipatedEndTime" , AAZStrType , ".anticipated_end_time" , typ_kwargs = {"flags" : {"required" : True }})
728759 properties .set_prop ("anticipatedStartTime" , AAZStrType , ".anticipated_start_time" , typ_kwargs = {"flags" : {"required" : True }})
760+ properties .set_prop ("changeDefinition" , AAZObjectType , ".change_definition" , typ_kwargs = {"flags" : {"required" : True }})
729761 properties .set_prop ("changeType" , AAZStrType , ".change_type" , typ_kwargs = {"flags" : {"required" : True }})
730762 properties .set_prop ("comments" , AAZStrType , ".comments" )
731763 properties .set_prop ("description" , AAZStrType , ".description" )
@@ -736,6 +768,12 @@ def content(self):
736768 properties .set_prop ("rolloutType" , AAZStrType , ".rollout_type" , typ_kwargs = {"flags" : {"required" : True }})
737769 properties .set_prop ("stageMap" , AAZObjectType , ".stage_map" )
738770
771+ change_definition = _builder .get (".properties.changeDefinition" )
772+ if change_definition is not None :
773+ change_definition .set_prop ("details" , AAZObjectType , ".details" , typ_kwargs = {"flags" : {"required" : True }})
774+ change_definition .set_prop ("kind" , AAZStrType , ".kind" , typ_kwargs = {"flags" : {"required" : True }})
775+ change_definition .set_prop ("name" , AAZStrType , ".name" , typ_kwargs = {"flags" : {"required" : True }})
776+
739777 links = _builder .get (".properties.links" )
740778 if links is not None :
741779 links .set_elements (AAZObjectType , "." )
0 commit comments