2
2
import uuid
3
3
from typing import Any , Optional , Union
4
4
5
- from .address_helper import (
6
- binding_path_with_exchange_queue ,
7
- exchange_address ,
8
- path_address ,
9
- purge_queue_address ,
10
- queue_address ,
11
- )
5
+ from .address_helper import AddressHelper
12
6
from .common import CommonValues , QueueType
13
7
from .entities import (
14
8
BindingSpecification ,
@@ -113,7 +107,7 @@ def declare_exchange(
113
107
body ["internal" ] = exchange_specification .is_internal
114
108
body ["arguments" ] = exchange_specification .arguments # type: ignore
115
109
116
- path = exchange_address (exchange_specification .name )
110
+ path = AddressHelper . exchange_address (exchange_specification .name )
117
111
118
112
self .request (
119
113
body ,
@@ -146,7 +140,7 @@ def declare_queue(
146
140
elif isinstance (queue_specification , StreamSpecification ):
147
141
body = self ._declare_stream (queue_specification )
148
142
149
- path = queue_address (queue_specification .name )
143
+ path = AddressHelper . queue_address (queue_specification .name )
150
144
151
145
self .request (
152
146
body ,
@@ -255,7 +249,7 @@ def _declare_stream(
255
249
256
250
def delete_exchange (self , exchange_name : str ) -> None :
257
251
logger .debug ("delete_exchange operation called" )
258
- path = exchange_address (exchange_name )
252
+ path = AddressHelper . exchange_address (exchange_name )
259
253
260
254
self .request (
261
255
None ,
@@ -268,7 +262,7 @@ def delete_exchange(self, exchange_name: str) -> None:
268
262
269
263
def delete_queue (self , queue_name : str ) -> None :
270
264
logger .debug ("delete_queue operation called" )
271
- path = queue_address (queue_name )
265
+ path = AddressHelper . queue_address (queue_name )
272
266
273
267
self .request (
274
268
None ,
@@ -302,7 +296,7 @@ def bind(self, bind_specification: BindingSpecification) -> str:
302
296
body ["destination_queue" ] = bind_specification .destination_queue
303
297
body ["arguments" ] = {} # type: ignore
304
298
305
- path = path_address ()
299
+ path = AddressHelper . path_address ()
306
300
307
301
self .request (
308
302
body ,
@@ -313,7 +307,9 @@ def bind(self, bind_specification: BindingSpecification) -> str:
313
307
],
314
308
)
315
309
316
- binding_path_with_queue = binding_path_with_exchange_queue (bind_specification )
310
+ binding_path_with_queue = AddressHelper .binding_path_with_exchange_queue (
311
+ bind_specification
312
+ )
317
313
return binding_path_with_queue
318
314
319
315
def unbind (self , binding_exchange_queue_path : str ) -> None :
@@ -329,7 +325,7 @@ def unbind(self, binding_exchange_queue_path: str) -> None:
329
325
330
326
def purge_queue (self , queue_name : str ) -> int :
331
327
logger .debug ("purge_queue operation called" )
332
- path = purge_queue_address (queue_name )
328
+ path = AddressHelper . purge_queue_address (queue_name )
333
329
334
330
response = self .request (
335
331
None ,
@@ -344,7 +340,7 @@ def purge_queue(self, queue_name: str) -> int:
344
340
345
341
def queue_info (self , queue_name : str ) -> QueueInfo :
346
342
logger .debug ("queue_info operation called" )
347
- path = queue_address (queue_name )
343
+ path = AddressHelper . queue_address (queue_name )
348
344
349
345
message = self .request (
350
346
None ,
0 commit comments