@@ -1516,13 +1516,13 @@ async def has_privileges(
1516
1516
t .Union [
1517
1517
t .List [
1518
1518
t .Union [
1519
- "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1519
+ "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', ' manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1520
1520
str ,
1521
1521
]
1522
1522
],
1523
1523
t .Tuple [
1524
1524
t .Union [
1525
- "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1525
+ "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', ' manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1526
1526
str ,
1527
1527
],
1528
1528
...,
@@ -1574,6 +1574,55 @@ async def has_privileges(
1574
1574
"POST" , __path , params = __query , headers = __headers , body = __body
1575
1575
)
1576
1576
1577
+ @_rewrite_parameters (
1578
+ body_fields = True ,
1579
+ )
1580
+ async def has_privileges_user_profile (
1581
+ self ,
1582
+ * ,
1583
+ privileges : t .Mapping [str , t .Any ],
1584
+ uids : t .Union [t .List [str ], t .Tuple [str , ...]],
1585
+ error_trace : t .Optional [bool ] = None ,
1586
+ filter_path : t .Optional [
1587
+ t .Union [str , t .Union [t .List [str ], t .Tuple [str , ...]]]
1588
+ ] = None ,
1589
+ human : t .Optional [bool ] = None ,
1590
+ pretty : t .Optional [bool ] = None ,
1591
+ ) -> ObjectApiResponse [t .Any ]:
1592
+ """
1593
+ Determines whether the users associated with the specified profile IDs have all
1594
+ the requested privileges.
1595
+
1596
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.3/security-api-has-privileges-user-profile.html>`_
1597
+
1598
+ :param privileges:
1599
+ :param uids: A list of profile IDs. The privileges are checked for associated
1600
+ users of the profiles.
1601
+ """
1602
+ if privileges is None :
1603
+ raise ValueError ("Empty value passed for parameter 'privileges'" )
1604
+ if uids is None :
1605
+ raise ValueError ("Empty value passed for parameter 'uids'" )
1606
+ __path = "/_security/profile/_has_privileges"
1607
+ __body : t .Dict [str , t .Any ] = {}
1608
+ __query : t .Dict [str , t .Any ] = {}
1609
+ if privileges is not None :
1610
+ __body ["privileges" ] = privileges
1611
+ if uids is not None :
1612
+ __body ["uids" ] = uids
1613
+ if error_trace is not None :
1614
+ __query ["error_trace" ] = error_trace
1615
+ if filter_path is not None :
1616
+ __query ["filter_path" ] = filter_path
1617
+ if human is not None :
1618
+ __query ["human" ] = human
1619
+ if pretty is not None :
1620
+ __query ["pretty" ] = pretty
1621
+ __headers = {"accept" : "application/json" , "content-type" : "application/json" }
1622
+ return await self .perform_request ( # type: ignore[return-value]
1623
+ "POST" , __path , params = __query , headers = __headers , body = __body
1624
+ )
1625
+
1577
1626
@_rewrite_parameters (
1578
1627
body_fields = True ,
1579
1628
)
@@ -1746,13 +1795,13 @@ async def put_role(
1746
1795
t .Union [
1747
1796
t .List [
1748
1797
t .Union [
1749
- "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1798
+ "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', ' manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1750
1799
str ,
1751
1800
]
1752
1801
],
1753
1802
t .Tuple [
1754
1803
t .Union [
1755
- "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1804
+ "t.Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', ' manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client']" ,
1756
1805
str ,
1757
1806
],
1758
1807
...,
@@ -2396,6 +2445,7 @@ async def suggest_user_profiles(
2396
2445
filter_path : t .Optional [
2397
2446
t .Union [str , t .Union [t .List [str ], t .Tuple [str , ...]]]
2398
2447
] = None ,
2448
+ hint : t .Optional [t .Mapping [str , t .Any ]] = None ,
2399
2449
human : t .Optional [bool ] = None ,
2400
2450
name : t .Optional [str ] = None ,
2401
2451
pretty : t .Optional [bool ] = None ,
@@ -2410,19 +2460,25 @@ async def suggest_user_profiles(
2410
2460
return all content use `data=*`. To return a subset of content use `data=<key>`
2411
2461
to retrieve content nested under the specified `<key>`. By default returns
2412
2462
no `data` content.
2463
+ :param hint: Extra search criteria to improve relevance of the suggestion result.
2464
+ Profiles matching the spcified hint are ranked higher in the response. Profiles
2465
+ not matching the hint don't exclude the profile from the response as long
2466
+ as the profile matches the `name` field query.
2413
2467
:param name: Query string used to match name-related fields in user profile documents.
2414
2468
Name-related fields are the user's `username`, `full_name`, and `email`.
2415
2469
:param size: Number of profiles to return.
2416
2470
"""
2417
2471
__path = "/_security/profile/_suggest"
2418
- __query : t .Dict [str , t .Any ] = {}
2419
2472
__body : t .Dict [str , t .Any ] = {}
2473
+ __query : t .Dict [str , t .Any ] = {}
2420
2474
if data is not None :
2421
- __query ["data" ] = data
2475
+ __body ["data" ] = data
2422
2476
if error_trace is not None :
2423
2477
__query ["error_trace" ] = error_trace
2424
2478
if filter_path is not None :
2425
2479
__query ["filter_path" ] = filter_path
2480
+ if hint is not None :
2481
+ __body ["hint" ] = hint
2426
2482
if human is not None :
2427
2483
__query ["human" ] = human
2428
2484
if name is not None :
0 commit comments