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 - removed azure refs in gen code
  • Loading branch information
l0lawrence committed Nov 8, 2023
commit 64faa0d1354e7cdf610448cfbcb2801ab4953ebc
11 changes: 7 additions & 4 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

_LOGGER = logging.getLogger(__name__)

__all__ = ["AzureJSONEncoder", "Model", "rest_field", "rest_discriminator"]
__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"]

TZ_UTC = timezone.utc

Expand Down Expand Up @@ -125,7 +125,7 @@ def _is_readonly(p):
return False


class AzureJSONEncoder(JSONEncoder):
class SdkJSONEncoder(JSONEncoder):
"""A JSON encoder that's capable of serializing datetime objects and bytes."""

def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs):
Expand All @@ -140,7 +140,7 @@ def default(self, o): # pylint: disable=too-many-return-statements
return {k: v for k, v in o.items() if k not in readonly_props}
return dict(o.items())
try:
return super(AzureJSONEncoder, self).default(o)
return super(SdkJSONEncoder, self).default(o)
except TypeError:
if isinstance(o, _Null):
return None
Expand All @@ -157,7 +157,7 @@ def default(self, o): # pylint: disable=too-many-return-statements
except AttributeError:
# This will be raised when it hits value.total_seconds in the method above
pass
return super(AzureJSONEncoder, self).default(o)
return super(SdkJSONEncoder, self).default(o)


_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
Expand Down Expand Up @@ -754,9 +754,12 @@ def _deserialize(
value: typing.Any,
module: typing.Optional[str] = None,
rf: typing.Optional["_RestField"] = None,
format: typing.Optional[str] = None,
) -> typing.Any:
if isinstance(value, PipelineResponse):
value = value.http_response.json()
if rf is None and format:
rf = _RestField(format=format)
deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf)
return _deserialize_with_callable(deserializer, value)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .._model_base import AzureJSONEncoder, _deserialize
from .._model_base import SdkJSONEncoder, _deserialize
from .._serialization import Serializer
from .._vendor import EventGridClientMixinABC

Expand Down Expand Up @@ -344,7 +344,7 @@ def _publish_cloud_event( # pylint: disable=protected-access
'cls', None
)

