Skip to content

Merge SB management client to central repo dev branch #12205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 174 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
f4a5e69
Fix pylint errors other than async-sync overrides
May 6, 2020
a213750
Restructure message/async message
May 7, 2020
cf02968
Restructure base handler sync/async
May 7, 2020
361a883
Restructure sb session sync/async
May 7, 2020
dc84d6c
Enable sb pylint
May 7, 2020
848b154
Fix mypy errors
May 7, 2020
abf2696
Enable mypy check for ServiceBus
May 7, 2020
2bbd20c
Add type hints for internal methods
May 11, 2020
a86a854
Fix a pylint disable comment
May 11, 2020
b819845
Fix a pylint error
May 12, 2020
344cbef
async ReceivedMessage extends sync ReceivedMessage directly
May 14, 2020
c856949
Change _from_connection_string to
May 14, 2020
068b83f
Remove BaseHandler
May 14, 2020
6e28814
Adjust for pylint 2.3.1
May 14, 2020
ae1dda6
Fix pylint errors
May 14, 2020
97075bc
Add swagger gen README
May 16, 2020
438febc
Kickstart new SB control client
May 16, 2020
dcc9c87
Add SB swagger file
May 16, 2020
4653614
Remove unnecessary attributes
May 16, 2020
d6fcc73
Atom swagger POC
May 21, 2020
c64ca66
Small changes
May 21, 2020
1cde437
Update CountDetails namespace
May 21, 2020
2c9b6bb
Small fixes for swagger
May 22, 2020
d8ae413
Add enrich and api-version
May 22, 2020
ef68d17
Add policy/pipeline
May 22, 2020
cae7a4c
Add enrich and api-version
May 22, 2020
043a919
Format string to date and timedelta
May 26, 2020
48f1c81
Update date data type
May 26, 2020
367d4c2
Small changes
May 26, 2020
1899eb0
Separate QueueProperties and QueueMetrics from QueueDescription
May 26, 2020
8c9a5db
Add authorization rule
May 27, 2020
c9c6deb
Add delete_queue
May 27, 2020
63b7066
Correct QueueProperties xml name to QueueDescription
May 27, 2020
9011a18
Support update and delete a queue
May 28, 2020
a8fafa9
add list queue
May 28, 2020
ca16f82
Adding Error Response and format for date.
conniey May 27, 2020
dae83d9
Remove unnecessary local names.
conniey May 27, 2020
afed3e3
Adding default response types.
conniey May 28, 2020
acc2adc
remove slash
conniey May 28, 2020
77d6084
Update based on duration feedback
conniey May 29, 2020
ad480ef
Add parameter information
conniey May 29, 2020
16ebe17
Merge pull request #1 from conniey/small-changes
YijunXieMS May 29, 2020
88f0498
Change swagger file to be compatible with Java
May 29, 2020
bde6a06
Change swagger file to be compatible with Java
May 29, 2020
562eac8
Correct path entityType param name
May 29, 2020
ceb2e30
Rename back to Description.
conniey Jun 1, 2020
96886fa
Adding if-match parameter
conniey Jun 1, 2020
6fec9e4
Change back to QueueRuntimeInfo
conniey Jun 1, 2020
28d5708
Merge pull request #2 from conniey/rename-swagger
YijunXieMS Jun 1, 2020
a7fb004
Update to QueueDescription/RuntimeInfo
YijunXieMS Jun 2, 2020
84d0ddb
Update management client folder
YijunXieMS Jun 2, 2020
6b3d0c6
Import async ServiceBusSharedKeyCredential
YijunXieMS Jun 2, 2020
d3b9e2e
Hide constants.py
YijunXieMS Jun 2, 2020
ea99b61
Remove validation when updating a queue description
YijunXieMS Jun 2, 2020
855627c
Add license header
YijunXieMS Jun 2, 2020
cbcead6
Fix pylint
YijunXieMS Jun 2, 2020
d42387a
Refactor to reuse convert from xml to obj
YijunXieMS Jun 2, 2020
352d319
Fix mypy
YijunXieMS Jun 2, 2020
b4dcc50
ignore azure.servicebus.management._generated
YijunXieMS Jun 2, 2020
e850cd8
Add aiohttp in dev req
YijunXieMS Jun 2, 2020
3368cbe
Remove debug code
YijunXieMS Jun 2, 2020
5a74f55
Remove duplicated param check
YijunXieMS Jun 2, 2020
2923f01
regroup import
YijunXieMS Jun 3, 2020
1418471
add list test
yunhaoling Jun 3, 2020
e6312db
tweak structure
yunhaoling Jun 3, 2020
8d9ec08
Put response error details into a new response error
YijunXieMS Jun 3, 2020
095dbf6
Add list_runtime_infos
YijunXieMS Jun 3, 2020
b4d6c85
Improve error handling of create queue
YijunXieMS Jun 3, 2020
afc3c76
Alphabetise definitions
conniey Jun 3, 2020
3f20506
Alphabetize parameters
conniey Jun 3, 2020
825e668
Merge pull request #4 from conniey/alphabetise_methods
YijunXieMS Jun 3, 2020
d7e32be
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 3, 2020
230f873
Initial commit of queue creation tests
KieranBrantnerMagee Jun 3, 2020
2e942fa
tweak test
yunhaoling Jun 3, 2020
fd00c1e
Merge remote-tracking branch 'yijunstream/sb_control_client' into sbt…
yunhaoling Jun 3, 2020
4319e44
Update comment on failure handling methodology.
KieranBrantnerMagee Jun 3, 2020
af398fb
Merge remote-tracking branch 'yijunstream/sb_control_client' into sbt…
yunhaoling Jun 3, 2020
8a657e7
Merge from sb_control_client main feature branch.
KieranBrantnerMagee Jun 3, 2020
f66773d
refine list tests
yunhaoling Jun 3, 2020
5674fa5
Add docstring for sync
YijunXieMS Jun 3, 2020
75d8d23
Merge branch 'sb_control_client' into kibrantn/servicebus/track2-cont…
YijunXieMS Jun 3, 2020
ea8750f
Merge pull request #5 from KieranBrantnerMagee/kibrantn/servicebus/tr…
YijunXieMS Jun 3, 2020
c40cc2d
add delete test
yunhaoling Jun 3, 2020
1898cfd
Merge remote-tracking branch 'yijunstream/sb_control_client' into sbt…
yunhaoling Jun 3, 2020
2fa5c0c
Merge pull request #3 from yunhaoling/sbt2-mgmt-test
yunhaoling Jun 3, 2020
46d4f70
Management client sync update tests.
KieranBrantnerMagee Jun 4, 2020
e3883f4
Workaround update description deserialization
YijunXieMS Jun 4, 2020
d1b5c9c
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 4, 2020
87c8dc8
Merge branch 'sb_control_client' into kibrantn/servicebus/track2-mgmt…
YijunXieMS Jun 4, 2020
bfd5a1c
Merge pull request #6 from KieranBrantnerMagee/kibrantn/servicebus/tr…
YijunXieMS Jun 4, 2020
3ce2262
Add more QueueDescription properties in serialization
YijunXieMS Jun 4, 2020
87af1a1
Small fix
YijunXieMS Jun 4, 2020
47658b3
Add-feed.
conniey Jun 4, 2020
db78371
Merge branch 'master' into sb_control_client
YijunXieMS Jun 4, 2020
e0ffaff
Use OrderedDict instead of dict
YijunXieMS Jun 4, 2020
b428ba1
structure list related test
yunhaoling Jun 4, 2020
2c0781e
Workaround for QueueRuntimeInfo.message_count_details being None in d…
YijunXieMS Jun 4, 2020
f832828
structure list related test
yunhaoling Jun 4, 2020
9dc2f4a
re-eanble test, detail count issued fixed
yunhaoling Jun 4, 2020
6709529
merge remote
yunhaoling Jun 4, 2020
d74e607
Clean up $ref xml namespace
YijunXieMS Jun 4, 2020
96f08bd
Adding classe
conniey Jun 4, 2020
1e35f4b
Merge pull request #8 from conniey/add-feeds
YijunXieMS Jun 4, 2020
5bed9b7
Fix count details
YijunXieMS Jun 4, 2020
c4ae178
Fix a swagger error about count details
YijunXieMS Jun 4, 2020
fc54aa9
Merge remote-tracking branch 'yijunstream/sb_control_client' into sbt…
yunhaoling Jun 4, 2020
2e8e6ca
add get_runtime_info test
yunhaoling Jun 4, 2020
2964b85
Merge pull request #7 from yunhaoling/sbt2-mgmt-test
yunhaoling Jun 5, 2020
abc75f6
Merge QueueRuntimeInfo to QueueDescription
YijunXieMS Jun 5, 2020
8195300
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 5, 2020
bb6da2a
Adjust AuthorizationRule
YijunXieMS Jun 5, 2020
b61db52
Move tests into proper folder structure
KieranBrantnerMagee Jun 5, 2020
12e4f3e
Merge from upstream sb_control_client
KieranBrantnerMagee Jun 5, 2020
8ec96eb
Fix tests by adjust import paths and valid update parameters
KieranBrantnerMagee Jun 5, 2020
e3fd00a
Merge pull request #9 from KieranBrantnerMagee/kibrantn/servicebus/tr…
YijunXieMS Jun 5, 2020
23da37e
Updated models from swagger
YijunXieMS Jun 5, 2020
454feb6
Add convenience layer model for QueueDescription and QueueRuntimeInfo
YijunXieMS Jun 5, 2020
572b08c
Updated models from swagger
YijunXieMS Jun 5, 2020
5947bd4
Correct import
YijunXieMS Jun 5, 2020
40f5036
Bug fixing
YijunXieMS Jun 5, 2020
50af5ad
Update API version to 2017-04
YijunXieMS Jun 5, 2020
97357e7
Fix code review feedback
YijunXieMS Jun 5, 2020
c58777a
max_size_in_megabytes can be multiplied
YijunXieMS Jun 5, 2020
89d46a2
Update keyword arguments
YijunXieMS Jun 5, 2020
786022f
Add link array.
conniey Jun 5, 2020
3e88c0b
Clean up convenience layer model
YijunXieMS Jun 5, 2020
51e93b7
Add description to AuthorizationRule
YijunXieMS Jun 5, 2020
3090a1d
Merge pull request #10 from conniey/add-pagination
YijunXieMS Jun 5, 2020
f2d39d8
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 5, 2020
14f1a3c
Java added pagination. No impact to Python.
YijunXieMS Jun 5, 2020
0ce80a6
Update README target namespace
YijunXieMS Jun 5, 2020
c8e0270
Only install aiphttp when python > 3.5
YijunXieMS Jun 5, 2020
be949c1
skip ServiceBus swagger README validation
YijunXieMS Jun 5, 2020
0639e24
Make AuthorizationRule.type attribute=true
YijunXieMS Jun 5, 2020
a5321e3
Make AuthorizationRule.type attribute=true
YijunXieMS Jun 5, 2020
05968e4
Update PR feedback
YijunXieMS Jun 5, 2020
30f62d1
small fixes
YijunXieMS Jun 5, 2020
f13d137
Add azure-core and update msrest version in servicebus dependency
YijunXieMS Jun 5, 2020
058772a
Fix live test code problem
YijunXieMS Jun 5, 2020
ef00018
Add live test recordings
YijunXieMS Jun 5, 2020
9b50f0e
Add msrest dependency
YijunXieMS Jun 5, 2020
9b7fd6d
small fix
YijunXieMS Jun 5, 2020
b10e500
Fix recordings replay problem
YijunXieMS Jun 6, 2020
4bb315f
add async recordings
YijunXieMS Jun 6, 2020
80170b6
Remove QueueDescriptionResponse
conniey Jun 8, 2020
b5cee14
Fix spelling mistake.
conniey Jun 8, 2020
02a0809
Merge pull request #12 from conniey/remove-queue-response
YijunXieMS Jun 8, 2020
eb33edb
Merge branch 'master' into sb_control_client
YijunXieMS Jun 8, 2020
ef95a67
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 8, 2020
bd7e9b4
Clean up for python deserialization
YijunXieMS Jun 10, 2020
820429b
Add Topic models and operations to swagger
YijunXieMS Jun 10, 2020
454330f
paging and topic
YijunXieMS Jun 10, 2020
55f68fe
Adjust QueueDescription properties order
YijunXieMS Jun 11, 2020
75e8a11
Add draft subscription
YijunXieMS Jun 11, 2020
34d3668
Remove rule description temp
YijunXieMS Jun 11, 2020
57672c4
Add rules
YijunXieMS Jun 11, 2020
8e81094
Add management APIs
YijunXieMS Jun 12, 2020
2a09c04
add management properties
YijunXieMS Jun 12, 2020
87cae66
end of 06/12
YijunXieMS Jun 13, 2020
2e4c898
Add namespaceInfo response.
conniey Jun 12, 2020
15b83bc
Update properties on NamespaceInfo
conniey Jun 16, 2020
0172300
Add proper types to namespace.
conniey Jun 16, 2020
3bf3d3e
Remove ResponseTitle
conniey Jun 16, 2020
fca5c82
Update Properties of CorrelationFilter
YijunXieMS Jun 16, 2020
ecd1bf2
Merge pull request #13 from conniey/add-namespace
YijunXieMS Jun 16, 2020
ee15876
Merge branch 'sb_control_client' of github.com:YijunXieMS/azure-sdk-f…
YijunXieMS Jun 16, 2020
9a56c59
Move swagger file to repo azure-rest-api-specs-pr
YijunXieMS Jun 24, 2020
5dd12dc
Day end 06/23/2020
YijunXieMS Jun 24, 2020
b22233a
Add content-length to header
YijunXieMS Jun 25, 2020
6418e77
Update model workaround
YijunXieMS Jun 25, 2020
e5a9840
Move async to new directory
YijunXieMS Jun 25, 2020
6482e9a
Move async management client
YijunXieMS Jun 25, 2020
f683910
xml tag title type changed from str to object
YijunXieMS Jun 25, 2020
6ae07b6
Small fixes
YijunXieMS Jun 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from typing import cast, Union
from xml.etree.ElementTree import ElementTree


