55
66from ... import errors
77from ...client import AuthenticatedClient , Client
8- from ...models .ekstern_identifikasjon import EksternIdentifikasjon
9- from ...models .geoteknisk_borehull import GeotekniskBorehull
8+ from ...models .geoteknisk_unders import GeotekniskUnders
109from ...types import Response
1110
1211
1312def _get_kwargs (
14- * ,
15- body : EksternIdentifikasjon ,
13+ code_list_name : str ,
1614) -> dict [str , Any ]:
17- headers : dict [str , Any ] = {}
18-
1915 _kwargs : dict [str , Any ] = {
20- "method" : "post " ,
21- "url" : "/nadag/innmelding/v1/GeotekniskBorehull " ,
16+ "method" : "get " ,
17+ "url" : f "/nadag/innmelding/v1/kodeliste/ { code_list_name } " ,
2218 }
2319
24- _kwargs ["json" ] = body .to_dict ()
25-
26- headers ["Content-Type" ] = "application/json"
27-
28- _kwargs ["headers" ] = headers
2920 return _kwargs
3021
3122
3223def _parse_response (
3324 * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
34- ) -> Optional [Union [Any , GeotekniskBorehull ]]:
25+ ) -> Optional [Union [Any , GeotekniskUnders ]]:
3526 if response .status_code == 200 :
36- response_200 = GeotekniskBorehull .from_dict (response .json ())
27+ response_200 = GeotekniskUnders .from_dict (response .json ())
3728
3829 return response_200
3930
40- if response .status_code == 401 :
41- response_401 = cast (Any , None )
42- return response_401
43-
4431 if response .status_code == 404 :
4532 response_404 = cast (Any , None )
4633 return response_404
@@ -53,7 +40,7 @@ def _parse_response(
5340
5441def _build_response (
5542 * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
56- ) -> Response [Union [Any , GeotekniskBorehull ]]:
43+ ) -> Response [Union [Any , GeotekniskUnders ]]:
5744 return Response (
5845 status_code = HTTPStatus (response .status_code ),
5946 content = response .content ,
@@ -63,28 +50,27 @@ def _build_response(
6350
6451
6552def sync_detailed (
53+ code_list_name : str ,
6654 * ,
6755 client : Union [AuthenticatedClient , Client ],
68- body : EksternIdentifikasjon ,
69- ) -> Response [Union [Any , GeotekniskBorehull ]]:
70- """Fetches a GeotekniskBorehull by external id.
56+ ) -> Response [Union [Any , GeotekniskUnders ]]:
57+ """Retrieves a list of codes and their labels.
7158
72- Fetches a GeotekniskBorehull by external id. Returns the most recent one .
59+ Fetches a list of codes and their labels .
7360
7461 Args:
75- body (EksternIdentifikasjon): Identifikasjon av et objekt, ivaretatt av den ansvarlige
76- leverandør inn til NADAG.
62+ code_list_name (str):
7763
7864 Raises:
7965 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
8066 httpx.TimeoutException: If the request takes longer than Client.timeout.
8167
8268 Returns:
83- Response[Union[Any, GeotekniskBorehull ]]
69+ Response[Union[Any, GeotekniskUnders ]]
8470 """
8571
8672 kwargs = _get_kwargs (
87- body = body ,
73+ code_list_name = code_list_name ,
8874 )
8975
9076 response = client .get_httpx_client ().request (
@@ -95,55 +81,53 @@ def sync_detailed(
9581
9682
9783def sync (
84+ code_list_name : str ,
9885 * ,
9986 client : Union [AuthenticatedClient , Client ],
100- body : EksternIdentifikasjon ,
101- ) -> Optional [Union [Any , GeotekniskBorehull ]]:
102- """Fetches a GeotekniskBorehull by external id.
87+ ) -> Optional [Union [Any , GeotekniskUnders ]]:
88+ """Retrieves a list of codes and their labels.
10389
104- Fetches a GeotekniskBorehull by external id. Returns the most recent one .
90+ Fetches a list of codes and their labels .
10591
10692 Args:
107- body (EksternIdentifikasjon): Identifikasjon av et objekt, ivaretatt av den ansvarlige
108- leverandør inn til NADAG.
93+ code_list_name (str):
10994
11095 Raises:
11196 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
11297 httpx.TimeoutException: If the request takes longer than Client.timeout.
11398
11499 Returns:
115- Union[Any, GeotekniskBorehull ]
100+ Union[Any, GeotekniskUnders ]
116101 """
117102
118103 return sync_detailed (
104+ code_list_name = code_list_name ,
119105 client = client ,
120- body = body ,
121106 ).parsed
122107
123108
124109async def asyncio_detailed (
110+ code_list_name : str ,
125111 * ,
126112 client : Union [AuthenticatedClient , Client ],
127- body : EksternIdentifikasjon ,
128- ) -> Response [Union [Any , GeotekniskBorehull ]]:
129- """Fetches a GeotekniskBorehull by external id.
113+ ) -> Response [Union [Any , GeotekniskUnders ]]:
114+ """Retrieves a list of codes and their labels.
130115
131- Fetches a GeotekniskBorehull by external id. Returns the most recent one .
116+ Fetches a list of codes and their labels .
132117
133118 Args:
134- body (EksternIdentifikasjon): Identifikasjon av et objekt, ivaretatt av den ansvarlige
135- leverandør inn til NADAG.
119+ code_list_name (str):
136120
137121 Raises:
138122 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
139123 httpx.TimeoutException: If the request takes longer than Client.timeout.
140124
141125 Returns:
142- Response[Union[Any, GeotekniskBorehull ]]
126+ Response[Union[Any, GeotekniskUnders ]]
143127 """
144128
145129 kwargs = _get_kwargs (
146- body = body ,
130+ code_list_name = code_list_name ,
147131 )
148132
149133 response = await client .get_async_httpx_client ().request (** kwargs )
@@ -152,29 +136,28 @@ async def asyncio_detailed(
152136
153137
154138async def asyncio (
139+ code_list_name : str ,
155140 * ,
156141 client : Union [AuthenticatedClient , Client ],
157- body : EksternIdentifikasjon ,
158- ) -> Optional [Union [Any , GeotekniskBorehull ]]:
159- """Fetches a GeotekniskBorehull by external id.
142+ ) -> Optional [Union [Any , GeotekniskUnders ]]:
143+ """Retrieves a list of codes and their labels.
160144
161- Fetches a GeotekniskBorehull by external id. Returns the most recent one .
145+ Fetches a list of codes and their labels .
162146
163147 Args:
164- body (EksternIdentifikasjon): Identifikasjon av et objekt, ivaretatt av den ansvarlige
165- leverandør inn til NADAG.
148+ code_list_name (str):
166149
167150 Raises:
168151 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
169152 httpx.TimeoutException: If the request takes longer than Client.timeout.
170153
171154 Returns:
172- Union[Any, GeotekniskBorehull ]
155+ Union[Any, GeotekniskUnders ]
173156 """
174157
175158 return (
176159 await asyncio_detailed (
160+ code_list_name = code_list_name ,
177161 client = client ,
178- body = body ,
179162 )
180163 ).parsed
0 commit comments