Skip to content

Commit a9b5cac

Browse files
xiangyan99pvaneck
andauthored
expose indexer_permission_options (Azure#40952)
* expose indexer_permission_options * update * Update sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py Co-authored-by: Paul Van Eck <[email protected]> --------- Co-authored-by: Paul Van Eck <[email protected]>
1 parent 372556c commit a9b5cac

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

sdk/search/azure-search-documents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Added `x_ms_query_source_authorization` as a keyword argument to `SearchClient.search`.
1212
- Added property `azure.search.documents.indexes.models.SearchField.permission_filter`.
1313
- Added property `azure.search.documents.indexes.models.SearchIndex.permission_filter_option`.
14+
- Added property `azure.search.documents.indexes.models.SearchIndexerDataSourceConnection.indexer_permission_options`.
1415

1516
- Added new models:
1617
- `azure.search.documents.models.QueryResultDocumentInnerHit`

sdk/search/azure-search-documents/azure/search/documents/agent/aio/_agent_client_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def __init__(
6666
api_version=self._api_version,
6767
**kwargs
6868
)
69+
self.knowledge_retrieval = self._client.knowledge_retrieval
6970

7071
def __repr__(self) -> str:
7172
return "<KnowledgeAgentRetrievalClient [endpoint={}, agent={}]>".format(

sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# license information.
66
# --------------------------------------------------------------------------
77

8-
from typing import Any, List, Optional, MutableMapping, Dict, Callable
8+
from typing import Any, List, Optional, MutableMapping, Dict, Callable, Union
99
from enum import Enum
1010
from typing_extensions import Self
1111
from azure.core import CaseInsensitiveEnumMeta
@@ -38,6 +38,7 @@
3838
IndexingParameters,
3939
FieldMapping,
4040
SearchIndexerCache,
41+
IndexerPermissionOption,
4142
)
4243

4344
DELIMITER = "|"
@@ -1060,7 +1061,7 @@ def from_dict( # type: ignore
10601061
)
10611062

10621063

1063-
class SearchIndexerDataSourceConnection(_serialization.Model):
1064+
class SearchIndexerDataSourceConnection(_serialization.Model): # pylint: disable=too-many-instance-attributes
10641065
"""Represents a datasource connection definition, which can be used to configure an indexer.
10651066
10661067
All required parameters must be populated in order to send to Azure.
@@ -1081,6 +1082,9 @@ class SearchIndexerDataSourceConnection(_serialization.Model):
10811082
not specified, the value remains unchanged. If "none" is specified, the value of this property
10821083
is cleared.
10831084
:vartype identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity
1085+
:ivar indexer_permission_options: Ingestion options with various types of permission data.
1086+
:vartype indexer_permission_options: list[str or
1087+
~azure.search.documents.indexes.models.IndexerPermissionOption]
10841088
:ivar data_change_detection_policy: The data change detection policy for the datasource connection.
10851089
:vartype data_change_detection_policy: ~azure.search.documents.models.DataChangeDetectionPolicy
10861090
:ivar data_deletion_detection_policy: The data deletion detection policy for the datasource connection.
@@ -1109,6 +1113,7 @@ def __init__(
11091113
connection_string: str,
11101114
container: SearchIndexerDataContainer,
11111115
identity: Optional[SearchIndexerDataIdentity] = None,
1116+
indexer_permission_options: Optional[List[Union[str, IndexerPermissionOption]]] = None,
11121117
data_change_detection_policy: Optional[DataChangeDetectionPolicy] = None,
11131118
data_deletion_detection_policy: Optional[DataDeletionDetectionPolicy] = None,
11141119
e_tag: Optional[str] = None,
@@ -1122,6 +1127,7 @@ def __init__(
11221127
self.connection_string = connection_string
11231128
self.container = container
11241129
self.identity = identity
1130+
self.indexer_permission_options = indexer_permission_options
11251131
self.data_change_detection_policy = data_change_detection_policy
11261132
self.data_deletion_detection_policy = data_deletion_detection_policy
11271133
self.e_tag = e_tag
@@ -1146,6 +1152,7 @@ def _to_generated(self):
11461152
self.encryption_key._to_generated() if self.encryption_key else None # pylint: disable=protected-access
11471153
),
11481154
identity=self.identity,
1155+
indexer_permission_options=self.indexer_permission_options,
11491156
)
11501157

11511158
@classmethod
@@ -1172,6 +1179,7 @@ def _from_generated(cls, search_indexer_data_source) -> Optional[Self]:
11721179
else None
11731180
),
11741181
identity=search_indexer_data_source.identity,
1182+
indexer_permission_options=search_indexer_data_source.indexer_permission_options,
11751183
)
11761184

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

0 commit comments

Comments
 (0)