try:
import urllib.parse as urlparse
except ImportError:
import urlparse # python 2.7

from azure.servicebus.management import _constants as constants
from ...management._handle_response_error import _handle_response_error


async def extract_data_template(feed_class, convert, feed_element):
deserialized = feed_class.deserialize(feed_element)
list_of_qd = [convert(x) if convert else x for x in deserialized.entry]
next_link = None
if deserialized.link and len(deserialized.link) == 2:
next_link = deserialized.link[1].href
return next_link, iter(list_of_qd)


async def get_next_template(list_func, *args, **kwargs):
if len(args) > 0:
next_link = args[0]
else:
next_link = kwargs.pop("next_link")

start_index = kwargs.pop("start_index", 0)
max_page_size = kwargs.pop("max_page_size", 100)
api_version = constants.API_VERSION
if next_link:
queries = urlparse.parse_qs(urlparse.urlparse(next_link).query)
start_index = int(queries['$skip'][0])
max_page_size = int(queries['$top'][0])
api_version = queries['api-version'][0]
with _handle_response_error():
feed_element = cast(
ElementTree,
await list_func(
skip=start_index, top=max_page_size,
api_version=api_version,
**kwargs
)
)
return feed_element
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@

from ._management_client import ServiceBusManagementClient
from ._generated.models import AuthorizationRule, MessageCountDetails, \
AccessRights, EntityAvailabilityStatus, EntityStatus
from ._models import QueueRuntimeInfo, QueueDescription
AccessRights, EntityAvailabilityStatus, EntityStatus, \
NamespaceProperties, MessagingSku, NamespaceType

