-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[EGv2] Build Release #30325
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
l0lawrence
merged 95 commits into
Azure:feature/eventgrid
from
l0lawrence:llaw/build_eventgrid
May 19, 2023
Merged
[EGv2] Build Release #30325
Changes from 86 commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
a25793b
move old sdk under legacy
l0lawrence ad72024
gen typespec code
l0lawrence f81c227
naming changes from archboard
l0lawrence 486735f
samples
l0lawrence 1fa0d92
update patch naming
l0lawrence e284adf
update imports with new gen
l0lawrence 5efd365
update samples
l0lawrence aebdf0c
update client naming on aio
l0lawrence 276d51a
update receive op
l0lawrence 81161a8
update async to close client
l0lawrence d419cf2
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
l0lawrence 32efd54
update receive()
l0lawrence b1eeca8
update gen code
l0lawrence 5634655
moving around samples
l0lawrence 36976bd
updating samples
l0lawrence 328a71a
update samples
l0lawrence ba088a2
update patch and samples
l0lawrence bdf3bc0
patch internalmodels
l0lawrence 57c6ada
spacing
l0lawrence 4100767
updating model patch
l0lawrence 69a61e1
update patch models
l0lawrence 594ba71
add both models back
l0lawrence abd97bc
update docstring
l0lawrence cb4d9a2
update docs
l0lawrence 3429e60
updating patch for receive
l0lawrence 9d7cf66
old EG models
l0lawrence 199542a
add reject samples
l0lawrence 8f77e83
patch
l0lawrence a31e9fa
update format
l0lawrence 710f8c3
update patch
l0lawrence bdec4b8
eventgrid_client exceptions
l0lawrence 5bca49d
update test imports
l0lawrence b9a4d6f
update total sample
l0lawrence b0e50c3
receive patch fix
l0lawrence 135b0c7
add in more tests
l0lawrence 19573e2
update test file
l0lawrence 24b2535
remove locktoken model
l0lawrence 9a12471
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
l0lawrence dc2d26c
remove LockToken in patch
l0lawrence cec8bd0
remove event delivery delay
l0lawrence a26c1e7
eg client exceptions
l0lawrence cf80540
.8.5 generation, and deliveryCount
l0lawrence c1f1ae7
rename sample
l0lawrence 8538458
update version for beta
l0lawrence 4e7b141
changelog
l0lawrence 7713d3b
updating for gen
l0lawrence e9eab96
regen
l0lawrence 36ac074
generate via commit
l0lawrence b58773e
publish result
l0lawrence 459b403
fix docstring
l0lawrence e091bb9
publish docstring
l0lawrence eb50871
return type
l0lawrence 1edd9ac
publish result
l0lawrence 7fb9946
return publish result -- is none
l0lawrence f1f18f5
format
l0lawrence 1646322
update Publish result model
l0lawrence 0da1768
deliverycount patch
l0lawrence 7ef5bbe
update from main
l0lawrence 07da8c7
Merge branch 'feature/eventgrid' of https://github.com/Azure/azure-sd…
l0lawrence ed4c53c
add copyright
l0lawrence da155ae
added to readme
l0lawrence 11708ec
remove from readme
l0lawrence 6acc4bc
force publish_result response
l0lawrence 5c97aed
update patch tp unindent
l0lawrence 994ab41
cspell
l0lawrence 060c9ce
update mypy.ini
l0lawrence d72039c
import order
l0lawrence e16a255
mark livetest
l0lawrence df0430f
update operations init
l0lawrence 830fd1d
rename async
l0lawrence 30bc939
mypy
l0lawrence fb0479e
ignore mypy
l0lawrence 2a050e1
pylint
l0lawrence 26dfdef
pylint
l0lawrence 37e7341
ignore pylint for now to avoid gen code errors
l0lawrence 99bbe93
ignore samples until ARM setup
l0lawrence bcf7d34
update patches
l0lawrence 4927ac1
remove publish result
l0lawrence 4bde87e
remove PublishResult
l0lawrence 78605f2
remove publishresult
l0lawrence b050474
comma
l0lawrence e0ff0ed
update publishResult
l0lawrence 34ff7a3
Merge branch 'llaw/build_eventgrid' of https://github.com/l0lawrence/…
l0lawrence 4f26e01
change to .value
l0lawrence 80f0384
gen code " to '
l0lawrence 58b4d7e
remove comment
l0lawrence fea7384
ran black
l0lawrence c557de0
update changelog
l0lawrence 522e90c
update sample readme
l0lawrence 7349da4
gen code without query name
l0lawrence 204a6d6
gen code
l0lawrence adb9f45
update tsp commit
l0lawrence 0fdc51f
remove publishresult
l0lawrence 1442893
readme disclaimer
l0lawrence b820027
update changelog
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
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 |
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
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,87 @@ | ||
| # 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. | ||
swathipil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from copy import deepcopy | ||
| from typing import Any | ||
|
|
||
| from azure.core import PipelineClient | ||
| from azure.core.credentials import AzureKeyCredential | ||
| from azure.core.rest import HttpRequest, HttpResponse | ||
|
|
||
| from ._configuration import EventGridClientConfiguration | ||
| from ._operations import EventGridClientOperationsMixin | ||
| from ._serialization import Deserializer, Serializer | ||
|
|
||
| class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword | ||
| """Azure Messaging EventGrid Client. | ||
|
|
||
| :param endpoint: The host name of the namespace, e.g. | ||
| namespaceName1.westus-1.eventgrid.azure.net. Required. | ||
| :type endpoint: str | ||
| :param credential: Credential needed for the client to connect to Azure. Required. | ||
| :type credential: ~azure.core.credentials.AzureKeyCredential | ||
| :keyword api_version: The API version to use for this operation. Default value is | ||
| "2023-06-01-preview". Note that overriding this default value may result in unsupported | ||
| behavior. | ||
| :paramtype api_version: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint: str, | ||
| credential: AzureKeyCredential, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| _endpoint = '{endpoint}' | ||
| self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) | ||
| self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) | ||
|
|
||
| self._serialize = Serializer() | ||
| self._deserialize = Deserializer() | ||
| self._serialize.client_side_validation = False | ||
|
|
||
|
|
||
| def send_request( | ||
| self, | ||
| request: HttpRequest, | ||
| **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, **kwargs) | ||
|
|
||
| def close(self) -> None: | ||
| self._client.close() | ||
|
|
||
| def __enter__(self) -> "EventGridClient": | ||
| self._client.__enter__() | ||
| return self | ||
|
|
||
| def __exit__(self, *exc_details: Any) -> None: | ||
| self._client.__exit__(*exc_details) | ||
70 changes: 70 additions & 0 deletions
70
sdk/eventgrid/azure-eventgrid/azure/eventgrid/_configuration.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,70 @@ | ||
| # 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 typing import Any | ||
|
|
||
| from azure.core.configuration import Configuration | ||
| from azure.core.credentials import AzureKeyCredential | ||
| from azure.core.pipeline import policies | ||
|
|
||
| from ._version import VERSION | ||
|
|
||
|
|
||
| class EventGridClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes | ||
| """Configuration for EventGridClient. | ||
|
|
||
| Note that all parameters used to create this instance are saved as instance | ||
| attributes. | ||
|
|
||
| :param endpoint: The host name of the namespace, e.g. | ||
| namespaceName1.westus-1.eventgrid.azure.net. Required. | ||
| :type endpoint: str | ||
| :param credential: Credential needed for the client to connect to Azure. Required. | ||
| :type credential: ~azure.core.credentials.AzureKeyCredential | ||
| :keyword api_version: The API version to use for this operation. Default value is | ||
| "2023-06-01-preview". Note that overriding this default value may result in unsupported | ||
| behavior. | ||
| :paramtype api_version: str | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| endpoint: str, | ||
| credential: AzureKeyCredential, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| super(EventGridClientConfiguration, self).__init__(**kwargs) | ||
| api_version: str = kwargs.pop('api_version', "2023-06-01-preview") | ||
|
|
||
| if endpoint is None: | ||
| raise ValueError("Parameter 'endpoint' must not be None.") | ||
| if credential is None: | ||
| raise ValueError("Parameter 'credential' must not be None.") | ||
|
|
||
| self.endpoint = endpoint | ||
| self.credential = credential | ||
| self.api_version = api_version | ||
| kwargs.setdefault('sdk_moniker', 'eventgrid/{}'.format(VERSION)) | ||
| self._configure(**kwargs) | ||
|
|
||
|
|
||
| def _configure( | ||
| self, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
| self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
| self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
| self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
| self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) | ||
| self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
| self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
| self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
| self.authentication_policy = kwargs.get('authentication_policy') | ||
| if self.credential and not self.authentication_policy: | ||
| self.authentication_policy = policies.AzureKeyCredentialPolicy(self.credential, "SharedAccessKey", **kwargs) |
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.