55
66from ... import errors
77from ...client import AuthenticatedClient , Client
8- from ...types import Response
8+ from ...models .epsg_code import EpsgCode
9+ from ...models .validated_geoteknisk_unders import ValidatedGeotekniskUnders
10+ from ...types import UNSET , Response
911
1012
1113def _get_kwargs (
1214 geoteknisk_unders_id : str ,
1315 geoteknisk_borehull_id : str ,
16+ * ,
17+ epsg_code : EpsgCode ,
1418) -> dict [str , Any ]:
19+ params : dict [str , Any ] = {}
20+
21+ json_epsg_code = epsg_code .value
22+ params ["epsgCode" ] = json_epsg_code
23+
24+ params = {k : v for k , v in params .items () if v is not UNSET and v is not None }
25+
1526 _kwargs : dict [str , Any ] = {
1627 "method" : "delete" ,
1728 "url" : f"/nadag/innmelding/v1/GeotekniskUnders/{ geoteknisk_unders_id } /undersPkt/{ geoteknisk_borehull_id } " ,
29+ "params" : params ,
1830 }
1931
2032 return _kwargs
2133
2234
23- def _parse_response (* , client : Union [AuthenticatedClient , Client ], response : httpx .Response ) -> Optional [Any ]:
24- if response .status_code == 204 :
25- return None
35+ def _parse_response (
36+ * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
37+ ) -> Optional [ValidatedGeotekniskUnders ]:
38+ if response .status_code == 200 :
39+ response_200 = ValidatedGeotekniskUnders .from_dict (response .json ())
40+
41+ return response_200
2642
2743 if client .raise_on_unexpected_status :
2844 raise errors .UnexpectedStatus (response .status_code , response .content )
2945 else :
3046 return None
3147
3248
33- def _build_response (* , client : Union [AuthenticatedClient , Client ], response : httpx .Response ) -> Response [Any ]:
49+ def _build_response (
50+ * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
51+ ) -> Response [ValidatedGeotekniskUnders ]:
3452 return Response (
3553 status_code = HTTPStatus (response .status_code ),
3654 content = response .content ,
@@ -44,26 +62,29 @@ def sync_detailed(
4462 geoteknisk_borehull_id : str ,
4563 * ,
4664 client : AuthenticatedClient ,
47- ) -> Response [Any ]:
65+ epsg_code : EpsgCode ,
66+ ) -> Response [ValidatedGeotekniskUnders ]:
4867 """Deletes a GeotekniskBorehull.
4968
5069 Deletes a GeotekniskBorehull.
5170
5271 Args:
5372 geoteknisk_unders_id (str):
5473 geoteknisk_borehull_id (str):
74+ epsg_code (EpsgCode):
5575
5676 Raises:
5777 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
5878 httpx.TimeoutException: If the request takes longer than Client.timeout.
5979
6080 Returns:
61- Response[Any ]
81+ Response[ValidatedGeotekniskUnders ]
6282 """
6383
6484 kwargs = _get_kwargs (
6585 geoteknisk_unders_id = geoteknisk_unders_id ,
6686 geoteknisk_borehull_id = geoteknisk_borehull_id ,
87+ epsg_code = epsg_code ,
6788 )
6889
6990 response = client .get_httpx_client ().request (
@@ -73,33 +94,102 @@ def sync_detailed(
7394 return _build_response (client = client , response = response )
7495
7596
97+ def sync (
98+ geoteknisk_unders_id : str ,
99+ geoteknisk_borehull_id : str ,
100+ * ,
101+ client : AuthenticatedClient ,
102+ epsg_code : EpsgCode ,
103+ ) -> Optional [ValidatedGeotekniskUnders ]:
104+ """Deletes a GeotekniskBorehull.
105+
106+ Deletes a GeotekniskBorehull.
107+
108+ Args:
109+ geoteknisk_unders_id (str):
110+ geoteknisk_borehull_id (str):
111+ epsg_code (EpsgCode):
112+
113+ Raises:
114+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
115+ httpx.TimeoutException: If the request takes longer than Client.timeout.
116+
117+ Returns:
118+ ValidatedGeotekniskUnders
119+ """
120+
121+ return sync_detailed (
122+ geoteknisk_unders_id = geoteknisk_unders_id ,
123+ geoteknisk_borehull_id = geoteknisk_borehull_id ,
124+ client = client ,
125+ epsg_code = epsg_code ,
126+ ).parsed
127+
128+
76129async def asyncio_detailed (
77130 geoteknisk_unders_id : str ,
78131 geoteknisk_borehull_id : str ,
79132 * ,
80133 client : AuthenticatedClient ,
81- ) -> Response [Any ]:
134+ epsg_code : EpsgCode ,
135+ ) -> Response [ValidatedGeotekniskUnders ]:
82136 """Deletes a GeotekniskBorehull.
83137
84138 Deletes a GeotekniskBorehull.
85139
86140 Args:
87141 geoteknisk_unders_id (str):
88142 geoteknisk_borehull_id (str):
143+ epsg_code (EpsgCode):
89144
90145 Raises:
91146 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92147 httpx.TimeoutException: If the request takes longer than Client.timeout.
93148
94149 Returns:
95- Response[Any ]
150+ Response[ValidatedGeotekniskUnders ]
96151 """
97152
98153 kwargs = _get_kwargs (
99154 geoteknisk_unders_id = geoteknisk_unders_id ,
100155 geoteknisk_borehull_id = geoteknisk_borehull_id ,
156+ epsg_code = epsg_code ,
101157 )
102158
103159 response = await client .get_async_httpx_client ().request (** kwargs )
104160
105161 return _build_response (client = client , response = response )
162+
163+
164+ async def asyncio (
165+ geoteknisk_unders_id : str ,
166+ geoteknisk_borehull_id : str ,
167+ * ,
168+ client : AuthenticatedClient ,
169+ epsg_code : EpsgCode ,
170+ ) -> Optional [ValidatedGeotekniskUnders ]:
171+ """Deletes a GeotekniskBorehull.
172+
173+ Deletes a GeotekniskBorehull.
174+
175+ Args:
176+ geoteknisk_unders_id (str):
177+ geoteknisk_borehull_id (str):
178+ epsg_code (EpsgCode):
179+
180+ Raises:
181+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
182+ httpx.TimeoutException: If the request takes longer than Client.timeout.
183+
184+ Returns:
185+ ValidatedGeotekniskUnders
186+ """
187+
188+ return (
189+ await asyncio_detailed (
190+ geoteknisk_unders_id = geoteknisk_unders_id ,
191+ geoteknisk_borehull_id = geoteknisk_borehull_id ,
192+ client = client ,
193+ epsg_code = epsg_code ,
194+ )
195+ ).parsed
0 commit comments