11from datetime import datetime , timedelta
22from typing import Any
33
4+ from typing_extensions import Self
5+
46from .managers import ConsumersManager
57
68class StorageType :
@@ -28,27 +30,31 @@ class ConsumerLimits:
2830 inactive_threshold : timedelta
2931 max_ack_pending : int
3032
31- def __init__ (self , inactive_threshold : timedelta , max_ack_pending : int ) -> None : ...
33+ def __new__ (
34+ cls ,
35+ inactive_threshold : timedelta ,
36+ max_ack_pending : int ,
37+ ) -> Self : ...
3238
3339class External :
3440 api_prefix : str
3541 delivery_prefix : str | None
3642
37- def __init__ (
38- self ,
43+ def __new__ (
44+ cls ,
3945 api_prefix : str ,
4046 delivery_prefix : str | None = None ,
41- ) -> None : ...
47+ ) -> Self : ...
4248
4349class SubjectTransform :
4450 source : str
4551 destination : str
4652
47- def __init__ (
48- self ,
53+ def __new__ (
54+ cls ,
4955 source : str ,
5056 destination : str ,
51- ) -> None : ...
57+ ) -> Self : ...
5258
5359class Source :
5460 name : str
@@ -59,38 +65,38 @@ class Source:
5965 domain : str | None = None
6066 subject_transforms : SubjectTransform | None = None
6167
62- def __init__ (
63- self ,
68+ def __new__ (
69+ cls ,
6470 name : str ,
6571 filter_subject : str | None = None ,
6672 external : External | None = None ,
6773 start_sequence : int | None = None ,
6874 start_time : int | None = None ,
6975 domain : str | None = None ,
7076 subject_transforms : SubjectTransform | None = None ,
71- ) -> None : ...
77+ ) -> Self : ...
7278
7379class Placement :
7480 cluster : str | None
7581 tags : list [str ] | None
7682
77- def __init__ (
78- self ,
83+ def __new__ (
84+ cls ,
7985 cluster : str | None = None ,
8086 tags : list [str ] | None = None ,
81- ) -> None : ...
87+ ) -> Self : ...
8288
8389class Republish :
8490 source : str
8591 destination : str
8692 headers_only : bool
8793
88- def __init__ (
89- self ,
94+ def __new__ (
95+ cls ,
9096 source : str ,
9197 destination : str ,
9298 headers_only : bool ,
93- ) -> None : ...
99+ ) -> Self : ...
94100
95101class StreamConfig :
96102 name : str
@@ -133,8 +139,8 @@ class StreamConfig:
133139 allow_message_schedules : bool | None
134140 allow_message_counter : bool | None
135141
136- def __init__ (
137- self ,
142+ def __new__ (
143+ cls ,
138144 name : str ,
139145 subjects : list [str ],
140146 max_bytes : int | None = None ,
@@ -174,7 +180,7 @@ class StreamConfig:
174180 allow_atomic_publish : bool | None = None ,
175181 allow_message_schedules : bool | None = None ,
176182 allow_message_counter : bool | None = None ,
177- ) -> None : ...
183+ ) -> Self : ...
178184
179185class StreamMessage :
180186 subject : str
0 commit comments