66
77from .utils import DOC_URL
88from .utils import formatted_payload
9+ from .utils import split_headers
910
1011
1112@click .command (cls = make_rst_to_ansi_formatter (DOC_URL ), name = "delete" )
1213@click .argument ("resource-type" , required = True )
1314@click .argument ("id" , required = True )
15+ @click .option (
16+ "-h" , "--headers" , multiple = True , help = "Header to pass in the HTTP requests."
17+ )
1418@click .option (
1519 "--indent/--no-indent" ,
1620 is_flag = True ,
1721 default = True ,
1822 help = "Indent JSON response payloads." ,
1923)
2024@click .pass_context
21- def delete_cli (ctx , resource_type , id , indent ):
25+ def delete_cli (ctx , resource_type , id , headers , indent ):
2226 """Perform a `SCIM DELETE query <https://www.rfc-editor.org/rfc/rfc7644#section-3.6>`_ request.
2327
2428 .. code-block:: bash
@@ -35,7 +39,9 @@ def delete_cli(ctx, resource_type, id, indent):
3539 )
3640
3741 try :
38- response = ctx .obj ["client" ].delete (resource_type , id )
42+ response = ctx .obj ["client" ].delete (
43+ resource_type , id , headers = split_headers (headers )
44+ )
3945
4046 except (httpx .HTTPError , SCIMClientError ) as exc :
4147 raise ClickException (exc ) from exc
0 commit comments