|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +import httpx |
| 6 | + |
| 7 | +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
| 8 | +from ..._utils import maybe_transform, async_maybe_transform |
| 9 | +from ..._compat import cached_property |
| 10 | +from ..._resource import SyncAPIResource, AsyncAPIResource |
| 11 | +from ..._response import ( |
| 12 | + to_raw_response_wrapper, |
| 13 | + to_streamed_response_wrapper, |
| 14 | + async_to_raw_response_wrapper, |
| 15 | + async_to_streamed_response_wrapper, |
| 16 | +) |
| 17 | +from ..._base_client import make_request_options |
| 18 | +from ...types.analytics import nept_unlocks_distribution_params |
| 19 | +from ...types.analytics.nept_unlocks_distribution_response import NeptUnlocksDistributionResponse |
| 20 | + |
| 21 | +__all__ = ["NeptResource", "AsyncNeptResource"] |
| 22 | + |
| 23 | + |
| 24 | +class NeptResource(SyncAPIResource): |
| 25 | + @cached_property |
| 26 | + def with_raw_response(self) -> NeptResourceWithRawResponse: |
| 27 | + """ |
| 28 | + This property can be used as a prefix for any HTTP method call to return |
| 29 | + the raw response object instead of the parsed content. |
| 30 | +
|
| 31 | + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers |
| 32 | + """ |
| 33 | + return NeptResourceWithRawResponse(self) |
| 34 | + |
| 35 | + @cached_property |
| 36 | + def with_streaming_response(self) -> NeptResourceWithStreamingResponse: |
| 37 | + """ |
| 38 | + An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 39 | +
|
| 40 | + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response |
| 41 | + """ |
| 42 | + return NeptResourceWithStreamingResponse(self) |
| 43 | + |
| 44 | + def unlocks_distribution( |
| 45 | + self, |
| 46 | + *, |
| 47 | + with_percent: bool | Omit = omit, |
| 48 | + with_text: bool | Omit = omit, |
| 49 | + with_value: bool | Omit = omit, |
| 50 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 51 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 52 | + extra_headers: Headers | None = None, |
| 53 | + extra_query: Query | None = None, |
| 54 | + extra_body: Body | None = None, |
| 55 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 56 | + ) -> NeptUnlocksDistributionResponse: |
| 57 | + """ |
| 58 | + Get distribution analytics for NEPT unlocks |
| 59 | +
|
| 60 | + Args: |
| 61 | + with_percent: Calculate and include proportional percentages, where applicable |
| 62 | +
|
| 63 | + with_text: Include text variation fields |
| 64 | +
|
| 65 | + with_value: Calculate and include USD values for amounts, where applicable |
| 66 | +
|
| 67 | + extra_headers: Send extra headers |
| 68 | +
|
| 69 | + extra_query: Add additional query parameters to the request |
| 70 | +
|
| 71 | + extra_body: Add additional JSON properties to the request |
| 72 | +
|
| 73 | + timeout: Override the client-level default timeout for this request, in seconds |
| 74 | + """ |
| 75 | + return self._get( |
| 76 | + "/api/v1/analytics/nept/unlocks-distribution", |
| 77 | + options=make_request_options( |
| 78 | + extra_headers=extra_headers, |
| 79 | + extra_query=extra_query, |
| 80 | + extra_body=extra_body, |
| 81 | + timeout=timeout, |
| 82 | + query=maybe_transform( |
| 83 | + { |
| 84 | + "with_percent": with_percent, |
| 85 | + "with_text": with_text, |
| 86 | + "with_value": with_value, |
| 87 | + }, |
| 88 | + nept_unlocks_distribution_params.NeptUnlocksDistributionParams, |
| 89 | + ), |
| 90 | + ), |
| 91 | + cast_to=NeptUnlocksDistributionResponse, |
| 92 | + ) |
| 93 | + |
| 94 | + |
| 95 | +class AsyncNeptResource(AsyncAPIResource): |
| 96 | + @cached_property |
| 97 | + def with_raw_response(self) -> AsyncNeptResourceWithRawResponse: |
| 98 | + """ |
| 99 | + This property can be used as a prefix for any HTTP method call to return |
| 100 | + the raw response object instead of the parsed content. |
| 101 | +
|
| 102 | + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers |
| 103 | + """ |
| 104 | + return AsyncNeptResourceWithRawResponse(self) |
| 105 | + |
| 106 | + @cached_property |
| 107 | + def with_streaming_response(self) -> AsyncNeptResourceWithStreamingResponse: |
| 108 | + """ |
| 109 | + An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 110 | +
|
| 111 | + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response |
| 112 | + """ |
| 113 | + return AsyncNeptResourceWithStreamingResponse(self) |
| 114 | + |
| 115 | + async def unlocks_distribution( |
| 116 | + self, |
| 117 | + *, |
| 118 | + with_percent: bool | Omit = omit, |
| 119 | + with_text: bool | Omit = omit, |
| 120 | + with_value: bool | Omit = omit, |
| 121 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 122 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 123 | + extra_headers: Headers | None = None, |
| 124 | + extra_query: Query | None = None, |
| 125 | + extra_body: Body | None = None, |
| 126 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 127 | + ) -> NeptUnlocksDistributionResponse: |
| 128 | + """ |
| 129 | + Get distribution analytics for NEPT unlocks |
| 130 | +
|
| 131 | + Args: |
| 132 | + with_percent: Calculate and include proportional percentages, where applicable |
| 133 | +
|
| 134 | + with_text: Include text variation fields |
| 135 | +
|
| 136 | + with_value: Calculate and include USD values for amounts, where applicable |
| 137 | +
|
| 138 | + extra_headers: Send extra headers |
| 139 | +
|
| 140 | + extra_query: Add additional query parameters to the request |
| 141 | +
|
| 142 | + extra_body: Add additional JSON properties to the request |
| 143 | +
|
| 144 | + timeout: Override the client-level default timeout for this request, in seconds |
| 145 | + """ |
| 146 | + return await self._get( |
| 147 | + "/api/v1/analytics/nept/unlocks-distribution", |
| 148 | + options=make_request_options( |
| 149 | + extra_headers=extra_headers, |
| 150 | + extra_query=extra_query, |
| 151 | + extra_body=extra_body, |
| 152 | + timeout=timeout, |
| 153 | + query=await async_maybe_transform( |
| 154 | + { |
| 155 | + "with_percent": with_percent, |
| 156 | + "with_text": with_text, |
| 157 | + "with_value": with_value, |
| 158 | + }, |
| 159 | + nept_unlocks_distribution_params.NeptUnlocksDistributionParams, |
| 160 | + ), |
| 161 | + ), |
| 162 | + cast_to=NeptUnlocksDistributionResponse, |
| 163 | + ) |
| 164 | + |
| 165 | + |
| 166 | +class NeptResourceWithRawResponse: |
| 167 | + def __init__(self, nept: NeptResource) -> None: |
| 168 | + self._nept = nept |
| 169 | + |
| 170 | + self.unlocks_distribution = to_raw_response_wrapper( |
| 171 | + nept.unlocks_distribution, |
| 172 | + ) |
| 173 | + |
| 174 | + |
| 175 | +class AsyncNeptResourceWithRawResponse: |
| 176 | + def __init__(self, nept: AsyncNeptResource) -> None: |
| 177 | + self._nept = nept |
| 178 | + |
| 179 | + self.unlocks_distribution = async_to_raw_response_wrapper( |
| 180 | + nept.unlocks_distribution, |
| 181 | + ) |
| 182 | + |
| 183 | + |
| 184 | +class NeptResourceWithStreamingResponse: |
| 185 | + def __init__(self, nept: NeptResource) -> None: |
| 186 | + self._nept = nept |
| 187 | + |
| 188 | + self.unlocks_distribution = to_streamed_response_wrapper( |
| 189 | + nept.unlocks_distribution, |
| 190 | + ) |
| 191 | + |
| 192 | + |
| 193 | +class AsyncNeptResourceWithStreamingResponse: |
| 194 | + def __init__(self, nept: AsyncNeptResource) -> None: |
| 195 | + self._nept = nept |
| 196 | + |
| 197 | + self.unlocks_distribution = async_to_streamed_response_wrapper( |
| 198 | + nept.unlocks_distribution, |
| 199 | + ) |
0 commit comments