Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ec73729
[EGv2] Build Release (#30325)
l0lawrence May 19, 2023
c7188d3
Beta LiveTests (#30728)
l0lawrence Aug 25, 2023
7e5003c
[EGv2] Build Release (#30325)
l0lawrence May 19, 2023
951a9d8
fix merge
l0lawrence Oct 5, 2023
69d253b
dont go to generated before binary
l0lawrence Oct 5, 2023
000e3b3
update patch
l0lawrence Oct 12, 2023
97fb553
update patches
l0lawrence Oct 12, 2023
2e7bb32
eventgrid client patch
l0lawrence Oct 12, 2023
028484f
changes
l0lawrence Oct 12, 2023
503c9e8
add
l0lawrence Oct 12, 2023
92df675
update test
l0lawrence Oct 12, 2023
c2b9eed
update tyoe checking
l0lawrence Oct 13, 2023
31f0c02
pass through binary_mode for now --
l0lawrence Oct 13, 2023
67a7279
update patch aio
l0lawrence Oct 13, 2023
54b2c43
add async func
l0lawrence Oct 16, 2023
2bcb97f
update
l0lawrence Oct 16, 2023
7a650bb
sys
l0lawrence Oct 16, 2023
db034eb
update kwargs
l0lawrence Oct 16, 2023
e83ac70
add Todo and start adding more tests
l0lawrence Oct 17, 2023
0ec4a3a
update
l0lawrence Oct 17, 2023
8647028
differentiate between binary and not
l0lawrence Oct 17, 2023
2e3b639
update binary
l0lawrence Oct 17, 2023
3a1b72a
no base64 in binary mode
l0lawrence Oct 17, 2023
110f3f1
binary
l0lawrence Oct 17, 2023
015d1f4
try JSONEncoder on everything if not str/bytes
l0lawrence Oct 18, 2023
13f0ae3
update test
l0lawrence Oct 18, 2023
79dba1b
update test
l0lawrence Oct 20, 2023
47148f5
update changes
l0lawrence Oct 23, 2023
0a1307d
whitespace
l0lawrence Oct 23, 2023
9ca6f1d
space
l0lawrence Oct 23, 2023
52845d3
remove commented
l0lawrence Oct 23, 2023
fb53f33
str serialize extensions?
l0lawrence Oct 23, 2023
74c434d
xml test
l0lawrence Oct 23, 2023
cec8eaf
encode extensions as object
l0lawrence Oct 23, 2023
08eacb6
update test
l0lawrence Oct 23, 2023
fd002c1
update extension serialization for deserialize
l0lawrence Oct 23, 2023
dec4248
move flag to operation level
l0lawrence Oct 25, 2023
4eb1876
extra comma
l0lawrence Oct 25, 2023
60ff404
dont raise httpresponse
l0lawrence Oct 25, 2023
2b17321
update patch
l0lawrence Oct 25, 2023
6fe171d
accept dict cloud events
l0lawrence Oct 26, 2023
bb8ba88
spacing
l0lawrence Oct 26, 2023
633166e
remove content_type check
l0lawrence Oct 26, 2023
3b37f20
add live test
l0lawrence Oct 26, 2023
6b50b87
remove live test mark
l0lawrence Oct 27, 2023
bc997b2
update
l0lawrence Oct 27, 2023
efb5911
use env vars
l0lawrence Oct 27, 2023
4e046c8
update test
l0lawrence Oct 27, 2023
7db3968
only run live test
l0lawrence Oct 27, 2023
1d74cda
comment
l0lawrence Oct 30, 2023
0abd334
typo
l0lawrence Oct 31, 2023
9495362
error incorrect
l0lawrence Oct 31, 2023
58bd912
start comments
l0lawrence Nov 1, 2023
205758e
update test
l0lawrence Nov 1, 2023
67ac8d2
add sample
l0lawrence Nov 1, 2023
35ecda1
update tests
l0lawrence Nov 1, 2023
6611e67
update docstrings to add clarity
l0lawrence Nov 2, 2023
5016b76
update err message
l0lawrence Nov 2, 2023
1f07d6f
remove generated cloud event
l0lawrence Nov 2, 2023
dac9cf0
update sample
l0lawrence Nov 2, 2023
fc52a69
update
l0lawrence Nov 2, 2023
502c371
update samples to include dict
l0lawrence Nov 2, 2023
9a9c4b1
update patch
l0lawrence Nov 2, 2023
ba01c09
spacing
l0lawrence Nov 2, 2023
6bcbb77
add comments
l0lawrence Nov 2, 2023
464cd6b
formatting
l0lawrence Nov 2, 2023
8d0bbe6
update doc
l0lawrence Nov 2, 2023
ee013cc
update tests
l0lawrence Nov 2, 2023
5b0beac
update tests
l0lawrence Nov 2, 2023
3bf9dd2
tests
l0lawrence Nov 2, 2023
5c47708
skip tests for now
l0lawrence Nov 2, 2023
eeb1aaf
typo
l0lawrence Nov 3, 2023
df23b8b
add dict binary mode
l0lawrence Nov 3, 2023
b5b5236
update docstring
l0lawrence Nov 3, 2023
b21b5e6
update patch to allow throw error
l0lawrence Nov 3, 2023
11f9560
first pass at comments
l0lawrence Nov 3, 2023
89e889d
update patch eror
l0lawrence Nov 3, 2023
f3546d9
nit
l0lawrence Nov 3, 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
eventgrid client patch
  • Loading branch information
l0lawrence committed Nov 2, 2023
commit 2e7bb32fdcf277f461e6932312d1ae2d7b80da7b
41 changes: 40 additions & 1 deletion sdk/eventgrid/azure-eventgrid/azure/eventgrid/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,51 @@
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List
from typing import List, Any, TYPE_CHECKING, Union
from azure.core.credentials import AzureKeyCredential

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
from ._legacy import (
EventGridPublisherClient,
SystemEventNames,
EventGridEvent,
generate_sas,
)
from ._client import EventGridClient as InternalEventGridClient


class EventGridClient(InternalEventGridClient):
"""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. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword binary_mode: Whether to use binary mode for CloudEvents. Default value is False.
:paramtype binary_mode: bool
: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: Union[AzureKeyCredential, "TokenCredential"],
**kwargs: Any
) -> None:

self._binary_mode = kwargs.pop("binary_mode", False)
super().__init__(endpoint=endpoint, credential=credential, **kwargs)




def patch_sdk():
"""Do not remove from this file.
Expand All @@ -27,4 +65,5 @@ def patch_sdk():
"SystemEventNames",
"EventGridEvent",
"generate_sas",
"EventGridClient",
] # Add all objects you want publicly available to users at this package level
40 changes: 39 additions & 1 deletion sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,46 @@
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List
from typing import List, Any, TYPE_CHECKING, Union
from azure.core.credentials import AzureKeyCredential
from .._legacy.aio import EventGridPublisherClient

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._client import EventGridClient as InternalEventGridClient


class EventGridClient(InternalEventGridClient):
"""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. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials_async.AsyncTokenCredential
:keyword binary_mode: Whether to use binary mode for CloudEvents. Default value is False.
:paramtype binary_mode: bool
: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: Union[AzureKeyCredential, "AsyncTokenCredential"],
**kwargs: Any
) -> None:

self._binary_mode = kwargs.pop("binary_mode", False)
super().__init__(endpoint=endpoint, credential=credential, **kwargs)


def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
Expand All @@ -19,4 +56,5 @@ def patch_sdk():

__all__: List[str] = [
"EventGridPublisherClient",
"EventGridClient",
] # Add all objects you want publicly available to users at this package level