Skip to content
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

[EG] GA Namespaces #35831

Merged
merged 45 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
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 May 19, 2023
0cf20d1
link to samples
l0lawrence May 22, 2023
9f2feda
remove comment
l0lawrence May 22, 2023
626393c
remove uneeded test
l0lawrence May 22, 2023
0d92b59
[EGv2] doc updates (#30483)
l0lawrence May 22, 2023
4487000
[EGv2] Eg typing/formatting (#30492)
l0lawrence May 23, 2023
66cb39d
Beta LiveTests (#30728)
l0lawrence Aug 25, 2023
5ce8776
[EGv2] generate with newer emitter (#31962)
l0lawrence Oct 5, 2023
211d80f
[EGv2] Binary mode (#32922)
l0lawrence Nov 3, 2023
3129eb9
[EventGrid] Ignite Release generate with new typespec (#32652)
l0lawrence Nov 9, 2023
2808655
update for release
l0lawrence Nov 9, 2023
285d5f5
add changelog
l0lawrence Nov 9, 2023
0fff786
[EG] Regenerate beta (#35014)
l0lawrence Mar 29, 2024
9123ac0
[EG] Beta One Client (#34973)
l0lawrence Apr 8, 2024
c1e2e67
[EG] Docstring/update changelog (#35108)
l0lawrence Apr 9, 2024
f1cb640
update readme (#35147)
l0lawrence Apr 10, 2024
49d46d4
beta version
l0lawrence Apr 10, 2024
f48ab90
[EG] Readme updates (#35152)
l0lawrence Apr 11, 2024
47fc92e
type error to value error (#35164)
l0lawrence Apr 11, 2024
2950192
[EG] rename release_delay (#35172)
l0lawrence Apr 11, 2024
7ddd0e5
[EG] regenerate to fix gen code bug (#35327)
l0lawrence Apr 24, 2024
303fc88
ver (#35345)
l0lawrence Apr 24, 2024
ba8a71f
typo (#35348)
l0lawrence Apr 24, 2024
e6b05cb
typo (#35351)
l0lawrence Apr 24, 2024
6186af3
[EG] Archboard Feedback (#35738)
l0lawrence May 30, 2024
7181462
[EG] Update tests (#35833)
l0lawrence May 31, 2024
3b603cf
Merge branch 'main' into feature/eventgrid
l0lawrence May 31, 2024
66bafef
remove print (#35855)
l0lawrence May 31, 2024
6e4a87f
Merge branch 'main' into feature/eventgrid
l0lawrence May 31, 2024
6190bde
[EG] update pyproject and samples (#35857)
l0lawrence Jun 3, 2024
14bfdaf
update readme + version
l0lawrence Jun 3, 2024
bd91117
regen
l0lawrence Jun 3, 2024
6a821f3
Update scripts/devops_tasks/test_run_samples.py
l0lawrence Jun 3, 2024
9a80b90
readme
l0lawrence Jun 3, 2024
88e1a09
typo
l0lawrence Jun 3, 2024
3dd74c3
update
l0lawrence Jun 4, 2024
77abc56
add tests
l0lawrence Jun 4, 2024
1b85d9e
updates tests 2
l0lawrence Jun 4, 2024
1b9ed9b
Revert "updates tests 2"
l0lawrence Jun 4, 2024
06d4bef
try
l0lawrence Jun 4, 2024
e74d7b4
typeError
l0lawrence Jun 4, 2024
a56bf9e
missing await
l0lawrence Jun 4, 2024
1cd9f27
unused import
l0lawrence Jun 5, 2024
4909e83
test rbac (#35953)
l0lawrence Jun 6, 2024
eea5393
readme updates
l0lawrence Jun 7, 2024
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
5 changes: 5 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"centraluseuap",
"creds",
"ctoring",
"ctxt",
"ctypes",
"curr",
"dateutil",
Expand All @@ -209,6 +210,7 @@
"dependened",
"deque",
"deserialization",
"deserializers",
"disablecov",
"distilbert",
"distilroberta",
Expand Down Expand Up @@ -297,6 +299,8 @@
"mibps",
"mgmt",
"mhsm",
"mros",
"Nify",
"mipsle",
"mktime",
"mlindex",
Expand Down Expand Up @@ -449,6 +453,7 @@
"yarl",
"SDDL",
"dacl",
"wday",
"whls",
"aiter",
"solft",
Expand Down
36 changes: 32 additions & 4 deletions sdk/eventgrid/azure-eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
# Release History

## 4.19.1 (Unreleased)
## 4.20.0 (Unreleased)

### Features Added

### Breaking Changes
### Bugs Fixed
l0lawrence marked this conversation as resolved.
Show resolved Hide resolved
### Other Changes

## 4.20.0b2 (2024-04-25)

This is a Beta of the EventGridClient

### Bugs Fixed

### Other Changes
- Fixed serialization issues with CloudEvent and CNCF Cloud Event

## 4.20.0b1 (2024-04-11)

### Features Added

- This is a Beta of the EventGridClient
- EventGridClient `send` can be used for both Event Grid Namespace Resources and Event Grid Basic Resources.
- Added a kwarg `level` in the EventGridClient constructor. The default value is `Standard` which creates a client for an Event Grid Namespace Resource.

### Breaking Changes

- Removed the `AcknowledgeOptions`,`ReleaseOptions`, `RejectOptions`, and `RenewLockOptions` models. `lock_tokens` can now be specified as a `kwarg` on the operation.
kashifkhan marked this conversation as resolved.
Show resolved Hide resolved
- Renamed `publish_cloud_events` to `send`.

## 4.19.0 (2024-04-10)

### Features Added

- Added new enum values to `SystemEventNames` related to Azure Communication Services.

### Bugs Fixed
### Breaking Changes

- Fixed a bug where the Api Version was being hardcoded to `2018-01-01` on any request sent to the service.

Expand All @@ -32,6 +50,15 @@ This version and all future versions will require Python 3.8+.
### Features Added

- Added new enums values to `SystemEventNames` related to Azure Storage and Azure VMware Solution.
## 4.17.0b1 (2023-11-09)

### Features Added

- Beta EventGridClient features were added on top of the last GA version of EventGrid.
- Added new features to the EventGridClient that supports `publish_cloud_events`, `receive_cloud_events`, `acknowledge_cloud_events` , `release_cloud_events`, and `reject_cloud_events` operations. These features include a `renew_cloud_event_locks` operation, as well as a `release_with_delay` parameter on the `release_cloud_events` operation.
- The `lock_tokens` parameter in `reject_cloud_events`, `release_cloud_events`, and `acknowledge_cloud_events` was renamed to `reject_options`, `release_options`, and `acknowledge_options`.
l0lawrence marked this conversation as resolved.
Show resolved Hide resolved
- The `binary_mode` keyword argument on `publish_cloud_events` was added to allow for binary mode support when publishing single Cloud Events.
- Added new models to support these new operations on EventGridClient.

## 4.16.0 (2023-11-08)

Expand All @@ -55,6 +82,7 @@ This version and all future versions will require Python 3.8+.

### Features Added

- Beta EventGridClient features were removed for this and future GA versions.
- Added new enum values to `SystemEventNames` related to Azure Container Services.

## 4.12.0b1 (2023-05-22)
Expand Down
6 changes: 3 additions & 3 deletions sdk/eventgrid/azure-eventgrid/MANIFEST.in
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
279 changes: 134 additions & 145 deletions sdk/eventgrid/azure-eventgrid/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/azure/__init__.py
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
25 changes: 17 additions & 8 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
# --------------------------------------------------------------------------
# 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 ._publisher_client import EventGridPublisherClient
from ._event_mappings import SystemEventNames
from ._helpers import generate_sas
from ._models import EventGridEvent
from ._patch import EventGridPublisherClient
from ._patch import EventGridConsumerClient
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"EventGridPublisherClient",
"EventGridEvent",
"generate_sas",
"SystemEventNames",
"EventGridConsumerClient",
]
__version__ = VERSION
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
183 changes: 183 additions & 0 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_client.py
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)
Loading