_content = json.dumps(event, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(event, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_publish_cloud_event_request(
topic_name=topic_name,
Expand Down Expand Up @@ -428,7 +428,7 @@ def _publish_cloud_events( # pylint: disable=protected-access
'cls', None
)

_content = json.dumps(events, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(events, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_publish_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -702,7 +702,7 @@ def acknowledge_cloud_events(
if isinstance(acknowledge_options, (IOBase, bytes)):
_content = acknowledge_options
else:
_content = json.dumps(acknowledge_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(acknowledge_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_acknowledge_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -902,7 +902,7 @@ def release_cloud_events(
if isinstance(release_options, (IOBase, bytes)):
_content = release_options
else:
_content = json.dumps(release_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(release_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_release_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -1086,7 +1086,7 @@ def reject_cloud_events(
if isinstance(reject_options, (IOBase, bytes)):
_content = reject_options
else:
_content = json.dumps(reject_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(reject_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_reject_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -1277,7 +1277,7 @@ def renew_cloud_event_locks(
if isinstance(renew_lock_options, (IOBase, bytes)):
_content = renew_lock_options
else:
_content = json.dumps(renew_lock_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(renew_lock_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_renew_cloud_event_locks_request(
topic_name=topic_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import isodate # type: ignore

from azure.core.exceptions import DeserializationError, SerializationError
from azure.core.serialization import NULL as AzureCoreNull
from azure.core.serialization import NULL as CoreNull

_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")

Expand Down Expand Up @@ -732,7 +732,6 @@ def url(self, name, data, data_type, **kwargs):

if kwargs.get("skip_quote") is True:
output = str(output)
# https://github.com/Azure/autorest.python/issues/2063
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
Expand Down Expand Up @@ -808,7 +807,7 @@ def serialize_data(self, data, data_type, **kwargs):
raise ValueError("No value for given attribute")

try:
if data is AzureCoreNull:
if data is CoreNull:
return None
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
Expand Down Expand Up @@ -1217,7 +1216,6 @@ def rest_key_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
# https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])

Expand All @@ -1238,7 +1236,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
# https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from azure.core.utils import case_insensitive_dict

from ... import models as _models
from ..._model_base import AzureJSONEncoder, _deserialize
from ..._model_base import SdkJSONEncoder, _deserialize
from ..._operations._operations import build_event_grid_acknowledge_cloud_events_request, build_event_grid_publish_cloud_event_request, build_event_grid_publish_cloud_events_request, build_event_grid_receive_cloud_events_request, build_event_grid_reject_cloud_events_request, build_event_grid_release_cloud_events_request, build_event_grid_renew_cloud_event_locks_request
from .._vendor import EventGridClientMixinABC

Expand Down Expand Up @@ -73,7 +73,7 @@ async def _publish_cloud_event( # pylint: disable=protected-access
'cls', None
)

_content = json.dumps(event, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(event, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_publish_cloud_event_request(
topic_name=topic_name,
Expand Down Expand Up @@ -157,7 +157,7 @@ async def _publish_cloud_events( # pylint: disable=protected-access
'cls', None
)

_content = json.dumps(events, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(events, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_publish_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -431,7 +431,7 @@ async def acknowledge_cloud_events(
if isinstance(acknowledge_options, (IOBase, bytes)):
_content = acknowledge_options
else:
_content = json.dumps(acknowledge_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(acknowledge_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_acknowledge_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -631,7 +631,7 @@ async def release_cloud_events(
if isinstance(release_options, (IOBase, bytes)):
_content = release_options
else:
_content = json.dumps(release_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(release_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_release_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -815,7 +815,7 @@ async def reject_cloud_events(
if isinstance(reject_options, (IOBase, bytes)):
_content = reject_options
else:
_content = json.dumps(reject_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(reject_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_reject_cloud_events_request(
topic_name=topic_name,
Expand Down Expand Up @@ -1006,7 +1006,7 @@ async def renew_cloud_event_locks(
if isinstance(renew_lock_options, (IOBase, bytes)):
_content = renew_lock_options
else:
_content = json.dumps(renew_lock_options, cls=AzureJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(renew_lock_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_event_grid_renew_cloud_event_locks_request(
topic_name=topic_name,
Expand Down
28 changes: 14 additions & 14 deletions sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class AcknowledgeOptions(_model_base.Model):
"""Array of lock tokens for the corresponding received Cloud Events to be acknowledged.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_tokens: Array of lock tokens. Required.
:vartype lock_tokens: list[str]
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class AcknowledgeResult(_model_base.Model):
"""The result of the Acknowledge operation.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar failed_lock_tokens: Array of FailedLockToken for failed cloud events. Each
FailedLockToken includes the lock token along with the related error information (namely, the
Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class BrokerProperties(_model_base.Model):
"""Properties of the Event Broker operation.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_token: The token of the lock on the event. Required.
:vartype lock_token: str
Expand All @@ -111,7 +111,7 @@ class CloudEvent(_model_base.Model):
"""Properties of an event published to an Azure Messaging EventGrid Namespace topic using the
CloudEvent 1.0 Schema.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar id: An identifier for the event. The combination of id and source must be unique for each
distinct event. Required.
Expand Down Expand Up @@ -167,7 +167,7 @@ class CloudEvent(_model_base.Model):
class Error(_model_base.Model):
"""The error object.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar code: One of a server-defined set of error codes. Required.
:vartype code: str
Expand Down Expand Up @@ -219,7 +219,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class FailedLockToken(_model_base.Model):
"""Failed LockToken information.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_token: The lock token of an entry in the request. Required.
:vartype lock_token: str
Expand Down Expand Up @@ -300,7 +300,7 @@ class PublishResult(_model_base.Model):
class ReceiveDetails(_model_base.Model):
"""Receive operation details per Cloud Event.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar broker_properties: The Event Broker details. Required.
:vartype broker_properties: ~azure.eventgrid.models.BrokerProperties
Expand All @@ -318,7 +318,7 @@ class ReceiveDetails(_model_base.Model):
class ReceiveResult(_model_base.Model):
"""Details of the Receive operation response.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar value: Array of receive responses, one per cloud event. Required.
:vartype value: list[~azure.eventgrid.models.ReceiveDetails]
Expand All @@ -332,7 +332,7 @@ class ReceiveResult(_model_base.Model):
class RejectOptions(_model_base.Model):
"""Array of lock tokens for the corresponding received Cloud Events to be rejected.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_tokens: Array of lock tokens. Required.
:vartype lock_tokens: list[str]
Expand Down Expand Up @@ -363,7 +363,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class RejectResult(_model_base.Model):
"""The result of the Reject operation.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar failed_lock_tokens: Array of FailedLockToken for failed cloud events. Each
FailedLockToken includes the lock token along with the related error information (namely, the
Expand Down Expand Up @@ -403,7 +403,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class ReleaseOptions(_model_base.Model):
"""Array of lock tokens for the corresponding received Cloud Events to be released.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_tokens: Array of lock tokens. Required.
:vartype lock_tokens: list[str]
Expand Down Expand Up @@ -434,7 +434,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class ReleaseResult(_model_base.Model):
"""The result of the Release operation.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar failed_lock_tokens: Array of FailedLockToken for failed cloud events. Each
FailedLockToken includes the lock token along with the related error information (namely, the
Expand Down Expand Up @@ -474,7 +474,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class RenewCloudEventLocksResult(_model_base.Model):
"""The result of the RenewLock operation.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar failed_lock_tokens: Array of FailedLockToken for failed cloud events. Each
FailedLockToken includes the lock token along with the related error information (namely, the
Expand Down Expand Up @@ -513,7 +513,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:# pylint: disable=useless-
class RenewLockOptions(_model_base.Model):
"""Array of lock tokens for the corresponding received Cloud Events to be renewed.

All required parameters must be populated in order to send to Azure.
All required parameters must be populated in order to send to server.

:ivar lock_tokens: Array of lock tokens. Required.
:vartype lock_tokens: list[str]
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/azure-eventgrid/tsp-location.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cleanup: false
commit: 2515d74715a277aa566249d12b9a2f2d5a20ab11
commit: 116c17a841a9b37a3fce426558099b5ad5fe16de
directory: specification/eventgrid/Azure.Messaging.EventGrid
repo: Azure/azure-rest-api-specs