-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Event grid track 2 (#12768) * genereated python client for event grid * updated readme to use track2 generator * added sas key auth sample * added consume sample, not final * removing old eg * added track 2 changes needed for api view * add consumer operations * cleanup client versions for api view * remove _initialize_mapping() in BaseEventType class in models * track 2 design manual changes * added publisher wrapper in azure/eventgrid for demo * modified naming for publish sample for demo * final sample fix for demo * added response to publish_events(), still need to fix * added decoder for apiview * renamed consumer, added Deserialized/CustomEvent * final for Board Review * testing changes * added EventGridSharedAccessSignatureCredential,Policy and modified samples * added eg_client test * moving generated code out from event_grid_publisher_client nested folder * added consumption function samples * removed eg required package and removed service bus dependency in consumer * removed unnecessary functions * changed consumer deserialize_event() to take,return single event of one type of (string, bytes string, dict). changed DeserializedEvent to have to_json() method, instead of extending DictMixin * added publish tests * fixed PR, added CustomEvent, added tests/samples * updated swagger, removed unnecessary imports * removed unnecessary reqs in dev_requirements * changed async publisher import path, added type hints * modified typehints for publishers, based on apiview * added newlines * added shared_reqs file * moved shared_requirement * fixed non live test * added changelog, test fix * changed topic preparer * added samples to exclude to setup.py * Packaging update of azure-eventgrid * Packaging update of azure-eventgrid * tests fix (#13026) * other fixes * p2 compat * Packaging update of azure-eventgrid * Event grid v2 (#13051) * other fixes * auto update * Send spec initial * recordings * tests fix * Update sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml * Apply suggestions from code review * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py * analyze * Apply suggestions from code review Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com> * async tests * no async for py2 * comment * Apply suggestions from code review Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com> * Apply suggestions from code review Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com> * Apply suggestions from code review Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com> Co-authored-by: t-swpill <66144935+t-swpill@users.noreply.github.com> Co-authored-by: Azure SDK Bot <adxpysdk@microsoft.com> Co-authored-by: KieranBrantnerMagee <kibrantn@microsoft.com>
- Loading branch information
1 parent
bf9d44f
commit 9f4bbb0
Showing
26 changed files
with
1,088 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -------------------------------------------------------------------------- | ||
# | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# | ||
# The MIT License (MIT) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the ""Software""), to | ||
# deal in the Software without restriction, including without limitation the | ||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
# sell copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
# | ||
# -------------------------------------------------------------------------- | ||
import platform | ||
import sys | ||
|
||
|
||
# Ignore async tests for Python < 3.5 | ||
collect_ignore_glob = [] | ||
if sys.version_info < (3, 5): | ||
collect_ignore_glob.append("*_async.py") |
40 changes: 40 additions & 0 deletions
40
...entgrid/tests/recordings/test_eg_publisher_client.test_send_cloud_event_data_as_list.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
interactions: | ||
- request: | ||
body: '[{"id": "3dc4b913-4bc2-41f8-be9b-bf1f67069806", "source": "http://samplesource.dev", | ||
"data": "cloudevent", "type": "Sample.Cloud.Event", "time": "2020-08-19T03:36:41.947462Z", | ||
"specversion": "1.0"}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '198' | ||
Content-Type: | ||
- application/cloudevents-batch+json; charset=utf-8 | ||
User-Agent: | ||
- azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) | ||
aeg-sas-key: | ||
- dHUaOOg5xRj+D7iH/AC92GyHweLx9ugrDuMDg4e5Xvw= | ||
method: POST | ||
uri: https://cloudeventgridtestegtopic.westus-1.eventgrid.azure.net/api/events?api-version=2018-01-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
api-supported-versions: | ||
- '2018-01-01' | ||
content-length: | ||
- '0' | ||
date: | ||
- Wed, 19 Aug 2020 03:36:43 GMT | ||
server: | ||
- Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
40 changes: 40 additions & 0 deletions
40
...-eventgrid/tests/recordings/test_eg_publisher_client.test_send_cloud_event_data_dict.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
interactions: | ||
- request: | ||
body: '[{"id": "51c18497-2a25-45f1-b9ba-fdaf08c00263", "source": "http://samplesource.dev", | ||
"data": {"sample": "cloudevent"}, "type": "Sample.Cloud.Event", "time": "2020-08-19T03:36:42.304479Z", | ||
"specversion": "1.0"}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '210' | ||
Content-Type: | ||
- application/cloudevents-batch+json; charset=utf-8 | ||
User-Agent: | ||
- azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) | ||
aeg-sas-key: | ||
- dHUaOOg5xRj+D7iH/AC92GyHweLx9ugrDuMDg4e5Xvw= | ||
method: POST | ||
uri: https://cloudeventgridtestegtopic.westus-1.eventgrid.azure.net/api/events?api-version=2018-01-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
api-supported-versions: | ||
- '2018-01-01' | ||
content-length: | ||
- '0' | ||
date: | ||
- Wed, 19 Aug 2020 03:36:43 GMT | ||
server: | ||
- Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
40 changes: 40 additions & 0 deletions
40
...e-eventgrid/tests/recordings/test_eg_publisher_client.test_send_cloud_event_data_str.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
interactions: | ||
- request: | ||
body: '[{"id": "6a315e93-a59c-4eca-b2f2-6bf3b8f27984", "source": "http://samplesource.dev", | ||
"data": "cloudevent", "type": "Sample.Cloud.Event", "time": "2020-08-19T03:36:42.629467Z", | ||
"specversion": "1.0"}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '198' | ||
Content-Type: | ||
- application/cloudevents-batch+json; charset=utf-8 | ||
User-Agent: | ||
- azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) | ||
aeg-sas-key: | ||
- dHUaOOg5xRj+D7iH/AC92GyHweLx9ugrDuMDg4e5Xvw= | ||
method: POST | ||
uri: https://cloudeventgridtestegtopic.westus-1.eventgrid.azure.net/api/events?api-version=2018-01-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
api-supported-versions: | ||
- '2018-01-01' | ||
content-length: | ||
- '0' | ||
date: | ||
- Wed, 19 Aug 2020 03:36:43 GMT | ||
server: | ||
- Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
39 changes: 39 additions & 0 deletions
39
...azure-eventgrid/tests/recordings/test_eg_publisher_client.test_send_cloud_event_dict.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
interactions: | ||
- request: | ||
body: '[{"id": "1234", "source": "http://samplesource.dev", "data": "cloudevent", | ||
"type": "Sample.Cloud.Event", "specversion": "1.0"}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '127' | ||
Content-Type: | ||
- application/cloudevents-batch+json; charset=utf-8 | ||
User-Agent: | ||
- azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) | ||
aeg-sas-key: | ||
- dHUaOOg5xRj+D7iH/AC92GyHweLx9ugrDuMDg4e5Xvw= | ||
method: POST | ||
uri: https://cloudeventgridtestegtopic.westus-1.eventgrid.azure.net/api/events?api-version=2018-01-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
api-supported-versions: | ||
- '2018-01-01' | ||
content-length: | ||
- '0' | ||
date: | ||
- Wed, 19 Aug 2020 03:36:44 GMT | ||
server: | ||
- Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
40 changes: 40 additions & 0 deletions
40
...re-eventgrid/tests/recordings/test_eg_publisher_client.test_send_custom_schema_event.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
interactions: | ||
- request: | ||
body: '[{"customSubject": "sample", "customEventType": "sample.event", "customDataVersion": | ||
"2.0", "customId": "1234", "customEventTime": "2020-08-19T03:36:56.936961+00:00", | ||
"customData": "sample data"}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '196' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) | ||
aeg-sas-key: | ||
- uPQPJHQHsAhBxWOWtRXslz3sXf7TJ5lcqLZ6SC4QzJ4= | ||
method: POST | ||
uri: https://customeventgridtestegtopic.westus-1.eventgrid.azure.net/api/events?api-version=2018-01-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
api-supported-versions: | ||
- '2018-01-01' | ||
content-length: | ||
- '0' | ||
date: | ||
- Wed, 19 Aug 2020 03:36:57 GMT | ||
server: | ||
- Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.