Skip to content

Commit a233d8a

Browse files
authored
feat: Update hosted extractor API maturity (#2668)
1 parent f7e74ab commit a233d8a

8 files changed

Lines changed: 42 additions & 68 deletions

File tree

cognite/client/_api/hosted_extractors/destinations.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DestinationsAPI(APIClient):
2525
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: AsyncCogniteClient) -> None:
2626
super().__init__(config, api_version, cognite_client)
2727
self._warning = FeaturePreviewWarning(
28-
api_maturity="beta", sdk_maturity="alpha", feature_name="Hosted Extractors"
28+
api_maturity="General Availability", sdk_maturity="alpha", feature_name="Hosted Extractors"
2929
)
3030
self._CREATE_LIMIT = 10
3131
self._LIST_LIMIT = 100
@@ -61,7 +61,6 @@ async def __call__(
6161
method="GET",
6262
chunk_size=chunk_size,
6363
limit=limit,
64-
headers={"cdf-version": "beta"},
6564
):
6665
yield item
6766

@@ -76,7 +75,7 @@ async def retrieve(
7675
async def retrieve(
7776
self, external_ids: str | SequenceNotStr[str], ignore_unknown_ids: bool = False
7877
) -> Destination | DestinationList:
79-
"""`Retrieve one or more destinations <https://api-docs.cognite.com/20230101-beta/tag/Destinations/operation/retrieve_destinations>`_.
78+
"""`Retrieve one or more destinations <https://api-docs.cognite.com/20230101/tag/Destinations/operation/retrieve_destinations>`_.
8079
8180
Args:
8281
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the resource type.
@@ -106,13 +105,12 @@ async def retrieve(
106105
resource_cls=Destination,
107106
identifiers=IdentifierSequence.load(external_ids=external_ids),
108107
ignore_unknown_ids=ignore_unknown_ids,
109-
headers={"cdf-version": "beta"},
110108
)
111109

112110
async def delete(
113111
self, external_ids: str | SequenceNotStr[str], ignore_unknown_ids: bool = False, force: bool = False
114112
) -> None:
115-
"""`Delete one or more destinations <https://api-docs.cognite.com/20230101-beta/tag/Destinations/operation/delete_destinations>`_.
113+
"""`Delete one or more destinations <https://api-docs.cognite.com/20230101/tag/Destinations/operation/delete_destinations>`_.
116114
117115
Args:
118116
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the resource type.
@@ -139,7 +137,6 @@ async def delete(
139137
identifiers=IdentifierSequence.load(external_ids=external_ids),
140138
wrap_ids=True,
141139
returns_items=False,
142-
headers={"cdf-version": "beta"},
143140
extra_body_fields=extra_body_fields or None,
144141
)
145142

@@ -150,7 +147,7 @@ async def create(self, items: DestinationWrite) -> Destination: ...
150147
async def create(self, items: Sequence[DestinationWrite]) -> DestinationList: ...
151148

152149
async def create(self, items: DestinationWrite | Sequence[DestinationWrite]) -> Destination | DestinationList:
153-
"""`Create one or more destinations <https://api-docs.cognite.com/20230101-beta/tag/Destinations/operation/create_destinations>`_.
150+
"""`Create one or more destinations <https://api-docs.cognite.com/20230101/tag/Destinations/operation/create_destinations>`_.
154151
155152
Args:
156153
items (DestinationWrite | Sequence[DestinationWrite]): Destination(s) to create.
@@ -182,7 +179,6 @@ async def create(self, items: DestinationWrite | Sequence[DestinationWrite]) ->
182179
resource_cls=Destination,
183180
items=items,
184181
input_resource_cls=DestinationWrite,
185-
headers={"cdf-version": "beta"},
186182
)
187183

188184
@overload
@@ -204,7 +200,7 @@ async def update(
204200
items: DestinationWrite | DestinationUpdate | Sequence[DestinationWrite | DestinationUpdate],
205201
mode: Literal["replace_ignore_null", "patch", "replace"] = "replace_ignore_null",
206202
) -> Destination | DestinationList:
207-
"""`Update one or more destinations <https://api-docs.cognite.com/20230101-beta/tag/Destinations/operation/update_destinations>`_.
203+
"""`Update one or more destinations <https://api-docs.cognite.com/20230101/tag/Destinations/operation/update_destinations>`_.
208204
209205
Args:
210206
items (DestinationWrite | DestinationUpdate | Sequence[DestinationWrite | DestinationUpdate]): Destination(s) to update.
@@ -231,14 +227,13 @@ async def update(
231227
resource_cls=Destination,
232228
update_cls=DestinationUpdate,
233229
mode=mode,
234-
headers={"cdf-version": "beta"},
235230
)
236231

