1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2
  3from __future__ import annotations
  4
  5from ...._compat import cached_property
  6from .permissions import (
  7    Permissions,
  8    AsyncPermissions,
  9    PermissionsWithRawResponse,
 10    AsyncPermissionsWithRawResponse,
 11    PermissionsWithStreamingResponse,
 12    AsyncPermissionsWithStreamingResponse,
 13)
 14from ...._resource import SyncAPIResource, AsyncAPIResource
 15
 16__all__ = ["Checkpoints", "AsyncCheckpoints"]
 17
 18
 19class Checkpoints(SyncAPIResource):
 20    @cached_property
 21    def permissions(self) -> Permissions:
 22        return Permissions(self._client)
 23
 24    @cached_property
 25    def with_raw_response(self) -> CheckpointsWithRawResponse:
 26        """
 27        This property can be used as a prefix for any HTTP method call to return
 28        the raw response object instead of the parsed content.
 29
 30        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
 31        """
 32        return CheckpointsWithRawResponse(self)
 33
 34    @cached_property
 35    def with_streaming_response(self) -> CheckpointsWithStreamingResponse:
 36        """
 37        An alternative to `.with_raw_response` that doesn't eagerly read the response body.
 38
 39        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
 40        """
 41        return CheckpointsWithStreamingResponse(self)
 42
 43
 44class AsyncCheckpoints(AsyncAPIResource):
 45    @cached_property
 46    def permissions(self) -> AsyncPermissions:
 47        return AsyncPermissions(self._client)
 48
 49    @cached_property
 50    def with_raw_response(self) -> AsyncCheckpointsWithRawResponse:
 51        """
 52        This property can be used as a prefix for any HTTP method call to return
 53        the raw response object instead of the parsed content.
 54
 55        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
 56        """
 57        return AsyncCheckpointsWithRawResponse(self)
 58
 59    @cached_property
 60    def with_streaming_response(self) -> AsyncCheckpointsWithStreamingResponse:
 61        """
 62        An alternative to `.with_raw_response` that doesn't eagerly read the response body.
 63
 64        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
 65        """
 66        return AsyncCheckpointsWithStreamingResponse(self)
 67
 68
 69class CheckpointsWithRawResponse:
 70    def __init__(self, checkpoints: Checkpoints) -> None:
 71        self._checkpoints = checkpoints
 72
 73    @cached_property
 74    def permissions(self) -> PermissionsWithRawResponse:
 75        return PermissionsWithRawResponse(self._checkpoints.permissions)
 76
 77
 78class AsyncCheckpointsWithRawResponse:
 79    def __init__(self, checkpoints: AsyncCheckpoints) -> None:
 80        self._checkpoints = checkpoints
 81
 82    @cached_property
 83    def permissions(self) -> AsyncPermissionsWithRawResponse:
 84        return AsyncPermissionsWithRawResponse(self._checkpoints.permissions)
 85
 86
 87class CheckpointsWithStreamingResponse:
 88    def __init__(self, checkpoints: Checkpoints) -> None:
 89        self._checkpoints = checkpoints
 90
 91    @cached_property
 92    def permissions(self) -> PermissionsWithStreamingResponse:
 93        return PermissionsWithStreamingResponse(self._checkpoints.permissions)
 94
 95
 96class AsyncCheckpointsWithStreamingResponse:
 97    def __init__(self, checkpoints: AsyncCheckpoints) -> None:
 98        self._checkpoints = checkpoints
 99
100    @cached_property
101    def permissions(self) -> AsyncPermissionsWithStreamingResponse:
102        return AsyncPermissionsWithStreamingResponse(self._checkpoints.permissions)