zenbroker 0.3__py3-none-any.whl → 0.5__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.
zenbroker/__init__.py CHANGED
@@ -1,7 +1,6 @@
1
- from .client import ZenbrokerClient, ZenbrokerClientOptions, PostPublishEventResponse
1
+ from .client import ZenbrokerClient, PostPublishEventResponse
2
2
 
3
3
  __all__ = [
4
4
  "ZenbrokerClient",
5
- "ZenbrokerClientOptions",
6
5
  "PostPublishEventResponse"
7
6
  ]
zenbroker/client.py CHANGED
@@ -2,10 +2,6 @@ import httpx
2
2
  from typing import Dict, Any
3
3
  from pydantic import BaseModel, Field, HttpUrl
4
4
 
5
- class ZenbrokerClientOptions(BaseModel):
6
- base_url: HttpUrl = Field(..., description="URL of the broker service.")
7
- application_id: str = Field(..., description="Application ID")
8
-
9
5
  class PostPublishEventPayload(BaseModel):
10
6
  applicationId: str = Field(..., description="Application ID")
11
7
  channel: str = Field(..., description="ChannelID")
@@ -16,9 +12,9 @@ class PostPublishEventResponse(BaseModel):
16
12
  id: str = Field(..., description="ID of the message")
17
13
 
18
14
  class ZenbrokerClient:
19
- def __init__(self, opts: ZenbrokerClientOptions) -> None:
20
- self._url: str = str(opts.base_url)
21
- self._application_id: str = str(opts.application_id)
15
+ def __init__(self, base_url: HttpUrl, application_id: str) -> None:
16
+ self._url: str = str(base_url)
17
+ self._application_id: str = str(application_id)
22
18
 
23
19
  self._api = httpx.Client(base_url=self._url)
24
20
 
@@ -38,7 +34,7 @@ class ZenbrokerClient:
38
34
  result = response.json()
39
35
 
40
36
  return PostPublishEventResponse(
41
- id=result.id,
42
- message=result.message
37
+ id=result['id'],
38
+ message=result['message']
43
39
  )
44
40
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenbroker
3
- Version: 0.3
3
+ Version: 0.5
4
4
  Summary: UNKNOWN
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -0,0 +1,6 @@
1
+ zenbroker/__init__.py,sha256=J-UtdbKCUJ2xJVcng2slPY81nl015BHBTNNSE6ZAwvA,130
2
+ zenbroker/client.py,sha256=FDjIbV9yRhdbAsWp_kc-0GHqUYuAENlOI3b5l2ZB85o,1279
3
+ zenbroker-0.5.dist-info/METADATA,sha256=wL1oZm959nUC3mkNugLxXv9508FAgOE9gel2hnQFL9Q,206
4
+ zenbroker-0.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
5
+ zenbroker-0.5.dist-info/top_level.txt,sha256=u-V5a1mTLsnD3DQb01LQo8WtbYc75BIZ6jSWrZ7vDkY,10
6
+ zenbroker-0.5.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- zenbroker/__init__.py,sha256=i7O6N_4p6LuYKp8uc6UohCELn2TI523-oNf97F_Kbjw,184
2
- zenbroker/client.py,sha256=uunO-cQwj8WR25RyKqc1o19Bge_eA9QWqQBbayHmAPY,1459
3
- zenbroker-0.3.dist-info/METADATA,sha256=Rmeyd4FwOoD7xqzsTjW1yO2ycG2DeSNpJKjNLkC4CHo,206
4
- zenbroker-0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
5
- zenbroker-0.3.dist-info/top_level.txt,sha256=u-V5a1mTLsnD3DQb01LQo8WtbYc75BIZ6jSWrZ7vDkY,10
6
- zenbroker-0.3.dist-info/RECORD,,