237232
async def list(
238233
self,
239234
limit: int | None = DEFAULT_LIMIT_READ,
240235
) -> DestinationList:
241-
"""`List destinations <https://api-docs.cognite.com/20230101-beta/tag/Destinations/operation/list_destinations>`_.
236+
"""`List destinations <https://api-docs.cognite.com/20230101/tag/Destinations/operation/list_destinations>`_.
242237
243238
Args:
244239
limit (int | None): Maximum number of destinations to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
@@ -271,5 +266,4 @@ async def list(
271266
resource_cls=Destination,
272267
method="GET",
273268
limit=limit,
274-
headers={"cdf-version": "beta"},
275269
)

cognite/client/_api/hosted_extractors/jobs.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class JobsAPI(APIClient):
2929
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: AsyncCogniteClient) -> None:
3030
super().__init__(config, api_version, cognite_client)
3131
self._warning = FeaturePreviewWarning(
32-
api_maturity="beta", sdk_maturity="alpha", feature_name="Hosted Extractors"
32+
api_maturity="General Availability", sdk_maturity="alpha", feature_name="Hosted Extractors"
3333
)
3434
self._CREATE_LIMIT = 10
3535
self._LIST_LIMIT = 100
@@ -64,7 +64,6 @@ async def __call__(
6464
method="GET",
6565
chunk_size=chunk_size,
6666
limit=limit,
67-
headers={"cdf-version": "beta"},
6867
):
6968
yield item
7069

@@ -77,7 +76,7 @@ async def retrieve(self, external_ids: SequenceNotStr[str], ignore_unknown_ids:
7776
async def retrieve(
7877
self, external_ids: str | SequenceNotStr[str], ignore_unknown_ids: bool = False
7978
) -> Job | None | JobList:
80-
"""`Retrieve one or more jobs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/retrieve_jobs>`_.
79+
"""`Retrieve one or more jobs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/retrieve_jobs>`_.
8180
8281
Args:
8382
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the job type.
@@ -106,15 +105,14 @@ async def retrieve(
106105
resource_cls=Job,
107106
identifiers=IdentifierSequence.load(external_ids=external_ids),
108107
ignore_unknown_ids=ignore_unknown_ids,
109-
headers={"cdf-version": "beta"},
110108
)
111109

112110
async def delete(
113111
self,
114112
external_ids: str | SequenceNotStr[str],
115113
ignore_unknown_ids: bool = False,
116114
) -> None:
117-
"""`Delete one or more jobs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/delete_jobs>`_.
115+
"""`Delete one or more jobs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/delete_jobs>`_.
118116
119117
Args:
120118
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the resource type.
@@ -137,7 +135,6 @@ async def delete(
137135
identifiers=IdentifierSequence.load(external_ids=external_ids),
138136
wrap_ids=True,
139137
returns_items=False,
140-
headers={"cdf-version": "beta"},
141138
extra_body_fields=extra_body_fields,
142139
)
143140

@@ -148,7 +145,7 @@ async def create(self, items: JobWrite) -> Job: ...
148145
async def create(self, items: Sequence[JobWrite]) -> JobList: ...
149146

150147
async def create(self, items: JobWrite | Sequence[JobWrite]) -> Job | JobList:
151-
"""`Create one or more jobs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/create_jobs>`_.
148+
"""`Create one or more jobs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/create_jobs>`_.
152149
153150
Args:
154151
items (JobWrite | Sequence[JobWrite]): Job(s) to create.
@@ -175,7 +172,6 @@ async def create(self, items: JobWrite | Sequence[JobWrite]) -> Job | JobList:
175172
resource_cls=Job,
176173
items=items,
177174
input_resource_cls=JobWrite,
178-
headers={"cdf-version": "beta"},
179175
)
180176

181177
@overload
@@ -197,7 +193,7 @@ async def update(
197193
items: JobWrite | JobUpdate | Sequence[JobWrite | JobUpdate],
198194
mode: Literal["replace_ignore_null", "patch", "replace"] = "replace_ignore_null",
199195
) -> Job | JobList:
200-
"""`Update one or more jobs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/update_jobs>`_.
196+
"""`Update one or more jobs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/update_jobs>`_.
201197
202198
Args:
203199
items (JobWrite | JobUpdate | Sequence[JobWrite | JobUpdate]): Job(s) to update.
@@ -224,14 +220,13 @@ async def update(
224220
resource_cls=Job,
225221
update_cls=JobUpdate,
226222
mode=mode,
227-
headers={"cdf-version": "beta"},
228223
)
229224

