growsurf-python 1.1.1__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- growsurf/_client.py +47 -8
- growsurf/_version.py +1 -1
- growsurf/resources/__init__.py +14 -0
- growsurf/resources/account.py +45 -426
- growsurf/resources/campaign/campaign.py +2 -2
- growsurf/resources/campaign/participant.py +4 -4
- growsurf/resources/campaign/reward.py +6 -4
- growsurf/resources/team.py +323 -0
- growsurf/types/__init__.py +2 -2
- growsurf/types/create_account_response.py +8 -6
- growsurf/types/rotate_api_key_response.py +1 -1
- growsurf/types/{account.py → team.py} +6 -17
- growsurf/types/team_update_params.py +10 -0
- {growsurf_python-1.1.1.dist-info → growsurf_python-1.2.0.dist-info}/METADATA +1 -1
- {growsurf_python-1.1.1.dist-info → growsurf_python-1.2.0.dist-info}/RECORD +17 -16
- growsurf/types/account_update_params.py +0 -17
- {growsurf_python-1.1.1.dist-info → growsurf_python-1.2.0.dist-info}/WHEEL +0 -0
- {growsurf_python-1.1.1.dist-info → growsurf_python-1.2.0.dist-info}/licenses/LICENSE +0 -0
growsurf/_client.py
CHANGED
|
@@ -28,7 +28,7 @@ from ._compat import cached_property
|
|
|
28
28
|
from ._models import SecurityOptions
|
|
29
29
|
from ._version import __version__
|
|
30
30
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
31
|
-
from ._exceptions import
|
|
31
|
+
from ._exceptions import APIStatusError
|
|
32
32
|
from ._base_client import (
|
|
33
33
|
DEFAULT_MAX_RETRIES,
|
|
34
34
|
SyncAPIClient,
|
|
@@ -36,7 +36,8 @@ from ._base_client import (
|
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
|
-
from .resources import account, campaign
|
|
39
|
+
from .resources import team, account, campaign
|
|
40
|
+
from .resources.team import TeamResource, AsyncTeamResource
|
|
40
41
|
from .resources.account import AccountResource, AsyncAccountResource
|
|
41
42
|
from .resources.campaign.campaign import CampaignResource, AsyncCampaignResource
|
|
42
43
|
|
|
@@ -86,9 +87,7 @@ class Growsurf(SyncAPIClient):
|
|
|
86
87
|
if api_key is None:
|
|
87
88
|
api_key = os.environ.get("GROWSURF_API_KEY")
|
|
88
89
|
if api_key is None:
|
|
89
|
-
|
|
90
|
-
"The api_key client option must be set either by passing api_key to the client or by setting the GROWSURF_API_KEY environment variable"
|
|
91
|
-
)
|
|
90
|
+
api_key = ""
|
|
92
91
|
self.api_key = api_key
|
|
93
92
|
|
|
94
93
|
if base_url is None:
|
|
@@ -115,6 +114,7 @@ class Growsurf(SyncAPIClient):
|
|
|
115
114
|
custom_query=default_query,
|
|
116
115
|
_strict_response_validation=_strict_response_validation,
|
|
117
116
|
)
|
|
117
|
+
self._idempotency_header = "Idempotency-Key"
|
|
118
118
|
|
|
119
119
|
@cached_property
|
|
120
120
|
def account(self) -> AccountResource:
|
|
@@ -122,6 +122,12 @@ class Growsurf(SyncAPIClient):
|
|
|
122
122
|
|
|
123
123
|
return AccountResource(self)
|
|
124
124
|
|
|
125
|
+
@cached_property
|
|
126
|
+
def team(self) -> TeamResource:
|
|
127
|
+
from .resources.team import TeamResource
|
|
128
|
+
|
|
129
|
+
return TeamResource(self)
|
|
130
|
+
|
|
125
131
|
@cached_property
|
|
126
132
|
def campaign(self) -> CampaignResource:
|
|
127
133
|
from .resources.campaign import CampaignResource
|
|
@@ -152,6 +158,8 @@ class Growsurf(SyncAPIClient):
|
|
|
152
158
|
@property
|
|
153
159
|
def _api_key_auth(self) -> dict[str, str]:
|
|
154
160
|
api_key = self.api_key
|
|
161
|
+
if not api_key:
|
|
162
|
+
return {}
|
|
155
163
|
return {"Authorization": f"Bearer {api_key}"}
|
|
156
164
|
|
|
157
165
|
@property
|
|
@@ -282,9 +290,7 @@ class AsyncGrowsurf(AsyncAPIClient):
|
|
|
282
290
|
if api_key is None:
|
|
283
291
|
api_key = os.environ.get("GROWSURF_API_KEY")
|
|
284
292
|
if api_key is None:
|
|
285
|
-
|
|
286
|
-
"The api_key client option must be set either by passing api_key to the client or by setting the GROWSURF_API_KEY environment variable"
|
|
287
|
-
)
|
|
293
|
+
api_key = ""
|
|
288
294
|
self.api_key = api_key
|
|
289
295
|
|
|
290
296
|
if base_url is None:
|
|
@@ -311,6 +317,7 @@ class AsyncGrowsurf(AsyncAPIClient):
|
|
|
311
317
|
custom_query=default_query,
|
|
312
318
|
_strict_response_validation=_strict_response_validation,
|
|
313
319
|
)
|
|
320
|
+
self._idempotency_header = "Idempotency-Key"
|
|
314
321
|
|
|
315
322
|
@cached_property
|
|
316
323
|
def account(self) -> AsyncAccountResource:
|
|
@@ -318,6 +325,12 @@ class AsyncGrowsurf(AsyncAPIClient):
|
|
|
318
325
|
|
|
319
326
|
return AsyncAccountResource(self)
|
|
320
327
|
|
|
328
|
+
@cached_property
|
|
329
|
+
def team(self) -> AsyncTeamResource:
|
|
330
|
+
from .resources.team import AsyncTeamResource
|
|
331
|
+
|
|
332
|
+
return AsyncTeamResource(self)
|
|
333
|
+
|
|
321
334
|
@cached_property
|
|
322
335
|
def campaign(self) -> AsyncCampaignResource:
|
|
323
336
|
from .resources.campaign import AsyncCampaignResource
|
|
@@ -348,6 +361,8 @@ class AsyncGrowsurf(AsyncAPIClient):
|
|
|
348
361
|
@property
|
|
349
362
|
def _api_key_auth(self) -> dict[str, str]:
|
|
350
363
|
api_key = self.api_key
|
|
364
|
+
if not api_key:
|
|
365
|
+
return {}
|
|
351
366
|
return {"Authorization": f"Bearer {api_key}"}
|
|
352
367
|
|
|
353
368
|
@property
|
|
@@ -456,6 +471,12 @@ class GrowsurfWithRawResponse:
|
|
|
456
471
|
|
|
457
472
|
return AccountResourceWithRawResponse(self._client.account)
|
|
458
473
|
|
|
474
|
+
@cached_property
|
|
475
|
+
def team(self) -> team.TeamResourceWithRawResponse:
|
|
476
|
+
from .resources.team import TeamResourceWithRawResponse
|
|
477
|
+
|
|
478
|
+
return TeamResourceWithRawResponse(self._client.team)
|
|
479
|
+
|
|
459
480
|
@cached_property
|
|
460
481
|
def campaign(self) -> campaign.CampaignResourceWithRawResponse:
|
|
461
482
|
from .resources.campaign import CampaignResourceWithRawResponse
|
|
@@ -475,6 +496,12 @@ class AsyncGrowsurfWithRawResponse:
|
|
|
475
496
|
|
|
476
497
|
return AsyncAccountResourceWithRawResponse(self._client.account)
|
|
477
498
|
|
|
499
|
+
@cached_property
|
|
500
|
+
def team(self) -> team.AsyncTeamResourceWithRawResponse:
|
|
501
|
+
from .resources.team import AsyncTeamResourceWithRawResponse
|
|
502
|
+
|
|
503
|
+
return AsyncTeamResourceWithRawResponse(self._client.team)
|
|
504
|
+
|
|
478
505
|
@cached_property
|
|
479
506
|
def campaign(self) -> campaign.AsyncCampaignResourceWithRawResponse:
|
|
480
507
|
from .resources.campaign import AsyncCampaignResourceWithRawResponse
|
|
@@ -494,6 +521,12 @@ class GrowsurfWithStreamedResponse:
|
|
|
494
521
|
|
|
495
522
|
return AccountResourceWithStreamingResponse(self._client.account)
|
|
496
523
|
|
|
524
|
+
@cached_property
|
|
525
|
+
def team(self) -> team.TeamResourceWithStreamingResponse:
|
|
526
|
+
from .resources.team import TeamResourceWithStreamingResponse
|
|
527
|
+
|
|
528
|
+
return TeamResourceWithStreamingResponse(self._client.team)
|
|
529
|
+
|
|
497
530
|
@cached_property
|
|
498
531
|
def campaign(self) -> campaign.CampaignResourceWithStreamingResponse:
|
|
499
532
|
from .resources.campaign import CampaignResourceWithStreamingResponse
|
|
@@ -513,6 +546,12 @@ class AsyncGrowsurfWithStreamedResponse:
|
|
|
513
546
|
|
|
514
547
|
return AsyncAccountResourceWithStreamingResponse(self._client.account)
|
|
515
548
|
|
|
549
|
+
@cached_property
|
|
550
|
+
def team(self) -> team.AsyncTeamResourceWithStreamingResponse:
|
|
551
|
+
from .resources.team import AsyncTeamResourceWithStreamingResponse
|
|
552
|
+
|
|
553
|
+
return AsyncTeamResourceWithStreamingResponse(self._client.team)
|
|
554
|
+
|
|
516
555
|
@cached_property
|
|
517
556
|
def campaign(self) -> campaign.AsyncCampaignResourceWithStreamingResponse:
|
|
518
557
|
from .resources.campaign import AsyncCampaignResourceWithStreamingResponse
|
growsurf/_version.py
CHANGED
growsurf/resources/__init__.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .team import (
|
|
4
|
+
TeamResource,
|
|
5
|
+
AsyncTeamResource,
|
|
6
|
+
TeamResourceWithRawResponse,
|
|
7
|
+
AsyncTeamResourceWithRawResponse,
|
|
8
|
+
TeamResourceWithStreamingResponse,
|
|
9
|
+
AsyncTeamResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .account import (
|
|
4
12
|
AccountResource,
|
|
5
13
|
AsyncAccountResource,
|
|
@@ -24,6 +32,12 @@ __all__ = [
|
|
|
24
32
|
"AsyncAccountResourceWithRawResponse",
|
|
25
33
|
"AccountResourceWithStreamingResponse",
|
|
26
34
|
"AsyncAccountResourceWithStreamingResponse",
|
|
35
|
+
"TeamResource",
|
|
36
|
+
"AsyncTeamResource",
|
|
37
|
+
"TeamResourceWithRawResponse",
|
|
38
|
+
"AsyncTeamResourceWithRawResponse",
|
|
39
|
+
"TeamResourceWithStreamingResponse",
|
|
40
|
+
"AsyncTeamResourceWithStreamingResponse",
|
|
27
41
|
"CampaignResource",
|
|
28
42
|
"AsyncCampaignResource",
|
|
29
43
|
"CampaignResourceWithRawResponse",
|