vibe-client 0.1.1__tar.gz → 0.1.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibe_client
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: vibe client
5
5
  License: Apache-2.0
6
6
  Keywords: smithy,vibe
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = "vibe_client"
6
- version = "0.1.1"
6
+ version = "0.1.2"
7
7
  description = "vibe client"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.12"
@@ -1,3 +1,3 @@
1
1
  # Code generated by smithy-python-codegen DO NOT EDIT.
2
2
 
3
- __version__: str = "0.1.0"
3
+ __version__: str = "0.1.2"
@@ -128,6 +128,27 @@ INTEGER_LIST = Schema.collection(
128
128
  }
129
129
  )
130
130
 
131
+ FORBIDDEN_EXCEPTION = Schema.collection(
132
+ id=ShapeID("vibe.astar.public.api.shared#ForbiddenException"),
133
+
134
+ traits=[
135
+ Trait.new(id=ShapeID("smithy.api#error"), value="client"),
136
+ Trait.new(id=ShapeID("smithy.api#httpError"), value=403),
137
+
138
+ ],
139
+ members={
140
+ "message": {
141
+ "target": STRING,
142
+ "index": 0,
143
+ "traits": [
144
+ Trait.new(id=ShapeID("smithy.api#required")),
145
+
146
+ ],
147
+ },
148
+
149
+ }
150
+ )
151
+
131
152
  UNAUTHORIZED_EXCEPTION = Schema.collection(
132
153
  id=ShapeID("vibe.astar.public.api.shared#UnauthorizedException"),
133
154
 
@@ -12,6 +12,7 @@ from smithy_json import JSONCodec
12
12
  from .config import Config
13
13
  from .models import (
14
14
  ApiError,
15
+ ForbiddenException,
15
16
  QueryAgentOutput,
16
17
  UnauthorizedException,
17
18
  UnknownApiError,
@@ -48,6 +49,9 @@ async def _deserialize_error_query_agent(http_response: HTTPResponse, config: Co
48
49
  case "vibevalidationexception":
49
50
  return await _deserialize_error_vibe_validation_exception(http_response, config, parsed_body, message)
50
51
 
52
+ case "forbiddenexception":
53
+ return await _deserialize_error_forbidden_exception(http_response, config, parsed_body, message)
54
+
51
55
  case _:
52
56
  return UnknownApiError(f"{code}: {message}")
53
57
 
@@ -72,6 +76,27 @@ async def _deserialize_error_validation_exception(
72
76
 
73
77
  return ValidationException(**kwargs)
74
78
 
79
+ async def _deserialize_error_forbidden_exception(
80
+ http_response: HTTPResponse,
81
+ config: Config,
82
+ parsed_body: dict[str, DocumentValue] | None,
83
+ default_message: str,
84
+ ) -> ForbiddenException:
85
+ kwargs: dict[str, Any] = {"message": default_message}
86
+
87
+ if parsed_body is None:
88
+ body = await http_response.consume_body_async()
89
+ else:
90
+ body = json.dumps(parsed_body).encode('utf-8')
91
+
92
+ if body:
93
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
94
+ deserializer = codec.create_deserializer(body)
95
+ body_kwargs = ForbiddenException.deserialize_kwargs(deserializer)
96
+ kwargs.update(body_kwargs)
97
+
98
+ return ForbiddenException(**kwargs)
99
+
75
100
  async def _deserialize_error_unauthorized_exception(
76
101
  http_response: HTTPResponse,
77
102
  config: Config,
@@ -14,6 +14,7 @@ from smithy_core.shapes import ShapeID
14
14
 
15
15
  from ._private.schemas import (
16
16
  ACTION_VALUE as _SCHEMA_ACTION_VALUE,
17
+ FORBIDDEN_EXCEPTION as _SCHEMA_FORBIDDEN_EXCEPTION,
17
18
  OBSERVATION_VALUE as _SCHEMA_OBSERVATION_VALUE,
18
19
  QUERY_AGENT as _SCHEMA_QUERY_AGENT,
19
20
  QUERY_AGENT_INPUT as _SCHEMA_QUERY_AGENT_INPUT,
@@ -236,6 +237,39 @@ def _deserialize_integer_list(deserializer: ShapeDeserializer, schema: Schema) -
236
237
  deserializer.read_list(schema, _read_value)
237
238
  return result
238
239
 
240
+ @dataclass(kw_only=True)
241
+ class ForbiddenException(ApiError):
242
+
243
+ code: ClassVar[str] = "ForbiddenException"
244
+ fault: ClassVar[Literal["client", "server"]] = "client"
245
+
246
+ message: str
247
+
248
+ def serialize(self, serializer: ShapeSerializer):
249
+ serializer.write_struct(_SCHEMA_FORBIDDEN_EXCEPTION, self)
250
+
251
+ def serialize_members(self, serializer: ShapeSerializer):
252
+ serializer.write_string(_SCHEMA_FORBIDDEN_EXCEPTION.members["message"], self.message)
253
+
254
+ @classmethod
255
+ def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
256
+ return cls(**cls.deserialize_kwargs(deserializer))
257
+
258
+ @classmethod
259
+ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]:
260
+ kwargs: dict[str, Any] = {}
261
+
262
+ def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
263
+ match schema.expect_member_index():
264
+ case 0:
265
+ kwargs["message"] = de.read_string(_SCHEMA_FORBIDDEN_EXCEPTION.members["message"])
266
+
267
+ case _:
268
+ logger.debug("Unexpected member schema: %s", schema)
269
+
270
+ deserializer.read_struct(_SCHEMA_FORBIDDEN_EXCEPTION, consumer=_consumer)
271
+ return kwargs
272
+
239
273
  @dataclass(kw_only=True)
240
274
  class UnauthorizedException(ApiError):
241
275
 
@@ -703,6 +737,7 @@ QUERY_AGENT = APIOperation(
703
737
  ShapeID("vibe.astar.public.api.shared#UnauthorizedException"): UnauthorizedException,
704
738
  ShapeID("smithy.framework#ValidationException"): ValidationException,
705
739
  ShapeID("vibe.astar.public.api.shared#VibeValidationException"): VibeValidationException,
740
+ ShapeID("vibe.astar.public.api.shared#ForbiddenException"): ForbiddenException,
706
741
  }),
707
742
  effective_auth_schemes = [
708
743
  ShapeID("smithy.api#noAuth")
File without changes
File without changes