-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[EG] GA Namespaces #35831
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
[EG] GA Namespaces #35831
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
2a2b28c
[EGv2] Build Release (#30325)
l0lawrence 0cf20d1
link to samples
l0lawrence 9f2feda
remove comment
l0lawrence 626393c
remove uneeded test
l0lawrence 0d92b59
[EGv2] doc updates (#30483)
l0lawrence 4487000
[EGv2] Eg typing/formatting (#30492)
l0lawrence 66cb39d
Beta LiveTests (#30728)
l0lawrence 5ce8776
[EGv2] generate with newer emitter (#31962)
l0lawrence 211d80f
[EGv2] Binary mode (#32922)
l0lawrence 3129eb9
[EventGrid] Ignite Release generate with new typespec (#32652)
l0lawrence 2808655
update for release
l0lawrence 285d5f5
add changelog
l0lawrence 0fff786
[EG] Regenerate beta (#35014)
l0lawrence 9123ac0
[EG] Beta One Client (#34973)
l0lawrence c1e2e67
[EG] Docstring/update changelog (#35108)
l0lawrence f1cb640
update readme (#35147)
l0lawrence 49d46d4
beta version
l0lawrence f48ab90
[EG] Readme updates (#35152)
l0lawrence 47fc92e
type error to value error (#35164)
l0lawrence 2950192
[EG] rename release_delay (#35172)
l0lawrence 7ddd0e5
[EG] regenerate to fix gen code bug (#35327)
l0lawrence 303fc88
ver (#35345)
l0lawrence ba8a71f
typo (#35348)
l0lawrence e6b05cb
typo (#35351)
l0lawrence 6186af3
[EG] Archboard Feedback (#35738)
l0lawrence 7181462
[EG] Update tests (#35833)
l0lawrence 3b603cf
Merge branch 'main' into feature/eventgrid
l0lawrence 66bafef
remove print (#35855)
l0lawrence 6e4a87f
Merge branch 'main' into feature/eventgrid
l0lawrence 6190bde
[EG] update pyproject and samples (#35857)
l0lawrence 14bfdaf
update readme + version
l0lawrence bd91117
regen
l0lawrence 6a821f3
Update scripts/devops_tasks/test_run_samples.py
l0lawrence 9a80b90
readme
l0lawrence 88e1a09
typo
l0lawrence 3dd74c3
update
l0lawrence 77abc56
add tests
l0lawrence 1b85d9e
updates tests 2
l0lawrence 1b9ed9b
Revert "updates tests 2"
l0lawrence 06d4bef
try
l0lawrence e74d7b4
typeError
l0lawrence a56bf9e
missing await
l0lawrence 1cd9f27
unused import
l0lawrence 4909e83
test rbac (#35953)
l0lawrence eea5393
readme updates
l0lawrence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| recursive-include tests *.py *.yaml | ||
| recursive-include samples *.py | ||
| include *.md | ||
| include LICENSE | ||
| include azure/__init__.py | ||
| include azure/eventgrid/py.typed | ||
| recursive-include tests *.py | ||
| recursive-include samples *.py *.md | ||
| include azure/__init__.py |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore | ||
| __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
sdk/eventgrid/azure-eventgrid/azure/eventgrid/_client.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # Code generated by Microsoft (R) Python Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from copy import deepcopy | ||
| from typing import Any, TYPE_CHECKING, Union | ||
|
|
||
| from azure.core import PipelineClient | ||
| from azure.core.credentials import AzureKeyCredential | ||
| from azure.core.pipeline import policies | ||
| from azure.core.rest import HttpRequest, HttpResponse | ||
|
|
||
| from ._configuration import EventGridConsumerClientConfiguration, EventGridPublisherClientConfiguration | ||
| from ._operations import EventGridConsumerClientOperationsMixin, EventGridPublisherClientOperationsMixin | ||
| from ._serialization import Deserializer, Serializer | ||
|
|
||
| if TYPE_CHECKING: | ||
| # pylint: disable=unused-import,ungrouped-imports | ||
| from azure.core.credentials import TokenCredential | ||
|
|
||
|
|
||
| class EventGridPublisherClient( | ||
| EventGridPublisherClientOperationsMixin | ||
| ): # pylint: disable=client-accepts-api-version-keyword | ||
| """EventGridPublisherClient. | ||
|
|
||
| :param endpoint: The host name of the namespace, e.g. | ||
| namespaceName1.westus-1.eventgrid.azure.net. Required. | ||
| :type endpoint: str | ||
| :param credential: Credential used to authenticate requests to the service. Is either a | ||
| AzureKeyCredential type or a TokenCredential type. Required. | ||
| :type credential: ~azure.core.credentials.AzureKeyCredential or | ||
| ~azure.core.credentials.TokenCredential | ||
| :keyword api_version: The API version to use for this operation. Default value is "2024-06-01". | ||
| Note that overriding this default value may result in unsupported behavior. | ||
| :paramtype api_version: str | ||
| """ | ||
|
|
||
| def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: | ||
| _endpoint = "{endpoint}" | ||
| self._config = EventGridPublisherClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) | ||
| _policies = kwargs.pop("policies", None) | ||
| if _policies is None: | ||
| _policies = [ | ||
| policies.RequestIdPolicy(**kwargs), | ||
| self._config.headers_policy, | ||
| self._config.user_agent_policy, | ||
| self._config.proxy_policy, | ||
| policies.ContentDecodePolicy(**kwargs), | ||
| self._config.redirect_policy, | ||
| self._config.retry_policy, | ||
| self._config.authentication_policy, | ||
| self._config.custom_hook_policy, | ||
| self._config.logging_policy, | ||
| policies.DistributedTracingPolicy(**kwargs), | ||
| policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, | ||
| self._config.http_logging_policy, | ||
| ] | ||
| self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) | ||
|
|
||
| self._serialize = Serializer() | ||
| self._deserialize = Deserializer() | ||
| self._serialize.client_side_validation = False | ||
|
|
||
| def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: | ||
| """Runs the network request through the client's chained policies. | ||
|
|
||
| >>> from azure.core.rest import HttpRequest | ||
| >>> request = HttpRequest("GET", "https://www.example.org/") | ||
| <HttpRequest [GET], url: 'https://www.example.org/'> | ||
| >>> response = client.send_request(request) | ||
| <HttpResponse: 200 OK> | ||
|
|
||
| For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request | ||
|
|
||
| :param request: The network request you want to make. Required. | ||
| :type request: ~azure.core.rest.HttpRequest | ||
| :keyword bool stream: Whether the response payload will be streamed. Defaults to False. | ||
| :return: The response of your network call. Does not do error handling on your response. | ||
| :rtype: ~azure.core.rest.HttpResponse | ||
| """ | ||
|
|
||
| request_copy = deepcopy(request) | ||
| path_format_arguments = { | ||
| "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), | ||
| } | ||
|
|
||
| request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) | ||
| return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore | ||
|
|
||
| def close(self) -> None: | ||
| self._client.close() | ||
|
|
||
| def __enter__(self) -> "EventGridPublisherClient": | ||
| self._client.__enter__() | ||
| return self | ||
|
|
||
| def __exit__(self, *exc_details: Any) -> None: | ||
| self._client.__exit__(*exc_details) | ||
|
|
||
|
|
||
| class EventGridConsumerClient( | ||
| EventGridConsumerClientOperationsMixin | ||
| ): # pylint: disable=client-accepts-api-version-keyword | ||
| """EventGridConsumerClient. | ||
|
|
||
| :param endpoint: The host name of the namespace, e.g. | ||
| namespaceName1.westus-1.eventgrid.azure.net. Required. | ||
| :type endpoint: str | ||
| :param credential: Credential used to authenticate requests to the service. Is either a | ||
| AzureKeyCredential type or a TokenCredential type. Required. | ||
| :type credential: ~azure.core.credentials.AzureKeyCredential or | ||
| ~azure.core.credentials.TokenCredential | ||
| :keyword api_version: The API version to use for this operation. Default value is "2024-06-01". | ||
| Note that overriding this default value may result in unsupported behavior. | ||
| :paramtype api_version: str | ||
| """ | ||
|
|
||
| def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: | ||
| _endpoint = "{endpoint}" | ||
| self._config = EventGridConsumerClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) | ||
| _policies = kwargs.pop("policies", None) | ||
| if _policies is None: | ||
| _policies = [ | ||
| policies.RequestIdPolicy(**kwargs), | ||
| self._config.headers_policy, | ||
| self._config.user_agent_policy, | ||
| self._config.proxy_policy, | ||
| policies.ContentDecodePolicy(**kwargs), | ||
| self._config.redirect_policy, | ||
| self._config.retry_policy, | ||
| self._config.authentication_policy, | ||
| self._config.custom_hook_policy, | ||
| self._config.logging_policy, | ||
| policies.DistributedTracingPolicy(**kwargs), | ||
| policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, | ||
| self._config.http_logging_policy, | ||
| ] | ||
| self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) | ||
|
|
||
| self._serialize = Serializer() | ||
| self._deserialize = Deserializer() | ||
| self._serialize.client_side_validation = False | ||
|
|
||
| def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: | ||
| """Runs the network request through the client's chained policies. | ||
|
|
||
| >>> from azure.core.rest import HttpRequest | ||
| >>> request = HttpRequest("GET", "https://www.example.org/") | ||
| <HttpRequest [GET], url: 'https://www.example.org/'> | ||
| >>> response = client.send_request(request) | ||
| <HttpResponse: 200 OK> | ||
|
|
||
| For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request | ||
|
|
||
| :param request: The network request you want to make. Required. | ||
| :type request: ~azure.core.rest.HttpRequest | ||
| :keyword bool stream: Whether the response payload will be streamed. Defaults to False. | ||
| :return: The response of your network call. Does not do error handling on your response. | ||
| :rtype: ~azure.core.rest.HttpResponse | ||
| """ | ||
|
|
||
| request_copy = deepcopy(request) | ||
| path_format_arguments = { | ||
| "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), | ||
| } | ||
|
|
||
| request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) | ||
| return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore | ||
|
|
||
| def close(self) -> None: | ||
| self._client.close() | ||
|
|
||
| def __enter__(self) -> "EventGridConsumerClient": | ||
| self._client.__enter__() | ||
| return self | ||
|
|
||
| def __exit__(self, *exc_details: Any) -> None: | ||
| self._client.__exit__(*exc_details) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.