230225
async def list(
231226
self,
232227
limit: int | None = DEFAULT_LIMIT_READ,
233228
) -> JobList:
234-
"""`List jobs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/list_jobs>`_.
229+
"""`List jobs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/list_jobs>`_.
235230
236231
Args:
237232
limit (int | None): Maximum number of jobs to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
@@ -264,7 +259,6 @@ async def list(
264259
resource_cls=Job,
265260
method="GET",
266261
limit=limit,
267-
headers={"cdf-version": "beta"},
268262
)
269263

270264
async def list_logs(
@@ -274,7 +268,7 @@ async def list_logs(
274268
destination: str | None = None,
275269
limit: int | None = DEFAULT_LIMIT_READ,
276270
) -> JobLogsList:
277-
"""`List job logs <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/get_job_logs>`_.
271+
"""`List job logs <https://api-docs.cognite.com/20230101/tag/Jobs/operation/get_job_logs>`_.
278272
279273
Args:
280274
job (str | None): Require returned logs to belong to the job given by this external ID.
@@ -310,7 +304,6 @@ async def list_logs(
310304
filter=filter_ or None,
311305
method="GET",
312306
limit=limit,
313-
headers={"cdf-version": "beta"},
314307
)
315308

316309
async def list_metrics(
@@ -320,7 +313,7 @@ async def list_metrics(
320313
destination: str | None = None,
321314
limit: int | None = DEFAULT_LIMIT_READ,
322315
) -> JobMetricsList:
323-
"""`List job metrics <https://api-docs.cognite.com/20230101-beta/tag/Jobs/operation/get_job_metrics>`_.
316+
"""`List job metrics <https://api-docs.cognite.com/20230101/tag/Jobs/operation/get_job_metrics>`_.
324317
325318
Args:
326319
job (str | None): Require returned metrics to belong to the job given by this external ID.
@@ -356,5 +349,4 @@ async def list_metrics(
356349
filter=filter_ or None,
357350
method="GET",
358351
limit=limit,
359-
headers={"cdf-version": "beta"},
360352
)

cognite/client/_api/hosted_extractors/mappings.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MappingsAPI(APIClient):
2020
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: AsyncCogniteClient) -> None:
2121
super().__init__(config, api_version, cognite_client)
2222
self._warning = FeaturePreviewWarning(
23-
api_maturity="alpha", sdk_maturity="alpha", feature_name="Hosted Extractors"
23+
api_maturity="General Availability", sdk_maturity="alpha", feature_name="Hosted Extractors"
2424
)
2525
self._CREATE_LIMIT = 10
2626
self._LIST_LIMIT = 100
@@ -56,7 +56,6 @@ async def __call__(
5656
method="GET",
5757
chunk_size=chunk_size,
5858
limit=limit,
59-
headers={"cdf-version": "beta"},
6059
):
6160
yield item
6261

@@ -69,7 +68,7 @@ async def retrieve(self, external_ids: SequenceNotStr[str], ignore_unknown_ids:
6968
async def retrieve(
7069
self, external_ids: str | SequenceNotStr[str], ignore_unknown_ids: bool = False
7170
) -> Mapping | MappingList:
72-
"""`Retrieve one or more mappings <https://api-docs.cognite.com/20230101-beta/tag/Mappings/operation/retrieve_mappings>`_.
71+
"""`Retrieve one or more mappings <https://api-docs.cognite.com/20230101/tag/Mappings/operation/retrieve_mappings>`_.
7372
7473
Args:
7574
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the resource type.
@@ -99,13 +98,12 @@ async def retrieve(
9998
resource_cls=Mapping,
10099
identifiers=IdentifierSequence.load(external_ids=external_ids),
101100
ignore_unknown_ids=ignore_unknown_ids,
102-
headers={"cdf-version": "beta"},
103101
)
104102

105103
async def delete(
106104
self, external_ids: str | SequenceNotStr[str], ignore_unknown_ids: bool = False, force: bool = False
107105
) -> None:
108-
"""`Delete one or more mappings <https://api-docs.cognite.com/20230101-beta/tag/Mappings/operation/delete_mappings>`_.
106+
"""`Delete one or more mappings <https://api-docs.cognite.com/20230101/tag/Mappings/operation/delete_mappings>`_.
109107
110108
Args:
111109
external_ids (str | SequenceNotStr[str]): The external ID provided by the client. Must be unique for the resource type.
@@ -131,7 +129,6 @@ async def delete(
131129
identifiers=IdentifierSequence.load(external_ids=external_ids),
132130
wrap_ids=True,
133131
returns_items=False,
134-
headers={"cdf-version": "beta"},
135132
extra_body_fields=extra_body_fields,
136133
)
137134

@@ -142,7 +139,7 @@ async def create(self, items: MappingWrite) -> Mapping: ...
142139
async def create(self, items: Sequence[MappingWrite]) -> MappingList: ...
143140

144141
async def create(self, items: MappingWrite | Sequence[MappingWrite]) -> Mapping | MappingList:
145-
"""`Create one or more mappings <https://api-docs.cognite.com/20230101-beta/tag/Mappings/operation/create_mappings>`_.
142+
"""`Create one or more mappings <https://api-docs.cognite.com/20230101/tag/Mappings/operation/create_mappings>`_.
146143
147144
Args:
148145
items (MappingWrite | Sequence[MappingWrite]): Mapping(s) to create.
@@ -172,7 +169,6 @@ async def create(self, items: MappingWrite | Sequence[MappingWrite]) -> Mapping
172169
resource_cls=Mapping,
173170
items=items,
174171
input_resource_cls=MappingWrite,
175-
headers={"cdf-version": "beta"},
176172
)
177173

178174
@overload
@@ -184,7 +180,7 @@ async def update(self, items: Sequence[MappingWrite | MappingUpdate]) -> Mapping
184180
async def update(
185181
self, items: MappingWrite | MappingUpdate | Sequence[MappingWrite | MappingUpdate]
186182
) -> Mapping | MappingList:
187-
"""`Update one or more mappings <https://api-docs.cognite.com/20230101-beta/tag/Mappings/operation/update_mappings>`_.
183+
"""`Update one or more mappings <https://api-docs.cognite.com/20230101/tag/Mappings/operation/update_mappings>`_.
188184
189185
Args:
190186
items (MappingWrite | MappingUpdate | Sequence[MappingWrite | MappingUpdate]): Mapping(s) to update.
@@ -209,14 +205,13 @@ async def update(
209205
list_cls=MappingList,
210206
resource_cls=Mapping,
211207
update_cls=MappingUpdate,
212-
headers={"cdf-version": "beta"},
213208
)
214209

215210
async def list(
216211
self,
217212
limit: int | None = DEFAULT_LIMIT_READ,
218213
) -> MappingList:
219-
"""`List mappings <https://api-docs.cognite.com/20230101-beta/tag/Mappings/operation/list_mappings>`_.
214+
"""`List mappings <https://api-docs.cognite.com/20230101/tag/Mappings/operation/list_mappings>`_.
220215
221216
Args:
222217
limit (int | None): Maximum number of mappings to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
@@ -249,5 +244,4 @@ async def list(
249244
resource_cls=Mapping,
250245
method="GET",
251246
limit=limit,
252-
headers={"cdf-version": "beta"},
253247
)

cognite/client/_api/hosted_extractors/sources.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SourcesAPI(APIClient):
2121
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: AsyncCogniteClient) -> None:
2222
super().__init__(config, api_version, cognite_client)
2323
self._warning = FeaturePreviewWarning(
24-
api_maturity="alpha", sdk_maturity="alpha", feature_name="Hosted Extractors"
24+
api_maturity="General Availability", sdk_maturity="alpha", feature_name="Hosted Extractors"
2525
)
2626
self._CREATE_LIMIT = 10
2727
self._LIST_LIMIT = 100
@@ -57,7 +57,6 @@ async def __call__(
5757
method="GET",
5858
chunk_size=chunk_size,
5959
limit=limit,
60-
headers={"cdf-version": "beta"},
6160
):
6261
yield item
6362

