Skip to content

Commit

Permalink
[EG] rename release_delay (#35172)
Browse files Browse the repository at this point in the history
* rename

* valueError

* update version

* version
  • Loading branch information
l0lawrence committed Apr 22, 2024
1 parent 9e675bc commit 93330c9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 4.19.0b1 (2024-04-11)
## 4.20.0b1 (2024-04-11)

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def use_standard_only(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
if self._level == "Basic": # pylint: disable=protected-access
raise AttributeError(
raise ValueError(
"The basic client is not supported for this operation."
)
return func(self, *args, **kwargs)
Expand Down Expand Up @@ -501,15 +501,15 @@ def acknowledge_cloud_events(
@use_standard_only
@distributed_trace
@api_version_validation(
params_added_on={"2023-10-01-preview": ["release_delay_in_seconds"]},
params_added_on={"2023-10-01-preview": ["release_delay"]},
)
def release_cloud_events(
self,
topic_name: str,
subscription_name: str,
*,
lock_tokens: List[str],
release_delay_in_seconds: Optional[Union[int, _models.ReleaseDelay]] = None,
release_delay: Optional[Union[int, _models.ReleaseDelay]] = None,
**kwargs: Any,
) -> _models.ReleaseResult:
"""Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request
Expand All @@ -522,9 +522,9 @@ def release_cloud_events(
:type subscription_name: str
:keyword lock_tokens: Array of lock tokens of Cloud Events. Required.
:paramtype lock_tokens: List[str]
:keyword release_delay_in_seconds: Release cloud events with the specified delay in seconds.
:keyword release_delay: Release cloud events with the specified delay in seconds.
Known values are: 0, 10, 60, 600, and 3600. Default value is None.
:paramtype release_delay_in_seconds: int or ~azure.eventgrid.models.ReleaseDelay
:paramtype release_delay: int or ~azure.eventgrid.models.ReleaseDelay
:return: ReleaseResult. The ReleaseResult is compatible with MutableMapping
:rtype: ~azure.eventgrid.models.ReleaseResult
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -534,7 +534,7 @@ def release_cloud_events(
topic_name=topic_name,
event_subscription_name=subscription_name,
release_options=options,
release_delay_in_seconds=release_delay_in_seconds,
release_delay_in_seconds=release_delay,
**kwargs,
)

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py
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 = "4.19.0b1"
VERSION = "4.20.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,15 @@ async def acknowledge_cloud_events(
@use_standard_only
@distributed_trace_async
@api_version_validation(
params_added_on={"2023-10-01-preview": ["release_delay_in_seconds"]},
params_added_on={"2023-10-01-preview": ["release_delay"]},
)
async def release_cloud_events(
self,
topic_name: str,
subscription_name: str,
*,
lock_tokens: List[str],
release_delay_in_seconds: Optional[Union[int, _models.ReleaseDelay]] = None,
release_delay: Optional[Union[int, _models.ReleaseDelay]] = None,
**kwargs: Any,
) -> _models.ReleaseResult:
"""Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request
Expand All @@ -349,9 +349,9 @@ async def release_cloud_events(
:type subscription_name: str
:keyword lock_tokens: Array of lock tokens of Cloud Events. Required.
:paramtype lock_tokens: List[str]
:keyword release_delay_in_seconds: Release cloud events with the specified delay in seconds.
:keyword release_delay: Release cloud events with the specified delay in seconds.
Known values are: 0, 10, 60, 600, and 3600. Default value is None.
:paramtype release_delay_in_seconds: int or ~azure.eventgrid.models.ReleaseDelay
:paramtype release_delay: int or ~azure.eventgrid.models.ReleaseDelay
:return: ReleaseResult. The ReleaseResult is compatible with MutableMapping
:rtype: ~azure.eventgrid.models.ReleaseResult
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -361,7 +361,7 @@ async def release_cloud_events(
topic_name,
subscription_name,
options,
release_delay_in_seconds=release_delay_in_seconds,
release_delay_in_seconds=release_delay,
**kwargs,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def run():
release_events = await client.release_cloud_events(
topic_name=TOPIC_NAME,
subscription_name=EVENT_SUBSCRIPTION_NAME,
release_delay_in_seconds=60,
release_delay=60,
lock_tokens=lock_tokens_to_release,
)
print("Released Event:", release_events)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def run():
release_events = await client.release_cloud_events(
topic_name=TOPIC_NAME,
subscription_name=EVENT_SUBSCRIPTION_NAME,
release_delay_in_seconds=10,
release_delay=10,
lock_tokens=tokens,
)
print(release_events)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
release_events = client.release_cloud_events(
topic_name=TOPIC_NAME,
subscription_name=EVENT_SUBSCRIPTION_NAME,
release_delay_in_seconds=60,
release_delay=60,
lock_tokens=lock_tokens_to_release,
)
print("Released Event:", release_events)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
release_events = client.release_cloud_events(
topic_name=TOPIC_NAME,
subscription_name=EVENT_SUBSCRIPTION_NAME,
release_delay_in_seconds=3600,
release_delay=3600,
lock_tokens=lock_tokens,
)
print(release_events)
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/tests/test_dual_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_create_client_receive(self, level, eventgrid_endpoint, eventgrid_key, e
)

if level=="Basic":
with pytest.raises(AttributeError):
with pytest.raises(ValueError):
client.receive_cloud_events(
topic_name=eventgrid_topic_name, subscription_name=eventgrid_event_subscription_name
)
Expand Down

0 comments on commit 93330c9

Please sign in to comment.