From 10ae284f939d4f5f0ce5eb45800adc0bab6f140a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Mon, 11 Nov 2019 13:44:56 +0000 Subject: [PATCH 1/2] Generated from 259f42961fa1a6b2443113509ca05920812b5cbb Moving Priority and EvictionPolicy enum to the definitions section and adding 'Spot' priority (#7748) --- .../compute/v2019_03_01/models/__init__.py | 8 +- .../_compute_management_client_enums.py | 25 ++-- .../compute/v2019_03_01/models/_models.py | 51 ++++--- .../compute/v2019_03_01/models/_models_py3.py | 51 ++++--- .../compute/v2019_07_01/models/__init__.py | 14 +- .../_compute_management_client_enums.py | 25 ++-- .../compute/v2019_07_01/models/_models.py | 140 +++++++++--------- .../compute/v2019_07_01/models/_models_py3.py | 140 +++++++++--------- 8 files changed, 227 insertions(+), 227 deletions(-) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index c5a62027a0fd..e445bca8db62 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -429,11 +429,11 @@ ComponentNames, SettingNames, ProtocolTypes, + VirtualMachinePriorityTypes, + VirtualMachineEvictionPolicyTypes, ResourceIdentityType, MaintenanceOperationResultCodeTypes, HyperVGenerationType, - VirtualMachinePriorityTypes, - VirtualMachineEvictionPolicyTypes, UpgradeMode, VirtualMachineScaleSetScaleInRules, OperatingSystemStateTypes, @@ -686,11 +686,11 @@ 'ComponentNames', 'SettingNames', 'ProtocolTypes', + 'VirtualMachinePriorityTypes', + 'VirtualMachineEvictionPolicyTypes', 'ResourceIdentityType', 'MaintenanceOperationResultCodeTypes', 'HyperVGenerationType', - 'VirtualMachinePriorityTypes', - 'VirtualMachineEvictionPolicyTypes', 'UpgradeMode', 'VirtualMachineScaleSetScaleInRules', 'OperatingSystemStateTypes', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py index 2682a3590cca..86bae678606b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py @@ -269,6 +269,19 @@ class ProtocolTypes(str, Enum): https = "Https" +class VirtualMachinePriorityTypes(str, Enum): + + regular = "Regular" + low = "Low" + spot = "Spot" + + +class VirtualMachineEvictionPolicyTypes(str, Enum): + + deallocate = "Deallocate" + delete = "Delete" + + class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" @@ -291,18 +304,6 @@ class HyperVGenerationType(str, Enum): v2 = "V2" -class VirtualMachinePriorityTypes(str, Enum): - - regular = "Regular" - low = "Low" - - -class VirtualMachineEvictionPolicyTypes(str, Enum): - - deallocate = "Deallocate" - delete = "Delete" - - class UpgradeMode(str, Enum): automatic = "Automatic" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index 9055a1dc5c1d..02f46ec33e0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -448,23 +448,22 @@ def __init__(self, **kwargs): class BillingProfile(Model): - """Specifies the billing related details of a low priority VM or VMSS. + """Specifies the billing related details of a Azure Spot VM or VMSS.

Minimum api-version: 2019-03-01. :param max_price: Specifies the maximum price you are willing to pay for a - low priority VM/VMSS. This price is in US Dollars.

This price - will be compared with the current low priority price for the VM size. - Also, the prices are compared at the time of create/update of low priority - VM/VMSS and the operation will only succeed if the maxPrice is greater - than the current low priority price.

The maxPrice will also be - used for evicting a low priority VM/VMSS if the current low priority price - goes beyond the maxPrice after creation of VM/VMSS.

Possible - values are:

- Any decimal value greater than zero. Example: - $0.01538

-1 – indicates default price to be up-to on-demand. -

You can set the maxPrice to -1 to indicate that the low priority - VM/VMSS should not be evicted for price reasons. Also, the default max - price is -1 if it is not provided by you.

Minimum api-version: - 2019-03-01. + Azure Spot VM/VMSS. This price is in US Dollars.

This price will + be compared with the current Azure Spot price for the VM size. Also, the + prices are compared at the time of create/update of Azure Spot VM/VMSS and + the operation will only succeed if the maxPrice is greater than the + current Azure Spot price.

The maxPrice will also be used for + evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond + the maxPrice after creation of VM/VMSS.

Possible values are: +

- Any decimal value greater than zero. Example: 0.01538

+ -1 – indicates default price to be up-to on-demand.

You can set + the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be + evicted for price reasons. Also, the default max price is -1 if it is not + provided by you.

Minimum api-version: 2019-03-01. :type max_price: float """ @@ -5049,16 +5048,16 @@ class VirtualMachine(Resource): ~azure.mgmt.compute.v2019_03_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param host: Specifies information about the dedicated host that the @@ -7630,16 +7629,16 @@ class VirtualMachineScaleSetVMProfile(Model): :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible - values include: 'Regular', 'Low' + values include: 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for virtual machines - in a low priority scale set.

Minimum api-version: + in a Azure Spot scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -7838,16 +7837,16 @@ class VirtualMachineUpdate(UpdateResource): ~azure.mgmt.compute.v2019_03_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param host: Specifies information about the dedicated host that the diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index 63830126d4be..a03405a074c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -448,23 +448,22 @@ def __init__(self, *, tags=None, platform_update_domain_count: int=None, platfor class BillingProfile(Model): - """Specifies the billing related details of a low priority VM or VMSS. + """Specifies the billing related details of a Azure Spot VM or VMSS.

Minimum api-version: 2019-03-01. :param max_price: Specifies the maximum price you are willing to pay for a - low priority VM/VMSS. This price is in US Dollars.

This price - will be compared with the current low priority price for the VM size. - Also, the prices are compared at the time of create/update of low priority - VM/VMSS and the operation will only succeed if the maxPrice is greater - than the current low priority price.

The maxPrice will also be - used for evicting a low priority VM/VMSS if the current low priority price - goes beyond the maxPrice after creation of VM/VMSS.

Possible - values are:

- Any decimal value greater than zero. Example: - $0.01538

-1 – indicates default price to be up-to on-demand. -

You can set the maxPrice to -1 to indicate that the low priority - VM/VMSS should not be evicted for price reasons. Also, the default max - price is -1 if it is not provided by you.

Minimum api-version: - 2019-03-01. + Azure Spot VM/VMSS. This price is in US Dollars.

This price will + be compared with the current Azure Spot price for the VM size. Also, the + prices are compared at the time of create/update of Azure Spot VM/VMSS and + the operation will only succeed if the maxPrice is greater than the + current Azure Spot price.

The maxPrice will also be used for + evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond + the maxPrice after creation of VM/VMSS.

Possible values are: +

- Any decimal value greater than zero. Example: 0.01538

+ -1 – indicates default price to be up-to on-demand.

You can set + the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be + evicted for price reasons. Also, the default max price is -1 if it is not + provided by you.

Minimum api-version: 2019-03-01. :type max_price: float """ @@ -5049,16 +5048,16 @@ class VirtualMachine(Resource): ~azure.mgmt.compute.v2019_03_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param host: Specifies information about the dedicated host that the @@ -7630,16 +7629,16 @@ class VirtualMachineScaleSetVMProfile(Model): :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible - values include: 'Regular', 'Low' + values include: 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for virtual machines - in a low priority scale set.

Minimum api-version: + in a Azure Spot scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -7838,16 +7837,16 @@ class VirtualMachineUpdate(UpdateResource): ~azure.mgmt.compute.v2019_03_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_03_01.models.BillingProfile :param host: Specifies information about the dedicated host that the diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py index 92be01068a9b..533d07a8f28d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py @@ -47,6 +47,7 @@ from ._models_py3 import DiskSku from ._models_py3 import DiskUpdate from ._models_py3 import Encryption + from ._models_py3 import EncryptionSetIdentity from ._models_py3 import EncryptionSettingsCollection from ._models_py3 import EncryptionSettingsElement from ._models_py3 import Gallery @@ -104,7 +105,6 @@ from ._models_py3 import ReplicationStatus from ._models_py3 import RequestRateByIntervalInput from ._models_py3 import Resource - from ._models_py3 import ResourceIdentity from ._models_py3 import ResourceRange from ._models_py3 import RollbackStatusInfo from ._models_py3 import RollingUpgradePolicy @@ -245,6 +245,7 @@ from ._models import DiskSku from ._models import DiskUpdate from ._models import Encryption + from ._models import EncryptionSetIdentity from ._models import EncryptionSettingsCollection from ._models import EncryptionSettingsElement from ._models import Gallery @@ -302,7 +303,6 @@ from ._models import ReplicationStatus from ._models import RequestRateByIntervalInput from ._models import Resource - from ._models import ResourceIdentity from ._models import ResourceRange from ._models import RollbackStatusInfo from ._models import RollingUpgradePolicy @@ -444,11 +444,11 @@ ComponentNames, SettingNames, ProtocolTypes, + VirtualMachinePriorityTypes, + VirtualMachineEvictionPolicyTypes, ResourceIdentityType, MaintenanceOperationResultCodeTypes, HyperVGenerationType, - VirtualMachinePriorityTypes, - VirtualMachineEvictionPolicyTypes, UpgradeMode, VirtualMachineScaleSetScaleInRules, OperatingSystemStateTypes, @@ -513,6 +513,7 @@ 'DiskSku', 'DiskUpdate', 'Encryption', + 'EncryptionSetIdentity', 'EncryptionSettingsCollection', 'EncryptionSettingsElement', 'Gallery', @@ -570,7 +571,6 @@ 'ReplicationStatus', 'RequestRateByIntervalInput', 'Resource', - 'ResourceIdentity', 'ResourceRange', 'RollbackStatusInfo', 'RollingUpgradePolicy', @@ -711,11 +711,11 @@ 'ComponentNames', 'SettingNames', 'ProtocolTypes', + 'VirtualMachinePriorityTypes', + 'VirtualMachineEvictionPolicyTypes', 'ResourceIdentityType', 'MaintenanceOperationResultCodeTypes', 'HyperVGenerationType', - 'VirtualMachinePriorityTypes', - 'VirtualMachineEvictionPolicyTypes', 'UpgradeMode', 'VirtualMachineScaleSetScaleInRules', 'OperatingSystemStateTypes', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py index c3b10ef8d524..d68461d98830 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py @@ -269,6 +269,19 @@ class ProtocolTypes(str, Enum): https = "Https" +class VirtualMachinePriorityTypes(str, Enum): + + regular = "Regular" + low = "Low" + spot = "Spot" + + +class VirtualMachineEvictionPolicyTypes(str, Enum): + + deallocate = "Deallocate" + delete = "Delete" + + class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" @@ -291,18 +304,6 @@ class HyperVGenerationType(str, Enum): v2 = "V2" -class VirtualMachinePriorityTypes(str, Enum): - - regular = "Regular" - low = "Low" - - -class VirtualMachineEvictionPolicyTypes(str, Enum): - - deallocate = "Deallocate" - delete = "Delete" - - class UpgradeMode(str, Enum): automatic = "Automatic" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py index c2ed0104c780..c9591582ab3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py @@ -448,23 +448,22 @@ def __init__(self, **kwargs): class BillingProfile(Model): - """Specifies the billing related details of a low priority VM or VMSS. + """Specifies the billing related details of a Azure Spot VM or VMSS.

Minimum api-version: 2019-03-01. :param max_price: Specifies the maximum price you are willing to pay for a - low priority VM/VMSS. This price is in US Dollars.

This price - will be compared with the current low priority price for the VM size. - Also, the prices are compared at the time of create/update of low priority - VM/VMSS and the operation will only succeed if the maxPrice is greater - than the current low priority price.

The maxPrice will also be - used for evicting a low priority VM/VMSS if the current low priority price - goes beyond the maxPrice after creation of VM/VMSS.

Possible - values are:

- Any decimal value greater than zero. Example: - $0.01538

-1 – indicates default price to be up-to on-demand. -

You can set the maxPrice to -1 to indicate that the low priority - VM/VMSS should not be evicted for price reasons. Also, the default max - price is -1 if it is not provided by you.

Minimum api-version: - 2019-03-01. + Azure Spot VM/VMSS. This price is in US Dollars.

This price will + be compared with the current Azure Spot price for the VM size. Also, the + prices are compared at the time of create/update of Azure Spot VM/VMSS and + the operation will only succeed if the maxPrice is greater than the + current Azure Spot price.

The maxPrice will also be used for + evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond + the maxPrice after creation of VM/VMSS.

Possible values are: +

- Any decimal value greater than zero. Example: 0.01538

+ -1 – indicates default price to be up-to on-demand.

You can set + the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be + evicted for price reasons. Also, the default max price is -1 if it is not + provided by you.

Minimum api-version: 2019-03-01. :type max_price: float """ @@ -1361,7 +1360,8 @@ class DiskEncryptionSet(Resource): :param tags: Resource tags :type tags: dict[str, str] :param identity: - :type identity: ~azure.mgmt.compute.v2019_07_01.models.ResourceIdentity + :type identity: + ~azure.mgmt.compute.v2019_07_01.models.EncryptionSetIdentity :param active_key: The key vault key which is currently used by this disk encryption set. :type active_key: @@ -1390,7 +1390,7 @@ class DiskEncryptionSet(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -1627,6 +1627,46 @@ def __init__(self, **kwargs): self.type = kwargs.get('type', None) +class EncryptionSetIdentity(Model): + """The managed identity for the disk encryption set. It should be given + permission on the key vault before it can be used to encrypt disks. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: The type of Managed Identity used by the DiskEncryptionSet. + Only SystemAssigned is supported. Possible values include: + 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetIdentityType + :ivar principal_id: The object id of the Managed Identity Resource. This + will be sent to the RP from ARM via the x-ms-identity-principal-id header + in the PUT request if the resource has a systemAssigned(implicit) identity + :vartype principal_id: str + :ivar tenant_id: The tenant id of the Managed Identity Resource. This will + be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT + request if the resource has a systemAssigned(implicit) identity + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + class EncryptionSettingsCollection(Model): """Encryption settings for disk or snapshot. @@ -3953,46 +3993,6 @@ def __init__(self, **kwargs): self.interval_length = kwargs.get('interval_length', None) -class ResourceIdentity(Model): - """The managed identity for the disk encryption set. It should be given - permission on the key vault before it can be used to encrypt disks. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param type: The type of Managed Identity used by the DiskEncryptionSet. - Only SystemAssigned is supported. Possible values include: - 'SystemAssigned' - :type type: str or - ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetIdentityType - :ivar principal_id: The object id of the Managed Identity Resource. This - will be sent to the RP from ARM via the x-ms-identity-principal-id header - in the PUT request if the resource has a systemAssigned(implicit) identity - :vartype principal_id: str - :ivar tenant_id: The tenant id of the Managed Identity Resource. This will - be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT - request if the resource has a systemAssigned(implicit) identity - :vartype tenant_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - - class ResourceRange(Model): """Describes the resource range. @@ -5334,16 +5334,16 @@ class VirtualMachine(Resource): ~azure.mgmt.compute.v2019_07_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param host: Specifies information about the dedicated host that the @@ -7538,8 +7538,8 @@ class VirtualMachineScaleSetUpdateVMProfile(Model): :param license_type: The license type, which is for bring your own license scenario. :type license_type: str - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -7942,16 +7942,16 @@ class VirtualMachineScaleSetVMProfile(Model): :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible - values include: 'Regular', 'Low' + values include: 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for virtual machines - in a low priority scale set.

Minimum api-version: + in a Azure Spot scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -8150,16 +8150,16 @@ class VirtualMachineUpdate(UpdateResource): ~azure.mgmt.compute.v2019_07_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param host: Specifies information about the dedicated host that the diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index 6d81a8e0bf4a..b1c701d51320 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -448,23 +448,22 @@ def __init__(self, *, tags=None, platform_update_domain_count: int=None, platfor class BillingProfile(Model): - """Specifies the billing related details of a low priority VM or VMSS. + """Specifies the billing related details of a Azure Spot VM or VMSS.

Minimum api-version: 2019-03-01. :param max_price: Specifies the maximum price you are willing to pay for a - low priority VM/VMSS. This price is in US Dollars.

This price - will be compared with the current low priority price for the VM size. - Also, the prices are compared at the time of create/update of low priority - VM/VMSS and the operation will only succeed if the maxPrice is greater - than the current low priority price.

The maxPrice will also be - used for evicting a low priority VM/VMSS if the current low priority price - goes beyond the maxPrice after creation of VM/VMSS.

Possible - values are:

- Any decimal value greater than zero. Example: - $0.01538

-1 – indicates default price to be up-to on-demand. -

You can set the maxPrice to -1 to indicate that the low priority - VM/VMSS should not be evicted for price reasons. Also, the default max - price is -1 if it is not provided by you.

Minimum api-version: - 2019-03-01. + Azure Spot VM/VMSS. This price is in US Dollars.

This price will + be compared with the current Azure Spot price for the VM size. Also, the + prices are compared at the time of create/update of Azure Spot VM/VMSS and + the operation will only succeed if the maxPrice is greater than the + current Azure Spot price.

The maxPrice will also be used for + evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond + the maxPrice after creation of VM/VMSS.

Possible values are: +

- Any decimal value greater than zero. Example: 0.01538

+ -1 – indicates default price to be up-to on-demand.

You can set + the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be + evicted for price reasons. Also, the default max price is -1 if it is not + provided by you.

Minimum api-version: 2019-03-01. :type max_price: float """ @@ -1361,7 +1360,8 @@ class DiskEncryptionSet(Resource): :param tags: Resource tags :type tags: dict[str, str] :param identity: - :type identity: ~azure.mgmt.compute.v2019_07_01.models.ResourceIdentity + :type identity: + ~azure.mgmt.compute.v2019_07_01.models.EncryptionSetIdentity :param active_key: The key vault key which is currently used by this disk encryption set. :type active_key: @@ -1390,7 +1390,7 @@ class DiskEncryptionSet(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, 'active_key': {'key': 'properties.activeKey', 'type': 'KeyVaultAndKeyReference'}, 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyVaultAndKeyReference]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -1627,6 +1627,46 @@ def __init__(self, *, type, disk_encryption_set_id: str=None, **kwargs) -> None: self.type = type +class EncryptionSetIdentity(Model): + """The managed identity for the disk encryption set. It should be given + permission on the key vault before it can be used to encrypt disks. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: The type of Managed Identity used by the DiskEncryptionSet. + Only SystemAssigned is supported. Possible values include: + 'SystemAssigned' + :type type: str or + ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetIdentityType + :ivar principal_id: The object id of the Managed Identity Resource. This + will be sent to the RP from ARM via the x-ms-identity-principal-id header + in the PUT request if the resource has a systemAssigned(implicit) identity + :vartype principal_id: str + :ivar tenant_id: The tenant id of the Managed Identity Resource. This will + be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT + request if the resource has a systemAssigned(implicit) identity + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + class EncryptionSettingsCollection(Model): """Encryption settings for disk or snapshot. @@ -3953,46 +3993,6 @@ def __init__(self, *, blob_container_sas_uri: str, from_time, to_time, interval_ self.interval_length = interval_length -class ResourceIdentity(Model): - """The managed identity for the disk encryption set. It should be given - permission on the key vault before it can be used to encrypt disks. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param type: The type of Managed Identity used by the DiskEncryptionSet. - Only SystemAssigned is supported. Possible values include: - 'SystemAssigned' - :type type: str or - ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetIdentityType - :ivar principal_id: The object id of the Managed Identity Resource. This - will be sent to the RP from ARM via the x-ms-identity-principal-id header - in the PUT request if the resource has a systemAssigned(implicit) identity - :vartype principal_id: str - :ivar tenant_id: The tenant id of the Managed Identity Resource. This will - be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT - request if the resource has a systemAssigned(implicit) identity - :vartype tenant_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__(self, *, type=None, **kwargs) -> None: - super(ResourceIdentity, self).__init__(**kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - - class ResourceRange(Model): """Describes the resource range. @@ -5334,16 +5334,16 @@ class VirtualMachine(Resource): ~azure.mgmt.compute.v2019_07_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param host: Specifies information about the dedicated host that the @@ -7538,8 +7538,8 @@ class VirtualMachineScaleSetUpdateVMProfile(Model): :param license_type: The license type, which is for bring your own license scenario. :type license_type: str - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -7942,16 +7942,16 @@ class VirtualMachineScaleSetVMProfile(Model): :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible - values include: 'Regular', 'Low' + values include: 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes :param eviction_policy: Specifies the eviction policy for virtual machines - in a low priority scale set.

Minimum api-version: + in a Azure Spot scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority VMSS.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot VMSS.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param scheduled_events_profile: Specifies Scheduled Event related @@ -8150,16 +8150,16 @@ class VirtualMachineUpdate(UpdateResource): ~azure.mgmt.compute.v2019_07_01.models.SubResource :param priority: Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: - 'Regular', 'Low' + 'Regular', 'Low', 'Spot' :type priority: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachinePriorityTypes - :param eviction_policy: Specifies the eviction policy for the low priority + :param eviction_policy: Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' :type eviction_policy: str or ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineEvictionPolicyTypes - :param billing_profile: Specifies the billing related details of a low - priority virtual machine.

Minimum api-version: 2019-03-01. + :param billing_profile: Specifies the billing related details of a Azure + Spot virtual machine.

Minimum api-version: 2019-03-01. :type billing_profile: ~azure.mgmt.compute.v2019_07_01.models.BillingProfile :param host: Specifies information about the dedicated host that the From cd84a63a723feb250c2bd73d5b631deb5ceaa368 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Fri, 15 Nov 2019 05:56:59 +0000 Subject: [PATCH 2/2] Generated from b68cad540dc63f6c4f79e1867ddd873497af5038 Remove readonly properties from swagger example.e --- .../operations/_apps_operations.py | 18 ++------- .../operations/_bindings_operations.py | 18 ++------- .../operations/_deployments_operations.py | 18 ++------- .../operations/_services_operations.py | 39 +++++++------------ 4 files changed, 26 insertions(+), 67 deletions(-) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py index 22b7af0eb1d3..b80a5da1d0aa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py @@ -114,9 +114,7 @@ def get( def _create_or_update_initial( self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, **operation_config): - app_resource = None - if properties is not None: - app_resource = models.AppResource(properties=properties) + app_resource = models.AppResource(properties=properties) # Construct URL url = self.create_or_update.metadata['url'] @@ -144,10 +142,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if app_resource is not None: - body_content = self._serialize.body(app_resource, 'AppResource') - else: - body_content = None + body_content = self._serialize.body(app_resource, 'AppResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -287,9 +282,7 @@ def delete( def _update_initial( self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, **operation_config): - app_resource = None - if properties is not None: - app_resource = models.AppResource(properties=properties) + app_resource = models.AppResource(properties=properties) # Construct URL url = self.update.metadata['url'] @@ -317,10 +310,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if app_resource is not None: - body_content = self._serialize.body(app_resource, 'AppResource') - else: - body_content = None + body_content = self._serialize.body(app_resource, 'AppResource') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py index 2a5b4322ca07..1be603bdfc98 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py @@ -135,9 +135,7 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - binding_resource = None - if properties is not None: - binding_resource = models.BindingResource(properties=properties) + binding_resource = models.BindingResource(properties=properties) # Construct URL url = self.create_or_update.metadata['url'] @@ -166,10 +164,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if binding_resource is not None: - body_content = self._serialize.body(binding_resource, 'BindingResource') - else: - body_content = None + body_content = self._serialize.body(binding_resource, 'BindingResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -279,9 +274,7 @@ def update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - binding_resource = None - if properties is not None: - binding_resource = models.BindingResource(properties=properties) + binding_resource = models.BindingResource(properties=properties) # Construct URL url = self.update.metadata['url'] @@ -310,10 +303,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if binding_resource is not None: - body_content = self._serialize.body(binding_resource, 'BindingResource') - else: - body_content = None + body_content = self._serialize.body(binding_resource, 'BindingResource') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py index 9d07e4221749..3fe638e1abe3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py @@ -113,9 +113,7 @@ def get( def _create_or_update_initial( self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): - deployment_resource = None - if properties is not None: - deployment_resource = models.DeploymentResource(properties=properties) + deployment_resource = models.DeploymentResource(properties=properties) # Construct URL url = self.create_or_update.metadata['url'] @@ -144,10 +142,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if deployment_resource is not None: - body_content = self._serialize.body(deployment_resource, 'DeploymentResource') - else: - body_content = None + body_content = self._serialize.body(deployment_resource, 'DeploymentResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -294,9 +289,7 @@ def delete( def _update_initial( self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): - deployment_resource = None - if properties is not None: - deployment_resource = models.DeploymentResource(properties=properties) + deployment_resource = models.DeploymentResource(properties=properties) # Construct URL url = self.update.metadata['url'] @@ -325,10 +318,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if deployment_resource is not None: - body_content = self._serialize.body(deployment_resource, 'DeploymentResource') - else: - body_content = None + body_content = self._serialize.body(deployment_resource, 'DeploymentResource') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py index 95a200815e9d..eea8c269d105 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py @@ -106,7 +106,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, service_name, resource=None, custom_headers=None, raw=False, **operation_config): + self, resource, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -132,10 +132,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if resource is not None: - body_content = self._serialize.body(resource, 'ServiceResource') - else: - body_content = None + body_content = self._serialize.body(resource, 'ServiceResource') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -160,17 +157,17 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, service_name, resource=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource, resource_group_name, service_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create a new Service or update an exiting Service. + :param resource: Parameters for the create or update operation + :type resource: ~azure.mgmt.appplatform.models.ServiceResource :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param service_name: The name of the Service resource. :type service_name: str - :param resource: Parameters for the create or update operation - :type resource: ~azure.mgmt.appplatform.models.ServiceResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -185,9 +182,9 @@ def create_or_update( :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( + resource=resource, resource_group_name=resource_group_name, service_name=service_name, - resource=resource, custom_headers=custom_headers, raw=True, **operation_config @@ -294,7 +291,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, service_name, resource=None, custom_headers=None, raw=False, **operation_config): + self, resource, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -320,10 +317,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if resource is not None: - body_content = self._serialize.body(resource, 'ServiceResource') - else: - body_content = None + body_content = self._serialize.body(resource, 'ServiceResource') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -348,17 +342,17 @@ def _update_initial( return deserialized def update( - self, resource_group_name, service_name, resource=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource, resource_group_name, service_name, custom_headers=None, raw=False, polling=True, **operation_config): """Operation to update an exiting Service. + :param resource: Parameters for the update operation + :type resource: ~azure.mgmt.appplatform.models.ServiceResource :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param service_name: The name of the Service resource. :type service_name: str - :param resource: Parameters for the update operation - :type resource: ~azure.mgmt.appplatform.models.ServiceResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -373,9 +367,9 @@ def update( :raises: :class:`CloudError` """ raw_result = self._update_initial( + resource=resource, resource_group_name=resource_group_name, service_name=service_name, - resource=resource, custom_headers=custom_headers, raw=True, **operation_config @@ -485,9 +479,7 @@ def regenerate_test_key( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - regenerate_test_key_request = None - if key_type is not None: - regenerate_test_key_request = models.RegenerateTestKeyRequestPayload(key_type=key_type) + regenerate_test_key_request = models.RegenerateTestKeyRequestPayload(key_type=key_type) # Construct URL url = self.regenerate_test_key.metadata['url'] @@ -514,10 +506,7 @@ def regenerate_test_key( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if regenerate_test_key_request is not None: - body_content = self._serialize.body(regenerate_test_key_request, 'RegenerateTestKeyRequestPayload') - else: - body_content = None + body_content = self._serialize.body(regenerate_test_key_request, 'RegenerateTestKeyRequestPayload') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content)