@@ -99,7 +98,6 @@ async def retrieve(
9998
resource_cls=Source, # type: ignore[type-abstract]
10099
identifiers=IdentifierSequence.load(external_ids=external_ids),
101100
ignore_unknown_ids=ignore_unknown_ids,
102-
headers={"cdf-version": "beta"},
103101
)
104102

105103
async def delete(
@@ -130,7 +128,6 @@ async def delete(
130128
await self._delete_multiple(
131129
identifiers=IdentifierSequence.load(external_ids=external_ids),
132130
wrap_ids=True,
133-
headers={"cdf-version": "beta"},
134131
extra_body_fields=extra_body_fields or None,
135132
)
136133

@@ -168,7 +165,6 @@ async def create(self, items: SourceWrite | Sequence[SourceWrite]) -> Source | S
168165
resource_cls=Source, # type: ignore[type-abstract]
169166
items=items, # type: ignore[arg-type]
170167
input_resource_cls=SourceWrite,
171-
headers={"cdf-version": "beta"},
172168
)
173169

174170
@overload
@@ -219,7 +215,6 @@ async def update(
219215
resource_cls=Source, # type: ignore[type-abstract]
220216
update_cls=SourceUpdate,
221217
mode=mode,
222-
headers={"cdf-version": "beta"},
223218
)
224219

225220
@classmethod
@@ -272,5 +267,4 @@ async def list(
272267
resource_cls=Source, # type: ignore[type-abstract]
273268
method="GET",
274269
limit=limit,
275-
headers={"cdf-version": "beta"},
276270
)

0 commit comments

Comments
 (0)