1010from .utils import DOC_URL
1111from .utils import ModelCommand
1212from .utils import formatted_payload
13- from .utils import split_headers
1413from .utils import unacceptable_fields
1514
1615
17- def create_payload (client , payload , indent , headers ):
16+ def create_payload (client , payload , indent ):
1817 try :
19- response = client .create (
20- payload , headers = split_headers (headers ), raise_scim_errors = False
21- )
18+ response = client .create (payload , raise_scim_errors = False )
2219
2320 except SCIMClientError as scim_exc :
2421 message = str (scim_exc )
@@ -46,12 +43,9 @@ def create_factory(model):
4643 default = True ,
4744 help = "Indent JSON response payloads." ,
4845 )
49- @click .option (
50- "-h" , "--headers" , multiple = True , help = "Header to pass in the HTTP requests."
51- )
5246 @from_pydantic ("obj" , model , exclude = exclude )
5347 @click .pass_context
54- def create_command (ctx , indent , headers , obj : model , * args , ** kwargs ):
48+ def create_command (ctx , indent , obj : model , * args , ** kwargs ):
5549 r"""Perform a `SCIM POST <https://www.rfc-editor.org/rfc/rfc7644#section-3.3>`_ request on resources endpoint.
5650
5751 Input data can be passed through parameters like :code:`--external-id`.
@@ -83,7 +77,7 @@ def create_command(ctx, indent, headers, obj: model, *args, **kwargs):
8377 click .echo (ctx .get_help ())
8478 ctx .exit (1 )
8579
86- create_payload (ctx .obj ["client" ], payload , indent , headers )
80+ create_payload (ctx .obj ["client" ], payload , indent )
8781
8882 return create_command
8983
@@ -101,10 +95,7 @@ def create_command(ctx, indent, headers, obj: model, *args, **kwargs):
10195 default = True ,
10296 help = "Indent JSON response payloads." ,
10397)
104- @click .option (
105- "-h" , "--headers" , multiple = True , help = "Header to pass in the HTTP requests."
106- )
107- def create_cli (ctx , indent , headers ):
98+ def create_cli (ctx , indent ):
10899 """Perform a `SCIM POST <https://www.rfc-editor.org/rfc/rfc7644#section-3.3>`_ request on resources endpoint.
109100
110101 There are subcommands for all the available models, with dynamic attributes.
@@ -129,4 +120,4 @@ def create_cli(ctx, indent, headers):
129120 click .echo (ctx .get_help ())
130121 ctx .exit (1 )
131122
132- create_payload (ctx .obj ["client" ], payload , indent , headers )
123+ create_payload (ctx .obj ["client" ], payload , indent )
0 commit comments