checkpoints.py 3.5 KB

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