22
33from __future__ import annotations
44
5+ import typing_extensions
56from typing import Optional
67
78import httpx
@@ -321,6 +322,7 @@ def list_inspections(
321322 cast_to = RepositoryInspectionListView ,
322323 )
323324
325+ @typing_extensions .deprecated ("deprecated" )
324326 def refresh (
325327 self ,
326328 id : str ,
@@ -375,6 +377,39 @@ def refresh(
375377 cast_to = object ,
376378 )
377379
380+ def retrieve_inspection (
381+ self ,
382+ id : str ,
383+ * ,
384+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
385+ # The extra values given here take precedence over values defined on the client or passed to this method.
386+ extra_headers : Headers | None = None ,
387+ extra_query : Query | None = None ,
388+ extra_body : Body | None = None ,
389+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
390+ ) -> RepositoryInspectionDetails :
391+ """
392+ Get a repository inspection by id.
393+
394+ Args:
395+ extra_headers: Send extra headers
396+
397+ extra_query: Add additional query parameters to the request
398+
399+ extra_body: Add additional JSON properties to the request
400+
401+ timeout: Override the client-level default timeout for this request, in seconds
402+ """
403+ if not id :
404+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
405+ return self ._get (
406+ f"/v1/repositories/inspections/{ id } " ,
407+ options = make_request_options (
408+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
409+ ),
410+ cast_to = RepositoryInspectionDetails ,
411+ )
412+
378413
379414class AsyncRepositoriesResource (AsyncAPIResource ):
380415 @cached_property
@@ -666,6 +701,7 @@ async def list_inspections(
666701 cast_to = RepositoryInspectionListView ,
667702 )
668703
704+ @typing_extensions .deprecated ("deprecated" )
669705 async def refresh (
670706 self ,
671707 id : str ,
@@ -720,6 +756,39 @@ async def refresh(
720756 cast_to = object ,
721757 )
722758
759+ async def retrieve_inspection (
760+ self ,
761+ id : str ,
762+ * ,
763+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
764+ # The extra values given here take precedence over values defined on the client or passed to this method.
765+ extra_headers : Headers | None = None ,
766+ extra_query : Query | None = None ,
767+ extra_body : Body | None = None ,
768+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
769+ ) -> RepositoryInspectionDetails :
770+ """
771+ Get a repository inspection by id.
772+
773+ Args:
774+ extra_headers: Send extra headers
775+
776+ extra_query: Add additional query parameters to the request
777+
778+ extra_body: Add additional JSON properties to the request
779+
780+ timeout: Override the client-level default timeout for this request, in seconds
781+ """
782+ if not id :
783+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
784+ return await self ._get (
785+ f"/v1/repositories/inspections/{ id } " ,
786+ options = make_request_options (
787+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
788+ ),
789+ cast_to = RepositoryInspectionDetails ,
790+ )
791+
723792
724793class RepositoriesResourceWithRawResponse :
725794 def __init__ (self , repositories : RepositoriesResource ) -> None :
@@ -743,8 +812,13 @@ def __init__(self, repositories: RepositoriesResource) -> None:
743812 self .list_inspections = to_raw_response_wrapper (
744813 repositories .list_inspections ,
745814 )
746- self .refresh = to_raw_response_wrapper (
747- repositories .refresh ,
815+ self .refresh = ( # pyright: ignore[reportDeprecated]
816+ to_raw_response_wrapper (
817+ repositories .refresh , # pyright: ignore[reportDeprecated],
818+ )
819+ )
820+ self .retrieve_inspection = to_raw_response_wrapper (
821+ repositories .retrieve_inspection ,
748822 )
749823
750824
@@ -770,8 +844,13 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None:
770844 self .list_inspections = async_to_raw_response_wrapper (
771845 repositories .list_inspections ,
772846 )
773- self .refresh = async_to_raw_response_wrapper (
774- repositories .refresh ,
847+ self .refresh = ( # pyright: ignore[reportDeprecated]
848+ async_to_raw_response_wrapper (
849+ repositories .refresh , # pyright: ignore[reportDeprecated],
850+ )
851+ )
852+ self .retrieve_inspection = async_to_raw_response_wrapper (
853+ repositories .retrieve_inspection ,
775854 )
776855
777856
@@ -797,8 +876,13 @@ def __init__(self, repositories: RepositoriesResource) -> None:
797876 self .list_inspections = to_streamed_response_wrapper (
798877 repositories .list_inspections ,
799878 )
800- self .refresh = to_streamed_response_wrapper (
801- repositories .refresh ,
879+ self .refresh = ( # pyright: ignore[reportDeprecated]
880+ to_streamed_response_wrapper (
881+ repositories .refresh , # pyright: ignore[reportDeprecated],
882+ )
883+ )
884+ self .retrieve_inspection = to_streamed_response_wrapper (
885+ repositories .retrieve_inspection ,
802886 )
803887
804888
@@ -824,6 +908,11 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None:
824908 self .list_inspections = async_to_streamed_response_wrapper (
825909 repositories .list_inspections ,
826910 )
827- self .refresh = async_to_streamed_response_wrapper (
828- repositories .refresh ,
911+ self .refresh = ( # pyright: ignore[reportDeprecated]
912+ async_to_streamed_response_wrapper (
913+ repositories .refresh , # pyright: ignore[reportDeprecated],
914+ )
915+ )
916+ self .retrieve_inspection = async_to_streamed_response_wrapper (
917+ repositories .retrieve_inspection ,
829918 )
0 commit comments