from ._models import QueueRuntimeInfo, QueueDescription, TopicRuntimeInfo, TopicDescription, \
SubscriptionDescription, SubscriptionRuntimeInfo, RuleDescription, \
TrueRuleFilter, FalseRuleFilter, SqlRuleFilter, CorrelationRuleFilter, \
SqlRuleAction

__all__ = [
"ServiceBusManagementClient",
'ServiceBusManagementClient',
'AuthorizationRule',
'MessageCountDetails',
'QueueDescription',
'QueueRuntimeInfo',
'TopicDescription',
'TopicRuntimeInfo',
'SubscriptionDescription',
'SubscriptionRuntimeInfo',
'AccessRights',
'EntityAvailabilityStatus',
'EntityStatus',
'RuleDescription',
'CorrelationRuleFilter', 'SqlRuleFilter', 'TrueRuleFilter', 'FalseRuleFilter',
'SqlRuleAction',
'NamespaceProperties', 'MessagingSku', 'NamespaceType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
TITLE_TAG = "{http://www.w3.org/2005/Atom}title"

ENTITY_TYPE_QUEUES = "queues"
ENTITY_TYPE_TOPICS = "topics"
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@
from typing import Any, Optional

from ._configuration import ServiceBusManagementClientConfiguration
from .operations import QueueOperations
from .operations import EntityOperations
from .operations import ServiceBusManagementClientOperationsMixin
from .operations import SubscriptionOperations
from .operations import RuleOperations
from .operations import NamespaceOperations
from . import models


class ServiceBusManagementClient(ServiceBusManagementClientOperationsMixin):
"""Azure Service Bus client for managing Queues, Topics, and Subscriptions.

:ivar queue: QueueOperations operations
:vartype queue: azure.servicebus.management._generated.operations.QueueOperations
:ivar entity: EntityOperations operations
:vartype entity: azure.servicebus.management._generated.operations.EntityOperations
:ivar subscription: SubscriptionOperations operations
:vartype subscription: azure.servicebus.management._generated.operations.SubscriptionOperations
:ivar rule: RuleOperations operations
:vartype rule: azure.servicebus.management._generated.operations.RuleOperations
:ivar namespace: NamespaceOperations operations
:vartype namespace: azure.servicebus.management._generated.operations.NamespaceOperations
:param endpoint: The Service Bus fully qualified domain name.
:type endpoint: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -45,7 +54,13 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.queue = QueueOperations(
self.entity = EntityOperations(
self._client, self._config, self._serialize, self._deserialize)
self.subscription = SubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.rule = RuleOperations(
self._client, self._config, self._serialize, self._deserialize)
self.namespace = NamespaceOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@
from msrest import Deserializer, Serializer

from ._configuration_async import ServiceBusManagementClientConfiguration
from .operations_async import QueueOperations
from .operations_async import EntityOperations
from .operations_async import ServiceBusManagementClientOperationsMixin
from .operations_async import SubscriptionOperations
from .operations_async import RuleOperations
from .operations_async import NamespaceOperations
from .. import models


class ServiceBusManagementClient(ServiceBusManagementClientOperationsMixin):
"""Azure Service Bus client for managing Queues, Topics, and Subscriptions.

:ivar queue: QueueOperations operations
:vartype queue: azure.servicebus.management._generated.aio.operations_async.QueueOperations
:ivar entity: EntityOperations operations
:vartype entity: azure.servicebus.management._generated.aio.operations_async.EntityOperations
:ivar subscription: SubscriptionOperations operations
:vartype subscription: azure.servicebus.management._generated.aio.operations_async.SubscriptionOperations
:ivar rule: RuleOperations operations
:vartype rule: azure.servicebus.management._generated.aio.operations_async.RuleOperations
:ivar namespace: NamespaceOperations operations
:vartype namespace: azure.servicebus.management._generated.aio.operations_async.NamespaceOperations
:param endpoint: The Service Bus fully qualified domain name.
:type endpoint: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -40,7 +49,13 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.queue = QueueOperations(
self.entity = EntityOperations(
self._client, self._config, self._serialize, self._deserialize)
self.subscription = SubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.rule = RuleOperations(
self._client, self._config, self._serialize, self._deserialize)
self.namespace = NamespaceOperations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._queue_operations_async import QueueOperations
from ._entity_operations_async import EntityOperations
from ._service_bus_management_client_operations_async import ServiceBusManagementClientOperationsMixin
from ._subscription_operations_async import SubscriptionOperations
from ._rule_operations_async import RuleOperations
from ._namespace_operations_async import NamespaceOperations

__all__ = [
'QueueOperations',
'EntityOperations',
'ServiceBusManagementClientOperationsMixin',
'SubscriptionOperations',
'RuleOperations',
'NamespaceOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class QueueOperations:
"""QueueOperations async operations.
class EntityOperations:
"""EntityOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
Expand All @@ -41,17 +41,17 @@ def __init__(self, client, config, serializer, deserializer) -> None:

async def get(
self,
queue_name: str,
entity_name: str,
enrich: Optional[bool] = False,
api_version: Optional[str] = "2017_04",
**kwargs
) -> object:
"""Get the details about the Queue with the given queueName.
"""Get the details about the Queue or Topic with the given entityName.

Get Queue.
Get Queue or Topic.

:param queue_name: The name of the queue relative to the Service Bus namespace.
:type queue_name: str
:param entity_name: The name of the queue or topic relative to the Service Bus namespace.
:type entity_name: str
:param enrich: A query parameter that sets enrich to true or false.
:type enrich: bool
:param api_version: Api Version.
Expand All @@ -69,7 +69,7 @@ async def get(
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
'entityName': self._serialize.url("entity_name", entity_name, 'str', min_length=1),
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -100,21 +100,21 @@ async def get(
return cls(pipeline_response, deserialized, {})

return deserialized
get.metadata = {'url': '/{queueName}'} # type: ignore
get.metadata = {'url': '/{entityName}'} # type: ignore

async def put(
self,
queue_name: str,
entity_name: str,
request_body: object,
api_version: Optional[str] = "2017_04",
if_match: Optional[str] = None,
**kwargs
) -> object:
"""Create or update a queue at the provided queuePath.
"""Create or update a queue or topic at the provided entityName.

:param queue_name: The name of the queue relative to the Service Bus namespace.
:type queue_name: str
:param request_body: Parameters required to make or edit a queue.
:param entity_name: The name of the queue or topic relative to the Service Bus namespace.
:type entity_name: str
:param request_body: Parameters required to make or edit a queue or topic.
:type request_body: object
:param api_version: Api Version.
:type api_version: str
Expand All @@ -131,13 +131,13 @@ async def put(
cls = kwargs.pop('cls', None) # type: ClsType[object]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop("content_type", "application/xml")
content_type = kwargs.pop("content_type", "application/atom+xml")

# Construct URL
url = self.put.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
'entityName': self._serialize.url("entity_name", entity_name, 'str', min_length=1),
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -178,20 +178,20 @@ async def put(
return cls(pipeline_response, deserialized, {})

return deserialized
put.metadata = {'url': '/{queueName}'} # type: ignore
put.metadata = {'url': '/{entityName}'} # type: ignore

async def delete(
self,
queue_name: str,
entity_name: str,
api_version: Optional[str] = "2017_04",
**kwargs
) -> object:
"""Delete the Queue with the given queueName.
"""Delete the Queue or Topic with the given entityName.

Delete Queue.
Delete Queue or Topic.

:param queue_name: The name of the queue relative to the Service Bus namespace.
:type queue_name: str
:param entity_name: The name of the queue or topic relative to the Service Bus namespace.
:type entity_name: str
:param api_version: Api Version.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
Expand All @@ -207,7 +207,7 @@ async def delete(
url = self.delete.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
'entityName': self._serialize.url("entity_name", entity_name, 'str', min_length=1),
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -236,4 +236,4 @@ async def delete(
return cls(pipeline_response, deserialized, {})

return deserialized
delete.metadata = {'url': '/{queueName}'} # type: ignore
delete.metadata = {'url': '/{entityName}'} # type: ignore
Loading