3 ฒ˜‚]ญAใ@s,ddlmZmZmZmZGdd„deƒZdS)้)ฺNamespacedClientฺ query_paramsฺ _make_pathฺ SKIP_IN_PATHc@sพeZdZeƒd:dd„ƒZedƒd;dd„ƒZedƒdd d „ƒZedƒd?dd„ƒZ edƒd@dd„ƒZ edƒdAdd„ƒZ edƒdBdd„ƒZ edƒdCdd„ƒZ edƒdDdd„ƒZeddddƒdEdd„ƒZeƒdFd d!„ƒZeƒdGd"d#„ƒZeƒdHd$d%„ƒZeƒdId&d'„ƒZeƒdJd(d)„ƒZeƒdKd*d+„ƒZeƒdLd,d-„ƒZeƒdMd.d/„ƒZeƒdNd0d1„ƒZedƒdOd2d3„ƒZedƒdPd4d5„ƒZedƒdQd6d7„ƒZedƒdRd8d9„ƒZdS)SฺSecurityClientNcCs|jjdd|dS)zu ``_ ฺGETz/_security/_authenticate)ฺparams)ฺ transportฺperform_request)ฺselfrฉr ๚L/tmp/pip-build-z81i1n8o/elasticsearch/elasticsearch/client/xpack/security.pyฺ authenticateszSecurityClient.authenticateZrefreshcCs.|tkrtdƒ‚|jjdtdd|dƒ||dS)aI ``_ :arg body: the new password for the user :arg username: The username of the user to change the password for :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z2Empty value passed for a required argument 'body'.ฺPUTฺ _securityฺuserZ _password)rฺbody)rฺ ValueErrorr r r)r rฺusernamerr r r ฺchange_passwords  zSecurityClient.change_passwordZ usernamescCs,|tkrtdƒ‚|jjdtdd|dƒ|dS)a ``_ :arg realms: Comma-separated list of realms to clear :arg usernames: Comma-separated list of usernames to clear from the cache z4Empty value passed for a required argument 'realms'.ฺPOSTrฺrealmฺ _clear_cache)r)rrr r r)r Zrealmsrr r r ฺclear_cached_realms$s  z"SecurityClient.clear_cached_realmscCs,|tkrtdƒ‚|jjdtdd|dƒ|dS)z— ``_ :arg name: Role name z2Empty value passed for a required argument 'name'.rrฺroler)r)rrr r r)r ฺnamerr r r ฺclear_cached_roles5sz!SecurityClient.clear_cached_rolescCs$|tkrtdƒ‚|jjdd||dS)a ``_ :arg body: The api key request to create an API key :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z2Empty value passed for a required argument 'body'.rz/_security/api_key)rr)rrr r )r rrr r r ฺcreate_api_keyBs zSecurityClient.create_api_keycCs>x ||fD]}|tkr tdƒ‚q W|jjdtdd||ƒ|dS)aฝ ``_ :arg application: Application name :arg name: Privilege name :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z+Empty value passed for a required argument.ฺDELETErฺ privilege)r)rrr r r)r ฺ applicationrrฺparamr r r ฺdelete_privilegesTs   z SecurityClient.delete_privilegescCs*|tkrtdƒ‚|jjdtdd|ƒ|dS)aๆ ``_ :arg name: Role name :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z2Empty value passed for a required argument 'name'.rrr)r)rrr r r)r rrr r r ฺ delete_rolejs zSecurityClient.delete_rolecCs*|tkrtdƒ‚|jjdtdd|ƒ|dS)a๖ ``_ :arg name: Role-mapping name :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z2Empty value passed for a required argument 'name'.rrฺ role_mapping)r)rrr r r)r rrr r r ฺdelete_role_mapping|s z"SecurityClient.delete_role_mappingcCs*|tkrtdƒ‚|jjdtdd|ƒ|dS)a้ ``_ :arg username: username :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z6Empty value passed for a required argument 'username'.rrr)r)rrr r r)r rrr r r ฺ delete_userŽs zSecurityClient.delete_usercCs,|tkrtdƒ‚|jjdtdd|dƒ|dS)a ``_ :arg username: The username of the user to disable :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z6Empty value passed for a required argument 'username'.rrrZ_disable)r)rrr r r)r rrr r r ฺ disable_user s zSecurityClient.disable_usercCs,|tkrtdƒ‚|jjdtdd|dƒ|dS)a ``_ :arg username: The username of the user to enable :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z6Empty value passed for a required argument 'username'.rrrZ_enable)r)rrr r r)r rrr r r ฺ enable_userฒs zSecurityClient.enable_userฺidrZ realm_namercCs|jjdd|dS)aถ ``_ :arg id: API key id of the API key to be retrieved :arg name: API key name of the API key to be retrieved :arg realm_name: realm name of the user who created this API key to be retrieved :arg username: user name of the user who created this API key to be retrieved rz/_security/api_key)r)r r )r rr r r ฺ get_api_keyฤs zSecurityClient.get_api_keycCs|jjdtdd||ƒ|dS)zi ``_ :arg application: Application name :arg name: Privilege name rrr)r)r r r)r r rrr r r ฺget_privilegesิs zSecurityClient.get_privilegescCs|jjdtdd|ƒ|dS)z ``_ :arg name: Role name rrr)r)r r r)r rrr r r ฺget_roleโszSecurityClient.get_rolecCs|jjdtdd|ƒ|dS)zŸ ``_ :arg name: Role-Mapping name rrr$)r)r r r)r rrr r r ฺget_role_mappingํszSecurityClient.get_role_mappingcCs$|tkrtdƒ‚|jjdd||dS)zŸ ``_ :arg body: The token request to get z2Empty value passed for a required argument 'body'.rz/_security/oauth2/token)rr)rrr r )r rrr r r ฺ get_token๘szSecurityClient.get_tokencCs|jjdtdd|ƒ|dS)zญ ``_ :arg username: A comma-separated list of usernames rrr)r)r r r)r rrr r r ฺget_userszSecurityClient.get_usercCs|jjdd|dS)z| ``_ rz/_security/user/_privileges)r)r r )r rr r r ฺget_user_privilegessz"SecurityClient.get_user_privilegescCs.|tkrtdƒ‚|jjdtdd|dƒ||dS)zพ ``_ :arg body: The privileges to test :arg user: Username z2Empty value passed for a required argument 'body'.rrrZ_has_privileges)rr)rrr r r)r rrrr r r ฺhas_privilegess zSecurityClient.has_privilegescCs$|tkrtdƒ‚|jjdd||dS)zผ ``_ :arg body: The api key request to invalidate API key(s) z2Empty value passed for a required argument 'body'.rz/_security/api_key)rr)rrr r )r rrr r r ฺinvalidate_api_key*sz!SecurityClient.invalidate_api_keycCs$|tkrtdƒ‚|jjdd||dS)zฅ ``_ :arg body: The token to invalidate z2Empty value passed for a required argument 'body'.rz/_security/oauth2/token)rr)rrr r )r rrr r r ฺinvalidate_token7szSecurityClient.invalidate_tokencCs$|tkrtdƒ‚|jjdd||dS)a› ``_ :arg body: The privilege(s) to add :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z2Empty value passed for a required argument 'body'.rz/_security/privilege/)rr)rrr r )r rrr r r ฺput_privilegesDs zSecurityClient.put_privilegescCs>x ||fD]}|tkr tdƒ‚q W|jjdtdd|ƒ||dS)a ``_ :arg name: Role name :arg body: The role to add :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z+Empty value passed for a required argument.rrr)rr)rrr r r)r rrrr!r r r ฺput_roleVs  zSecurityClient.put_rolecCs>x ||fD]}|tkr tdƒ‚q W|jjdtdd|ƒ||dS)a ``_ :arg name: Role-mapping name :arg body: The role to add :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z+Empty value passed for a required argument.rrr$)rr)rrr r r)r rrrr!r r r ฺput_role_mappingjs   zSecurityClient.put_role_mappingcCs>x ||fD]}|tkr tdƒ‚q W|jjdtdd|ƒ||dS)a ``_ :arg username: The username of the User :arg body: The user to add :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes., valid choices are: 'true', 'false', 'wait_for' z+Empty value passed for a required argument.rrr)rr)rrr r r)r rrrr!r r r ฺput_users  zSecurityClient.put_user)N)NN)N)N)N)N)N)N)N)N)N)N)NNN)NN)NN)N)NN)N)NN)N)N)N)N)N)N)ฺ__name__ฺ __module__ฺ __qualname__rrrrrrr"r#r%r&r'r(r*r+r,r-r.r/r0r1r2r3r4r5r6r7r r r r rsd                         rN)ฺutilsrrrrrr r r r ฺs