growsurf-python 1.1.2__py3-none-any.whl → 1.2.1__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 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 GrowsurfError, APIStatusError
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
- raise GrowsurfError(
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:
@@ -123,6 +122,12 @@ class Growsurf(SyncAPIClient):
123
122
 
124
123
  return AccountResource(self)
125
124
 
125
+ @cached_property
126
+ def team(self) -> TeamResource:
127
+ from .resources.team import TeamResource
128
+
129
+ return TeamResource(self)
130
+
126
131
  @cached_property
127
132
  def campaign(self) -> CampaignResource:
128
133
  from .resources.campaign import CampaignResource
@@ -153,6 +158,8 @@ class Growsurf(SyncAPIClient):
153
158
  @property
154
159
  def _api_key_auth(self) -> dict[str, str]:
155
160
  api_key = self.api_key
161
+ if not api_key:
162
+ return {}
156
163
  return {"Authorization": f"Bearer {api_key}"}
157
164
 
158
165
  @property
@@ -283,9 +290,7 @@ class AsyncGrowsurf(AsyncAPIClient):
283
290
  if api_key is None:
284
291
  api_key = os.environ.get("GROWSURF_API_KEY")
285
292
  if api_key is None:
286
- raise GrowsurfError(
287
- "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"
288
- )
293
+ api_key = ""
289
294
  self.api_key = api_key
290
295
 
291
296
  if base_url is None:
@@ -320,6 +325,12 @@ class AsyncGrowsurf(AsyncAPIClient):
320
325
 
321
326
  return AsyncAccountResource(self)
322
327
 
328
+ @cached_property
329
+ def team(self) -> AsyncTeamResource:
330
+ from .resources.team import AsyncTeamResource
331
+
332
+ return AsyncTeamResource(self)
333
+
323
334
  @cached_property
324
335
  def campaign(self) -> AsyncCampaignResource:
325
336
  from .resources.campaign import AsyncCampaignResource
@@ -350,6 +361,8 @@ class AsyncGrowsurf(AsyncAPIClient):
350
361
  @property
351
362
  def _api_key_auth(self) -> dict[str, str]:
352
363
  api_key = self.api_key
364
+ if not api_key:
365
+ return {}
353
366
  return {"Authorization": f"Bearer {api_key}"}
354
367
 
355
368
  @property
@@ -458,6 +471,12 @@ class GrowsurfWithRawResponse:
458
471
 
459
472
  return AccountResourceWithRawResponse(self._client.account)
460
473
 
474
+ @cached_property
475
+ def team(self) -> team.TeamResourceWithRawResponse:
476
+ from .resources.team import TeamResourceWithRawResponse
477
+
478
+ return TeamResourceWithRawResponse(self._client.team)
479
+
461
480
  @cached_property
462
481
  def campaign(self) -> campaign.CampaignResourceWithRawResponse:
463
482
  from .resources.campaign import CampaignResourceWithRawResponse
@@ -477,6 +496,12 @@ class AsyncGrowsurfWithRawResponse:
477
496
 
478
497
  return AsyncAccountResourceWithRawResponse(self._client.account)
479
498
 
499
+ @cached_property
500
+ def team(self) -> team.AsyncTeamResourceWithRawResponse:
501
+ from .resources.team import AsyncTeamResourceWithRawResponse
502
+
503
+ return AsyncTeamResourceWithRawResponse(self._client.team)
504
+
480
505
  @cached_property
481
506
  def campaign(self) -> campaign.AsyncCampaignResourceWithRawResponse:
482
507
  from .resources.campaign import AsyncCampaignResourceWithRawResponse
@@ -496,6 +521,12 @@ class GrowsurfWithStreamedResponse:
496
521
 
497
522
  return AccountResourceWithStreamingResponse(self._client.account)
498
523
 
524
+ @cached_property
525
+ def team(self) -> team.TeamResourceWithStreamingResponse:
526
+ from .resources.team import TeamResourceWithStreamingResponse
527
+
528
+ return TeamResourceWithStreamingResponse(self._client.team)
529
+
499
530
  @cached_property
500
531
  def campaign(self) -> campaign.CampaignResourceWithStreamingResponse:
501
532
  from .resources.campaign import CampaignResourceWithStreamingResponse
@@ -515,6 +546,12 @@ class AsyncGrowsurfWithStreamedResponse:
515
546
 
516
547
  return AsyncAccountResourceWithStreamingResponse(self._client.account)
517
548
 
549
+ @cached_property
550
+ def team(self) -> team.AsyncTeamResourceWithStreamingResponse:
551
+ from .resources.team import AsyncTeamResourceWithStreamingResponse
552
+
553
+ return AsyncTeamResourceWithStreamingResponse(self._client.team)
554
+
518
555
  @cached_property
519
556
  def campaign(self) -> campaign.AsyncCampaignResourceWithStreamingResponse:
520
557
  from .resources.campaign import AsyncCampaignResourceWithStreamingResponse
growsurf/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "growsurf"
4
- __version__ = "1.1.2" # x-release-please-version
4
+ __version__ = "1.2.1" # x-release-please-version
@@ -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",