17
17
T = TypeVar ('T' )
18
18
ClsType = Optional [Callable [[PipelineResponse [HttpRequest , AsyncHttpResponse ], T , Dict [str , Any ]], Any ]]
19
19
20
- class QueueOperations :
21
- """QueueOperations async operations.
20
+ class EntityOperations :
21
+ """EntityOperations async operations.
22
22
23
23
You should not instantiate this class directly. Instead, you should create a Client instance that
24
24
instantiates it for you and attaches it as an attribute.
@@ -41,17 +41,17 @@ def __init__(self, client, config, serializer, deserializer) -> None:
41
41
42
42
async def get (
43
43
self ,
44
- queue_name : str ,
44
+ entity_name : str ,
45
45
enrich : Optional [bool ] = False ,
46
46
api_version : Optional [str ] = "2017_04" ,
47
47
** kwargs
48
48
) -> object :
49
- """Get the details about the Queue with the given queueName .
49
+ """Get the details about the Queue or Topic with the given entityName .
50
50
51
- Get Queue.
51
+ Get Queue or Topic .
52
52
53
- :param queue_name : The name of the queue relative to the Service Bus namespace.
54
- :type queue_name : str
53
+ :param entity_name : The name of the queue or topic relative to the Service Bus namespace.
54
+ :type entity_name : str
55
55
:param enrich: A query parameter that sets enrich to true or false.
56
56
:type enrich: bool
57
57
:param api_version: Api Version.
@@ -69,7 +69,7 @@ async def get(
69
69
url = self .get .metadata ['url' ] # type: ignore
70
70
path_format_arguments = {
71
71
'endpoint' : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , 'str' , skip_quote = True ),
72
- 'queueName ' : self ._serialize .url ("queue_name " , queue_name , 'str' , min_length = 1 ),
72
+ 'entityName ' : self ._serialize .url ("entity_name " , entity_name , 'str' , min_length = 1 ),
73
73
}
74
74
url = self ._client .format_url (url , ** path_format_arguments )
75
75
@@ -100,21 +100,21 @@ async def get(
100
100
return cls (pipeline_response , deserialized , {})
101
101
102
102
return deserialized
103
- get .metadata = {'url' : '/{queueName }' } # type: ignore
103
+ get .metadata = {'url' : '/{entityName }' } # type: ignore
104
104
105
105
async def put (
106
106
self ,
107
- queue_name : str ,
107
+ entity_name : str ,
108
108
request_body : object ,
109
109
api_version : Optional [str ] = "2017_04" ,
110
110
if_match : Optional [str ] = None ,
111
111
** kwargs
112
112
) -> object :
113
- """Create or update a queue at the provided queuePath .
113
+ """Create or update a queue or topic at the provided entityName .
114
114
115
- :param queue_name : The name of the queue relative to the Service Bus namespace.
116
- :type queue_name : str
117
- :param request_body: Parameters required to make or edit a queue.
115
+ :param entity_name : The name of the queue or topic relative to the Service Bus namespace.
116
+ :type entity_name : str
117
+ :param request_body: Parameters required to make or edit a queue or topic .
118
118
:type request_body: object
119
119
:param api_version: Api Version.
120
120
:type api_version: str
@@ -131,13 +131,13 @@ async def put(
131
131
cls = kwargs .pop ('cls' , None ) # type: ClsType[object]
132
132
error_map = {404 : ResourceNotFoundError , 409 : ResourceExistsError }
133
133
error_map .update (kwargs .pop ('error_map' , {}))
134
- content_type = kwargs .pop ("content_type" , "application/xml" )
134
+ content_type = kwargs .pop ("content_type" , "application/atom+ xml" )
135
135
136
136
# Construct URL
137
137
url = self .put .metadata ['url' ] # type: ignore
138
138
path_format_arguments = {
139
139
'endpoint' : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , 'str' , skip_quote = True ),
140
- 'queueName ' : self ._serialize .url ("queue_name " , queue_name , 'str' , min_length = 1 ),
140
+ 'entityName ' : self ._serialize .url ("entity_name " , entity_name , 'str' , min_length = 1 ),
141
141
}
142
142
url = self ._client .format_url (url , ** path_format_arguments )
143
143
@@ -178,20 +178,20 @@ async def put(
178
178
return cls (pipeline_response , deserialized , {})
179
179
180
180
return deserialized
181
- put .metadata = {'url' : '/{queueName }' } # type: ignore
181
+ put .metadata = {'url' : '/{entityName }' } # type: ignore
182
182
183
183
async def delete (
184
184
self ,
185
- queue_name : str ,
185
+ entity_name : str ,
186
186
api_version : Optional [str ] = "2017_04" ,
187
187
** kwargs
188
188
) -> object :
189
- """Delete the Queue with the given queueName .
189
+ """Delete the Queue or Topic with the given entityName .
190
190
191
- Delete Queue.
191
+ Delete Queue or Topic .
192
192
193
- :param queue_name : The name of the queue relative to the Service Bus namespace.
194
- :type queue_name : str
193
+ :param entity_name : The name of the queue or topic relative to the Service Bus namespace.
194
+ :type entity_name : str
195
195
:param api_version: Api Version.
196
196
:type api_version: str
197
197
:keyword callable cls: A custom type or function that will be passed the direct response
@@ -207,7 +207,7 @@ async def delete(
207
207
url = self .delete .metadata ['url' ] # type: ignore
208
208
path_format_arguments = {
209
209
'endpoint' : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , 'str' , skip_quote = True ),
210
- 'queueName ' : self ._serialize .url ("queue_name " , queue_name , 'str' , min_length = 1 ),
210
+ 'entityName ' : self ._serialize .url ("entity_name " , entity_name , 'str' , min_length = 1 ),
211
211
}
212
212
url = self ._client .format_url (url , ** path_format_arguments )
213
213
@@ -236,4 +236,4 @@ async def delete(
236
236
return cls (pipeline_response , deserialized , {})
237
237
238
238
return deserialized
239
- delete .metadata = {'url' : '/{queueName }' } # type: ignore
239
+ delete .metadata = {'url' : '/{entityName }' } # type: ignore
0 commit comments