SearchResourceEncryptionKey Class

A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest in Azure Cognitive Search, such as indexes and synonym maps.

All required parameters must be populated in order to send to Azure.

Inheritance
azure.search.documents.indexes._generated._serialization.Model
SearchResourceEncryptionKey

Constructor

SearchResourceEncryptionKey(*, key_name: str, key_version: str, vault_uri: str, application_id: str | None = None, application_secret: str | None = None, **kwargs)

Keyword-Only Parameters

Name Description
key_name
Required
key_version
Required
vault_uri
Required
application_id
Required
application_secret
Required

Variables

Name Description
key_name
str

Required. The name of your Azure Key Vault key to be used to encrypt your data at rest.

key_version
str

Required. The version of your Azure Key Vault key to be used to encrypt your data at rest.

vault_uri
str

Required. The URI of your Azure Key Vault, also referred to as DNS name, that contains the key to be used to encrypt your data at rest. An example URI might be https://my- keyvault-name.vault.azure.net.

application_id
str

Required. An AAD Application ID that was granted the required access permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID should not be confused with the Object ID for your AAD Application.

application_secret
str

The authentication key of the specified AAD application.

Methods

as_dict

Return a dict that can be serialized using json.dump.

deserialize

Parse a str using the RestAPI syntax and return a SearchResourceEncryptionKey instance.

enable_additional_properties_sending
from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

Return the JSON that would be sent to server from this model. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict

as_dict

Return a dict that can be serialized using json.dump.

as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) -> MutableMapping[str, Any]

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes

Default value: True
key_transformer

A callable that will transform the key of the dict

Returns

Type Description

A dict JSON compatible object

deserialize

Parse a str using the RestAPI syntax and return a SearchResourceEncryptionKey instance.

deserialize(data: Any, content_type: str | None = None) -> Self | None

Parameters

Name Description
data
Required
str

A str using RestAPI structure. JSON by default.

content_type
str

JSON by default, set application/xml if XML.

Default value: None

Returns

Type Description

A SearchResourceEncryptionKey instance

Exceptions

Type Description
DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending() -> None

from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) -> Self | None

Parameters

Name Description
data
Required

A dict using RestAPI structure

key_extractors

A callable that will extract a key from a dict

Default value: None
content_type
str

JSON by default, set application/xml if XML.

Default value: None

Returns

Type Description

A SearchResourceEncryptionKey instance

Exceptions

Type Description
DeserializationError if something went wrong

is_xml_model

is_xml_model() -> bool

serialize

Return the JSON that would be sent to server from this model. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict

serialize(keep_readonly: bool = False, **kwargs: Any) -> MutableMapping[str, Any]

Parameters

Name Description
keep_readonly
Default value: False