Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a366776
Beta LiveTests (#30728)
l0lawrence Aug 25, 2023
835aa5f
[EGv2] Binary mode (#32922)
l0lawrence Nov 3, 2023
f7c1d1f
[EGv2] Build Release (#30325)
l0lawrence May 19, 2023
4f00208
Beta LiveTests (#30728)
l0lawrence Aug 25, 2023
cfcf881
regen
l0lawrence Oct 31, 2023
3bb49cf
new api version
l0lawrence Oct 31, 2023
921ad51
samples for new features
l0lawrence Oct 31, 2023
af75e64
update test-resources.json
l0lawrence Oct 31, 2023
f491579
update operation samples
l0lawrence Oct 31, 2023
851d112
add samples
l0lawrence Nov 1, 2023
052f431
more sample
l0lawrence Nov 1, 2023
7e52f8c
update tests
l0lawrence Nov 2, 2023
9299c34
add mros
l0lawrence Nov 2, 2023
8b4261d
gen
l0lawrence Nov 2, 2023
657d2de
fix changelog
l0lawrence Nov 3, 2023
af257bf
update tests
l0lawrence Nov 3, 2023
2658379
update preparer
l0lawrence Nov 3, 2023
560e961
point at canary until release
l0lawrence Nov 3, 2023
bdcbb01
update test deployment area
l0lawrence Nov 3, 2023
003ee06
update
l0lawrence Nov 3, 2023
1004f8c
add
l0lawrence Nov 3, 2023
8f7cf6c
try this tests
l0lawrence Nov 5, 2023
a22d999
update samples
l0lawrence Nov 5, 2023
6ae5fd3
livetest mark
l0lawrence Nov 5, 2023
0a509c3
update tests
l0lawrence Nov 5, 2023
22677cd
eastus working?
l0lawrence Nov 5, 2023
64faa0d
regen - removed azure refs in gen code
l0lawrence Nov 6, 2023
a003a09
update comments
l0lawrence Nov 6, 2023
d012ab1
add other sample
l0lawrence Nov 6, 2023
d3291b2
update
l0lawrence Nov 6, 2023
aaa8629
remove stream - no response
l0lawrence Nov 7, 2023
c3dd323
update version and date for release
l0lawrence Nov 9, 2023
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
Prev Previous commit
Next Next commit
regen
  • Loading branch information
l0lawrence committed Nov 8, 2023
commit cfcf88172e8fb9da47db4b5acf421d3c55f13e99
13 changes: 9 additions & 4 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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 EventGridClientConfiguration
Expand All @@ -32,7 +33,7 @@ class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client
: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
"2023-06-01-preview". Note that overriding this default value may result in unsupported
"2023-10-01-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
Expand All @@ -45,7 +46,11 @@ def __init__(
) -> None:
_endpoint = '{endpoint}'
self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **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()
Expand All @@ -54,7 +59,7 @@ def __init__(

def send_request(
self,
request: HttpRequest,
request: HttpRequest, *, stream: bool = False,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -80,7 +85,7 @@ def send_request(
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self) -> None:
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from typing import Any, TYPE_CHECKING, Union

from azure.core.configuration import Configuration
from azure.core.credentials import AzureKeyCredential
from azure.core.pipeline import policies

Expand All @@ -19,9 +18,7 @@
from azure.core.credentials import TokenCredential


class EventGridClientConfiguration( # pylint: disable=too-many-instance-attributes,name-too-long
Configuration
):
class EventGridClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for EventGridClient.

Note that all parameters used to create this instance are saved as instance
Expand All @@ -35,7 +32,7 @@ class EventGridClientConfiguration( # pylint: disable=too-many-instance-attri
: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
"2023-06-01-preview". Note that overriding this default value may result in unsupported
"2023-10-01-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
Expand All @@ -46,8 +43,7 @@ def __init__(
credential: Union[AzureKeyCredential, "TokenCredential"],
**kwargs: Any
) -> None:
super(EventGridClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop('api_version', "2023-06-01-preview")
api_version: str = kwargs.pop('api_version', "2023-10-01-preview")

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand All @@ -59,6 +55,7 @@ def __init__(
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://eventgrid.azure.net/.default'])
kwargs.setdefault('sdk_moniker', 'eventgrid/{}'.format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _infer_policy(self, **kwargs):
Expand All @@ -77,9 +74,9 @@ def _configure(
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.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = self._infer_policy(**kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.
if exclude_readonly:
readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)]
for k, v in self.items():
if exclude_readonly and k in readonly_props: # pyright: reportUnboundVariable=false
if exclude_readonly and k in readonly_props: # pyright: ignore[reportUnboundVariable]
continue
result[k] = Model._as_dict_value(v, exclude_readonly=exclude_readonly)
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._patch import EventGridClientOperationsMixin
from ._operations import EventGridClientOperationsMixin

from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
Expand Down
Loading