Skip to content

Commit

Permalink
CodeGen from PR 13355 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Management Plane][Azure Search] Adding new API version 2021-01-04. (Azure#13355)

* [Management Plane][Azure Search] Adding new API version for exposing Encryption with CMK.

* Fixing prittier and model validation errors

* Fixing errors raised by lintdiff and ModelValidations
  • Loading branch information
SDKAuto committed Mar 23, 2021
1 parent 7da6b64 commit 5dbaeec
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
super(SearchManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2020-08-01'
self.api_version = '2021-01-04'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
from ._models_py3 import AzureEntityResource
from ._models_py3 import CheckNameAvailabilityInput
from ._models_py3 import CheckNameAvailabilityOutput
from ._models_py3 import EncryptionWithCmk
from ._models_py3 import Identity
from ._models_py3 import IpRule
from ._models_py3 import NetworkRuleSet
from ._models_py3 import NonCmkEncryptedResource
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import PrivateEndpointConnection
Expand All @@ -44,9 +46,11 @@
from ._models import AzureEntityResource
from ._models import CheckNameAvailabilityInput
from ._models import CheckNameAvailabilityOutput
from ._models import EncryptionWithCmk
from ._models import Identity
from ._models import IpRule
from ._models import NetworkRuleSet
from ._models import NonCmkEncryptedResource
from ._models import Operation
from ._models import OperationDisplay
from ._models import PrivateEndpointConnection
Expand Down Expand Up @@ -77,6 +81,7 @@
UnavailableNameReason,
SkuName,
PrivateLinkServiceConnectionStatus,
EncryptionEnforcementStatus,
SharedPrivateLinkResourceStatus,
SharedPrivateLinkResourceProvisioningState,
HostingMode,
Expand All @@ -94,9 +99,11 @@
'AzureEntityResource',
'CheckNameAvailabilityInput',
'CheckNameAvailabilityOutput',
'EncryptionWithCmk',
'Identity',
'IpRule',
'NetworkRuleSet',
'NonCmkEncryptedResource',
'Operation',
'OperationDisplay',
'PrivateEndpointConnection',
Expand Down Expand Up @@ -126,6 +133,7 @@
'UnavailableNameReason',
'SkuName',
'PrivateLinkServiceConnectionStatus',
'EncryptionEnforcementStatus',
'SharedPrivateLinkResourceStatus',
'SharedPrivateLinkResourceProvisioningState',
'HostingMode',
Expand Down
140 changes: 108 additions & 32 deletions sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,19 @@ def __init__(self, **kwargs):
class Resource(Model):
"""Resource.
Common fields that are returned in the response for all Azure Resource
Manager resources.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
"""

Expand All @@ -98,19 +101,21 @@ def __init__(self, **kwargs):


class AzureEntityResource(Resource):
"""The resource model definition for a Azure Resource Manager resource with an
etag.
"""Entity Resource.
The resource model definition for an Azure Resource Manager resource with
an etag.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:ivar etag: Resource Etag.
:vartype etag: str
Expand Down Expand Up @@ -271,6 +276,38 @@ def __init__(self, **kwargs):
self.details = kwargs.get('details', None)


class EncryptionWithCmk(Model):
"""Describes properties associated with encryption of resources using customer
managed Keys.
Variables are only populated by the server, and will be ignored when
sending a request.
:param enforcement: Enforcement state of encryption with customer managed
keys. Can be enabled, disabled, or unspecified. Possible values include:
'unspecified', 'enabled', 'disabled'
:type enforcement: str or
~azure.mgmt.search.models.EncryptionEnforcementStatus
:ivar non_cmk_encrypted_resources: The list of Non Cmk encrypted resource.
:vartype non_cmk_encrypted_resources:
list[~azure.mgmt.search.models.NonCmkEncryptedResource]
"""

_validation = {
'non_cmk_encrypted_resources': {'readonly': True},
}

_attribute_map = {
'enforcement': {'key': 'enforcement', 'type': 'EncryptionEnforcementStatus'},
'non_cmk_encrypted_resources': {'key': 'nonCmkEncryptedResources', 'type': '[NonCmkEncryptedResource]'},
}

def __init__(self, **kwargs):
super(EncryptionWithCmk, self).__init__(**kwargs)
self.enforcement = kwargs.get('enforcement', None)
self.non_cmk_encrypted_resources = None


class Identity(Model):
"""Identity for the resource.
Expand Down Expand Up @@ -348,6 +385,28 @@ def __init__(self, **kwargs):
self.ip_rules = kwargs.get('ip_rules', None)


class NonCmkEncryptedResource(Model):
"""Describes properties of resources not encrypted with customer managed keys.
:param type: Describes type of resource (.i.e. index, indexer, skillset,
synonym map and debug session) not encrypted by customer managed keys.
:type type: str
:param name: Describes name of resource not encrypted by customer managed
keys.
:type name: str
"""

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, **kwargs):
super(NonCmkEncryptedResource, self).__init__(**kwargs)
self.type = kwargs.get('type', None)
self.name = kwargs.get('name', None)


class Operation(Model):
"""Describes a REST API operation.
Expand Down Expand Up @@ -423,13 +482,13 @@ class PrivateEndpointConnection(Resource):
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:param properties: Describes the properties of an existing Private
Endpoint connection to the Azure Cognitive Search service.
Expand Down Expand Up @@ -535,13 +594,13 @@ class PrivateLinkResource(Resource):
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:ivar properties: Describes the properties of a supported private link
resource for the Azure Cognitive Search service.
Expand Down Expand Up @@ -614,19 +673,21 @@ def __init__(self, **kwargs):


class ProxyResource(Resource):
"""The resource model definition for a ARM proxy resource. It will have
everything other than required location and tags.
"""Proxy Resource.
The resource model definition for a Azure Resource Manager proxy resource.
It will not have tags and a location.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
"""

Expand Down Expand Up @@ -694,20 +755,23 @@ def __init__(self, **kwargs):


class TrackedResource(Resource):
"""The resource model definition for a ARM tracked top level resource.
"""Tracked Resource.
The resource model definition for an Azure Resource Manager tracked top
level resource which has 'tags' and a 'location'.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:param tags: Resource tags.
:type tags: dict[str, str]
Expand Down Expand Up @@ -744,13 +808,13 @@ class SearchService(TrackedResource):
All required parameters must be populated in order to send to Azure.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:param tags: Resource tags.
:type tags: dict[str, str]
Expand Down Expand Up @@ -810,6 +874,10 @@ class SearchService(TrackedResource):
'provisioning', 'failed'
:vartype provisioning_state: str or
~azure.mgmt.search.models.ProvisioningState
:param encryption_with_cmk: Details related to encrypting resources (.i.e.
index, indexer, skillset, synonym map and debug session) with customer
managed keys by the Azure Cognitive Search service.
:type encryption_with_cmk: ~azure.mgmt.search.models.EncryptionWithCmk
:param network_rule_set: Network specific rules that determine how the
Azure Cognitive Search service may be reached.
:type network_rule_set: ~azure.mgmt.search.models.NetworkRuleSet
Expand Down Expand Up @@ -856,6 +924,7 @@ class SearchService(TrackedResource):
'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'},
'status_details': {'key': 'properties.statusDetails', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'},
'encryption_with_cmk': {'key': 'properties.encryptionWithCmk', 'type': 'EncryptionWithCmk'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'},
'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'},
Expand All @@ -872,6 +941,7 @@ def __init__(self, **kwargs):
self.status = None
self.status_details = None
self.provisioning_state = None
self.encryption_with_cmk = kwargs.get('encryption_with_cmk', None)
self.network_rule_set = kwargs.get('network_rule_set', None)
self.private_endpoint_connections = None
self.shared_private_link_resources = None
Expand All @@ -885,13 +955,13 @@ class SearchServiceUpdate(Resource):
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:param replica_count: The number of replicas in the search service. If
specified, it must be a value between 1 and 12 inclusive for standard SKUs
Expand Down Expand Up @@ -947,6 +1017,10 @@ class SearchServiceUpdate(Resource):
'provisioning', 'failed'
:vartype provisioning_state: str or
~azure.mgmt.search.models.ProvisioningState
:param encryption_with_cmk: Details related to encrypting resources (.i.e.
index, indexer, skillset, synonym map and debug session) with customer
managed keys by the Azure Cognitive Search service.
:type encryption_with_cmk: ~azure.mgmt.search.models.EncryptionWithCmk
:param network_rule_set: Network specific rules that determine how the
Azure Cognitive Search service may be reached.
:type network_rule_set: ~azure.mgmt.search.models.NetworkRuleSet
Expand Down Expand Up @@ -997,6 +1071,7 @@ class SearchServiceUpdate(Resource):
'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'},
'status_details': {'key': 'properties.statusDetails', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'},
'encryption_with_cmk': {'key': 'properties.encryptionWithCmk', 'type': 'EncryptionWithCmk'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'},
'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'},
Expand All @@ -1015,6 +1090,7 @@ def __init__(self, **kwargs):
self.status = None
self.status_details = None
self.provisioning_state = None
self.encryption_with_cmk = kwargs.get('encryption_with_cmk', None)
self.network_rule_set = kwargs.get('network_rule_set', None)
self.private_endpoint_connections = None
self.shared_private_link_resources = None
Expand Down Expand Up @@ -1102,13 +1178,13 @@ class SharedPrivateLinkResource(Resource):
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g.
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
:vartype type: str
:param properties: Describes the properties of a Shared Private Link
Resource managed by the Azure Cognitive Search service.
Expand Down
Loading

0 comments on commit 5dbaeec

Please sign in to comment.