Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/notificationhubs/azure-mgmt-notificationhubs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "7f530e3727f746e26f5b5ece8a5874daf10cc56f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/notificationhubs/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.2",
"readme": "specification/notificationhubs/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"chosen_version": "2017-04-01",
"total_api_version_list": ["2017-04-01"],
"client": {
"name": "NotificationHubsManagementClient",
"filename": "_notification_hubs_management_client",
"description": "Azure NotificationHub client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"NotificationHubsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"NotificationHubsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"namespaces": "NamespacesOperations",
"notification_hubs": "NotificationHubsOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import NotificationHubsManagementClientConfiguration
from .operations import Operations
Expand Down Expand Up @@ -66,6 +67,24 @@ def __init__(
self.notification_hubs = NotificationHubsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

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

VERSION = "7.0.0"
VERSION = "7.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -63,6 +64,23 @@ def __init__(
self.notification_hubs = NotificationHubsOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
async def check_availability(
self,
parameters: "_models.CheckAvailabilityParameters",
**kwargs
**kwargs: Any
) -> "_models.CheckAvailabilityResult":
"""Checks the availability of the given service namespace across all Azure subscriptions. This is
useful because the domain name is created based on the service namespace name.
Expand Down Expand Up @@ -107,7 +107,7 @@ async def create_or_update(
resource_group_name: str,
namespace_name: str,
parameters: "_models.NamespaceCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.NamespaceResource":
"""Creates/Updates a service namespace. Once created, this namespace's resource manifest is
immutable. This operation is idempotent.
Expand Down Expand Up @@ -178,7 +178,7 @@ async def patch(
resource_group_name: str,
namespace_name: str,
parameters: "_models.NamespacePatchParameters",
**kwargs
**kwargs: Any
) -> "_models.NamespaceResource":
"""Patches the existing namespace.

Expand Down Expand Up @@ -243,7 +243,7 @@ async def _delete_initial(
self,
resource_group_name: str,
namespace_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
Expand Down Expand Up @@ -285,7 +285,7 @@ async def begin_delete(
self,
resource_group_name: str,
namespace_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Deletes an existing namespace. This operation also removes all associated notificationHubs
under the namespace.
Expand All @@ -296,8 +296,8 @@ async def begin_delete(
:type namespace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
Expand Down Expand Up @@ -350,7 +350,7 @@ async def get(
self,
resource_group_name: str,
namespace_name: str,
**kwargs
**kwargs: Any
) -> "_models.NamespaceResource":
"""Returns the description for the specified namespace.

Expand Down Expand Up @@ -410,7 +410,7 @@ async def create_or_update_authorization_rule(
namespace_name: str,
authorization_rule_name: str,
parameters: "_models.SharedAccessAuthorizationRuleCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.SharedAccessAuthorizationRuleResource":
"""Creates an authorization rule for a namespace.

Expand Down Expand Up @@ -479,7 +479,7 @@ async def delete_authorization_rule(
resource_group_name: str,
namespace_name: str,
authorization_rule_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes a namespace authorization rule.

Expand Down Expand Up @@ -536,7 +536,7 @@ async def get_authorization_rule(
resource_group_name: str,
namespace_name: str,
authorization_rule_name: str,
**kwargs
**kwargs: Any
) -> "_models.SharedAccessAuthorizationRuleResource":
"""Gets an authorization rule for a namespace by name.

Expand Down Expand Up @@ -596,7 +596,7 @@ async def get_authorization_rule(
def list(
self,
resource_group_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.NamespaceListResult"]:
"""Lists the available namespaces within a resourceGroup.

Expand Down Expand Up @@ -666,7 +666,7 @@ async def get_next(next_link=None):

def list_all(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.NamespaceListResult"]:
"""Lists all the available namespaces within the subscription irrespective of the resourceGroups.

Expand Down Expand Up @@ -734,7 +734,7 @@ def list_authorization_rules(
self,
resource_group_name: str,
namespace_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.SharedAccessAuthorizationRuleListResult"]:
"""Gets the authorization rules for a namespace.

Expand Down Expand Up @@ -809,7 +809,7 @@ async def list_keys(
resource_group_name: str,
namespace_name: str,
authorization_rule_name: str,
**kwargs
**kwargs: Any
) -> "_models.SharedAccessAuthorizationRuleListResult":
"""Gets the Primary and Secondary ConnectionStrings to the namespace.

Expand Down Expand Up @@ -873,7 +873,7 @@ async def regenerate_keys(
namespace_name: str,
authorization_rule_name: str,
parameters: "_models.PolicykeyResource",
**kwargs
**kwargs: Any
) -> "_models.ResourceListKeys":
"""Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule.

Expand Down
Loading