From af30a109dc8beeddecce52a9bb1afad90b9bc970 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 19 Aug 2020 17:07:04 -0700 Subject: [PATCH] Event grid track 2 (#13010) * 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 * Fix Tests (#13024) * Fix Tests * other fixes * Packaging update of azure-eventgrid * tests fix (#13026) * other fixes * p2 compat * Packaging update of azure-eventgrid * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Event grid v2 (#13051) * other fixes * auto update * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py * Event grid v2 (#13177) * other fixes * auto update * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py * comments * Update sdk/eventgrid/azure-eventgrid/tests/_mocks.py * Event grid v2 (#13201) * other fixes * auto update * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py * Update sdk/eventgrid/azure-eventgrid/CHANGELOG.md * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py * comments * tests fix * Update sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py * Update sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py Co-authored-by: KieranBrantnerMagee * Apply suggestions from code review Co-authored-by: t-swpill <66144935+t-swpill@users.noreply.github.com> Co-authored-by: Azure SDK Bot Co-authored-by: Rakshith Bhyravabhotla Co-authored-by: KieranBrantnerMagee --- sdk/eventgrid/azure-eventgrid/CHANGELOG.md | 4 + sdk/eventgrid/azure-eventgrid/MANIFEST.in | 1 + sdk/eventgrid/azure-eventgrid/README.md | 23 +- .../azure/eventgrid/__init__.py | 21 +- .../azure/eventgrid/_constants.py | 9 + .../azure/eventgrid/_consumer.py | 50 ++ .../azure/eventgrid/_generated/__init__.py | 16 + .../eventgrid/_generated/_configuration.py | 51 ++ .../_event_grid_publisher_client.py | 54 ++ .../eventgrid/_generated/aio/__init__.py | 10 + .../_generated/aio/_configuration_async.py | 45 ++ .../aio/_event_grid_publisher_client_async.py | 46 ++ .../aio/operations_async/__init__.py | 13 + ..._grid_publisher_client_operations_async.py | 185 +++++ .../eventgrid/_generated/models/__init__.py | 52 ++ .../eventgrid/_generated/models/_models.py | 623 +++++++++++++++ .../_generated/models/_models_py3.py | 716 ++++++++++++++++++ .../_generated/operations/__init__.py | 13 + ..._event_grid_publisher_client_operations.py | 192 +++++ .../azure/eventgrid/_generated/py.typed | 1 + .../azure/eventgrid/_helpers.py | 72 ++ .../azure/eventgrid/_models.py | 201 +++++ .../azure/eventgrid/_publisher_client.py | 58 ++ .../azure/eventgrid/_shared/__init__.py | 8 + .../azure/eventgrid/_shared/mixins.py | 58 ++ .../_shared_access_signature_credential.py | 33 + .../eventgrid/_signature_credential_policy.py | 23 + .../eventgrid/{version.py => _version.py} | 3 +- .../azure/eventgrid/aio/__init__.py | 9 + .../eventgrid/aio/_publisher_client_async.py | 56 ++ .../azure/eventgrid/event_grid_client.py | 116 --- .../azure/eventgrid/models/__init__.py | 266 ------- ...figuration_key_value_deleted_event_data.py | 38 - ...ration_key_value_deleted_event_data_py3.py | 38 - ...iguration_key_value_modified_event_data.py | 38 - ...ation_key_value_modified_event_data_py3.py | 38 - .../container_registry_artifact_event_data.py | 40 - ...tainer_registry_artifact_event_data_py3.py | 40 - ...ontainer_registry_artifact_event_target.py | 52 -- ...iner_registry_artifact_event_target_py3.py | 52 -- ...ainer_registry_chart_deleted_event_data.py | 37 - ...r_registry_chart_deleted_event_data_py3.py | 37 - ...tainer_registry_chart_pushed_event_data.py | 37 - ...er_registry_chart_pushed_event_data_py3.py | 37 - .../models/container_registry_event_actor.py | 30 - .../container_registry_event_actor_py3.py | 30 - .../models/container_registry_event_data.py | 54 -- .../container_registry_event_data_py3.py | 54 -- .../container_registry_event_request.py | 47 -- .../container_registry_event_request_py3.py | 47 -- .../models/container_registry_event_source.py | 36 - .../container_registry_event_source_py3.py | 36 - .../models/container_registry_event_target.py | 53 -- .../container_registry_event_target_py3.py | 53 -- ...ainer_registry_image_deleted_event_data.py | 48 -- ...r_registry_image_deleted_event_data_py3.py | 48 -- ...tainer_registry_image_pushed_event_data.py | 48 -- ...er_registry_image_pushed_event_data_py3.py | 48 -- .../device_connection_state_event_info.py | 31 - .../device_connection_state_event_info_py3.py | 31 - ...evice_connection_state_event_properties.py | 50 -- ...e_connection_state_event_properties_py3.py | 50 -- .../device_life_cycle_event_properties.py | 42 - .../device_life_cycle_event_properties_py3.py | 42 - .../device_telemetry_event_properties.py | 39 - .../device_telemetry_event_properties_py3.py | 39 - .../eventgrid/models/device_twin_info.py | 78 -- .../models/device_twin_info_properties.py | 34 - .../models/device_twin_info_properties_py3.py | 34 - .../eventgrid/models/device_twin_info_py3.py | 78 -- .../device_twin_info_x509_thumbprint.py | 36 - .../device_twin_info_x509_thumbprint_py3.py | 36 - .../eventgrid/models/device_twin_metadata.py | 29 - .../models/device_twin_metadata_py3.py | 29 - .../models/device_twin_properties.py | 33 - .../models/device_twin_properties_py3.py | 33 - .../models/event_grid_client_enums.py | 51 -- .../eventgrid/models/event_grid_event.py | 71 -- .../eventgrid/models/event_grid_event_py3.py | 71 -- ...ent_hub_capture_file_created_event_data.py | 61 -- ...hub_capture_file_created_event_data_py3.py | 61 -- .../iot_hub_device_connected_event_data.py | 45 -- ...iot_hub_device_connected_event_data_py3.py | 45 -- .../iot_hub_device_created_event_data.py | 38 - .../iot_hub_device_created_event_data_py3.py | 38 - .../iot_hub_device_deleted_event_data.py | 38 - .../iot_hub_device_deleted_event_data_py3.py | 38 - .../iot_hub_device_disconnected_event_data.py | 45 -- ..._hub_device_disconnected_event_data_py3.py | 45 -- .../iot_hub_device_telemetry_event_data.py | 35 - ...iot_hub_device_telemetry_event_data_py3.py | 35 - .../maps_geofence_entered_event_data.py | 44 -- .../maps_geofence_entered_event_data_py3.py | 44 -- .../models/maps_geofence_event_properties.py | 48 -- .../maps_geofence_event_properties_py3.py | 48 -- .../models/maps_geofence_exited_event_data.py | 44 -- .../maps_geofence_exited_event_data_py3.py | 44 -- .../models/maps_geofence_geometry.py | 58 -- .../models/maps_geofence_geometry_py3.py | 58 -- .../models/maps_geofence_result_event_data.py | 44 -- .../maps_geofence_result_event_data_py3.py | 44 -- .../models/media_job_canceled_event_data.py | 49 -- .../media_job_canceled_event_data_py3.py | 49 -- .../models/media_job_canceling_event_data.py | 45 -- .../media_job_canceling_event_data_py3.py | 45 -- .../azure/eventgrid/models/media_job_error.py | 63 -- .../models/media_job_error_detail.py | 40 - .../models/media_job_error_detail_py3.py | 40 - .../eventgrid/models/media_job_error_py3.py | 63 -- .../models/media_job_errored_event_data.py | 49 -- .../media_job_errored_event_data_py3.py | 49 -- .../models/media_job_finished_event_data.py | 49 -- .../media_job_finished_event_data_py3.py | 49 -- .../eventgrid/models/media_job_output.py | 61 -- .../models/media_job_output_asset.py | 54 -- .../models/media_job_output_asset_py3.py | 54 -- .../media_job_output_canceled_event_data.py | 42 - ...edia_job_output_canceled_event_data_py3.py | 42 - .../media_job_output_canceling_event_data.py | 42 - ...dia_job_output_canceling_event_data_py3.py | 42 - .../media_job_output_errored_event_data.py | 42 - ...media_job_output_errored_event_data_py3.py | 42 - .../media_job_output_finished_event_data.py | 42 - ...edia_job_output_finished_event_data_py3.py | 42 - .../media_job_output_processing_event_data.py | 42 - ...ia_job_output_processing_event_data_py3.py | 42 - .../media_job_output_progress_event_data.py | 36 - ...edia_job_output_progress_event_data_py3.py | 36 - .../eventgrid/models/media_job_output_py3.py | 61 -- .../media_job_output_scheduled_event_data.py | 42 - ...dia_job_output_scheduled_event_data_py3.py | 42 - ...edia_job_output_state_change_event_data.py | 46 -- ..._job_output_state_change_event_data_py3.py | 46 -- .../models/media_job_processing_event_data.py | 45 -- .../media_job_processing_event_data_py3.py | 45 -- .../models/media_job_scheduled_event_data.py | 45 -- .../media_job_scheduled_event_data_py3.py | 45 -- .../media_job_state_change_event_data.py | 49 -- .../media_job_state_change_event_data_py3.py | 49 -- ...ve_event_connection_rejected_event_data.py | 55 -- ...vent_connection_rejected_event_data_py3.py | 55 -- ...live_event_encoder_connected_event_data.py | 50 -- ..._event_encoder_connected_event_data_py3.py | 50 -- ...e_event_encoder_disconnected_event_data.py | 55 -- ...ent_encoder_disconnected_event_data_py3.py | 55 -- ..._incoming_data_chunk_dropped_event_data.py | 61 -- ...oming_data_chunk_dropped_event_data_py3.py | 61 -- ...ent_incoming_stream_received_event_data.py | 75 -- ...incoming_stream_received_event_data_py3.py | 75 -- ...incoming_streams_out_of_sync_event_data.py | 65 -- ...ming_streams_out_of_sync_event_data_py3.py | 65 -- ...ng_video_streams_out_of_sync_event_data.py | 60 -- ...ideo_streams_out_of_sync_event_data_py3.py | 60 -- ..._live_event_ingest_heartbeat_event_data.py | 91 --- ...e_event_ingest_heartbeat_event_data_py3.py | 91 --- ...track_discontinuity_detected_event_data.py | 67 -- ...k_discontinuity_detected_event_data_py3.py | 67 -- .../models/resource_action_cancel_data.py | 70 -- .../models/resource_action_cancel_data_py3.py | 70 -- .../models/resource_action_failure_data.py | 70 -- .../resource_action_failure_data_py3.py | 70 -- .../models/resource_action_success_data.py | 70 -- .../resource_action_success_data_py3.py | 70 -- .../models/resource_delete_cancel_data.py | 70 -- .../models/resource_delete_cancel_data_py3.py | 70 -- .../models/resource_delete_failure_data.py | 70 -- .../resource_delete_failure_data_py3.py | 70 -- .../models/resource_delete_success_data.py | 70 -- .../resource_delete_success_data_py3.py | 70 -- .../models/resource_write_cancel_data.py | 70 -- .../models/resource_write_cancel_data_py3.py | 70 -- .../models/resource_write_failure_data.py | 70 -- .../models/resource_write_failure_data_py3.py | 70 -- .../models/resource_write_success_data.py | 70 -- .../models/resource_write_success_data_py3.py | 70 -- ..._available_with_no_listeners_event_data.py | 55 -- ...ilable_with_no_listeners_event_data_py3.py | 55 -- ..._available_with_no_listeners_event_data.py | 55 -- ...ilable_with_no_listeners_event_data_py3.py | 55 -- ..._client_connection_connected_event_data.py | 41 - ...ent_connection_connected_event_data_py3.py | 41 - ...ient_connection_disconnected_event_data.py | 46 -- ..._connection_disconnected_event_data_py3.py | 46 -- .../models/storage_blob_created_event_data.py | 74 -- .../storage_blob_created_event_data_py3.py | 74 -- .../models/storage_blob_deleted_event_data.py | 65 -- .../storage_blob_deleted_event_data_py3.py | 65 -- .../models/subscription_deleted_event_data.py | 37 - .../subscription_deleted_event_data_py3.py | 37 - .../subscription_validation_event_data.py | 50 -- .../subscription_validation_event_data_py3.py | 50 -- .../subscription_validation_response.py | 32 - .../subscription_validation_response_py3.py | 32 - .../azure-eventgrid/dev_requirements.txt | 6 +- .../cs1_publish_custom_events_to_a_topic.py | 19 + ...custom_events_to_a_topic_with_signature.py | 21 + ...publish_custom_events_to_a_domain_topic.py | 29 + .../cs3_consume_system_events.py | 21 + .../cs3_event_grid_event_system_event.json | 23 + .../champion_scenarios/cs3_system_event.json | 23 + .../cs4_consume_custom_events.py | 23 + .../cs4_event_grid_event_custom_event.json | 12 + ...sh_events_using_cloud_events_1.0_schema.py | 19 + .../cs6_cloud_event_system_event.json | 23 + ...me_events_using_cloud_events_1.0_schema.py | 21 + .../consume_cloud_custom_data_sample.py | 22 + ...ume_eg_storage_blob_created_data_sample.py | 37 + .../consume_cloud_events_from_eventhub.py | 47 ++ ...ume_cloud_events_from_service_bus_queue.py | 37 + ...consume_cloud_events_from_storage_queue.py | 27 + .../e2e_samples/functionsapp/.funcignore | 5 + .../e2e_samples/functionsapp/.gitignore | 130 ++++ .../EventGridTrigger1/__init__.py | 22 + .../EventGridTrigger1/function.json | 10 + .../functionsapp/EventGridTrigger1/host.json | 7 + .../functionsapp/EventGridTrigger1/sample.dat | 20 + .../e2e_samples/functionsapp/host.json | 15 + .../e2e_samples/functionsapp/proxies.json | 4 + .../e2e_samples/functionsapp/requirements.txt | 1 + ...ish_cloud_events_to_custom_topic_sample.py | 39 + ...ish_cloud_events_to_domain_topic_sample.py | 40 + ...sh_custom_schema_events_to_topic_sample.py | 44 ++ ...vent_grid_events_to_custom_topic_sample.py | 40 + ...ish_with_shared_access_signature_sample.py | 45 ++ .../azure-eventgrid/sdk_packaging.toml | 3 +- sdk/eventgrid/azure-eventgrid/setup.py | 12 +- .../swagger/README.PYTHON_T2.md | 21 + sdk/eventgrid/azure-eventgrid/tests/_mocks.py | 77 ++ .../tests/eventgrid_preparer.py | 98 +++ ...lient.test_eg_client_good_credentials.yaml | 40 + ...est_eg_client.test_eg_client_publish_.yaml | 40 + ...nt.test_eg_client_publish_cloud_event.yaml | 40 + ..._client_publish_cloud_event_data_dict.yaml | 40 + ...g_client_publish_cloud_event_data_str.yaml | 40 + ...st_eg_client_publish_event_grid_event.yaml | 40 + ...nt_publish_event_grid_event_data_dict.yaml | 40 + ..._client_publish_cloud_event_data_dict.yaml | 40 + ...r_client_publish_cloud_event_data_str.yaml | 40 + ...er_client_publish_custom_schema_event.yaml | 40 + ...nt_publish_event_grid_event_data_dict.yaml | 40 + ...ent_publish_event_grid_event_data_str.yaml | 40 + ...r_client_publish_signature_credential.yaml | 40 + .../tests/test_azure_eventgrid.py | 64 -- .../azure-eventgrid/tests/test_eg_consumer.py | 142 ++++ .../tests/test_eg_publisher_client.py | 111 +++ shared_requirements.txt | 3 +- 246 files changed, 4432 insertions(+), 8626 deletions(-) create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_constants.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_configuration.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration_async.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client_async.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/_event_grid_publisher_client_operations_async.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/py.typed create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py rename sdk/eventgrid/azure-eventgrid/azure/eventgrid/{version.py => _version.py} (95%) create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/event_grid_client.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py delete mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1_publish_custom_events_to_a_topic.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1b_publish_custom_events_to_a_topic_with_signature.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs2_publish_custom_events_to_a_domain_topic.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_consume_system_events.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_event_grid_event_system_event.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_system_event.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_consume_custom_events.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_event_grid_event_custom_event.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs5_publish_events_using_cloud_events_1.0_schema.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_cloud_event_system_event.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_cloud_custom_data_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_eg_storage_blob_created_data_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_eventhub.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_service_bus_queue.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_storage_queue.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.funcignore create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.gitignore create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/function.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/host.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/sample.dat create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/host.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/proxies.json create mode 100644 sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/requirements.txt create mode 100644 sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_custom_topic_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_domain_topic_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_custom_schema_events_to_topic_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_event_grid_events_to_custom_topic_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_with_shared_access_signature_sample.py create mode 100644 sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md create mode 100644 sdk/eventgrid/azure-eventgrid/tests/_mocks.py create mode 100644 sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_good_credentials.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_dict.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_str.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event_data_dict.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_dict.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_str.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_custom_schema_event.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_str.yaml create mode 100644 sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_signature_credential.yaml delete mode 100644 sdk/eventgrid/azure-eventgrid/tests/test_azure_eventgrid.py create mode 100644 sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py create mode 100644 sdk/eventgrid/azure-eventgrid/tests/test_eg_publisher_client.py diff --git a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md index 2fc7fda8852b..a4a05abba5b4 100644 --- a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.0b1 (Unreleased) + + - Placeholder - NEEDS TO BE CHANGED + ## 1.3.0 (2019-05-20) - Event Schemas for new event types from IotHub, Media Services, diff --git a/sdk/eventgrid/azure-eventgrid/MANIFEST.in b/sdk/eventgrid/azure-eventgrid/MANIFEST.in index cad40fe06b5f..abba13db8db2 100644 --- a/sdk/eventgrid/azure-eventgrid/MANIFEST.in +++ b/sdk/eventgrid/azure-eventgrid/MANIFEST.in @@ -1,4 +1,5 @@ recursive-include tests *.py *.yaml +recursive-include samples *.py include *.md include azure/__init__.py diff --git a/sdk/eventgrid/azure-eventgrid/README.md b/sdk/eventgrid/azure-eventgrid/README.md index 5aa35412bfe1..67a40b44a789 100644 --- a/sdk/eventgrid/azure-eventgrid/README.md +++ b/sdk/eventgrid/azure-eventgrid/README.md @@ -1,22 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Event Grid Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. -For a more complete set of Azure libraries, see the -[azure sdk python release](https://aka.ms/azsdk/python/all). +# Usage -## Usage - -For code examples, see [Event -Grid](https://docs.microsoft.com/python/api/overview/azure/event-grid) +For code examples, see [Event Grid](https://docs.microsoft.com/python/api/overview/azure/event-grid) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-eventgrid%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-eventgrid%2FREADME.png) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py index 336c61d76ffd..a9601110ac68 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py @@ -1,18 +1,17 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- -from .event_grid_client import EventGridClient -from .version import VERSION - -__all__ = ['EventGridClient'] +from ._publisher_client import EventGridPublisherClient +from ._consumer import EventGridConsumer +from ._helpers import generate_shared_access_signature +from ._models import CloudEvent, CustomEvent, EventGridEvent, DeserializedEvent, StorageBlobCreatedEventData +from ._shared_access_signature_credential import EventGridSharedAccessSignatureCredential +from ._version import VERSION +__all__ = ['EventGridPublisherClient', 'EventGridConsumer', + 'CloudEvent', 'CustomEvent', 'DeserializedEvent', 'EventGridEvent', 'StorageBlobCreatedEventData' + 'generate_shared_access_signature', 'EventGridSharedAccessSignatureCredential'] __version__ = VERSION - diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_constants.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_constants.py new file mode 100644 index 000000000000..e762ff44804a --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_constants.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +EVENTGRID_KEY_HEADER = 'aeg-sas-key' +EVENTGRID_TOKEN_HEADER = 'aeg-sas-token' +DEFAULT_API_VERSION = "2018-01-01" +SAFE_ENCODE = '~()*!.\'' diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py new file mode 100644 index 000000000000..def40ea69c4b --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING +import json +import six +import logging + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + +_LOGGER = logging.getLogger(__name__) + +from ._models import DeserializedEvent + +class EventGridConsumer(object): + """ + A consumer responsible for deserializing event handler messages, to allow for access to strongly typed Event objects. + """ + + def deserialize_event(self, event, **kwargs): + # type: (Union[str, dict, bytes]) -> models.DeserializedEvent + """Single event following CloudEvent/EventGridEvent schema will be parsed and returned as DeserializedEvent. + :param event: The event to be deserialized. + :type event: Union[str, dict, bytes] + :rtype: models.DeserializedEvent + + :raise: :class:`ValueError`, when events do not follow CloudEvent or EventGridEvent schema. + """ + encode = kwargs.pop('encoding', 'utf-8') + try: + if isinstance(event, six.binary_type): + event = json.loads(event.decode(encode)) + elif isinstance(event, six.string_types): + event = json.loads(event) + return DeserializedEvent(event) + except Exception as err: + _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent/EventGridEvent schema.') + _LOGGER.error('Your event: {}'.format(event)) + _LOGGER.error(err) + raise ValueError('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent/EventGridEvent schema.') diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/__init__.py new file mode 100644 index 000000000000..35d0a1eb904e --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_grid_publisher_client import EventGridPublisherClient +__all__ = ['EventGridPublisherClient'] + +try: + from ._patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_configuration.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_configuration.py new file mode 100644 index 000000000000..2cbd4c2d2b60 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_configuration.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + +VERSION = "unknown" + +class EventGridPublisherClientConfiguration(Configuration): + """Configuration for EventGridPublisherClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + """ + + def __init__( + self, + **kwargs # type: Any + ): + # type: (...) -> None + super(EventGridPublisherClientConfiguration, self).__init__(**kwargs) + + self.api_version = "2018-01-01" + kwargs.setdefault('sdk_moniker', 'eventgridpublisherclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**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.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py new file mode 100644 index 000000000000..fe915ae011f7 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + +from ._configuration import EventGridPublisherClientConfiguration +from .operations import EventGridPublisherClientOperationsMixin +from . import models + + +class EventGridPublisherClient(EventGridPublisherClientOperationsMixin): + """EventGrid Python Publisher Client. + + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + **kwargs # type: Any + ): + # type: (...) -> None + base_url = 'https://{topicHostname}' + self._config = EventGridPublisherClientConfiguration(**kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> EventGridPublisherClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py new file mode 100644 index 000000000000..6a44d89d724a --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_grid_publisher_client_async import EventGridPublisherClient +__all__ = ['EventGridPublisherClient'] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration_async.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration_async.py new file mode 100644 index 000000000000..fdf7045b660c --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration_async.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class EventGridPublisherClientConfiguration(Configuration): + """Configuration for EventGridPublisherClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + super(EventGridPublisherClientConfiguration, self).__init__(**kwargs) + + self.api_version = "2018-01-01" + kwargs.setdefault('sdk_moniker', 'eventgridpublisherclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client_async.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client_async.py new file mode 100644 index 000000000000..c54c3fe70368 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client_async.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import EventGridPublisherClientConfiguration +from .operations_async import EventGridPublisherClientOperationsMixin +from .. import models + + +class EventGridPublisherClient(EventGridPublisherClientOperationsMixin): + """EventGrid Python Publisher Client. + + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + base_url = 'https://{topicHostname}' + self._config = EventGridPublisherClientConfiguration(**kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "EventGridPublisherClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/__init__.py new file mode 100644 index 000000000000..f0c46bab822e --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_grid_publisher_client_operations_async import EventGridPublisherClientOperationsMixin + +__all__ = [ + 'EventGridPublisherClientOperationsMixin', +] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/_event_grid_publisher_client_operations_async.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/_event_grid_publisher_client_operations_async.py new file mode 100644 index 000000000000..15c54919f3af --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations_async/_event_grid_publisher_client_operations_async.py @@ -0,0 +1,185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EventGridPublisherClientOperationsMixin: + + async def publish_events( + self, + topic_hostname: str, + events: List["models.EventGridEvent"], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.EventGridEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[EventGridEvent]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_events.metadata = {'url': '/api/events'} # type: ignore + + async def publish_cloud_event_events( + self, + topic_hostname: str, + events: List["models.CloudEvent"], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.CloudEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8") + + # Construct URL + url = self.publish_cloud_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[CloudEvent]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_cloud_event_events.metadata = {'url': '/api/events'} # type: ignore + + async def publish_custom_event_events( + self, + topic_hostname: str, + events: List[object], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_custom_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[object]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_custom_event_events.metadata = {'url': '/api/events'} # type: ignore diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py new file mode 100644 index 000000000000..b6ae11646035 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import CloudEvent + from ._models_py3 import EventGridEvent + from ._models_py3 import StorageBlobCreatedEventData + from ._models_py3 import StorageBlobDeletedEventData + from ._models_py3 import StorageBlobRenamedEventData + from ._models_py3 import StorageDirectoryCreatedEventData + from ._models_py3 import StorageDirectoryDeletedEventData + from ._models_py3 import StorageDirectoryRenamedEventData + from ._models_py3 import StorageLifecyclePolicyActionSummaryDetail + from ._models_py3 import StorageLifecyclePolicyCompletedEventData + from ._models_py3 import SubscriptionDeletedEventData + from ._models_py3 import SubscriptionValidationEventData + from ._models_py3 import SubscriptionValidationResponse +except (SyntaxError, ImportError): + from ._models import CloudEvent # type: ignore + from ._models import EventGridEvent # type: ignore + from ._models import StorageBlobCreatedEventData # type: ignore + from ._models import StorageBlobDeletedEventData # type: ignore + from ._models import StorageBlobRenamedEventData # type: ignore + from ._models import StorageDirectoryCreatedEventData # type: ignore + from ._models import StorageDirectoryDeletedEventData # type: ignore + from ._models import StorageDirectoryRenamedEventData # type: ignore + from ._models import StorageLifecyclePolicyActionSummaryDetail # type: ignore + from ._models import StorageLifecyclePolicyCompletedEventData # type: ignore + from ._models import SubscriptionDeletedEventData # type: ignore + from ._models import SubscriptionValidationEventData # type: ignore + from ._models import SubscriptionValidationResponse # type: ignore + +__all__ = [ + 'CloudEvent', + 'EventGridEvent', + 'StorageBlobCreatedEventData', + 'StorageBlobDeletedEventData', + 'StorageBlobRenamedEventData', + 'StorageDirectoryCreatedEventData', + 'StorageDirectoryDeletedEventData', + 'StorageDirectoryRenamedEventData', + 'StorageLifecyclePolicyActionSummaryDetail', + 'StorageLifecyclePolicyCompletedEventData', + 'SubscriptionDeletedEventData', + 'SubscriptionValidationEventData', + 'SubscriptionValidationResponse', +] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py new file mode 100644 index 000000000000..5f1098ed381e --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py @@ -0,0 +1,623 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class CloudEvent(msrest.serialization.Model): + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, object] + :param id: Required. An identifier for the event. The combination of id and source must be + unique for each distinct event. + :type id: str + :param source: Required. Identifies the context in which an event happened. The combination of + id and source must be unique for each distinct event. + :type source: str + :param data: Event data specific to the event type. + :type data: object + :param data_base64: Event data specific to the event type, encoded as a base64 string. + :type data_base64: bytearray + :param type: Required. Type of event related to the originating occurrence. + :type type: str + :param time: The time (in UTC) the event was generated, in RFC3339 format. + :type time: ~datetime.datetime + :param specversion: Required. The version of the CloudEvents specification which the event + uses. + :type specversion: str + :param dataschema: Identifies the schema that data adheres to. + :type dataschema: str + :param datacontenttype: Content type of data value. + :type datacontenttype: str + :param subject: This describes the subject of the event in the context of the event producer + (identified by source). + :type subject: str + """ + + _validation = { + 'id': {'required': True}, + 'source': {'required': True}, + 'type': {'required': True}, + 'specversion': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'data_base64': {'key': 'data_base64', 'type': 'bytearray'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'specversion': {'key': 'specversion', 'type': 'str'}, + 'dataschema': {'key': 'dataschema', 'type': 'str'}, + 'datacontenttype': {'key': 'datacontenttype', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEvent, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.id = kwargs['id'] + self.source = kwargs['source'] + self.data = kwargs.get('data', None) + self.data_base64 = kwargs.get('data_base64', None) + self.type = kwargs['type'] + self.time = kwargs.get('time', None) + self.specversion = kwargs['specversion'] + self.dataschema = kwargs.get('dataschema', None) + self.datacontenttype = kwargs.get('datacontenttype', None) + self.subject = kwargs.get('subject', None) + + +class EventGridEvent(msrest.serialization.Model): + """Properties of an event published to an Event Grid topic using the EventGrid Schema. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. An unique identifier for the event. + :type id: str + :param topic: The resource path of the event source. + :type topic: str + :param subject: Required. A resource path relative to the topic path. + :type subject: str + :param data: Required. Event data specific to the event type. + :type data: object + :param event_type: Required. The type of the event that occurred. + :type event_type: str + :param event_time: Required. The time (in UTC) the event was generated. + :type event_time: ~datetime.datetime + :ivar metadata_version: The schema version of the event metadata. + :vartype metadata_version: str + :param data_version: Required. The schema version of the data object. + :type data_version: str + """ + + _validation = { + 'id': {'required': True}, + 'subject': {'required': True}, + 'data': {'required': True}, + 'event_type': {'required': True}, + 'event_time': {'required': True}, + 'metadata_version': {'readonly': True}, + 'data_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, + 'data_version': {'key': 'dataVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventGridEvent, self).__init__(**kwargs) + self.id = kwargs['id'] + self.topic = kwargs.get('topic', None) + self.subject = kwargs['subject'] + self.data = kwargs['data'] + self.event_type = kwargs['event_type'] + self.event_time = kwargs['event_time'] + self.metadata_version = None + self.data_version = kwargs['data_version'] + + +class StorageBlobCreatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param e_tag: The etag of the blob at the time this event was triggered. + :type e_tag: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param content_offset: The offset of the blob in bytes. + :type content_offset: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'content_offset': {'key': 'contentOffset', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageBlobCreatedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.e_tag = kwargs.get('e_tag', None) + self.content_type = kwargs.get('content_type', None) + self.content_length = kwargs.get('content_length', None) + self.content_offset = kwargs.get('content_offset', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageBlobDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobDeleted event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageBlobDeletedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.content_type = kwargs.get('content_type', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageBlobRenamedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobRenamed event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param source_url: The path to the blob that was renamed. + :type source_url: str + :param destination_url: The new path to the blob after the rename operation. + :type destination_url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'destination_url': {'key': 'destinationUrl', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageBlobRenamedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.source_url = kwargs.get('source_url', None) + self.destination_url = kwargs.get('destination_url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageDirectoryCreatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryCreated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param e_tag: The etag of the directory at the time this event was triggered. + :type e_tag: str + :param url: The path to the directory. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageDirectoryCreatedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.e_tag = kwargs.get('e_tag', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageDirectoryDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryDeleted event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param url: The path to the deleted directory. + :type url: str + :param recursive: Is this event for a recursive delete operation. + :type recursive: bool + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'recursive': {'key': 'recursive', 'type': 'bool'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageDirectoryDeletedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.url = kwargs.get('url', None) + self.recursive = kwargs.get('recursive', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageDirectoryRenamedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryRenamed event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param source_url: The path to the directory that was renamed. + :type source_url: str + :param destination_url: The new path to the directory after the rename operation. + :type destination_url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'destination_url': {'key': 'destinationUrl', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageDirectoryRenamedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.source_url = kwargs.get('source_url', None) + self.destination_url = kwargs.get('destination_url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + +class StorageLifecyclePolicyActionSummaryDetail(msrest.serialization.Model): + """Execution statistics of a specific policy action in a Blob Management cycle. + + :param total_objects_count: Total number of objects to be acted on by this action. + :type total_objects_count: long + :param success_count: Number of success operations of this action. + :type success_count: long + :param error_list: Error messages of this action if any. + :type error_list: str + """ + + _attribute_map = { + 'total_objects_count': {'key': 'totalObjectsCount', 'type': 'long'}, + 'success_count': {'key': 'successCount', 'type': 'long'}, + 'error_list': {'key': 'errorList', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageLifecyclePolicyActionSummaryDetail, self).__init__(**kwargs) + self.total_objects_count = kwargs.get('total_objects_count', None) + self.success_count = kwargs.get('success_count', None) + self.error_list = kwargs.get('error_list', None) + + +class StorageLifecyclePolicyCompletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.LifecyclePolicyCompleted event. + + :param schedule_time: The time the policy task was scheduled. + :type schedule_time: str + :param delete_summary: Execution statistics of a specific policy action in a Blob Management + cycle. + :type delete_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + :param tier_to_cool_summary: Execution statistics of a specific policy action in a Blob + Management cycle. + :type tier_to_cool_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + :param tier_to_archive_summary: Execution statistics of a specific policy action in a Blob + Management cycle. + :type tier_to_archive_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + """ + + _attribute_map = { + 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, + 'delete_summary': {'key': 'deleteSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + 'tier_to_cool_summary': {'key': 'tierToCoolSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + 'tier_to_archive_summary': {'key': 'tierToArchiveSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageLifecyclePolicyCompletedEventData, self).__init__(**kwargs) + self.schedule_time = kwargs.get('schedule_time', None) + self.delete_summary = kwargs.get('delete_summary', None) + self.tier_to_cool_summary = kwargs.get('tier_to_cool_summary', None) + self.tier_to_archive_summary = kwargs.get('tier_to_archive_summary', None) + + +class SubscriptionDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_subscription_id: The Azure resource ID of the deleted event subscription. + :vartype event_subscription_id: str + """ + + _validation = { + 'event_subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionDeletedEventData, self).__init__(**kwargs) + self.event_subscription_id = None + + +class SubscriptionValidationEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar validation_code: The validation code sent by Azure Event Grid to validate an event + subscription. To complete the validation handshake, the subscriber must either respond with + this validation code as part of the validation response, or perform a GET request on the + validationUrl (available starting version 2018-05-01-preview). + :vartype validation_code: str + :ivar validation_url: The validation URL sent by Azure Event Grid (available starting version + 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond + with the validationCode as part of the validation response, or perform a GET request on the + validationUrl (available starting version 2018-05-01-preview). + :vartype validation_url: str + """ + + _validation = { + 'validation_code': {'readonly': True}, + 'validation_url': {'readonly': True}, + } + + _attribute_map = { + 'validation_code': {'key': 'validationCode', 'type': 'str'}, + 'validation_url': {'key': 'validationUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionValidationEventData, self).__init__(**kwargs) + self.validation_code = None + self.validation_url = None + + +class SubscriptionValidationResponse(msrest.serialization.Model): + """To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response. + + :param validation_response: The validation response sent by the subscriber to Azure Event Grid + to complete the validation of an event subscription. + :type validation_response: str + """ + + _attribute_map = { + 'validation_response': {'key': 'validationResponse', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionValidationResponse, self).__init__(**kwargs) + self.validation_response = kwargs.get('validation_response', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py new file mode 100644 index 000000000000..ef19eeb0be37 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py @@ -0,0 +1,716 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, Optional + +import msrest.serialization + + +class CloudEvent(msrest.serialization.Model): + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, object] + :param id: Required. An identifier for the event. The combination of id and source must be + unique for each distinct event. + :type id: str + :param source: Required. Identifies the context in which an event happened. The combination of + id and source must be unique for each distinct event. + :type source: str + :param data: Event data specific to the event type. + :type data: object + :param data_base64: Event data specific to the event type, encoded as a base64 string. + :type data_base64: bytearray + :param type: Required. Type of event related to the originating occurrence. + :type type: str + :param time: The time (in UTC) the event was generated, in RFC3339 format. + :type time: ~datetime.datetime + :param specversion: Required. The version of the CloudEvents specification which the event + uses. + :type specversion: str + :param dataschema: Identifies the schema that data adheres to. + :type dataschema: str + :param datacontenttype: Content type of data value. + :type datacontenttype: str + :param subject: This describes the subject of the event in the context of the event producer + (identified by source). + :type subject: str + """ + + _validation = { + 'id': {'required': True}, + 'source': {'required': True}, + 'type': {'required': True}, + 'specversion': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'data_base64': {'key': 'data_base64', 'type': 'bytearray'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'specversion': {'key': 'specversion', 'type': 'str'}, + 'dataschema': {'key': 'dataschema', 'type': 'str'}, + 'datacontenttype': {'key': 'datacontenttype', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + source: str, + type: str, + specversion: str, + additional_properties: Optional[Dict[str, object]] = None, + data: Optional[object] = None, + data_base64: Optional[bytearray] = None, + time: Optional[datetime.datetime] = None, + dataschema: Optional[str] = None, + datacontenttype: Optional[str] = None, + subject: Optional[str] = None, + **kwargs + ): + super(CloudEvent, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.id = id + self.source = source + self.data = data + self.data_base64 = data_base64 + self.type = type + self.time = time + self.specversion = specversion + self.dataschema = dataschema + self.datacontenttype = datacontenttype + self.subject = subject + + +class EventGridEvent(msrest.serialization.Model): + """Properties of an event published to an Event Grid topic using the EventGrid Schema. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. An unique identifier for the event. + :type id: str + :param topic: The resource path of the event source. + :type topic: str + :param subject: Required. A resource path relative to the topic path. + :type subject: str + :param data: Required. Event data specific to the event type. + :type data: object + :param event_type: Required. The type of the event that occurred. + :type event_type: str + :param event_time: Required. The time (in UTC) the event was generated. + :type event_time: ~datetime.datetime + :ivar metadata_version: The schema version of the event metadata. + :vartype metadata_version: str + :param data_version: Required. The schema version of the data object. + :type data_version: str + """ + + _validation = { + 'id': {'required': True}, + 'subject': {'required': True}, + 'data': {'required': True}, + 'event_type': {'required': True}, + 'event_time': {'required': True}, + 'metadata_version': {'readonly': True}, + 'data_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, + 'data_version': {'key': 'dataVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + subject: str, + data: object, + event_type: str, + event_time: datetime.datetime, + data_version: str, + topic: Optional[str] = None, + **kwargs + ): + super(EventGridEvent, self).__init__(**kwargs) + self.id = id + self.topic = topic + self.subject = subject + self.data = data + self.event_type = event_type + self.event_time = event_time + self.metadata_version = None + self.data_version = data_version + + +class StorageBlobCreatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param e_tag: The etag of the blob at the time this event was triggered. + :type e_tag: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param content_offset: The offset of the blob in bytes. + :type content_offset: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'content_offset': {'key': 'contentOffset', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + e_tag: Optional[str] = None, + content_type: Optional[str] = None, + content_length: Optional[int] = None, + content_offset: Optional[int] = None, + blob_type: Optional[str] = None, + url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageBlobCreatedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.e_tag = e_tag + self.content_type = content_type + self.content_length = content_length + self.content_offset = content_offset + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageBlobDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobDeleted event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + content_type: Optional[str] = None, + blob_type: Optional[str] = None, + url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageBlobDeletedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.content_type = content_type + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageBlobRenamedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobRenamed event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param source_url: The path to the blob that was renamed. + :type source_url: str + :param destination_url: The new path to the blob after the rename operation. + :type destination_url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'destination_url': {'key': 'destinationUrl', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + source_url: Optional[str] = None, + destination_url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageBlobRenamedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.source_url = source_url + self.destination_url = destination_url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageDirectoryCreatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryCreated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param e_tag: The etag of the directory at the time this event was triggered. + :type e_tag: str + :param url: The path to the directory. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + e_tag: Optional[str] = None, + url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageDirectoryCreatedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.e_tag = e_tag + self.url = url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageDirectoryDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryDeleted event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param url: The path to the deleted directory. + :type url: str + :param recursive: Is this event for a recursive delete operation. + :type recursive: bool + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'recursive': {'key': 'recursive', 'type': 'bool'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + url: Optional[str] = None, + recursive: Optional[bool] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageDirectoryDeletedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.url = url + self.recursive = recursive + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageDirectoryRenamedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryRenamed event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the storage service for the storage API + operation that triggered this event. + :type request_id: str + :param source_url: The path to the directory that was renamed. + :type source_url: str + :param destination_url: The new path to the directory after the rename operation. + :type destination_url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular directory name. Users can use standard string comparison to understand the relative + sequence of two events on the same directory name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'destination_url': {'key': 'destinationUrl', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + source_url: Optional[str] = None, + destination_url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageDirectoryRenamedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.source_url = source_url + self.destination_url = destination_url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + +class StorageLifecyclePolicyActionSummaryDetail(msrest.serialization.Model): + """Execution statistics of a specific policy action in a Blob Management cycle. + + :param total_objects_count: Total number of objects to be acted on by this action. + :type total_objects_count: long + :param success_count: Number of success operations of this action. + :type success_count: long + :param error_list: Error messages of this action if any. + :type error_list: str + """ + + _attribute_map = { + 'total_objects_count': {'key': 'totalObjectsCount', 'type': 'long'}, + 'success_count': {'key': 'successCount', 'type': 'long'}, + 'error_list': {'key': 'errorList', 'type': 'str'}, + } + + def __init__( + self, + *, + total_objects_count: Optional[int] = None, + success_count: Optional[int] = None, + error_list: Optional[str] = None, + **kwargs + ): + super(StorageLifecyclePolicyActionSummaryDetail, self).__init__(**kwargs) + self.total_objects_count = total_objects_count + self.success_count = success_count + self.error_list = error_list + + +class StorageLifecyclePolicyCompletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.LifecyclePolicyCompleted event. + + :param schedule_time: The time the policy task was scheduled. + :type schedule_time: str + :param delete_summary: Execution statistics of a specific policy action in a Blob Management + cycle. + :type delete_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + :param tier_to_cool_summary: Execution statistics of a specific policy action in a Blob + Management cycle. + :type tier_to_cool_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + :param tier_to_archive_summary: Execution statistics of a specific policy action in a Blob + Management cycle. + :type tier_to_archive_summary: + ~event_grid_publisher_client.models.StorageLifecyclePolicyActionSummaryDetail + """ + + _attribute_map = { + 'schedule_time': {'key': 'scheduleTime', 'type': 'str'}, + 'delete_summary': {'key': 'deleteSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + 'tier_to_cool_summary': {'key': 'tierToCoolSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + 'tier_to_archive_summary': {'key': 'tierToArchiveSummary', 'type': 'StorageLifecyclePolicyActionSummaryDetail'}, + } + + def __init__( + self, + *, + schedule_time: Optional[str] = None, + delete_summary: Optional["StorageLifecyclePolicyActionSummaryDetail"] = None, + tier_to_cool_summary: Optional["StorageLifecyclePolicyActionSummaryDetail"] = None, + tier_to_archive_summary: Optional["StorageLifecyclePolicyActionSummaryDetail"] = None, + **kwargs + ): + super(StorageLifecyclePolicyCompletedEventData, self).__init__(**kwargs) + self.schedule_time = schedule_time + self.delete_summary = delete_summary + self.tier_to_cool_summary = tier_to_cool_summary + self.tier_to_archive_summary = tier_to_archive_summary + + +class SubscriptionDeletedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_subscription_id: The Azure resource ID of the deleted event subscription. + :vartype event_subscription_id: str + """ + + _validation = { + 'event_subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionDeletedEventData, self).__init__(**kwargs) + self.event_subscription_id = None + + +class SubscriptionValidationEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar validation_code: The validation code sent by Azure Event Grid to validate an event + subscription. To complete the validation handshake, the subscriber must either respond with + this validation code as part of the validation response, or perform a GET request on the + validationUrl (available starting version 2018-05-01-preview). + :vartype validation_code: str + :ivar validation_url: The validation URL sent by Azure Event Grid (available starting version + 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond + with the validationCode as part of the validation response, or perform a GET request on the + validationUrl (available starting version 2018-05-01-preview). + :vartype validation_url: str + """ + + _validation = { + 'validation_code': {'readonly': True}, + 'validation_url': {'readonly': True}, + } + + _attribute_map = { + 'validation_code': {'key': 'validationCode', 'type': 'str'}, + 'validation_url': {'key': 'validationUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionValidationEventData, self).__init__(**kwargs) + self.validation_code = None + self.validation_url = None + + +class SubscriptionValidationResponse(msrest.serialization.Model): + """To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response. + + :param validation_response: The validation response sent by the subscriber to Azure Event Grid + to complete the validation of an event subscription. + :type validation_response: str + """ + + _attribute_map = { + 'validation_response': {'key': 'validationResponse', 'type': 'str'}, + } + + def __init__( + self, + *, + validation_response: Optional[str] = None, + **kwargs + ): + super(SubscriptionValidationResponse, self).__init__(**kwargs) + self.validation_response = validation_response diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/__init__.py new file mode 100644 index 000000000000..842b4ec6d735 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_grid_publisher_client_operations import EventGridPublisherClientOperationsMixin + +__all__ = [ + 'EventGridPublisherClientOperationsMixin', +] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py new file mode 100644 index 000000000000..2e894cbcd5d5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py @@ -0,0 +1,192 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class EventGridPublisherClientOperationsMixin(object): + + def publish_events( + self, + topic_hostname, # type: str + events, # type: List["models.EventGridEvent"] + **kwargs # type: Any + ): + # type: (...) -> None + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.EventGridEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[EventGridEvent]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_events.metadata = {'url': '/api/events'} # type: ignore + + def publish_cloud_event_events( + self, + topic_hostname, # type: str + events, # type: List["models.CloudEvent"] + **kwargs # type: Any + ): + # type: (...) -> None + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.CloudEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8") + + # Construct URL + url = self.publish_cloud_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[CloudEvent]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_cloud_event_events.metadata = {'url': '/api/events'} # type: ignore + + def publish_custom_event_events( + self, + topic_hostname, # type: str + events, # type: List[object] + **kwargs # type: Any + ): + # type: (...) -> None + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_custom_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(events, '[object]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_custom_event_events.metadata = {'url': '/api/events'} # type: ignore diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/py.typed b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py new file mode 100644 index 000000000000..020150fe897e --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py @@ -0,0 +1,72 @@ +import hashlib +import hmac +import base64 +try: + from urllib.parse import quote +except ImportError: + from urllib2 import quote # type: ignore +import datetime + +from azure.core.pipeline.policies import AzureKeyCredentialPolicy +from azure.core.credentials import AzureKeyCredential +from ._shared_access_signature_credential import EventGridSharedAccessSignatureCredential +from ._signature_credential_policy import EventGridSharedAccessSignatureCredentialPolicy +from . import _constants as constants + +def generate_shared_access_signature(topic_hostname, shared_access_key, expiration_date_utc, **kwargs): + # type: (str, str, datetime.Datetime, Any) -> str + """ Helper method to generate shared access signature given hostname, key, and expiration date. + :param str topic_hostname: The topic endpoint to send the events to. + Similar to .-1.eventgrid.azure.net + :param str shared_access_key: The shared access key to be used for generating the token + :param datetime.datetime expiration_date_utc: The expiration datetime in UTC for the signature. + :param str api_version: The API Version to include in the signature. If not provided, the default API version will be used. + :rtype: str + """ + + full_topic_hostname = _get_full_topic_hostname(topic_hostname) + + full_topic_hostname = "{}?apiVersion={}".format(full_topic_hostname, kwargs.get('api_version', None) or constants.DEFAULT_API_VERSION) + encoded_resource = quote(full_topic_hostname, safe=constants.SAFE_ENCODE) + encoded_expiration_utc = quote(str(expiration_date_utc), safe=constants.SAFE_ENCODE) + + unsigned_sas = "r={}&e={}".format(encoded_resource, encoded_expiration_utc) + signature = quote(_generate_hmac(shared_access_key, unsigned_sas), safe=constants.SAFE_ENCODE) + signed_sas = "{}&s={}".format(unsigned_sas, signature) + return signed_sas + +def _get_topic_hostname_only_fqdn(topic_hostname): + if topic_hostname.startswith('http://'): + raise ValueError("HTTP is not supported. Only HTTPS is supported.") + if topic_hostname.startswith('https://'): + topic_hostname = topic_hostname.replace("https://", "") + if topic_hostname.endswith("/api/events"): + topic_hostname = topic_hostname.replace("/api/events", "") + + return topic_hostname + +def _get_full_topic_hostname(topic_hostname): + if topic_hostname.startswith('http://'): + raise ValueError("HTTP is not supported. Only HTTPS is supported.") + if not topic_hostname.startswith('https://'): + topic_hostname = "https://{}".format(topic_hostname) + if not topic_hostname.endswith("/api/events"): + topic_hostname = "{}/api/events".format(topic_hostname) + + return topic_hostname + +def _generate_hmac(key, message): + decoded_key = base64.b64decode(key) + bytes_message = message.encode('ascii') + hmac_new = hmac.new(decoded_key, bytes_message, hashlib.sha256).digest() + + return base64.b64encode(hmac_new) + +def _get_authentication_policy(credential): + if credential is None: + raise ValueError("Parameter 'self._credential' must not be None.") + if isinstance(credential, AzureKeyCredential): + authentication_policy = AzureKeyCredentialPolicy(credential=credential, name=constants.EVENTGRID_KEY_HEADER) + if isinstance(credential, EventGridSharedAccessSignatureCredential): + authentication_policy = EventGridSharedAccessSignatureCredentialPolicy(credential=credential, name=constants.EVENTGRID_TOKEN_HEADER) + return authentication_policy diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py new file mode 100644 index 000000000000..a20cc5107477 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py @@ -0,0 +1,201 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint:disable=protected-access +from typing import Optional +from msrest.serialization import UTC +import datetime as dt +import uuid +import json + +from ._generated.models import StorageBlobCreatedEventData, \ + EventGridEvent as InternalEventGridEvent, \ + CloudEvent as InternalCloudEvent +from ._shared.mixins import DictMixin + +class CloudEvent(InternalCloudEvent): #pylint:disable=too-many-instance-attributes + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Identifies the context in which an event happened. The combination of id and source must be + unique for each distinct event. If publishing to a domain topic, source must be the domain name. + :type source: str + :param data: Event data specific to the event type. + :type data: object + :param type: Required. Type of event related to the originating occurrence. + :type type: str + :param time: The time (in UTC) the event was generated, in RFC3339 format. + :type time: ~datetime.datetime + :param dataschema: Identifies the schema that data adheres to. + :type dataschema: str + :param datacontenttype: Content type of data value. + :type datacontenttype: str + :param subject: This describes the subject of the event in the context of the event producer + (identified by source). + :type subject: str + :param id: Optional. An identifier for the event. The combination of id and source must be + unique for each distinct event. + :type id: Optional[str] + """ + + _validation = { + 'source': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'data_base64': {'key': 'data_base64', 'type': 'bytearray'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'specversion': {'key': 'specversion', 'type': 'str'}, + 'dataschema': {'key': 'dataschema', 'type': 'str'}, + 'datacontenttype': {'key': 'datacontenttype', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + } + + def __init__(self, source, type, **kwargs): + # type: (str, str, Any) -> None + kwargs.setdefault('id', uuid.uuid4()) + kwargs.setdefault("source", source) + kwargs.setdefault("type", type) + kwargs.setdefault("time", dt.datetime.now(UTC()).isoformat()) + kwargs.setdefault("specversion", "1.0") + + super(CloudEvent, self).__init__(**kwargs) + + +class EventGridEvent(InternalEventGridEvent): + """Properties of an event published to an Event Grid topic using the EventGrid Schema. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param topic: The resource path of the event source. If not provided, Event Grid will stamp onto the event. + :type topic: str + :param subject: Required. A resource path relative to the topic path. + :type subject: str + :param data: Event data specific to the event type. + :type data: object + :param event_type: Required. The type of the event that occurred. + :type event_type: str + :ivar metadata_version: The schema version of the event metadata. If provided, must match Event Grid Schema exactly. + If not provided, EventGrid will stamp onto event. + :vartype metadata_version: str + :param data_version: The schema version of the data object. If not provided, will be stamped with an empty value. + :type data_version: str + :param id: Optional. An identifier for the event. The combination of id and source must be + unique for each distinct event. + :type id: Optional[str] + :param event_time: Optional.The time (in UTC) of the event. If not provided, it will be the time (in UTC) the event was generated. + :type event_time: Optional[~datetime.datetime] + """ + + _validation = { + 'id': {'required': True}, + 'subject': {'required': True}, + 'data': {'required': True}, + 'event_type': {'required': True}, + 'event_time': {'required': True}, + 'metadata_version': {'readonly': True}, + 'data_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, + 'data_version': {'key': 'dataVersion', 'type': 'str'}, + } + + def __init__(self, subject, event_type, **kwargs): + # type: (str, str, Any) -> None + kwargs.setdefault('id', uuid.uuid4()) + kwargs.setdefault('subject', subject) + kwargs.setdefault("event_type", event_type) + kwargs.setdefault('event_time', dt.datetime.now(UTC()).isoformat()) + kwargs.setdefault('data', None) + + super(EventGridEvent, self).__init__(**kwargs) + + +class DeserializedEvent(): + """The container for the deserialized event model and mapping of event envelope properties. + :param dict event: dict + """ + # class variable + _event_type_mappings = {'Microsoft.Storage.BlobCreated': StorageBlobCreatedEventData} + + def __init__(self, event): + # type: (Any) -> None + self._model = None + self._event_dict = event + + def to_json(self): + # type: () -> dict + return self._event_dict + + @property + def model(self): + # type: () -> Union[CloudEvent, EventGridEvent] + """ + Returns strongly typed EventGridEvent/CloudEvent object defined by the format of the properties. + All properties of the model are strongly typed (ie. for an EventGridEvent, event_time property will return a datetime.datetime object). + + model.data: Returns a system event type(StorageBlobCreated, StorageBlobDeleted, etc.). If model.type/model.event_type is not defined in the + system registry, returns None. + + :raise: :class:`ValueError`, when events do not follow CloudEvent or EventGridEvent schema. + + :rtype: Union[CloudEvent, EventGridEvent] + """ + if not self._model: + try: + if 'specversion' in self._event_dict.keys(): + self._model = CloudEvent.deserialize(self._event_dict) + event_type = self._model.type + else: + self._model = EventGridEvent.deserialize(self._event_dict) + event_type = self._model.event_type + except: + raise ValueError("Event is not correctly formatted CloudEvent or EventGridEvent.") + + self._deserialize_data(event_type) + + return self._model + + def _deserialize_data(self, event_type): + """ + Sets self._model.data to strongly typed event object if event type exists in _event_type_mappings. + Otherwise, sets self._model.data to None. + + :param str event_type: The event_type of the EventGridEvent object or the type of the CloudEvent object. + """ + # if system event type defined, set model.data to system event object + if event_type in DeserializedEvent._event_type_mappings: + self._model.data = (DeserializedEvent._event_type_mappings[event_type]).deserialize(self._model.data) + else: # else, if custom event, then model.data is dict and should be set to None + self._model.data = None + +class CustomEvent(DictMixin): + """The wrapper class for a CustomEvent, to be used when publishing events. + :param dict args: dict + """ + + def __init__(self, *args, **kwargs): + # type: (Any, Any) -> None + self._update(*args, **kwargs) + + def _update(self, *args, **kwargs): + for k, v in dict(*args, **kwargs).items(): + self[k] = v diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py new file mode 100644 index 000000000000..9c90992c69e6 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py @@ -0,0 +1,58 @@ +# +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Sequence +import json + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + +from ._models import CloudEvent, EventGridEvent, CustomEvent +from ._helpers import _get_topic_hostname_only_fqdn, _get_authentication_policy +from ._generated._event_grid_publisher_client import EventGridPublisherClient as EventGridPublisherClientImpl +from . import _constants as constants + +class EventGridPublisherClient(object): + """EventGrid Python Publisher Client. + + :param str topic_hostname: The topic endpoint to send the events to. + :param credential: The credential object used for authentication which implements SAS key authentication or SAS token authentication. + :type credential: Union[~azure.core.credentials.AzureKeyCredential, azure.eventgrid.EventGridSharedAccessSignatureCredential] + """ + + def __init__(self, topic_hostname, credential, **kwargs): + # type: (str, Union[AzureKeyCredential, EventGridSharedAccessSignatureCredential], Any) -> None + + topic_hostname = _get_topic_hostname_only_fqdn(topic_hostname) + + self._topic_hostname = topic_hostname + auth_policy = _get_authentication_policy(credential) + self._client = EventGridPublisherClientImpl(authentication_policy=auth_policy, **kwargs) + + def send(self, events, **kwargs): + # type: (Union[List[CloudEvent], List[EventGridEvent], List[CustomEvent]], Any) -> None + """Sends event data to topic hostname specified during client initialization. + + :param events: A list of CloudEvent/EventGridEvent/CustomEvent to be sent. + :type events: Union[List[models.CloudEvent], List[models.EventGridEvent], List[models.CustomEvent]] + :rtype: None + raise: :class:`ValueError`, when events do not follow specified SendType. + """ + + if all(isinstance(e, CloudEvent) for e in events): + self._client.publish_cloud_event_events(self._topic_hostname, events, **kwargs) + elif all(isinstance(e, EventGridEvent) for e in events): + self._client.publish_events(self._topic_hostname, events, **kwargs) + elif all(isinstance(e, CustomEvent) for e in events): + serialized_events = [dict(e) for e in events] + self._client.publish_custom_event_events(self._topic_hostname, serialized_events, **kwargs) + else: + raise ValueError("Event schema is not correct.") diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/__init__.py new file mode 100644 index 000000000000..4897306df708 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/__init__.py @@ -0,0 +1,8 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +from .mixins import DictMixin +__all__ = ['DictMixin'] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py new file mode 100644 index 000000000000..0b24e8edc45c --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py @@ -0,0 +1,58 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint:disable=protected-access + +class DictMixin(object): + + def __setitem__(self, key, item): + self.__dict__[key] = item + + def __getitem__(self, key): + return self.__dict__[key] + + def __contains__(self, key): + return key in self.__dict__ + + def __repr__(self): + return str(self) + + def __len__(self): + return len(self.keys()) + + def __delitem__(self, key): + self.__dict__[key] = None + + def __eq__(self, other): + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other): + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self): + return str({k: v for k, v in self.__dict__.items() if not k.startswith('_')}) + + def has_key(self, k, **kwargs): + return k in self.__dict__ + + def update(self, *args, **kwargs): + return self.__dict__.update(*args, **kwargs) + + def keys(self, **kwargs): + return [k for k in self.__dict__ if not k.startswith('_')] + + def values(self, **kwargs): + return [v for k, v in self.__dict__.items() if not k.startswith('_')] + + def items(self, **kwargs): + return [(k, v) for k, v in self.__dict__.items() if not k.startswith('_')] + + def get(self, key, default=None, **kwargs): + if key in self.__dict__: + return self.__dict__[key] + return default diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py new file mode 100644 index 000000000000..dece8da69fe1 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py @@ -0,0 +1,33 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- + +class EventGridSharedAccessSignatureCredential(object): + """Creates an instance of an EventGridSharedAccessSignatureCredential for use with a service client. + :param str signature: Signature to use in authentication. + """ + + def __init__(self, signature): + # type: (str) -> None + self._signature = signature + + @property + def signature(self): + # type: () -> str + """ + The value of the signature to be used in authentication. + + :rtype: str + """ + return self._signature + + def update(self, signature): + # type: (str) -> None + """ + Updates the key property value of the signature to be used in authentication. + + :param str signature: Signature to use in authentication. + """ + self._signature = signature diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py new file mode 100644 index 000000000000..3370595d1d5d --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py @@ -0,0 +1,23 @@ +import six + +from azure.core.pipeline.policies import SansIOHTTPPolicy + +class EventGridSharedAccessSignatureCredentialPolicy(SansIOHTTPPolicy): + """Adds a token header for the provided credential. + :param credential: The credential used to authenticate requests. + :type credential: ~azure.eventgrid.EventGridSharedAccessSignatureCredential + :param str name: The name of the token header used for the credential. + :raises: ValueError or TypeError + """ + def __init__(self, credential, name, **kwargs): # pylint: disable=unused-argument + # type: (EventGridSharedAccessSignatureCredential, str, Any) -> None + super(EventGridSharedAccessSignatureCredentialPolicy, self).__init__() + self._credential = credential + if not name: + raise ValueError("name can not be None or empty") + if not isinstance(name, six.string_types): + raise TypeError("name must be a string.") + self._name = name + + def on_request(self, request): + request.http_request.headers[self._name] = self._credential.signature diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/version.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py similarity index 95% rename from sdk/eventgrid/azure-eventgrid/azure/eventgrid/version.py rename to sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py index d24076f8d84b..b24b0b48a5e6 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/version.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_version.py @@ -9,5 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.3.0" - +VERSION = "2.0.0b1" diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/__init__.py new file mode 100644 index 000000000000..2de020d81e02 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/__init__.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +from ._publisher_client_async import EventGridPublisherClient + +__all__ = ['EventGridPublisherClient'] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py new file mode 100644 index 000000000000..2bc93dd6981f --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from .._models import CloudEvent, EventGridEvent +from .._helpers import _get_topic_hostname_only_fqdn, _get_authentication_policy +from azure.core.pipeline.policies import AzureKeyCredentialPolicy +from azure.core.credentials import AzureKeyCredential +from .._generated.aio import EventGridPublisherClient as EventGridPublisherClientAsync +from .. import _constants as constants + + +class EventGridPublisherClient(object): + """Asynchronous EventGrid Python Publisher Client. + + :param str topic_hostname: The topic endpoint to send the events to. + :param credential: The credential object used for authentication which implements SAS key authentication or SAS token authentication. + :type credential: Union[~azure.core.credentials.AzureKeyCredential, azure.eventgrid.EventGridSharedAccessSignatureCredential] + """ + + def __init__(self, topic_hostname, credential, **kwargs): + # type: (str, Union[AzureKeyCredential, EventGridSharedAccessSignatureCredential], Any) -> None + auth_policy = _get_authentication_policy(credential) + self._client = EventGridPublisherClientAsync(authentication_policy=auth_policy) + self._topic_hostname = topic_hostname + + + async def send(self, events, **kwargs): + # type: (Union[List[CloudEvent], List[EventGridEvent], List[CustomEvent]], Any) -> None + """Sends event data to topic hostname specified during client initialization. + + :param events: A list of CloudEvent/EventGridEvent/CustomEvent to be sent. + :type events: Union[List[models.CloudEvent], List[models.EventGridEvent], List[models.CustomEvent]] + :rtype: None + raise: :class:`ValueError`, when events do not follow specified SendType. + """ + + if all(isinstance(e, CloudEvent) for e in events): + await self._client.publish_cloud_event_events(self._topic_hostname, events, **kwargs) + elif all(isinstance(e, EventGridEvent) for e in events): + await self._client.publish_events(self._topic_hostname, events, **kwargs) + elif all(isinstance(e, CustomEvent) for e in events): + serialized_events = [dict(e) for e in events] + await self._client.publish_custom_event_events(self._topic_hostname, serialized_events, **kwargs) + else: + raise ValueError("Event schema is not correct.") + diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/event_grid_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/event_grid_client.py deleted file mode 100644 index cd2878ff4c78..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/event_grid_client.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError -from . import models - - -class EventGridClientConfiguration(Configuration): - """Configuration for EventGridClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, credentials): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - base_url = 'https://{topicHostname}' - - super(EventGridClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-eventgrid/{}'.format(VERSION)) - - self.credentials = credentials - - -class EventGridClient(SDKClient): - """EventGrid Client - - :ivar config: Configuration for client. - :vartype config: EventGridClientConfiguration - - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, credentials): - - self.config = EventGridClientConfiguration(credentials) - super(EventGridClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-01-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - - def publish_events( - self, topic_hostname, events, custom_headers=None, raw=False, **operation_config): - """Publishes a batch of events to an Azure Event Grid topic. - - :param topic_hostname: The host name of the topic, e.g. - topic1.westus2-1.eventgrid.azure.net - :type topic_hostname: str - :param events: An array of events to be published to Event Grid. - :type events: list[~azure.eventgrid.models.EventGridEvent] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.publish_events.metadata['url'] - path_format_arguments = { - 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(events, '[EventGridEvent]') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise HttpOperationError(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - publish_events.metadata = {'url': '/api/events'} diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py deleted file mode 100644 index 30defc1761ca..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py +++ /dev/null @@ -1,266 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -try: - from .storage_blob_created_event_data_py3 import StorageBlobCreatedEventData - from .storage_blob_deleted_event_data_py3 import StorageBlobDeletedEventData - from .event_hub_capture_file_created_event_data_py3 import EventHubCaptureFileCreatedEventData - from .resource_write_success_data_py3 import ResourceWriteSuccessData - from .resource_write_failure_data_py3 import ResourceWriteFailureData - from .resource_write_cancel_data_py3 import ResourceWriteCancelData - from .resource_delete_success_data_py3 import ResourceDeleteSuccessData - from .resource_delete_failure_data_py3 import ResourceDeleteFailureData - from .resource_delete_cancel_data_py3 import ResourceDeleteCancelData - from .resource_action_success_data_py3 import ResourceActionSuccessData - from .resource_action_failure_data_py3 import ResourceActionFailureData - from .resource_action_cancel_data_py3 import ResourceActionCancelData - from .event_grid_event_py3 import EventGridEvent - from .subscription_validation_event_data_py3 import SubscriptionValidationEventData - from .subscription_validation_response_py3 import SubscriptionValidationResponse - from .subscription_deleted_event_data_py3 import SubscriptionDeletedEventData - from .iot_hub_device_created_event_data_py3 import IotHubDeviceCreatedEventData - from .iot_hub_device_deleted_event_data_py3 import IotHubDeviceDeletedEventData - from .iot_hub_device_connected_event_data_py3 import IotHubDeviceConnectedEventData - from .iot_hub_device_disconnected_event_data_py3 import IotHubDeviceDisconnectedEventData - from .iot_hub_device_telemetry_event_data_py3 import IotHubDeviceTelemetryEventData - from .device_twin_metadata_py3 import DeviceTwinMetadata - from .device_twin_properties_py3 import DeviceTwinProperties - from .device_twin_info_properties_py3 import DeviceTwinInfoProperties - from .device_twin_info_x509_thumbprint_py3 import DeviceTwinInfoX509Thumbprint - from .device_twin_info_py3 import DeviceTwinInfo - from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties - from .device_connection_state_event_info_py3 import DeviceConnectionStateEventInfo - from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties - from .device_telemetry_event_properties_py3 import DeviceTelemetryEventProperties - from .container_registry_image_pushed_event_data_py3 import ContainerRegistryImagePushedEventData - from .container_registry_image_deleted_event_data_py3 import ContainerRegistryImageDeletedEventData - from .container_registry_chart_pushed_event_data_py3 import ContainerRegistryChartPushedEventData - from .container_registry_chart_deleted_event_data_py3 import ContainerRegistryChartDeletedEventData - from .container_registry_event_target_py3 import ContainerRegistryEventTarget - from .container_registry_event_request_py3 import ContainerRegistryEventRequest - from .container_registry_event_actor_py3 import ContainerRegistryEventActor - from .container_registry_event_source_py3 import ContainerRegistryEventSource - from .container_registry_event_data_py3 import ContainerRegistryEventData - from .container_registry_artifact_event_target_py3 import ContainerRegistryArtifactEventTarget - from .container_registry_artifact_event_data_py3 import ContainerRegistryArtifactEventData - from .service_bus_active_messages_available_with_no_listeners_event_data_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData - from .service_bus_deadletter_messages_available_with_no_listeners_event_data_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData - from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - from .media_job_error_detail_py3 import MediaJobErrorDetail - from .media_job_error_py3 import MediaJobError - from .media_job_output_py3 import MediaJobOutput - from .media_job_output_asset_py3 import MediaJobOutputAsset - from .media_job_output_progress_event_data_py3 import MediaJobOutputProgressEventData - from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - from .media_job_scheduled_event_data_py3 import MediaJobScheduledEventData - from .media_job_processing_event_data_py3 import MediaJobProcessingEventData - from .media_job_canceling_event_data_py3 import MediaJobCancelingEventData - from .media_job_finished_event_data_py3 import MediaJobFinishedEventData - from .media_job_canceled_event_data_py3 import MediaJobCanceledEventData - from .media_job_errored_event_data_py3 import MediaJobErroredEventData - from .media_job_output_canceled_event_data_py3 import MediaJobOutputCanceledEventData - from .media_job_output_canceling_event_data_py3 import MediaJobOutputCancelingEventData - from .media_job_output_errored_event_data_py3 import MediaJobOutputErroredEventData - from .media_job_output_finished_event_data_py3 import MediaJobOutputFinishedEventData - from .media_job_output_processing_event_data_py3 import MediaJobOutputProcessingEventData - from .media_job_output_scheduled_event_data_py3 import MediaJobOutputScheduledEventData - from .media_live_event_encoder_connected_event_data_py3 import MediaLiveEventEncoderConnectedEventData - from .media_live_event_connection_rejected_event_data_py3 import MediaLiveEventConnectionRejectedEventData - from .media_live_event_encoder_disconnected_event_data_py3 import MediaLiveEventEncoderDisconnectedEventData - from .media_live_event_incoming_stream_received_event_data_py3 import MediaLiveEventIncomingStreamReceivedEventData - from .media_live_event_incoming_streams_out_of_sync_event_data_py3 import MediaLiveEventIncomingStreamsOutOfSyncEventData - from .media_live_event_incoming_video_streams_out_of_sync_event_data_py3 import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData - from .media_live_event_incoming_data_chunk_dropped_event_data_py3 import MediaLiveEventIncomingDataChunkDroppedEventData - from .media_live_event_ingest_heartbeat_event_data_py3 import MediaLiveEventIngestHeartbeatEventData - from .media_live_event_track_discontinuity_detected_event_data_py3 import MediaLiveEventTrackDiscontinuityDetectedEventData - from .maps_geofence_entered_event_data_py3 import MapsGeofenceEnteredEventData - from .maps_geofence_exited_event_data_py3 import MapsGeofenceExitedEventData - from .maps_geofence_result_event_data_py3 import MapsGeofenceResultEventData - from .maps_geofence_geometry_py3 import MapsGeofenceGeometry - from .maps_geofence_event_properties_py3 import MapsGeofenceEventProperties - from .app_configuration_key_value_modified_event_data_py3 import AppConfigurationKeyValueModifiedEventData - from .app_configuration_key_value_deleted_event_data_py3 import AppConfigurationKeyValueDeletedEventData - from .signal_rservice_client_connection_connected_event_data_py3 import SignalRServiceClientConnectionConnectedEventData - from .signal_rservice_client_connection_disconnected_event_data_py3 import SignalRServiceClientConnectionDisconnectedEventData -except (SyntaxError, ImportError): - from .storage_blob_created_event_data import StorageBlobCreatedEventData - from .storage_blob_deleted_event_data import StorageBlobDeletedEventData - from .event_hub_capture_file_created_event_data import EventHubCaptureFileCreatedEventData - from .resource_write_success_data import ResourceWriteSuccessData - from .resource_write_failure_data import ResourceWriteFailureData - from .resource_write_cancel_data import ResourceWriteCancelData - from .resource_delete_success_data import ResourceDeleteSuccessData - from .resource_delete_failure_data import ResourceDeleteFailureData - from .resource_delete_cancel_data import ResourceDeleteCancelData - from .resource_action_success_data import ResourceActionSuccessData - from .resource_action_failure_data import ResourceActionFailureData - from .resource_action_cancel_data import ResourceActionCancelData - from .event_grid_event import EventGridEvent - from .subscription_validation_event_data import SubscriptionValidationEventData - from .subscription_validation_response import SubscriptionValidationResponse - from .subscription_deleted_event_data import SubscriptionDeletedEventData - from .iot_hub_device_created_event_data import IotHubDeviceCreatedEventData - from .iot_hub_device_deleted_event_data import IotHubDeviceDeletedEventData - from .iot_hub_device_connected_event_data import IotHubDeviceConnectedEventData - from .iot_hub_device_disconnected_event_data import IotHubDeviceDisconnectedEventData - from .iot_hub_device_telemetry_event_data import IotHubDeviceTelemetryEventData - from .device_twin_metadata import DeviceTwinMetadata - from .device_twin_properties import DeviceTwinProperties - from .device_twin_info_properties import DeviceTwinInfoProperties - from .device_twin_info_x509_thumbprint import DeviceTwinInfoX509Thumbprint - from .device_twin_info import DeviceTwinInfo - from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties - from .device_connection_state_event_info import DeviceConnectionStateEventInfo - from .device_connection_state_event_properties import DeviceConnectionStateEventProperties - from .device_telemetry_event_properties import DeviceTelemetryEventProperties - from .container_registry_image_pushed_event_data import ContainerRegistryImagePushedEventData - from .container_registry_image_deleted_event_data import ContainerRegistryImageDeletedEventData - from .container_registry_chart_pushed_event_data import ContainerRegistryChartPushedEventData - from .container_registry_chart_deleted_event_data import ContainerRegistryChartDeletedEventData - from .container_registry_event_target import ContainerRegistryEventTarget - from .container_registry_event_request import ContainerRegistryEventRequest - from .container_registry_event_actor import ContainerRegistryEventActor - from .container_registry_event_source import ContainerRegistryEventSource - from .container_registry_event_data import ContainerRegistryEventData - from .container_registry_artifact_event_target import ContainerRegistryArtifactEventTarget - from .container_registry_artifact_event_data import ContainerRegistryArtifactEventData - from .service_bus_active_messages_available_with_no_listeners_event_data import ServiceBusActiveMessagesAvailableWithNoListenersEventData - from .service_bus_deadletter_messages_available_with_no_listeners_event_data import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData - from .media_job_state_change_event_data import MediaJobStateChangeEventData - from .media_job_error_detail import MediaJobErrorDetail - from .media_job_error import MediaJobError - from .media_job_output import MediaJobOutput - from .media_job_output_asset import MediaJobOutputAsset - from .media_job_output_progress_event_data import MediaJobOutputProgressEventData - from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - from .media_job_scheduled_event_data import MediaJobScheduledEventData - from .media_job_processing_event_data import MediaJobProcessingEventData - from .media_job_canceling_event_data import MediaJobCancelingEventData - from .media_job_finished_event_data import MediaJobFinishedEventData - from .media_job_canceled_event_data import MediaJobCanceledEventData - from .media_job_errored_event_data import MediaJobErroredEventData - from .media_job_output_canceled_event_data import MediaJobOutputCanceledEventData - from .media_job_output_canceling_event_data import MediaJobOutputCancelingEventData - from .media_job_output_errored_event_data import MediaJobOutputErroredEventData - from .media_job_output_finished_event_data import MediaJobOutputFinishedEventData - from .media_job_output_processing_event_data import MediaJobOutputProcessingEventData - from .media_job_output_scheduled_event_data import MediaJobOutputScheduledEventData - from .media_live_event_encoder_connected_event_data import MediaLiveEventEncoderConnectedEventData - from .media_live_event_connection_rejected_event_data import MediaLiveEventConnectionRejectedEventData - from .media_live_event_encoder_disconnected_event_data import MediaLiveEventEncoderDisconnectedEventData - from .media_live_event_incoming_stream_received_event_data import MediaLiveEventIncomingStreamReceivedEventData - from .media_live_event_incoming_streams_out_of_sync_event_data import MediaLiveEventIncomingStreamsOutOfSyncEventData - from .media_live_event_incoming_video_streams_out_of_sync_event_data import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData - from .media_live_event_incoming_data_chunk_dropped_event_data import MediaLiveEventIncomingDataChunkDroppedEventData - from .media_live_event_ingest_heartbeat_event_data import MediaLiveEventIngestHeartbeatEventData - from .media_live_event_track_discontinuity_detected_event_data import MediaLiveEventTrackDiscontinuityDetectedEventData - from .maps_geofence_entered_event_data import MapsGeofenceEnteredEventData - from .maps_geofence_exited_event_data import MapsGeofenceExitedEventData - from .maps_geofence_result_event_data import MapsGeofenceResultEventData - from .maps_geofence_geometry import MapsGeofenceGeometry - from .maps_geofence_event_properties import MapsGeofenceEventProperties - from .app_configuration_key_value_modified_event_data import AppConfigurationKeyValueModifiedEventData - from .app_configuration_key_value_deleted_event_data import AppConfigurationKeyValueDeletedEventData - from .signal_rservice_client_connection_connected_event_data import SignalRServiceClientConnectionConnectedEventData - from .signal_rservice_client_connection_disconnected_event_data import SignalRServiceClientConnectionDisconnectedEventData -from .event_grid_client_enums import ( - MediaJobState, - MediaJobErrorCode, - MediaJobErrorCategory, - MediaJobRetry, -) - -__all__ = [ - 'StorageBlobCreatedEventData', - 'StorageBlobDeletedEventData', - 'EventHubCaptureFileCreatedEventData', - 'ResourceWriteSuccessData', - 'ResourceWriteFailureData', - 'ResourceWriteCancelData', - 'ResourceDeleteSuccessData', - 'ResourceDeleteFailureData', - 'ResourceDeleteCancelData', - 'ResourceActionSuccessData', - 'ResourceActionFailureData', - 'ResourceActionCancelData', - 'EventGridEvent', - 'SubscriptionValidationEventData', - 'SubscriptionValidationResponse', - 'SubscriptionDeletedEventData', - 'IotHubDeviceCreatedEventData', - 'IotHubDeviceDeletedEventData', - 'IotHubDeviceConnectedEventData', - 'IotHubDeviceDisconnectedEventData', - 'IotHubDeviceTelemetryEventData', - 'DeviceTwinMetadata', - 'DeviceTwinProperties', - 'DeviceTwinInfoProperties', - 'DeviceTwinInfoX509Thumbprint', - 'DeviceTwinInfo', - 'DeviceLifeCycleEventProperties', - 'DeviceConnectionStateEventInfo', - 'DeviceConnectionStateEventProperties', - 'DeviceTelemetryEventProperties', - 'ContainerRegistryImagePushedEventData', - 'ContainerRegistryImageDeletedEventData', - 'ContainerRegistryChartPushedEventData', - 'ContainerRegistryChartDeletedEventData', - 'ContainerRegistryEventTarget', - 'ContainerRegistryEventRequest', - 'ContainerRegistryEventActor', - 'ContainerRegistryEventSource', - 'ContainerRegistryEventData', - 'ContainerRegistryArtifactEventTarget', - 'ContainerRegistryArtifactEventData', - 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', - 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', - 'MediaJobStateChangeEventData', - 'MediaJobErrorDetail', - 'MediaJobError', - 'MediaJobOutput', - 'MediaJobOutputAsset', - 'MediaJobOutputProgressEventData', - 'MediaJobOutputStateChangeEventData', - 'MediaJobScheduledEventData', - 'MediaJobProcessingEventData', - 'MediaJobCancelingEventData', - 'MediaJobFinishedEventData', - 'MediaJobCanceledEventData', - 'MediaJobErroredEventData', - 'MediaJobOutputCanceledEventData', - 'MediaJobOutputCancelingEventData', - 'MediaJobOutputErroredEventData', - 'MediaJobOutputFinishedEventData', - 'MediaJobOutputProcessingEventData', - 'MediaJobOutputScheduledEventData', - 'MediaLiveEventEncoderConnectedEventData', - 'MediaLiveEventConnectionRejectedEventData', - 'MediaLiveEventEncoderDisconnectedEventData', - 'MediaLiveEventIncomingStreamReceivedEventData', - 'MediaLiveEventIncomingStreamsOutOfSyncEventData', - 'MediaLiveEventIncomingVideoStreamsOutOfSyncEventData', - 'MediaLiveEventIncomingDataChunkDroppedEventData', - 'MediaLiveEventIngestHeartbeatEventData', - 'MediaLiveEventTrackDiscontinuityDetectedEventData', - 'MapsGeofenceEnteredEventData', - 'MapsGeofenceExitedEventData', - 'MapsGeofenceResultEventData', - 'MapsGeofenceGeometry', - 'MapsGeofenceEventProperties', - 'AppConfigurationKeyValueModifiedEventData', - 'AppConfigurationKeyValueDeletedEventData', - 'SignalRServiceClientConnectionConnectedEventData', - 'SignalRServiceClientConnectionDisconnectedEventData', - 'MediaJobState', - 'MediaJobErrorCode', - 'MediaJobErrorCategory', - 'MediaJobRetry', -] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data.py deleted file mode 100644 index 8a0adb6c209a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppConfigurationKeyValueDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.AppConfiguration.KeyValueDeleted event. - - :param key: The key used to identify the key-value that was deleted. - :type key: str - :param label: The label, if any, used to identify the key-value that was - deleted. - :type label: str - :param etag: The etag representing the key-value that was deleted. - :type etag: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AppConfigurationKeyValueDeletedEventData, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.label = kwargs.get('label', None) - self.etag = kwargs.get('etag', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data_py3.py deleted file mode 100644 index 28ac0ab4055f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_deleted_event_data_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppConfigurationKeyValueDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.AppConfiguration.KeyValueDeleted event. - - :param key: The key used to identify the key-value that was deleted. - :type key: str - :param label: The label, if any, used to identify the key-value that was - deleted. - :type label: str - :param etag: The etag representing the key-value that was deleted. - :type etag: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, *, key: str=None, label: str=None, etag: str=None, **kwargs) -> None: - super(AppConfigurationKeyValueDeletedEventData, self).__init__(**kwargs) - self.key = key - self.label = label - self.etag = etag diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data.py deleted file mode 100644 index e0147ee242b2..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppConfigurationKeyValueModifiedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.AppConfiguration.KeyValueModified event. - - :param key: The key used to identify the key-value that was modified. - :type key: str - :param label: The label, if any, used to identify the key-value that was - modified. - :type label: str - :param etag: The etag representing the new state of the key-value. - :type etag: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AppConfigurationKeyValueModifiedEventData, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.label = kwargs.get('label', None) - self.etag = kwargs.get('etag', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data_py3.py deleted file mode 100644 index b37c56469de8..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/app_configuration_key_value_modified_event_data_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AppConfigurationKeyValueModifiedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.AppConfiguration.KeyValueModified event. - - :param key: The key used to identify the key-value that was modified. - :type key: str - :param label: The label, if any, used to identify the key-value that was - modified. - :type label: str - :param etag: The etag representing the new state of the key-value. - :type etag: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, *, key: str=None, label: str=None, etag: str=None, **kwargs) -> None: - super(AppConfigurationKeyValueModifiedEventData, self).__init__(**kwargs) - self.key = key - self.label = label - self.etag = etag diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data.py deleted file mode 100644 index 464d9ede7215..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryArtifactEventData(Model): - """The content of the event request message. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryArtifactEventData, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.timestamp = kwargs.get('timestamp', None) - self.action = kwargs.get('action', None) - self.target = kwargs.get('target', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data_py3.py deleted file mode 100644 index abd508e82b8e..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_data_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryArtifactEventData(Model): - """The content of the event request message. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, **kwargs) -> None: - super(ContainerRegistryArtifactEventData, self).__init__(**kwargs) - self.id = id - self.timestamp = timestamp - self.action = action - self.target = target diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target.py deleted file mode 100644 index 661b8c55564a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryArtifactEventTarget(Model): - """The target of the event. - - :param media_type: The MIME type of the artifact. - :type media_type: str - :param size: The size in bytes of the artifact. - :type size: long - :param digest: The digest of the artifact. - :type digest: str - :param repository: The repository name of the artifact. - :type repository: str - :param tag: The tag of the artifact. - :type tag: str - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: str - """ - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - 'digest': {'key': 'digest', 'type': 'str'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryArtifactEventTarget, self).__init__(**kwargs) - self.media_type = kwargs.get('media_type', None) - self.size = kwargs.get('size', None) - self.digest = kwargs.get('digest', None) - self.repository = kwargs.get('repository', None) - self.tag = kwargs.get('tag', None) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target_py3.py deleted file mode 100644 index 1acf124735a7..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_artifact_event_target_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryArtifactEventTarget(Model): - """The target of the event. - - :param media_type: The MIME type of the artifact. - :type media_type: str - :param size: The size in bytes of the artifact. - :type size: long - :param digest: The digest of the artifact. - :type digest: str - :param repository: The repository name of the artifact. - :type repository: str - :param tag: The tag of the artifact. - :type tag: str - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: str - """ - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - 'digest': {'key': 'digest', 'type': 'str'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__(self, *, media_type: str=None, size: int=None, digest: str=None, repository: str=None, tag: str=None, name: str=None, version: str=None, **kwargs) -> None: - super(ContainerRegistryArtifactEventTarget, self).__init__(**kwargs) - self.media_type = media_type - self.size = size - self.digest = digest - self.repository = repository - self.tag = tag - self.name = name - self.version = version diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data.py deleted file mode 100644 index bfca65e364b9..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_artifact_event_data import ContainerRegistryArtifactEventData - - -class ContainerRegistryChartDeletedEventData(ContainerRegistryArtifactEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ChartDeleted event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryChartDeletedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data_py3.py deleted file mode 100644 index 7c8b2d18d26a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_deleted_event_data_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_artifact_event_data_py3 import ContainerRegistryArtifactEventData - - -class ContainerRegistryChartDeletedEventData(ContainerRegistryArtifactEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ChartDeleted event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, **kwargs) -> None: - super(ContainerRegistryChartDeletedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data.py deleted file mode 100644 index 5a2b4b37e6cf..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_artifact_event_data import ContainerRegistryArtifactEventData - - -class ContainerRegistryChartPushedEventData(ContainerRegistryArtifactEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ChartPushed event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryChartPushedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data_py3.py deleted file mode 100644 index ecce11098dac..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_chart_pushed_event_data_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_artifact_event_data_py3 import ContainerRegistryArtifactEventData - - -class ContainerRegistryChartPushedEventData(ContainerRegistryArtifactEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ChartPushed event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryArtifactEventTarget - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryArtifactEventTarget'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, **kwargs) -> None: - super(ContainerRegistryChartPushedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py deleted file mode 100644 index 4fcf82f6a7fc..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventActor(Model): - """The agent that initiated the event. For most situations, this could be from - the authorization context of the request. - - :param name: The subject or username associated with the request context - that generated the event. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryEventActor, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py deleted file mode 100644 index 419b4e917e60..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventActor(Model): - """The agent that initiated the event. For most situations, this could be from - the authorization context of the request. - - :param name: The subject or username associated with the request context - that generated the event. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(ContainerRegistryEventActor, self).__init__(**kwargs) - self.name = name diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py deleted file mode 100644 index f2b7d10a3f3f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventData(Model): - """The content of the event request message. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryEventData, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.timestamp = kwargs.get('timestamp', None) - self.action = kwargs.get('action', None) - self.target = kwargs.get('target', None) - self.request = kwargs.get('request', None) - self.actor = kwargs.get('actor', None) - self.source = kwargs.get('source', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py deleted file mode 100644 index 1729ad8c9cba..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventData(Model): - """The content of the event request message. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: - super(ContainerRegistryEventData, self).__init__(**kwargs) - self.id = id - self.timestamp = timestamp - self.action = action - self.target = target - self.request = request - self.actor = actor - self.source = source diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py deleted file mode 100644 index 51d0917c1eb5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventRequest(Model): - """The request that generated the event. - - :param id: The ID of the request that initiated the event. - :type id: str - :param addr: The IP or hostname and possibly port of the client connection - that initiated the event. This is the RemoteAddr from the standard http - request. - :type addr: str - :param host: The externally accessible hostname of the registry instance, - as specified by the http host header on incoming requests. - :type host: str - :param method: The request method that generated the event. - :type method: str - :param useragent: The user agent header of the request. - :type useragent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'addr': {'key': 'addr', 'type': 'str'}, - 'host': {'key': 'host', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - 'useragent': {'key': 'useragent', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryEventRequest, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.addr = kwargs.get('addr', None) - self.host = kwargs.get('host', None) - self.method = kwargs.get('method', None) - self.useragent = kwargs.get('useragent', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py deleted file mode 100644 index 4f14fff4ad67..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventRequest(Model): - """The request that generated the event. - - :param id: The ID of the request that initiated the event. - :type id: str - :param addr: The IP or hostname and possibly port of the client connection - that initiated the event. This is the RemoteAddr from the standard http - request. - :type addr: str - :param host: The externally accessible hostname of the registry instance, - as specified by the http host header on incoming requests. - :type host: str - :param method: The request method that generated the event. - :type method: str - :param useragent: The user agent header of the request. - :type useragent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'addr': {'key': 'addr', 'type': 'str'}, - 'host': {'key': 'host', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - 'useragent': {'key': 'useragent', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, addr: str=None, host: str=None, method: str=None, useragent: str=None, **kwargs) -> None: - super(ContainerRegistryEventRequest, self).__init__(**kwargs) - self.id = id - self.addr = addr - self.host = host - self.method = method - self.useragent = useragent diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py deleted file mode 100644 index 4cd58ec01101..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventSource(Model): - """The registry node that generated the event. Put differently, while the - actor initiates the event, the source generates it. - - :param addr: The IP or hostname and the port of the registry node that - generated the event. Generally, this will be resolved by os.Hostname() - along with the running port. - :type addr: str - :param instance_id: The running instance of an application. Changes after - each restart. - :type instance_id: str - """ - - _attribute_map = { - 'addr': {'key': 'addr', 'type': 'str'}, - 'instance_id': {'key': 'instanceID', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryEventSource, self).__init__(**kwargs) - self.addr = kwargs.get('addr', None) - self.instance_id = kwargs.get('instance_id', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py deleted file mode 100644 index b12c6c354a61..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventSource(Model): - """The registry node that generated the event. Put differently, while the - actor initiates the event, the source generates it. - - :param addr: The IP or hostname and the port of the registry node that - generated the event. Generally, this will be resolved by os.Hostname() - along with the running port. - :type addr: str - :param instance_id: The running instance of an application. Changes after - each restart. - :type instance_id: str - """ - - _attribute_map = { - 'addr': {'key': 'addr', 'type': 'str'}, - 'instance_id': {'key': 'instanceID', 'type': 'str'}, - } - - def __init__(self, *, addr: str=None, instance_id: str=None, **kwargs) -> None: - super(ContainerRegistryEventSource, self).__init__(**kwargs) - self.addr = addr - self.instance_id = instance_id diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py deleted file mode 100644 index fd8c0448169c..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventTarget(Model): - """The target of the event. - - :param media_type: The MIME type of the referenced object. - :type media_type: str - :param size: The number of bytes of the content. Same as Length field. - :type size: long - :param digest: The digest of the content, as defined by the Registry V2 - HTTP API Specification. - :type digest: str - :param length: The number of bytes of the content. Same as Size field. - :type length: long - :param repository: The repository name. - :type repository: str - :param url: The direct URL to the content. - :type url: str - :param tag: The tag name. - :type tag: str - """ - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - 'digest': {'key': 'digest', 'type': 'str'}, - 'length': {'key': 'length', 'type': 'long'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryEventTarget, self).__init__(**kwargs) - self.media_type = kwargs.get('media_type', None) - self.size = kwargs.get('size', None) - self.digest = kwargs.get('digest', None) - self.length = kwargs.get('length', None) - self.repository = kwargs.get('repository', None) - self.url = kwargs.get('url', None) - self.tag = kwargs.get('tag', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py deleted file mode 100644 index accbe49f9615..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContainerRegistryEventTarget(Model): - """The target of the event. - - :param media_type: The MIME type of the referenced object. - :type media_type: str - :param size: The number of bytes of the content. Same as Length field. - :type size: long - :param digest: The digest of the content, as defined by the Registry V2 - HTTP API Specification. - :type digest: str - :param length: The number of bytes of the content. Same as Size field. - :type length: long - :param repository: The repository name. - :type repository: str - :param url: The direct URL to the content. - :type url: str - :param tag: The tag name. - :type tag: str - """ - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'long'}, - 'digest': {'key': 'digest', 'type': 'str'}, - 'length': {'key': 'length', 'type': 'long'}, - 'repository': {'key': 'repository', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - } - - def __init__(self, *, media_type: str=None, size: int=None, digest: str=None, length: int=None, repository: str=None, url: str=None, tag: str=None, **kwargs) -> None: - super(ContainerRegistryEventTarget, self).__init__(**kwargs) - self.media_type = media_type - self.size = size - self.digest = digest - self.length = length - self.repository = repository - self.url = url - self.tag = tag diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py deleted file mode 100644 index 5db3644bb11f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_event_data import ContainerRegistryEventData - - -class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ImageDeleted event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryImageDeletedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py deleted file mode 100644 index 7365ea5c6a98..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_event_data_py3 import ContainerRegistryEventData - - -class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ImageDeleted event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: - super(ContainerRegistryImageDeletedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, request=request, actor=actor, source=source, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py deleted file mode 100644 index 6ddc5985f4dc..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_event_data import ContainerRegistryEventData - - -class ContainerRegistryImagePushedEventData(ContainerRegistryEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ImagePushed event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, **kwargs): - super(ContainerRegistryImagePushedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py deleted file mode 100644 index f12aa21fc809..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .container_registry_event_data_py3 import ContainerRegistryEventData - - -class ContainerRegistryImagePushedEventData(ContainerRegistryEventData): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ContainerRegistry.ImagePushed event. - - :param id: The event ID. - :type id: str - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param action: The action that encompasses the provided event. - :type action: str - :param target: The target of the event. - :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget - :param request: The request that generated the event. - :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest - :param actor: The agent that initiated the event. For most situations, - this could be from the authorization context of the request. - :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor - :param source: The registry node that generated the event. Put - differently, while the actor initiates the event, the source generates it. - :type source: ~azure.eventgrid.models.ContainerRegistryEventSource - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'action': {'key': 'action', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, - 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, - 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, - 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, - } - - def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: - super(ContainerRegistryImagePushedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, request=request, actor=actor, source=source, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py deleted file mode 100644 index 7a110cab64af..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceConnectionStateEventInfo(Model): - """Information about the device connection state event. - - :param sequence_number: Sequence number is string representation of a - hexadecimal number. string compare can be used to identify the larger - number because both in ASCII and HEX numbers come after alphabets. If you - are converting the string to hex, then the number is a 256 bit number. - :type sequence_number: str - """ - - _attribute_map = { - 'sequence_number': {'key': 'sequenceNumber', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DeviceConnectionStateEventInfo, self).__init__(**kwargs) - self.sequence_number = kwargs.get('sequence_number', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py deleted file mode 100644 index 0ef8c03b2074..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceConnectionStateEventInfo(Model): - """Information about the device connection state event. - - :param sequence_number: Sequence number is string representation of a - hexadecimal number. string compare can be used to identify the larger - number because both in ASCII and HEX numbers come after alphabets. If you - are converting the string to hex, then the number is a 256 bit number. - :type sequence_number: str - """ - - _attribute_map = { - 'sequence_number': {'key': 'sequenceNumber', 'type': 'str'}, - } - - def __init__(self, *, sequence_number: str=None, **kwargs) -> None: - super(DeviceConnectionStateEventInfo, self).__init__(**kwargs) - self.sequence_number = sequence_number diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py deleted file mode 100644 index 04a5a1aefcb0..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceConnectionStateEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device connection - state event (DeviceConnected, DeviceDisconnected). - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, **kwargs): - super(DeviceConnectionStateEventProperties, self).__init__(**kwargs) - self.device_id = kwargs.get('device_id', None) - self.module_id = kwargs.get('module_id', None) - self.hub_name = kwargs.get('hub_name', None) - self.device_connection_state_event_info = kwargs.get('device_connection_state_event_info', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py deleted file mode 100644 index b8c339e55f64..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceConnectionStateEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device connection - state event (DeviceConnected, DeviceDisconnected). - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: - super(DeviceConnectionStateEventProperties, self).__init__(**kwargs) - self.device_id = device_id - self.module_id = module_id - self.hub_name = hub_name - self.device_connection_state_event_info = device_connection_state_event_info diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py deleted file mode 100644 index b6cf0e6f2961..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceLifeCycleEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device life cycle - event (DeviceCreated, DeviceDeleted). - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, **kwargs): - super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) - self.device_id = kwargs.get('device_id', None) - self.hub_name = kwargs.get('hub_name', None) - self.twin = kwargs.get('twin', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py deleted file mode 100644 index f203cf9f1005..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceLifeCycleEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device life cycle - event (DeviceCreated, DeviceDeleted). - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: - super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) - self.device_id = device_id - self.hub_name = hub_name - self.twin = twin diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py deleted file mode 100644 index 5ef54c29c86d..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTelemetryEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device telemetry - event (DeviceTelemetry). - - :param body: The content of the message from the device. - :type body: object - :param properties: Application properties are user-defined strings that - can be added to the message. These fields are optional. - :type properties: dict[str, str] - :param system_properties: System properties help identify contents and - source of the messages. - :type system_properties: dict[str, str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'object'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(DeviceTelemetryEventProperties, self).__init__(**kwargs) - self.body = kwargs.get('body', None) - self.properties = kwargs.get('properties', None) - self.system_properties = kwargs.get('system_properties', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py deleted file mode 100644 index 57fdb9114dc5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTelemetryEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a device telemetry - event (DeviceTelemetry). - - :param body: The content of the message from the device. - :type body: object - :param properties: Application properties are user-defined strings that - can be added to the message. These fields are optional. - :type properties: dict[str, str] - :param system_properties: System properties help identify contents and - source of the messages. - :type system_properties: dict[str, str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'object'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, - } - - def __init__(self, *, body=None, properties=None, system_properties=None, **kwargs) -> None: - super(DeviceTelemetryEventProperties, self).__init__(**kwargs) - self.body = body - self.properties = properties - self.system_properties = system_properties diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info.py deleted file mode 100644 index a3c555d320cf..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfo(Model): - """Information about the device twin, which is the cloud representation of - application device metadata. - - :param authentication_type: Authentication type used for this device: - either SAS, SelfSigned, or CertificateAuthority. - :type authentication_type: str - :param cloud_to_device_message_count: Count of cloud to device messages - sent to this device. - :type cloud_to_device_message_count: float - :param connection_state: Whether the device is connected or disconnected. - :type connection_state: str - :param device_id: The unique identifier of the device twin. - :type device_id: str - :param etag: A piece of information that describes the content of the - device twin. Each etag is guaranteed to be unique per device twin. - :type etag: str - :param last_activity_time: The ISO8601 timestamp of the last activity. - :type last_activity_time: str - :param properties: Properties JSON element. - :type properties: ~azure.eventgrid.models.DeviceTwinInfoProperties - :param status: Whether the device twin is enabled or disabled. - :type status: str - :param status_update_time: The ISO8601 timestamp of the last device twin - status update. - :type status_update_time: str - :param version: An integer that is incremented by one each time the device - twin is updated. - :type version: float - :param x509_thumbprint: The thumbprint is a unique value for the x509 - certificate, commonly used to find a particular certificate in a - certificate store. The thumbprint is dynamically generated using the SHA1 - algorithm, and does not physically exist in the certificate. - :type x509_thumbprint: - ~azure.eventgrid.models.DeviceTwinInfoX509Thumbprint - """ - - _attribute_map = { - 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, - 'cloud_to_device_message_count': {'key': 'cloudToDeviceMessageCount', 'type': 'float'}, - 'connection_state': {'key': 'connectionState', 'type': 'str'}, - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'last_activity_time': {'key': 'lastActivityTime', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'DeviceTwinInfoProperties'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_update_time': {'key': 'statusUpdateTime', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'float'}, - 'x509_thumbprint': {'key': 'x509Thumbprint', 'type': 'DeviceTwinInfoX509Thumbprint'}, - } - - def __init__(self, **kwargs): - super(DeviceTwinInfo, self).__init__(**kwargs) - self.authentication_type = kwargs.get('authentication_type', None) - self.cloud_to_device_message_count = kwargs.get('cloud_to_device_message_count', None) - self.connection_state = kwargs.get('connection_state', None) - self.device_id = kwargs.get('device_id', None) - self.etag = kwargs.get('etag', None) - self.last_activity_time = kwargs.get('last_activity_time', None) - self.properties = kwargs.get('properties', None) - self.status = kwargs.get('status', None) - self.status_update_time = kwargs.get('status_update_time', None) - self.version = kwargs.get('version', None) - self.x509_thumbprint = kwargs.get('x509_thumbprint', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py deleted file mode 100644 index 707a8bfb287f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfoProperties(Model): - """Properties JSON element. - - :param desired: A portion of the properties that can be written only by - the application back-end, and read by the device. - :type desired: ~azure.eventgrid.models.DeviceTwinProperties - :param reported: A portion of the properties that can be written only by - the device, and read by the application back-end. - :type reported: ~azure.eventgrid.models.DeviceTwinProperties - """ - - _attribute_map = { - 'desired': {'key': 'desired', 'type': 'DeviceTwinProperties'}, - 'reported': {'key': 'reported', 'type': 'DeviceTwinProperties'}, - } - - def __init__(self, **kwargs): - super(DeviceTwinInfoProperties, self).__init__(**kwargs) - self.desired = kwargs.get('desired', None) - self.reported = kwargs.get('reported', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py deleted file mode 100644 index efb94dee3d97..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfoProperties(Model): - """Properties JSON element. - - :param desired: A portion of the properties that can be written only by - the application back-end, and read by the device. - :type desired: ~azure.eventgrid.models.DeviceTwinProperties - :param reported: A portion of the properties that can be written only by - the device, and read by the application back-end. - :type reported: ~azure.eventgrid.models.DeviceTwinProperties - """ - - _attribute_map = { - 'desired': {'key': 'desired', 'type': 'DeviceTwinProperties'}, - 'reported': {'key': 'reported', 'type': 'DeviceTwinProperties'}, - } - - def __init__(self, *, desired=None, reported=None, **kwargs) -> None: - super(DeviceTwinInfoProperties, self).__init__(**kwargs) - self.desired = desired - self.reported = reported diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py deleted file mode 100644 index e74f3c65e994..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfo(Model): - """Information about the device twin, which is the cloud representation of - application device metadata. - - :param authentication_type: Authentication type used for this device: - either SAS, SelfSigned, or CertificateAuthority. - :type authentication_type: str - :param cloud_to_device_message_count: Count of cloud to device messages - sent to this device. - :type cloud_to_device_message_count: float - :param connection_state: Whether the device is connected or disconnected. - :type connection_state: str - :param device_id: The unique identifier of the device twin. - :type device_id: str - :param etag: A piece of information that describes the content of the - device twin. Each etag is guaranteed to be unique per device twin. - :type etag: str - :param last_activity_time: The ISO8601 timestamp of the last activity. - :type last_activity_time: str - :param properties: Properties JSON element. - :type properties: ~azure.eventgrid.models.DeviceTwinInfoProperties - :param status: Whether the device twin is enabled or disabled. - :type status: str - :param status_update_time: The ISO8601 timestamp of the last device twin - status update. - :type status_update_time: str - :param version: An integer that is incremented by one each time the device - twin is updated. - :type version: float - :param x509_thumbprint: The thumbprint is a unique value for the x509 - certificate, commonly used to find a particular certificate in a - certificate store. The thumbprint is dynamically generated using the SHA1 - algorithm, and does not physically exist in the certificate. - :type x509_thumbprint: - ~azure.eventgrid.models.DeviceTwinInfoX509Thumbprint - """ - - _attribute_map = { - 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, - 'cloud_to_device_message_count': {'key': 'cloudToDeviceMessageCount', 'type': 'float'}, - 'connection_state': {'key': 'connectionState', 'type': 'str'}, - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'last_activity_time': {'key': 'lastActivityTime', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'DeviceTwinInfoProperties'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_update_time': {'key': 'statusUpdateTime', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'float'}, - 'x509_thumbprint': {'key': 'x509Thumbprint', 'type': 'DeviceTwinInfoX509Thumbprint'}, - } - - def __init__(self, *, authentication_type: str=None, cloud_to_device_message_count: float=None, connection_state: str=None, device_id: str=None, etag: str=None, last_activity_time: str=None, properties=None, status: str=None, status_update_time: str=None, version: float=None, x509_thumbprint=None, **kwargs) -> None: - super(DeviceTwinInfo, self).__init__(**kwargs) - self.authentication_type = authentication_type - self.cloud_to_device_message_count = cloud_to_device_message_count - self.connection_state = connection_state - self.device_id = device_id - self.etag = etag - self.last_activity_time = last_activity_time - self.properties = properties - self.status = status - self.status_update_time = status_update_time - self.version = version - self.x509_thumbprint = x509_thumbprint diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py deleted file mode 100644 index abeb5e343bfa..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfoX509Thumbprint(Model): - """The thumbprint is a unique value for the x509 certificate, commonly used to - find a particular certificate in a certificate store. The thumbprint is - dynamically generated using the SHA1 algorithm, and does not physically - exist in the certificate. - - :param primary_thumbprint: Primary thumbprint for the x509 certificate. - :type primary_thumbprint: str - :param secondary_thumbprint: Secondary thumbprint for the x509 - certificate. - :type secondary_thumbprint: str - """ - - _attribute_map = { - 'primary_thumbprint': {'key': 'primaryThumbprint', 'type': 'str'}, - 'secondary_thumbprint': {'key': 'secondaryThumbprint', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DeviceTwinInfoX509Thumbprint, self).__init__(**kwargs) - self.primary_thumbprint = kwargs.get('primary_thumbprint', None) - self.secondary_thumbprint = kwargs.get('secondary_thumbprint', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py deleted file mode 100644 index 8255b523b0ba..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinInfoX509Thumbprint(Model): - """The thumbprint is a unique value for the x509 certificate, commonly used to - find a particular certificate in a certificate store. The thumbprint is - dynamically generated using the SHA1 algorithm, and does not physically - exist in the certificate. - - :param primary_thumbprint: Primary thumbprint for the x509 certificate. - :type primary_thumbprint: str - :param secondary_thumbprint: Secondary thumbprint for the x509 - certificate. - :type secondary_thumbprint: str - """ - - _attribute_map = { - 'primary_thumbprint': {'key': 'primaryThumbprint', 'type': 'str'}, - 'secondary_thumbprint': {'key': 'secondaryThumbprint', 'type': 'str'}, - } - - def __init__(self, *, primary_thumbprint: str=None, secondary_thumbprint: str=None, **kwargs) -> None: - super(DeviceTwinInfoX509Thumbprint, self).__init__(**kwargs) - self.primary_thumbprint = primary_thumbprint - self.secondary_thumbprint = secondary_thumbprint diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py deleted file mode 100644 index 59219bd36fe2..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinMetadata(Model): - """Metadata information for the properties JSON document. - - :param last_updated: The ISO8601 timestamp of the last time the properties - were updated. - :type last_updated: str - """ - - _attribute_map = { - 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DeviceTwinMetadata, self).__init__(**kwargs) - self.last_updated = kwargs.get('last_updated', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py deleted file mode 100644 index 8abb65fda8e2..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinMetadata(Model): - """Metadata information for the properties JSON document. - - :param last_updated: The ISO8601 timestamp of the last time the properties - were updated. - :type last_updated: str - """ - - _attribute_map = { - 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, - } - - def __init__(self, *, last_updated: str=None, **kwargs) -> None: - super(DeviceTwinMetadata, self).__init__(**kwargs) - self.last_updated = last_updated diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py deleted file mode 100644 index 9b207d5868ed..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinProperties(Model): - """A portion of the properties that can be written only by the application - back-end, and read by the device. - - :param metadata: Metadata information for the properties JSON document. - :type metadata: ~azure.eventgrid.models.DeviceTwinMetadata - :param version: Version of device twin properties. - :type version: float - """ - - _attribute_map = { - 'metadata': {'key': 'metadata', 'type': 'DeviceTwinMetadata'}, - 'version': {'key': 'version', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(DeviceTwinProperties, self).__init__(**kwargs) - self.metadata = kwargs.get('metadata', None) - self.version = kwargs.get('version', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py deleted file mode 100644 index d28f52af8f84..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeviceTwinProperties(Model): - """A portion of the properties that can be written only by the application - back-end, and read by the device. - - :param metadata: Metadata information for the properties JSON document. - :type metadata: ~azure.eventgrid.models.DeviceTwinMetadata - :param version: Version of device twin properties. - :type version: float - """ - - _attribute_map = { - 'metadata': {'key': 'metadata', 'type': 'DeviceTwinMetadata'}, - 'version': {'key': 'version', 'type': 'float'}, - } - - def __init__(self, *, metadata=None, version: float=None, **kwargs) -> None: - super(DeviceTwinProperties, self).__init__(**kwargs) - self.metadata = metadata - self.version = version diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py deleted file mode 100644 index eabef54f1c86..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class MediaJobState(str, Enum): - - canceled = "Canceled" #: The job was canceled. This is a final state for the job. - canceling = "Canceling" #: The job is in the process of being canceled. This is a transient state for the job. - error = "Error" #: The job has encountered an error. This is a final state for the job. - finished = "Finished" #: The job is finished. This is a final state for the job. - processing = "Processing" #: The job is processing. This is a transient state for the job. - queued = "Queued" #: The job is in a queued state, waiting for resources to become available. This is a transient state. - scheduled = "Scheduled" #: The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. - - -class MediaJobErrorCode(str, Enum): - - service_error = "ServiceError" #: Fatal service error, please contact support. - service_transient_error = "ServiceTransientError" #: Transient error, please retry, if retry is unsuccessful, please contact support. - download_not_accessible = "DownloadNotAccessible" #: While trying to download the input files, the files were not accessible, please check the availability of the source. - download_transient_error = "DownloadTransientError" #: While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. - upload_not_accessible = "UploadNotAccessible" #: While trying to upload the output files, the destination was not reachable, please check the availability of the destination. - upload_transient_error = "UploadTransientError" #: While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. - configuration_unsupported = "ConfigurationUnsupported" #: There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. - content_malformed = "ContentMalformed" #: There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. - content_unsupported = "ContentUnsupported" #: There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. - - -class MediaJobErrorCategory(str, Enum): - - service = "Service" #: The error is service related. - download = "Download" #: The error is download related. - upload = "Upload" #: The error is upload related. - configuration = "Configuration" #: The error is configuration related. - content = "Content" #: The error is related to data in the input files. - - -class MediaJobRetry(str, Enum): - - do_not_retry = "DoNotRetry" #: Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. - may_retry = "MayRetry" #: Issue may be resolved after waiting for a period of time and resubmitting the same Job. diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event.py deleted file mode 100644 index f4828c24dd38..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EventGridEvent(Model): - """Properties of an event published to an Event Grid topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. An unique identifier for the event. - :type id: str - :param topic: The resource path of the event source. - :type topic: str - :param subject: Required. A resource path relative to the topic path. - :type subject: str - :param data: Required. Event data specific to the event type. - :type data: object - :param event_type: Required. The type of the event that occurred. - :type event_type: str - :param event_time: Required. The time (in UTC) the event was generated. - :type event_time: datetime - :ivar metadata_version: The schema version of the event metadata. - :vartype metadata_version: str - :param data_version: Required. The schema version of the data object. - :type data_version: str - """ - - _validation = { - 'id': {'required': True}, - 'subject': {'required': True}, - 'data': {'required': True}, - 'event_type': {'required': True}, - 'event_time': {'required': True}, - 'metadata_version': {'readonly': True}, - 'data_version': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'data': {'key': 'data', 'type': 'object'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, - 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, - 'data_version': {'key': 'dataVersion', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventGridEvent, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.topic = kwargs.get('topic', None) - self.subject = kwargs.get('subject', None) - self.data = kwargs.get('data', None) - self.event_type = kwargs.get('event_type', None) - self.event_time = kwargs.get('event_time', None) - self.metadata_version = None - self.data_version = kwargs.get('data_version', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py deleted file mode 100644 index 1f54ddad918a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EventGridEvent(Model): - """Properties of an event published to an Event Grid topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. An unique identifier for the event. - :type id: str - :param topic: The resource path of the event source. - :type topic: str - :param subject: Required. A resource path relative to the topic path. - :type subject: str - :param data: Required. Event data specific to the event type. - :type data: object - :param event_type: Required. The type of the event that occurred. - :type event_type: str - :param event_time: Required. The time (in UTC) the event was generated. - :type event_time: datetime - :ivar metadata_version: The schema version of the event metadata. - :vartype metadata_version: str - :param data_version: Required. The schema version of the data object. - :type data_version: str - """ - - _validation = { - 'id': {'required': True}, - 'subject': {'required': True}, - 'data': {'required': True}, - 'event_type': {'required': True}, - 'event_time': {'required': True}, - 'metadata_version': {'readonly': True}, - 'data_version': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'data': {'key': 'data', 'type': 'object'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, - 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, - 'data_version': {'key': 'dataVersion', 'type': 'str'}, - } - - def __init__(self, *, id: str, subject: str, data, event_type: str, event_time, data_version: str, topic: str=None, **kwargs) -> None: - super(EventGridEvent, self).__init__(**kwargs) - self.id = id - self.topic = topic - self.subject = subject - self.data = data - self.event_type = event_type - self.event_time = event_time - self.metadata_version = None - self.data_version = data_version diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py deleted file mode 100644 index 7cca05430f96..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EventHubCaptureFileCreatedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.EventHub.CaptureFileCreated event. - - :param fileurl: The path to the capture file. - :type fileurl: str - :param file_type: The file type of the capture file. - :type file_type: str - :param partition_id: The shard ID. - :type partition_id: str - :param size_in_bytes: The file size. - :type size_in_bytes: int - :param event_count: The number of events in the file. - :type event_count: int - :param first_sequence_number: The smallest sequence number from the queue. - :type first_sequence_number: int - :param last_sequence_number: The last sequence number from the queue. - :type last_sequence_number: int - :param first_enqueue_time: The first time from the queue. - :type first_enqueue_time: datetime - :param last_enqueue_time: The last time from the queue. - :type last_enqueue_time: datetime - """ - - _attribute_map = { - 'fileurl': {'key': 'fileurl', 'type': 'str'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - 'partition_id': {'key': 'partitionId', 'type': 'str'}, - 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int'}, - 'event_count': {'key': 'eventCount', 'type': 'int'}, - 'first_sequence_number': {'key': 'firstSequenceNumber', 'type': 'int'}, - 'last_sequence_number': {'key': 'lastSequenceNumber', 'type': 'int'}, - 'first_enqueue_time': {'key': 'firstEnqueueTime', 'type': 'iso-8601'}, - 'last_enqueue_time': {'key': 'lastEnqueueTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EventHubCaptureFileCreatedEventData, self).__init__(**kwargs) - self.fileurl = kwargs.get('fileurl', None) - self.file_type = kwargs.get('file_type', None) - self.partition_id = kwargs.get('partition_id', None) - self.size_in_bytes = kwargs.get('size_in_bytes', None) - self.event_count = kwargs.get('event_count', None) - self.first_sequence_number = kwargs.get('first_sequence_number', None) - self.last_sequence_number = kwargs.get('last_sequence_number', None) - self.first_enqueue_time = kwargs.get('first_enqueue_time', None) - self.last_enqueue_time = kwargs.get('last_enqueue_time', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py deleted file mode 100644 index 673a61b031e9..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EventHubCaptureFileCreatedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.EventHub.CaptureFileCreated event. - - :param fileurl: The path to the capture file. - :type fileurl: str - :param file_type: The file type of the capture file. - :type file_type: str - :param partition_id: The shard ID. - :type partition_id: str - :param size_in_bytes: The file size. - :type size_in_bytes: int - :param event_count: The number of events in the file. - :type event_count: int - :param first_sequence_number: The smallest sequence number from the queue. - :type first_sequence_number: int - :param last_sequence_number: The last sequence number from the queue. - :type last_sequence_number: int - :param first_enqueue_time: The first time from the queue. - :type first_enqueue_time: datetime - :param last_enqueue_time: The last time from the queue. - :type last_enqueue_time: datetime - """ - - _attribute_map = { - 'fileurl': {'key': 'fileurl', 'type': 'str'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - 'partition_id': {'key': 'partitionId', 'type': 'str'}, - 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int'}, - 'event_count': {'key': 'eventCount', 'type': 'int'}, - 'first_sequence_number': {'key': 'firstSequenceNumber', 'type': 'int'}, - 'last_sequence_number': {'key': 'lastSequenceNumber', 'type': 'int'}, - 'first_enqueue_time': {'key': 'firstEnqueueTime', 'type': 'iso-8601'}, - 'last_enqueue_time': {'key': 'lastEnqueueTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, fileurl: str=None, file_type: str=None, partition_id: str=None, size_in_bytes: int=None, event_count: int=None, first_sequence_number: int=None, last_sequence_number: int=None, first_enqueue_time=None, last_enqueue_time=None, **kwargs) -> None: - super(EventHubCaptureFileCreatedEventData, self).__init__(**kwargs) - self.fileurl = fileurl - self.file_type = file_type - self.partition_id = partition_id - self.size_in_bytes = size_in_bytes - self.event_count = event_count - self.first_sequence_number = first_sequence_number - self.last_sequence_number = last_sequence_number - self.first_enqueue_time = first_enqueue_time - self.last_enqueue_time = last_enqueue_time diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py deleted file mode 100644 index 9f48f9c10abc..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_connection_state_event_properties import DeviceConnectionStateEventProperties - - -class IotHubDeviceConnectedEventData(DeviceConnectionStateEventProperties): - """Event data for Microsoft.Devices.DeviceConnected event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, **kwargs): - super(IotHubDeviceConnectedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py deleted file mode 100644 index 3c4791507b54..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties - - -class IotHubDeviceConnectedEventData(DeviceConnectionStateEventProperties): - """Event data for Microsoft.Devices.DeviceConnected event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: - super(IotHubDeviceConnectedEventData, self).__init__(device_id=device_id, module_id=module_id, hub_name=hub_name, device_connection_state_event_info=device_connection_state_event_info, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py deleted file mode 100644 index df911f0b0456..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties - - -class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): - """Event data for Microsoft.Devices.DeviceCreated event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, **kwargs): - super(IotHubDeviceCreatedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py deleted file mode 100644 index e8d497edc97e..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties - - -class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): - """Event data for Microsoft.Devices.DeviceCreated event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: - super(IotHubDeviceCreatedEventData, self).__init__(device_id=device_id, hub_name=hub_name, twin=twin, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py deleted file mode 100644 index 92d7e5c9c67f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties - - -class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): - """Event data for Microsoft.Devices.DeviceDeleted event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, **kwargs): - super(IotHubDeviceDeletedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py deleted file mode 100644 index 635003d7176c..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties - - -class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): - """Event data for Microsoft.Devices.DeviceDeleted event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param twin: Information about the device twin, which is the cloud - representation of application device metadata. - :type twin: ~azure.eventgrid.models.DeviceTwinInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, - } - - def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: - super(IotHubDeviceDeletedEventData, self).__init__(device_id=device_id, hub_name=hub_name, twin=twin, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py deleted file mode 100644 index 0de85a3a601f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_connection_state_event_properties import DeviceConnectionStateEventProperties - - -class IotHubDeviceDisconnectedEventData(DeviceConnectionStateEventProperties): - """Event data for Microsoft.Devices.DeviceDisconnected event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, **kwargs): - super(IotHubDeviceDisconnectedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py deleted file mode 100644 index d340d625e90c..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties - - -class IotHubDeviceDisconnectedEventData(DeviceConnectionStateEventProperties): - """Event data for Microsoft.Devices.DeviceDisconnected event. - - :param device_id: The unique identifier of the device. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type device_id: str - :param module_id: The unique identifier of the module. This case-sensitive - string can be up to 128 characters long, and supports ASCII 7-bit - alphanumeric characters plus the following special characters: - : . + % _ - # * ? ! ( ) , = @ ; $ '. - :type module_id: str - :param hub_name: Name of the IoT Hub where the device was created or - deleted. - :type hub_name: str - :param device_connection_state_event_info: Information about the device - connection state event. - :type device_connection_state_event_info: - ~azure.eventgrid.models.DeviceConnectionStateEventInfo - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'module_id': {'key': 'moduleId', 'type': 'str'}, - 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, - } - - def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: - super(IotHubDeviceDisconnectedEventData, self).__init__(device_id=device_id, module_id=module_id, hub_name=hub_name, device_connection_state_event_info=device_connection_state_event_info, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py deleted file mode 100644 index 68327f110245..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_telemetry_event_properties import DeviceTelemetryEventProperties - - -class IotHubDeviceTelemetryEventData(DeviceTelemetryEventProperties): - """Event data for Microsoft.Devices.DeviceTelemetry event. - - :param body: The content of the message from the device. - :type body: object - :param properties: Application properties are user-defined strings that - can be added to the message. These fields are optional. - :type properties: dict[str, str] - :param system_properties: System properties help identify contents and - source of the messages. - :type system_properties: dict[str, str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'object'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(IotHubDeviceTelemetryEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py deleted file mode 100644 index 99ff68ce2594..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .device_telemetry_event_properties_py3 import DeviceTelemetryEventProperties - - -class IotHubDeviceTelemetryEventData(DeviceTelemetryEventProperties): - """Event data for Microsoft.Devices.DeviceTelemetry event. - - :param body: The content of the message from the device. - :type body: object - :param properties: Application properties are user-defined strings that - can be added to the message. These fields are optional. - :type properties: dict[str, str] - :param system_properties: System properties help identify contents and - source of the messages. - :type system_properties: dict[str, str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'object'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, - } - - def __init__(self, *, body=None, properties=None, system_properties=None, **kwargs) -> None: - super(IotHubDeviceTelemetryEventData, self).__init__(body=body, properties=properties, system_properties=system_properties, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data.py deleted file mode 100644 index ad261166eab6..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties import MapsGeofenceEventProperties - - -class MapsGeofenceEnteredEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceEntered event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(MapsGeofenceEnteredEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data_py3.py deleted file mode 100644 index 4a49e99df5ab..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_entered_event_data_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties_py3 import MapsGeofenceEventProperties - - -class MapsGeofenceEnteredEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceEntered event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, *, expired_geofence_geometry_id=None, geometries=None, invalid_period_geofence_geometry_id=None, is_event_published: bool=None, **kwargs) -> None: - super(MapsGeofenceEnteredEventData, self).__init__(expired_geofence_geometry_id=expired_geofence_geometry_id, geometries=geometries, invalid_period_geofence_geometry_id=invalid_period_geofence_geometry_id, is_event_published=is_event_published, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties.py deleted file mode 100644 index a09219f411ca..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MapsGeofenceEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a Geofence event - (GeofenceEntered, GeofenceExited, GeofenceResult). - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(MapsGeofenceEventProperties, self).__init__(**kwargs) - self.expired_geofence_geometry_id = kwargs.get('expired_geofence_geometry_id', None) - self.geometries = kwargs.get('geometries', None) - self.invalid_period_geofence_geometry_id = kwargs.get('invalid_period_geofence_geometry_id', None) - self.is_event_published = kwargs.get('is_event_published', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties_py3.py deleted file mode 100644 index aaf8b3a60c08..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_event_properties_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MapsGeofenceEventProperties(Model): - """Schema of the Data property of an EventGridEvent for a Geofence event - (GeofenceEntered, GeofenceExited, GeofenceResult). - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, *, expired_geofence_geometry_id=None, geometries=None, invalid_period_geofence_geometry_id=None, is_event_published: bool=None, **kwargs) -> None: - super(MapsGeofenceEventProperties, self).__init__(**kwargs) - self.expired_geofence_geometry_id = expired_geofence_geometry_id - self.geometries = geometries - self.invalid_period_geofence_geometry_id = invalid_period_geofence_geometry_id - self.is_event_published = is_event_published diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data.py deleted file mode 100644 index f7c5aa0fc15a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties import MapsGeofenceEventProperties - - -class MapsGeofenceExitedEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceExited event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(MapsGeofenceExitedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data_py3.py deleted file mode 100644 index 6bec05c2212f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_exited_event_data_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties_py3 import MapsGeofenceEventProperties - - -class MapsGeofenceExitedEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceExited event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, *, expired_geofence_geometry_id=None, geometries=None, invalid_period_geofence_geometry_id=None, is_event_published: bool=None, **kwargs) -> None: - super(MapsGeofenceExitedEventData, self).__init__(expired_geofence_geometry_id=expired_geofence_geometry_id, geometries=geometries, invalid_period_geofence_geometry_id=invalid_period_geofence_geometry_id, is_event_published=is_event_published, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry.py deleted file mode 100644 index b7cff8da378a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MapsGeofenceGeometry(Model): - """The geofence geometry. - - :param device_id: ID of the device. - :type device_id: str - :param distance: Distance from the coordinate to the closest border of the - geofence. Positive means the coordinate is outside of the geofence. If the - coordinate is outside of the geofence, but more than the value of - searchBuffer away from the closest geofence border, then the value is 999. - Negative means the coordinate is inside of the geofence. If the coordinate - is inside the polygon, but more than the value of searchBuffer away from - the closest geofencing border,then the value is -999. A value of 999 means - that there is great confidence the coordinate is well outside the - geofence. A value of -999 means that there is great confidence the - coordinate is well within the geofence. - :type distance: float - :param geometry_id: The unique ID for the geofence geometry. - :type geometry_id: str - :param nearest_lat: Latitude of the nearest point of the geometry. - :type nearest_lat: float - :param nearest_lon: Longitude of the nearest point of the geometry. - :type nearest_lon: float - :param ud_id: The unique id returned from user upload service when - uploading a geofence. Will not be included in geofencing post API. - :type ud_id: str - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'distance': {'key': 'distance', 'type': 'float'}, - 'geometry_id': {'key': 'geometryId', 'type': 'str'}, - 'nearest_lat': {'key': 'nearestLat', 'type': 'float'}, - 'nearest_lon': {'key': 'nearestLon', 'type': 'float'}, - 'ud_id': {'key': 'udId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MapsGeofenceGeometry, self).__init__(**kwargs) - self.device_id = kwargs.get('device_id', None) - self.distance = kwargs.get('distance', None) - self.geometry_id = kwargs.get('geometry_id', None) - self.nearest_lat = kwargs.get('nearest_lat', None) - self.nearest_lon = kwargs.get('nearest_lon', None) - self.ud_id = kwargs.get('ud_id', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry_py3.py deleted file mode 100644 index bd6690005053..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_geometry_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MapsGeofenceGeometry(Model): - """The geofence geometry. - - :param device_id: ID of the device. - :type device_id: str - :param distance: Distance from the coordinate to the closest border of the - geofence. Positive means the coordinate is outside of the geofence. If the - coordinate is outside of the geofence, but more than the value of - searchBuffer away from the closest geofence border, then the value is 999. - Negative means the coordinate is inside of the geofence. If the coordinate - is inside the polygon, but more than the value of searchBuffer away from - the closest geofencing border,then the value is -999. A value of 999 means - that there is great confidence the coordinate is well outside the - geofence. A value of -999 means that there is great confidence the - coordinate is well within the geofence. - :type distance: float - :param geometry_id: The unique ID for the geofence geometry. - :type geometry_id: str - :param nearest_lat: Latitude of the nearest point of the geometry. - :type nearest_lat: float - :param nearest_lon: Longitude of the nearest point of the geometry. - :type nearest_lon: float - :param ud_id: The unique id returned from user upload service when - uploading a geofence. Will not be included in geofencing post API. - :type ud_id: str - """ - - _attribute_map = { - 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'distance': {'key': 'distance', 'type': 'float'}, - 'geometry_id': {'key': 'geometryId', 'type': 'str'}, - 'nearest_lat': {'key': 'nearestLat', 'type': 'float'}, - 'nearest_lon': {'key': 'nearestLon', 'type': 'float'}, - 'ud_id': {'key': 'udId', 'type': 'str'}, - } - - def __init__(self, *, device_id: str=None, distance: float=None, geometry_id: str=None, nearest_lat: float=None, nearest_lon: float=None, ud_id: str=None, **kwargs) -> None: - super(MapsGeofenceGeometry, self).__init__(**kwargs) - self.device_id = device_id - self.distance = distance - self.geometry_id = geometry_id - self.nearest_lat = nearest_lat - self.nearest_lon = nearest_lon - self.ud_id = ud_id diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data.py deleted file mode 100644 index a609225c822e..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties import MapsGeofenceEventProperties - - -class MapsGeofenceResultEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceResult event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(MapsGeofenceResultEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data_py3.py deleted file mode 100644 index 24a1bebf7180..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/maps_geofence_result_event_data_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .maps_geofence_event_properties_py3 import MapsGeofenceEventProperties - - -class MapsGeofenceResultEventData(MapsGeofenceEventProperties): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Maps.GeofenceResult event. - - :param expired_geofence_geometry_id: Lists of the geometry ID of the - geofence which is expired relative to the user time in the request. - :type expired_geofence_geometry_id: list[str] - :param geometries: Lists the fence geometries that either fully contain - the coordinate position or have an overlap with the searchBuffer around - the fence. - :type geometries: list[~azure.eventgrid.models.MapsGeofenceGeometry] - :param invalid_period_geofence_geometry_id: Lists of the geometry ID of - the geofence which is in invalid period relative to the user time in the - request. - :type invalid_period_geofence_geometry_id: list[str] - :param is_event_published: True if at least one event is published to the - Azure Maps event subscriber, false if no event is published to the Azure - Maps event subscriber. - :type is_event_published: bool - """ - - _attribute_map = { - 'expired_geofence_geometry_id': {'key': 'expiredGeofenceGeometryId', 'type': '[str]'}, - 'geometries': {'key': 'geometries', 'type': '[MapsGeofenceGeometry]'}, - 'invalid_period_geofence_geometry_id': {'key': 'invalidPeriodGeofenceGeometryId', 'type': '[str]'}, - 'is_event_published': {'key': 'isEventPublished', 'type': 'bool'}, - } - - def __init__(self, *, expired_geofence_geometry_id=None, geometries=None, invalid_period_geofence_geometry_id=None, is_event_published: bool=None, **kwargs) -> None: - super(MapsGeofenceResultEventData, self).__init__(expired_geofence_geometry_id=expired_geofence_geometry_id, geometries=geometries, invalid_period_geofence_geometry_id=invalid_period_geofence_geometry_id, is_event_published=is_event_published, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data.py deleted file mode 100644 index f8a820f2b8fb..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobCanceledEventData(MediaJobStateChangeEventData): - """Job canceled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, **kwargs): - super(MediaJobCanceledEventData, self).__init__(**kwargs) - self.outputs = kwargs.get('outputs', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data_py3.py deleted file mode 100644 index 2febfeb9d2d5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceled_event_data_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobCanceledEventData(MediaJobStateChangeEventData): - """Job canceled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, *, correlation_data=None, outputs=None, **kwargs) -> None: - super(MediaJobCanceledEventData, self).__init__(correlation_data=correlation_data, **kwargs) - self.outputs = outputs diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data.py deleted file mode 100644 index 4c25c6c2cae9..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobCancelingEventData(MediaJobStateChangeEventData): - """Job canceling event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobCancelingEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data_py3.py deleted file mode 100644 index 1ed04a59b0c5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_canceling_event_data_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobCancelingEventData(MediaJobStateChangeEventData): - """Job canceling event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, *, correlation_data=None, **kwargs) -> None: - super(MediaJobCancelingEventData, self).__init__(correlation_data=correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error.py deleted file mode 100644 index 2a4c16b33889..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobError(Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Error code describing the error. Possible values include: - 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', - 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', - 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported' - :vartype code: str or ~azure.eventgrid.models.MediaJobErrorCode - :ivar message: A human-readable language-dependent representation of the - error. - :vartype message: str - :ivar category: Helps with categorization of errors. Possible values - include: 'Service', 'Download', 'Upload', 'Configuration', 'Content' - :vartype category: str or ~azure.eventgrid.models.MediaJobErrorCategory - :ivar retry: Indicates that it may be possible to retry the Job. If retry - is unsuccessful, please contact Azure support via Azure Portal. Possible - values include: 'DoNotRetry', 'MayRetry' - :vartype retry: str or ~azure.eventgrid.models.MediaJobRetry - :ivar details: An array of details about specific errors that led to this - reported error. - :vartype details: list[~azure.eventgrid.models.MediaJobErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'category': {'readonly': True}, - 'retry': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'MediaJobErrorCode'}, - 'message': {'key': 'message', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'MediaJobErrorCategory'}, - 'retry': {'key': 'retry', 'type': 'MediaJobRetry'}, - 'details': {'key': 'details', 'type': '[MediaJobErrorDetail]'}, - } - - def __init__(self, **kwargs): - super(MediaJobError, self).__init__(**kwargs) - self.code = None - self.message = None - self.category = None - self.retry = None - self.details = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail.py deleted file mode 100644 index acbb98e6c437..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobErrorDetail(Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Code describing the error detail. - :vartype code: str - :ivar message: A human-readable representation of the error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaJobErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail_py3.py deleted file mode 100644 index 9c419b996add..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_detail_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobErrorDetail(Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Code describing the error detail. - :vartype code: str - :ivar message: A human-readable representation of the error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaJobErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_py3.py deleted file mode 100644 index afd055ba62ec..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_error_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobError(Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Error code describing the error. Possible values include: - 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', - 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', - 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported' - :vartype code: str or ~azure.eventgrid.models.MediaJobErrorCode - :ivar message: A human-readable language-dependent representation of the - error. - :vartype message: str - :ivar category: Helps with categorization of errors. Possible values - include: 'Service', 'Download', 'Upload', 'Configuration', 'Content' - :vartype category: str or ~azure.eventgrid.models.MediaJobErrorCategory - :ivar retry: Indicates that it may be possible to retry the Job. If retry - is unsuccessful, please contact Azure support via Azure Portal. Possible - values include: 'DoNotRetry', 'MayRetry' - :vartype retry: str or ~azure.eventgrid.models.MediaJobRetry - :ivar details: An array of details about specific errors that led to this - reported error. - :vartype details: list[~azure.eventgrid.models.MediaJobErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'category': {'readonly': True}, - 'retry': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'MediaJobErrorCode'}, - 'message': {'key': 'message', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'MediaJobErrorCategory'}, - 'retry': {'key': 'retry', 'type': 'MediaJobRetry'}, - 'details': {'key': 'details', 'type': '[MediaJobErrorDetail]'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaJobError, self).__init__(**kwargs) - self.code = None - self.message = None - self.category = None - self.retry = None - self.details = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data.py deleted file mode 100644 index 91b5cda1eeec..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobErroredEventData(MediaJobStateChangeEventData): - """Job error state event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, **kwargs): - super(MediaJobErroredEventData, self).__init__(**kwargs) - self.outputs = kwargs.get('outputs', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data_py3.py deleted file mode 100644 index 2a2e7b7af094..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_errored_event_data_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobErroredEventData(MediaJobStateChangeEventData): - """Job error state event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, *, correlation_data=None, outputs=None, **kwargs) -> None: - super(MediaJobErroredEventData, self).__init__(correlation_data=correlation_data, **kwargs) - self.outputs = outputs diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data.py deleted file mode 100644 index 29d2f2a1420e..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobFinishedEventData(MediaJobStateChangeEventData): - """Job finished event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, **kwargs): - super(MediaJobFinishedEventData, self).__init__(**kwargs) - self.outputs = kwargs.get('outputs', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data_py3.py deleted file mode 100644 index 9e9ee8d588c0..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_finished_event_data_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobFinishedEventData(MediaJobStateChangeEventData): - """Job finished event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - :param outputs: Gets the Job outputs. - :type outputs: list[~azure.eventgrid.models.MediaJobOutput] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'}, - } - - def __init__(self, *, correlation_data=None, outputs=None, **kwargs) -> None: - super(MediaJobFinishedEventData, self).__init__(correlation_data=correlation_data, **kwargs) - self.outputs = outputs diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output.py deleted file mode 100644 index ec105fd697dd..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutput(Model): - """The event data for a Job output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MediaJobOutputAsset - - All required parameters must be populated in order to send to Azure. - - :param error: Gets the Job output error. - :type error: ~azure.eventgrid.models.MediaJobError - :param label: Gets the Job output label. - :type label: str - :param progress: Required. Gets the Job output progress. - :type progress: long - :param state: Required. Gets the Job output state. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :type state: str or ~azure.eventgrid.models.MediaJobState - :param odatatype: Required. Constant filled by server. - :type odatatype: str - """ - - _validation = { - 'progress': {'required': True}, - 'state': {'required': True}, - 'odatatype': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'MediaJobError'}, - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odatatype': {'#Microsoft.Media.JobOutputAsset': 'MediaJobOutputAsset'} - } - - def __init__(self, **kwargs): - super(MediaJobOutput, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - self.label = kwargs.get('label', None) - self.progress = kwargs.get('progress', None) - self.state = kwargs.get('state', None) - self.odatatype = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset.py deleted file mode 100644 index efe51ce529f5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output import MediaJobOutput - - -class MediaJobOutputAsset(MediaJobOutput): - """The event data for a Job output asset. - - All required parameters must be populated in order to send to Azure. - - :param error: Gets the Job output error. - :type error: ~azure.eventgrid.models.MediaJobError - :param label: Gets the Job output label. - :type label: str - :param progress: Required. Gets the Job output progress. - :type progress: long - :param state: Required. Gets the Job output state. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :type state: str or ~azure.eventgrid.models.MediaJobState - :param odatatype: Required. Constant filled by server. - :type odatatype: str - :param asset_name: Gets the Job output asset name. - :type asset_name: str - """ - - _validation = { - 'progress': {'required': True}, - 'state': {'required': True}, - 'odatatype': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'MediaJobError'}, - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputAsset, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.odatatype = '#Microsoft.Media.JobOutputAsset' diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset_py3.py deleted file mode 100644 index de6fc83d47c8..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_asset_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_py3 import MediaJobOutput - - -class MediaJobOutputAsset(MediaJobOutput): - """The event data for a Job output asset. - - All required parameters must be populated in order to send to Azure. - - :param error: Gets the Job output error. - :type error: ~azure.eventgrid.models.MediaJobError - :param label: Gets the Job output label. - :type label: str - :param progress: Required. Gets the Job output progress. - :type progress: long - :param state: Required. Gets the Job output state. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :type state: str or ~azure.eventgrid.models.MediaJobState - :param odatatype: Required. Constant filled by server. - :type odatatype: str - :param asset_name: Gets the Job output asset name. - :type asset_name: str - """ - - _validation = { - 'progress': {'required': True}, - 'state': {'required': True}, - 'odatatype': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'MediaJobError'}, - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - } - - def __init__(self, *, progress: int, state, error=None, label: str=None, asset_name: str=None, **kwargs) -> None: - super(MediaJobOutputAsset, self).__init__(error=error, label=label, progress=progress, state=state, **kwargs) - self.asset_name = asset_name - self.odatatype = '#Microsoft.Media.JobOutputAsset' diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data.py deleted file mode 100644 index c082ca91470f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputCanceledEventData(MediaJobOutputStateChangeEventData): - """Job output canceled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputCanceledEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data_py3.py deleted file mode 100644 index 07fe3029aeb5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceled_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputCanceledEventData(MediaJobOutputStateChangeEventData): - """Job output canceled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputCanceledEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data.py deleted file mode 100644 index 5b8f61dc1432..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputCancelingEventData(MediaJobOutputStateChangeEventData): - """Job output canceling event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputCancelingEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data_py3.py deleted file mode 100644 index 440bb91f08f4..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_canceling_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputCancelingEventData(MediaJobOutputStateChangeEventData): - """Job output canceling event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputCancelingEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data.py deleted file mode 100644 index b6e9bf9f4bf0..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputErroredEventData(MediaJobOutputStateChangeEventData): - """Job output error event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputErroredEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data_py3.py deleted file mode 100644 index c6f8c6ed5eb2..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_errored_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputErroredEventData(MediaJobOutputStateChangeEventData): - """Job output error event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputErroredEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data.py deleted file mode 100644 index ad08587a4d2a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputFinishedEventData(MediaJobOutputStateChangeEventData): - """Job output finished event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputFinishedEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data_py3.py deleted file mode 100644 index d973441dfb22..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_finished_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputFinishedEventData(MediaJobOutputStateChangeEventData): - """Job output finished event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputFinishedEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data.py deleted file mode 100644 index 40bc09600888..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputProcessingEventData(MediaJobOutputStateChangeEventData): - """Job output processing event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputProcessingEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data_py3.py deleted file mode 100644 index ccf97c3470ec..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_processing_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputProcessingEventData(MediaJobOutputStateChangeEventData): - """Job output processing event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputProcessingEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data.py deleted file mode 100644 index 37c2c9662421..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutputProgressEventData(Model): - """Job Output Progress Event Data. - - :param label: Gets the Job output label. - :type label: str - :param progress: Gets the Job output progress. - :type progress: long - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _attribute_map = { - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputProgressEventData, self).__init__(**kwargs) - self.label = kwargs.get('label', None) - self.progress = kwargs.get('progress', None) - self.job_correlation_data = kwargs.get('job_correlation_data', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data_py3.py deleted file mode 100644 index 3f23816b7c37..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_progress_event_data_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutputProgressEventData(Model): - """Job Output Progress Event Data. - - :param label: Gets the Job output label. - :type label: str - :param progress: Gets the Job output progress. - :type progress: long - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _attribute_map = { - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, label: str=None, progress: int=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputProgressEventData, self).__init__(**kwargs) - self.label = label - self.progress = progress - self.job_correlation_data = job_correlation_data diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_py3.py deleted file mode 100644 index 8be196363b90..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutput(Model): - """The event data for a Job output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MediaJobOutputAsset - - All required parameters must be populated in order to send to Azure. - - :param error: Gets the Job output error. - :type error: ~azure.eventgrid.models.MediaJobError - :param label: Gets the Job output label. - :type label: str - :param progress: Required. Gets the Job output progress. - :type progress: long - :param state: Required. Gets the Job output state. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :type state: str or ~azure.eventgrid.models.MediaJobState - :param odatatype: Required. Constant filled by server. - :type odatatype: str - """ - - _validation = { - 'progress': {'required': True}, - 'state': {'required': True}, - 'odatatype': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'MediaJobError'}, - 'label': {'key': 'label', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'long'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odatatype': {'#Microsoft.Media.JobOutputAsset': 'MediaJobOutputAsset'} - } - - def __init__(self, *, progress: int, state, error=None, label: str=None, **kwargs) -> None: - super(MediaJobOutput, self).__init__(**kwargs) - self.error = error - self.label = label - self.progress = progress - self.state = state - self.odatatype = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data.py deleted file mode 100644 index add4742a19e3..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData - - -class MediaJobOutputScheduledEventData(MediaJobOutputStateChangeEventData): - """Job output scheduled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputScheduledEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data_py3.py deleted file mode 100644 index a0ebd525de32..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_scheduled_event_data_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData - - -class MediaJobOutputScheduledEventData(MediaJobOutputStateChangeEventData): - """Job output scheduled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputScheduledEventData, self).__init__(output=output, job_correlation_data=job_correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data.py deleted file mode 100644 index f60b5b944a15..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutputStateChangeEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Media.JobOutputStateChange event. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobOutputStateChangeEventData, self).__init__(**kwargs) - self.previous_state = None - self.output = kwargs.get('output', None) - self.job_correlation_data = kwargs.get('job_correlation_data', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data_py3.py deleted file mode 100644 index 7c66b5dde9df..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_output_state_change_event_data_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobOutputStateChangeEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Media.JobOutputStateChange event. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :param output: Gets the output. - :type output: ~azure.eventgrid.models.MediaJobOutput - :param job_correlation_data: Gets the Job correlation data. - :type job_correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'output': {'key': 'output', 'type': 'MediaJobOutput'}, - 'job_correlation_data': {'key': 'jobCorrelationData', 'type': '{str}'}, - } - - def __init__(self, *, output=None, job_correlation_data=None, **kwargs) -> None: - super(MediaJobOutputStateChangeEventData, self).__init__(**kwargs) - self.previous_state = None - self.output = output - self.job_correlation_data = job_correlation_data diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data.py deleted file mode 100644 index 9723cb17d9c5..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobProcessingEventData(MediaJobStateChangeEventData): - """Job processing event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobProcessingEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data_py3.py deleted file mode 100644 index 6fa5a6bada00..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_processing_event_data_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobProcessingEventData(MediaJobStateChangeEventData): - """Job processing event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, *, correlation_data=None, **kwargs) -> None: - super(MediaJobProcessingEventData, self).__init__(correlation_data=correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data.py deleted file mode 100644 index e7f3ac435b4b..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data import MediaJobStateChangeEventData - - -class MediaJobScheduledEventData(MediaJobStateChangeEventData): - """Job scheduled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobScheduledEventData, self).__init__(**kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data_py3.py deleted file mode 100644 index a48b518f50d7..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_scheduled_event_data_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData - - -class MediaJobScheduledEventData(MediaJobStateChangeEventData): - """Job scheduled event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, *, correlation_data=None, **kwargs) -> None: - super(MediaJobScheduledEventData, self).__init__(correlation_data=correlation_data, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py deleted file mode 100644 index 180cc78a98fa..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobStateChangeEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Media.JobStateChange event. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(MediaJobStateChangeEventData, self).__init__(**kwargs) - self.previous_state = None - self.state = None - self.correlation_data = kwargs.get('correlation_data', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py deleted file mode 100644 index 669d790a1843..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaJobStateChangeEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Media.JobStateChange event. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar previous_state: The previous state of the Job. Possible values - include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', - 'Queued', 'Scheduled' - :vartype previous_state: str or ~azure.eventgrid.models.MediaJobState - :ivar state: The new state of the Job. Possible values include: - 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', - 'Scheduled' - :vartype state: str or ~azure.eventgrid.models.MediaJobState - :param correlation_data: Gets the Job correlation data. - :type correlation_data: dict[str, str] - """ - - _validation = { - 'previous_state': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'previous_state': {'key': 'previousState', 'type': 'MediaJobState'}, - 'state': {'key': 'state', 'type': 'MediaJobState'}, - 'correlation_data': {'key': 'correlationData', 'type': '{str}'}, - } - - def __init__(self, *, correlation_data=None, **kwargs) -> None: - super(MediaJobStateChangeEventData, self).__init__(**kwargs) - self.previous_state = None - self.state = None - self.correlation_data = correlation_data diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data.py deleted file mode 100644 index 76a49ae592bd..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventConnectionRejectedEventData(Model): - """Encoder connection rejected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar result_code: Gets the result code. - :vartype result_code: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'result_code': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventConnectionRejectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None - self.result_code = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data_py3.py deleted file mode 100644 index 3727fde97d6b..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_connection_rejected_event_data_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventConnectionRejectedEventData(Model): - """Encoder connection rejected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar result_code: Gets the result code. - :vartype result_code: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'result_code': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventConnectionRejectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None - self.result_code = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data.py deleted file mode 100644 index 8b89a722d117..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventEncoderConnectedEventData(Model): - """Encoder connect event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventEncoderConnectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data_py3.py deleted file mode 100644 index 64d9148ba712..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_connected_event_data_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventEncoderConnectedEventData(Model): - """Encoder connect event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventEncoderConnectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data.py deleted file mode 100644 index 8fd787e6ebfa..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventEncoderDisconnectedEventData(Model): - """Encoder disconnected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar result_code: Gets the result code. - :vartype result_code: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'result_code': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventEncoderDisconnectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None - self.result_code = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data_py3.py deleted file mode 100644 index 14df222bddac..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_encoder_disconnected_event_data_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventEncoderDisconnectedEventData(Model): - """Encoder disconnected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar stream_id: Gets the stream Id. - :vartype stream_id: str - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar result_code: Gets the result code. - :vartype result_code: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'stream_id': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'result_code': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'stream_id': {'key': 'streamId', 'type': 'str'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventEncoderDisconnectedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.stream_id = None - self.encoder_ip = None - self.encoder_port = None - self.result_code = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data.py deleted file mode 100644 index 6210002346cd..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingDataChunkDroppedEventData(Model): - """Ingest fragment dropped event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar timestamp: Gets the timestamp of the data chunk dropped. - :vartype timestamp: str - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar timescale: Gets the timescale of the Timestamp. - :vartype timescale: str - :ivar result_code: Gets the result code for fragment drop operation. - :vartype result_code: str - :ivar track_name: Gets the name of the track for which fragment is - dropped. - :vartype track_name: str - """ - - _validation = { - 'timestamp': {'readonly': True}, - 'track_type': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'timescale': {'readonly': True}, - 'result_code': {'readonly': True}, - 'track_name': {'readonly': True}, - } - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'str'}, - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventIncomingDataChunkDroppedEventData, self).__init__(**kwargs) - self.timestamp = None - self.track_type = None - self.bitrate = None - self.timescale = None - self.result_code = None - self.track_name = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data_py3.py deleted file mode 100644 index 00fed549af42..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_data_chunk_dropped_event_data_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingDataChunkDroppedEventData(Model): - """Ingest fragment dropped event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar timestamp: Gets the timestamp of the data chunk dropped. - :vartype timestamp: str - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar timescale: Gets the timescale of the Timestamp. - :vartype timescale: str - :ivar result_code: Gets the result code for fragment drop operation. - :vartype result_code: str - :ivar track_name: Gets the name of the track for which fragment is - dropped. - :vartype track_name: str - """ - - _validation = { - 'timestamp': {'readonly': True}, - 'track_type': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'timescale': {'readonly': True}, - 'result_code': {'readonly': True}, - 'track_name': {'readonly': True}, - } - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'str'}, - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'result_code': {'key': 'resultCode', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventIncomingDataChunkDroppedEventData, self).__init__(**kwargs) - self.timestamp = None - self.track_type = None - self.bitrate = None - self.timescale = None - self.result_code = None - self.track_name = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data.py deleted file mode 100644 index 756218ad5856..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingStreamReceivedEventData(Model): - """Encoder connect event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar timestamp: Gets the first timestamp of the data chunk received. - :vartype timestamp: str - :ivar duration: Gets the duration of the first data chunk. - :vartype duration: str - :ivar timescale: Gets the timescale in which timestamp is represented. - :vartype timescale: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'duration': {'readonly': True}, - 'timescale': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventIncomingStreamReceivedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.track_type = None - self.track_name = None - self.bitrate = None - self.encoder_ip = None - self.encoder_port = None - self.timestamp = None - self.duration = None - self.timescale = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data_py3.py deleted file mode 100644 index 928dfc666158..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_stream_received_event_data_py3.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingStreamReceivedEventData(Model): - """Encoder connect event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ingest_url: Gets the ingest URL provided by the live event. - :vartype ingest_url: str - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar encoder_ip: Gets the remote IP. - :vartype encoder_ip: str - :ivar encoder_port: Gets the remote port. - :vartype encoder_port: str - :ivar timestamp: Gets the first timestamp of the data chunk received. - :vartype timestamp: str - :ivar duration: Gets the duration of the first data chunk. - :vartype duration: str - :ivar timescale: Gets the timescale in which timestamp is represented. - :vartype timescale: str - """ - - _validation = { - 'ingest_url': {'readonly': True}, - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'encoder_ip': {'readonly': True}, - 'encoder_port': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'duration': {'readonly': True}, - 'timescale': {'readonly': True}, - } - - _attribute_map = { - 'ingest_url': {'key': 'ingestUrl', 'type': 'str'}, - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'encoder_ip': {'key': 'encoderIp', 'type': 'str'}, - 'encoder_port': {'key': 'encoderPort', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventIncomingStreamReceivedEventData, self).__init__(**kwargs) - self.ingest_url = None - self.track_type = None - self.track_name = None - self.bitrate = None - self.encoder_ip = None - self.encoder_port = None - self.timestamp = None - self.duration = None - self.timescale = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data.py deleted file mode 100644 index c0fef1d78f95..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingStreamsOutOfSyncEventData(Model): - """Incoming streams out of sync event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar min_last_timestamp: Gets the minimum last timestamp received. - :vartype min_last_timestamp: str - :ivar type_of_stream_with_min_last_timestamp: Gets the type of stream with - minimum last timestamp. - :vartype type_of_stream_with_min_last_timestamp: str - :ivar max_last_timestamp: Gets the maximum timestamp among all the tracks - (audio or video). - :vartype max_last_timestamp: str - :ivar type_of_stream_with_max_last_timestamp: Gets the type of stream with - maximum last timestamp. - :vartype type_of_stream_with_max_last_timestamp: str - :ivar timescale_of_min_last_timestamp: Gets the timescale in which - "MinLastTimestamp" is represented. - :vartype timescale_of_min_last_timestamp: str - :ivar timescale_of_max_last_timestamp: Gets the timescale in which - "MaxLastTimestamp" is represented. - :vartype timescale_of_max_last_timestamp: str - """ - - _validation = { - 'min_last_timestamp': {'readonly': True}, - 'type_of_stream_with_min_last_timestamp': {'readonly': True}, - 'max_last_timestamp': {'readonly': True}, - 'type_of_stream_with_max_last_timestamp': {'readonly': True}, - 'timescale_of_min_last_timestamp': {'readonly': True}, - 'timescale_of_max_last_timestamp': {'readonly': True}, - } - - _attribute_map = { - 'min_last_timestamp': {'key': 'minLastTimestamp', 'type': 'str'}, - 'type_of_stream_with_min_last_timestamp': {'key': 'typeOfStreamWithMinLastTimestamp', 'type': 'str'}, - 'max_last_timestamp': {'key': 'maxLastTimestamp', 'type': 'str'}, - 'type_of_stream_with_max_last_timestamp': {'key': 'typeOfStreamWithMaxLastTimestamp', 'type': 'str'}, - 'timescale_of_min_last_timestamp': {'key': 'timescaleOfMinLastTimestamp', 'type': 'str'}, - 'timescale_of_max_last_timestamp': {'key': 'timescaleOfMaxLastTimestamp', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventIncomingStreamsOutOfSyncEventData, self).__init__(**kwargs) - self.min_last_timestamp = None - self.type_of_stream_with_min_last_timestamp = None - self.max_last_timestamp = None - self.type_of_stream_with_max_last_timestamp = None - self.timescale_of_min_last_timestamp = None - self.timescale_of_max_last_timestamp = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data_py3.py deleted file mode 100644 index 0d1a4789aa37..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_streams_out_of_sync_event_data_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingStreamsOutOfSyncEventData(Model): - """Incoming streams out of sync event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar min_last_timestamp: Gets the minimum last timestamp received. - :vartype min_last_timestamp: str - :ivar type_of_stream_with_min_last_timestamp: Gets the type of stream with - minimum last timestamp. - :vartype type_of_stream_with_min_last_timestamp: str - :ivar max_last_timestamp: Gets the maximum timestamp among all the tracks - (audio or video). - :vartype max_last_timestamp: str - :ivar type_of_stream_with_max_last_timestamp: Gets the type of stream with - maximum last timestamp. - :vartype type_of_stream_with_max_last_timestamp: str - :ivar timescale_of_min_last_timestamp: Gets the timescale in which - "MinLastTimestamp" is represented. - :vartype timescale_of_min_last_timestamp: str - :ivar timescale_of_max_last_timestamp: Gets the timescale in which - "MaxLastTimestamp" is represented. - :vartype timescale_of_max_last_timestamp: str - """ - - _validation = { - 'min_last_timestamp': {'readonly': True}, - 'type_of_stream_with_min_last_timestamp': {'readonly': True}, - 'max_last_timestamp': {'readonly': True}, - 'type_of_stream_with_max_last_timestamp': {'readonly': True}, - 'timescale_of_min_last_timestamp': {'readonly': True}, - 'timescale_of_max_last_timestamp': {'readonly': True}, - } - - _attribute_map = { - 'min_last_timestamp': {'key': 'minLastTimestamp', 'type': 'str'}, - 'type_of_stream_with_min_last_timestamp': {'key': 'typeOfStreamWithMinLastTimestamp', 'type': 'str'}, - 'max_last_timestamp': {'key': 'maxLastTimestamp', 'type': 'str'}, - 'type_of_stream_with_max_last_timestamp': {'key': 'typeOfStreamWithMaxLastTimestamp', 'type': 'str'}, - 'timescale_of_min_last_timestamp': {'key': 'timescaleOfMinLastTimestamp', 'type': 'str'}, - 'timescale_of_max_last_timestamp': {'key': 'timescaleOfMaxLastTimestamp', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventIncomingStreamsOutOfSyncEventData, self).__init__(**kwargs) - self.min_last_timestamp = None - self.type_of_stream_with_min_last_timestamp = None - self.max_last_timestamp = None - self.type_of_stream_with_max_last_timestamp = None - self.timescale_of_min_last_timestamp = None - self.timescale_of_max_last_timestamp = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data.py deleted file mode 100644 index e29df8e47d3f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(Model): - """Incoming video stream out of synch event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar first_timestamp: Gets the first timestamp received for one of the - quality levels. - :vartype first_timestamp: str - :ivar first_duration: Gets the duration of the data chunk with first - timestamp. - :vartype first_duration: str - :ivar second_timestamp: Gets the timestamp received for some other quality - levels. - :vartype second_timestamp: str - :ivar second_duration: Gets the duration of the data chunk with second - timestamp. - :vartype second_duration: str - :ivar timescale: Gets the timescale in which both the timestamps and - durations are represented. - :vartype timescale: str - """ - - _validation = { - 'first_timestamp': {'readonly': True}, - 'first_duration': {'readonly': True}, - 'second_timestamp': {'readonly': True}, - 'second_duration': {'readonly': True}, - 'timescale': {'readonly': True}, - } - - _attribute_map = { - 'first_timestamp': {'key': 'firstTimestamp', 'type': 'str'}, - 'first_duration': {'key': 'firstDuration', 'type': 'str'}, - 'second_timestamp': {'key': 'secondTimestamp', 'type': 'str'}, - 'second_duration': {'key': 'secondDuration', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData, self).__init__(**kwargs) - self.first_timestamp = None - self.first_duration = None - self.second_timestamp = None - self.second_duration = None - self.timescale = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data_py3.py deleted file mode 100644 index f0963a0d6ec2..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_incoming_video_streams_out_of_sync_event_data_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(Model): - """Incoming video stream out of synch event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar first_timestamp: Gets the first timestamp received for one of the - quality levels. - :vartype first_timestamp: str - :ivar first_duration: Gets the duration of the data chunk with first - timestamp. - :vartype first_duration: str - :ivar second_timestamp: Gets the timestamp received for some other quality - levels. - :vartype second_timestamp: str - :ivar second_duration: Gets the duration of the data chunk with second - timestamp. - :vartype second_duration: str - :ivar timescale: Gets the timescale in which both the timestamps and - durations are represented. - :vartype timescale: str - """ - - _validation = { - 'first_timestamp': {'readonly': True}, - 'first_duration': {'readonly': True}, - 'second_timestamp': {'readonly': True}, - 'second_duration': {'readonly': True}, - 'timescale': {'readonly': True}, - } - - _attribute_map = { - 'first_timestamp': {'key': 'firstTimestamp', 'type': 'str'}, - 'first_duration': {'key': 'firstDuration', 'type': 'str'}, - 'second_timestamp': {'key': 'secondTimestamp', 'type': 'str'}, - 'second_duration': {'key': 'secondDuration', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData, self).__init__(**kwargs) - self.first_timestamp = None - self.first_duration = None - self.second_timestamp = None - self.second_duration = None - self.timescale = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data.py deleted file mode 100644 index 67928e5bd938..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIngestHeartbeatEventData(Model): - """Ingest fragment dropped event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar incoming_bitrate: Gets the incoming bitrate. - :vartype incoming_bitrate: long - :ivar last_timestamp: Gets the last timestamp. - :vartype last_timestamp: str - :ivar timescale: Gets the timescale of the last timestamp. - :vartype timescale: str - :ivar overlap_count: Gets the fragment Overlap count. - :vartype overlap_count: long - :ivar discontinuity_count: Gets the fragment Discontinuity count. - :vartype discontinuity_count: long - :ivar nonincreasing_count: Gets Non increasing count. - :vartype nonincreasing_count: long - :ivar unexpected_bitrate: Gets a value indicating whether unexpected - bitrate is present or not. - :vartype unexpected_bitrate: bool - :ivar state: Gets the state of the live event. - :vartype state: str - :ivar healthy: Gets a value indicating whether preview is healthy or not. - :vartype healthy: bool - """ - - _validation = { - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'incoming_bitrate': {'readonly': True}, - 'last_timestamp': {'readonly': True}, - 'timescale': {'readonly': True}, - 'overlap_count': {'readonly': True}, - 'discontinuity_count': {'readonly': True}, - 'nonincreasing_count': {'readonly': True}, - 'unexpected_bitrate': {'readonly': True}, - 'state': {'readonly': True}, - 'healthy': {'readonly': True}, - } - - _attribute_map = { - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'incoming_bitrate': {'key': 'incomingBitrate', 'type': 'long'}, - 'last_timestamp': {'key': 'lastTimestamp', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'overlap_count': {'key': 'overlapCount', 'type': 'long'}, - 'discontinuity_count': {'key': 'discontinuityCount', 'type': 'long'}, - 'nonincreasing_count': {'key': 'nonincreasingCount', 'type': 'long'}, - 'unexpected_bitrate': {'key': 'unexpectedBitrate', 'type': 'bool'}, - 'state': {'key': 'state', 'type': 'str'}, - 'healthy': {'key': 'healthy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventIngestHeartbeatEventData, self).__init__(**kwargs) - self.track_type = None - self.track_name = None - self.bitrate = None - self.incoming_bitrate = None - self.last_timestamp = None - self.timescale = None - self.overlap_count = None - self.discontinuity_count = None - self.nonincreasing_count = None - self.unexpected_bitrate = None - self.state = None - self.healthy = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data_py3.py deleted file mode 100644 index 6f9447c3a23e..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_ingest_heartbeat_event_data_py3.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventIngestHeartbeatEventData(Model): - """Ingest fragment dropped event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate of the track. - :vartype bitrate: long - :ivar incoming_bitrate: Gets the incoming bitrate. - :vartype incoming_bitrate: long - :ivar last_timestamp: Gets the last timestamp. - :vartype last_timestamp: str - :ivar timescale: Gets the timescale of the last timestamp. - :vartype timescale: str - :ivar overlap_count: Gets the fragment Overlap count. - :vartype overlap_count: long - :ivar discontinuity_count: Gets the fragment Discontinuity count. - :vartype discontinuity_count: long - :ivar nonincreasing_count: Gets Non increasing count. - :vartype nonincreasing_count: long - :ivar unexpected_bitrate: Gets a value indicating whether unexpected - bitrate is present or not. - :vartype unexpected_bitrate: bool - :ivar state: Gets the state of the live event. - :vartype state: str - :ivar healthy: Gets a value indicating whether preview is healthy or not. - :vartype healthy: bool - """ - - _validation = { - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'incoming_bitrate': {'readonly': True}, - 'last_timestamp': {'readonly': True}, - 'timescale': {'readonly': True}, - 'overlap_count': {'readonly': True}, - 'discontinuity_count': {'readonly': True}, - 'nonincreasing_count': {'readonly': True}, - 'unexpected_bitrate': {'readonly': True}, - 'state': {'readonly': True}, - 'healthy': {'readonly': True}, - } - - _attribute_map = { - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'incoming_bitrate': {'key': 'incomingBitrate', 'type': 'long'}, - 'last_timestamp': {'key': 'lastTimestamp', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'overlap_count': {'key': 'overlapCount', 'type': 'long'}, - 'discontinuity_count': {'key': 'discontinuityCount', 'type': 'long'}, - 'nonincreasing_count': {'key': 'nonincreasingCount', 'type': 'long'}, - 'unexpected_bitrate': {'key': 'unexpectedBitrate', 'type': 'bool'}, - 'state': {'key': 'state', 'type': 'str'}, - 'healthy': {'key': 'healthy', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventIngestHeartbeatEventData, self).__init__(**kwargs) - self.track_type = None - self.track_name = None - self.bitrate = None - self.incoming_bitrate = None - self.last_timestamp = None - self.timescale = None - self.overlap_count = None - self.discontinuity_count = None - self.nonincreasing_count = None - self.unexpected_bitrate = None - self.state = None - self.healthy = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data.py deleted file mode 100644 index d60c04d8f294..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventTrackDiscontinuityDetectedEventData(Model): - """Ingest track discontinuity detected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate. - :vartype bitrate: long - :ivar previous_timestamp: Gets the timestamp of the previous fragment. - :vartype previous_timestamp: str - :ivar new_timestamp: Gets the timestamp of the current fragment. - :vartype new_timestamp: str - :ivar timescale: Gets the timescale in which both timestamps and - discontinuity gap are represented. - :vartype timescale: str - :ivar discontinuity_gap: Gets the discontinuity gap between - PreviousTimestamp and NewTimestamp. - :vartype discontinuity_gap: str - """ - - _validation = { - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'previous_timestamp': {'readonly': True}, - 'new_timestamp': {'readonly': True}, - 'timescale': {'readonly': True}, - 'discontinuity_gap': {'readonly': True}, - } - - _attribute_map = { - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'previous_timestamp': {'key': 'previousTimestamp', 'type': 'str'}, - 'new_timestamp': {'key': 'newTimestamp', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'discontinuity_gap': {'key': 'discontinuityGap', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MediaLiveEventTrackDiscontinuityDetectedEventData, self).__init__(**kwargs) - self.track_type = None - self.track_name = None - self.bitrate = None - self.previous_timestamp = None - self.new_timestamp = None - self.timescale = None - self.discontinuity_gap = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data_py3.py deleted file mode 100644 index 872d6094d5ce..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/media_live_event_track_discontinuity_detected_event_data_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MediaLiveEventTrackDiscontinuityDetectedEventData(Model): - """Ingest track discontinuity detected event data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar track_type: Gets the type of the track (Audio / Video). - :vartype track_type: str - :ivar track_name: Gets the track name. - :vartype track_name: str - :ivar bitrate: Gets the bitrate. - :vartype bitrate: long - :ivar previous_timestamp: Gets the timestamp of the previous fragment. - :vartype previous_timestamp: str - :ivar new_timestamp: Gets the timestamp of the current fragment. - :vartype new_timestamp: str - :ivar timescale: Gets the timescale in which both timestamps and - discontinuity gap are represented. - :vartype timescale: str - :ivar discontinuity_gap: Gets the discontinuity gap between - PreviousTimestamp and NewTimestamp. - :vartype discontinuity_gap: str - """ - - _validation = { - 'track_type': {'readonly': True}, - 'track_name': {'readonly': True}, - 'bitrate': {'readonly': True}, - 'previous_timestamp': {'readonly': True}, - 'new_timestamp': {'readonly': True}, - 'timescale': {'readonly': True}, - 'discontinuity_gap': {'readonly': True}, - } - - _attribute_map = { - 'track_type': {'key': 'trackType', 'type': 'str'}, - 'track_name': {'key': 'trackName', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'long'}, - 'previous_timestamp': {'key': 'previousTimestamp', 'type': 'str'}, - 'new_timestamp': {'key': 'newTimestamp', 'type': 'str'}, - 'timescale': {'key': 'timescale', 'type': 'str'}, - 'discontinuity_gap': {'key': 'discontinuityGap', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MediaLiveEventTrackDiscontinuityDetectedEventData, self).__init__(**kwargs) - self.track_type = None - self.track_name = None - self.bitrate = None - self.previous_timestamp = None - self.new_timestamp = None - self.timescale = None - self.discontinuity_gap = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data.py deleted file mode 100644 index 3a01e07bbf84..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionCancelData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Resources.ResourceActionCancel event. This is raised when a - resource action operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceActionCancelData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data_py3.py deleted file mode 100644 index 7999e471f542..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_cancel_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionCancelData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Resources.ResourceActionCancel event. This is raised when a - resource action operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceActionCancelData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data.py deleted file mode 100644 index bb3225665c81..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceActionFailure event. This is raised when a - resource action operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceActionFailureData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data_py3.py deleted file mode 100644 index 2c356d0b0340..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_failure_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceActionFailure event. This is raised when a - resource action operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceActionFailureData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data.py deleted file mode 100644 index 559817f997ca..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceActionSuccess event. This is raised when a - resource action operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceActionSuccessData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data_py3.py deleted file mode 100644 index 59e9f32f46fc..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_action_success_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceActionSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceActionSuccess event. This is raised when a - resource action operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceActionSuccessData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py deleted file mode 100644 index fe44a24f3482..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteCancelData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Resources.ResourceDeleteCancel event. This is raised when a - resource delete operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceDeleteCancelData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py deleted file mode 100644 index d160235c5335..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteCancelData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Resources.ResourceDeleteCancel event. This is raised when a - resource delete operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceDeleteCancelData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py deleted file mode 100644 index 1354bd7943fa..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceDeleteFailure event. This is raised when a - resource delete operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceDeleteFailureData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py deleted file mode 100644 index 29524ca382b8..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceDeleteFailure event. This is raised when a - resource delete operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceDeleteFailureData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py deleted file mode 100644 index a8a114e554c6..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a - resource delete operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceDeleteSuccessData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py deleted file mode 100644 index 6775b5666aa0..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceDeleteSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a - resource delete operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceDeleteSuccessData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py deleted file mode 100644 index 7e1b1e14e351..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteCancelData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteCancel event. This is raised when a - resource create or update operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceWriteCancelData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py deleted file mode 100644 index c2ab521c0495..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteCancelData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteCancel event. This is raised when a - resource create or update operation is canceled. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceWriteCancelData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py deleted file mode 100644 index d36108de8d30..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteFailure event. This is raised when a - resource create or update operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceWriteFailureData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py deleted file mode 100644 index ab45309bd180..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteFailureData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteFailure event. This is raised when a - resource create or update operation fails. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceWriteFailureData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py deleted file mode 100644 index a38370581387..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteSuccess event. This is raised when a - resource create or update operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceWriteSuccessData, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.resource_provider = kwargs.get('resource_provider', None) - self.resource_uri = kwargs.get('resource_uri', None) - self.operation_name = kwargs.get('operation_name', None) - self.status = kwargs.get('status', None) - self.authorization = kwargs.get('authorization', None) - self.claims = kwargs.get('claims', None) - self.correlation_id = kwargs.get('correlation_id', None) - self.http_request = kwargs.get('http_request', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py deleted file mode 100644 index 0aed7ef74931..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceWriteSuccessData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.Resources.ResourceWriteSuccess event. This is raised when a - resource create or update operation succeeds. - - :param tenant_id: The tenant ID of the resource. - :type tenant_id: str - :param subscription_id: The subscription ID of the resource. - :type subscription_id: str - :param resource_group: The resource group of the resource. - :type resource_group: str - :param resource_provider: The resource provider performing the operation. - :type resource_provider: str - :param resource_uri: The URI of the resource in the operation. - :type resource_uri: str - :param operation_name: The operation that was performed. - :type operation_name: str - :param status: The status of the operation. - :type status: str - :param authorization: The requested authorization for the operation. - :type authorization: str - :param claims: The properties of the claims. - :type claims: str - :param correlation_id: An operation ID used for troubleshooting. - :type correlation_id: str - :param http_request: The details of the operation. - :type http_request: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'authorization': {'key': 'authorization', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': 'str'}, - 'correlation_id': {'key': 'correlationId', 'type': 'str'}, - 'http_request': {'key': 'httpRequest', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: - super(ResourceWriteSuccessData, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py deleted file mode 100644 index c409c8396a05..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServiceBusActiveMessagesAvailableWithNoListenersEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. - - :param namespace_name: The namespace name of the Microsoft.ServiceBus - resource. - :type namespace_name: str - :param request_uri: The endpoint of the Microsoft.ServiceBus resource. - :type request_uri: str - :param entity_type: The entity type of the Microsoft.ServiceBus resource. - Could be one of 'queue' or 'subscriber'. - :type entity_type: str - :param queue_name: The name of the Microsoft.ServiceBus queue. If the - entity type is of type 'subscriber', then this value will be null. - :type queue_name: str - :param topic_name: The name of the Microsoft.ServiceBus topic. If the - entity type is of type 'queue', then this value will be null. - :type topic_name: str - :param subscription_name: The name of the Microsoft.ServiceBus topic's - subscription. If the entity type is of type 'queue', then this value will - be null. - :type subscription_name: str - """ - - _attribute_map = { - 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'queue_name': {'key': 'queueName', 'type': 'str'}, - 'topic_name': {'key': 'topicName', 'type': 'str'}, - 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceBusActiveMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) - self.namespace_name = kwargs.get('namespace_name', None) - self.request_uri = kwargs.get('request_uri', None) - self.entity_type = kwargs.get('entity_type', None) - self.queue_name = kwargs.get('queue_name', None) - self.topic_name = kwargs.get('topic_name', None) - self.subscription_name = kwargs.get('subscription_name', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py deleted file mode 100644 index 35a4108ae4d9..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServiceBusActiveMessagesAvailableWithNoListenersEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. - - :param namespace_name: The namespace name of the Microsoft.ServiceBus - resource. - :type namespace_name: str - :param request_uri: The endpoint of the Microsoft.ServiceBus resource. - :type request_uri: str - :param entity_type: The entity type of the Microsoft.ServiceBus resource. - Could be one of 'queue' or 'subscriber'. - :type entity_type: str - :param queue_name: The name of the Microsoft.ServiceBus queue. If the - entity type is of type 'subscriber', then this value will be null. - :type queue_name: str - :param topic_name: The name of the Microsoft.ServiceBus topic. If the - entity type is of type 'queue', then this value will be null. - :type topic_name: str - :param subscription_name: The name of the Microsoft.ServiceBus topic's - subscription. If the entity type is of type 'queue', then this value will - be null. - :type subscription_name: str - """ - - _attribute_map = { - 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'queue_name': {'key': 'queueName', 'type': 'str'}, - 'topic_name': {'key': 'topicName', 'type': 'str'}, - 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, - } - - def __init__(self, *, namespace_name: str=None, request_uri: str=None, entity_type: str=None, queue_name: str=None, topic_name: str=None, subscription_name: str=None, **kwargs) -> None: - super(ServiceBusActiveMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) - self.namespace_name = namespace_name - self.request_uri = request_uri - self.entity_type = entity_type - self.queue_name = queue_name - self.topic_name = topic_name - self.subscription_name = subscription_name diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py deleted file mode 100644 index 60310de45628..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. - - :param namespace_name: The namespace name of the Microsoft.ServiceBus - resource. - :type namespace_name: str - :param request_uri: The endpoint of the Microsoft.ServiceBus resource. - :type request_uri: str - :param entity_type: The entity type of the Microsoft.ServiceBus resource. - Could be one of 'queue' or 'subscriber'. - :type entity_type: str - :param queue_name: The name of the Microsoft.ServiceBus queue. If the - entity type is of type 'subscriber', then this value will be null. - :type queue_name: str - :param topic_name: The name of the Microsoft.ServiceBus topic. If the - entity type is of type 'queue', then this value will be null. - :type topic_name: str - :param subscription_name: The name of the Microsoft.ServiceBus topic's - subscription. If the entity type is of type 'queue', then this value will - be null. - :type subscription_name: str - """ - - _attribute_map = { - 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'queue_name': {'key': 'queueName', 'type': 'str'}, - 'topic_name': {'key': 'topicName', 'type': 'str'}, - 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) - self.namespace_name = kwargs.get('namespace_name', None) - self.request_uri = kwargs.get('request_uri', None) - self.entity_type = kwargs.get('entity_type', None) - self.queue_name = kwargs.get('queue_name', None) - self.topic_name = kwargs.get('topic_name', None) - self.subscription_name = kwargs.get('subscription_name', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py deleted file mode 100644 index 3f8afafc482c..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. - - :param namespace_name: The namespace name of the Microsoft.ServiceBus - resource. - :type namespace_name: str - :param request_uri: The endpoint of the Microsoft.ServiceBus resource. - :type request_uri: str - :param entity_type: The entity type of the Microsoft.ServiceBus resource. - Could be one of 'queue' or 'subscriber'. - :type entity_type: str - :param queue_name: The name of the Microsoft.ServiceBus queue. If the - entity type is of type 'subscriber', then this value will be null. - :type queue_name: str - :param topic_name: The name of the Microsoft.ServiceBus topic. If the - entity type is of type 'queue', then this value will be null. - :type topic_name: str - :param subscription_name: The name of the Microsoft.ServiceBus topic's - subscription. If the entity type is of type 'queue', then this value will - be null. - :type subscription_name: str - """ - - _attribute_map = { - 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'queue_name': {'key': 'queueName', 'type': 'str'}, - 'topic_name': {'key': 'topicName', 'type': 'str'}, - 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, - } - - def __init__(self, *, namespace_name: str=None, request_uri: str=None, entity_type: str=None, queue_name: str=None, topic_name: str=None, subscription_name: str=None, **kwargs) -> None: - super(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) - self.namespace_name = namespace_name - self.request_uri = request_uri - self.entity_type = entity_type - self.queue_name = queue_name - self.topic_name = topic_name - self.subscription_name = subscription_name diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data.py deleted file mode 100644 index f48d5ff56765..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SignalRServiceClientConnectionConnectedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.SignalRService.ClientConnectionConnected event. - - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param hub: The hub of connected client connection. - :type hub: str - :param connection_id: The connection Id of connected client connection. - :type connection_id: str - :param user_id: The user Id of connected client connection. - :type user_id: str - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'hub': {'key': 'hub', 'type': 'str'}, - 'connection_id': {'key': 'connectionId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SignalRServiceClientConnectionConnectedEventData, self).__init__(**kwargs) - self.timestamp = kwargs.get('timestamp', None) - self.hub = kwargs.get('hub', None) - self.connection_id = kwargs.get('connection_id', None) - self.user_id = kwargs.get('user_id', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data_py3.py deleted file mode 100644 index 2237e0ed5bec..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_connected_event_data_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SignalRServiceClientConnectionConnectedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.SignalRService.ClientConnectionConnected event. - - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param hub: The hub of connected client connection. - :type hub: str - :param connection_id: The connection Id of connected client connection. - :type connection_id: str - :param user_id: The user Id of connected client connection. - :type user_id: str - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'hub': {'key': 'hub', 'type': 'str'}, - 'connection_id': {'key': 'connectionId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - } - - def __init__(self, *, timestamp=None, hub: str=None, connection_id: str=None, user_id: str=None, **kwargs) -> None: - super(SignalRServiceClientConnectionConnectedEventData, self).__init__(**kwargs) - self.timestamp = timestamp - self.hub = hub - self.connection_id = connection_id - self.user_id = user_id diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data.py deleted file mode 100644 index d888c23cd9dc..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SignalRServiceClientConnectionDisconnectedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.SignalRService.ClientConnectionDisconnected event. - - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param hub: The hub of connected client connection. - :type hub: str - :param connection_id: The connection Id of connected client connection. - :type connection_id: str - :param user_id: The user Id of connected client connection. - :type user_id: str - :param error_message: The message of error that cause the client - connection disconnected. - :type error_message: str - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'hub': {'key': 'hub', 'type': 'str'}, - 'connection_id': {'key': 'connectionId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SignalRServiceClientConnectionDisconnectedEventData, self).__init__(**kwargs) - self.timestamp = kwargs.get('timestamp', None) - self.hub = kwargs.get('hub', None) - self.connection_id = kwargs.get('connection_id', None) - self.user_id = kwargs.get('user_id', None) - self.error_message = kwargs.get('error_message', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data_py3.py deleted file mode 100644 index 44e722c83d3a..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/signal_rservice_client_connection_disconnected_event_data_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SignalRServiceClientConnectionDisconnectedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.SignalRService.ClientConnectionDisconnected event. - - :param timestamp: The time at which the event occurred. - :type timestamp: datetime - :param hub: The hub of connected client connection. - :type hub: str - :param connection_id: The connection Id of connected client connection. - :type connection_id: str - :param user_id: The user Id of connected client connection. - :type user_id: str - :param error_message: The message of error that cause the client - connection disconnected. - :type error_message: str - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'hub': {'key': 'hub', 'type': 'str'}, - 'connection_id': {'key': 'connectionId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - } - - def __init__(self, *, timestamp=None, hub: str=None, connection_id: str=None, user_id: str=None, error_message: str=None, **kwargs) -> None: - super(SignalRServiceClientConnectionDisconnectedEventData, self).__init__(**kwargs) - self.timestamp = timestamp - self.hub = hub - self.connection_id = connection_id - self.user_id = user_id - self.error_message = error_message diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py deleted file mode 100644 index edb52bb6a720..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageBlobCreatedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Storage.BlobCreated event. - - :param api: The name of the API/operation that triggered this event. - :type api: str - :param client_request_id: A request id provided by the client of the - storage API operation that triggered this event. - :type client_request_id: str - :param request_id: The request id generated by the Storage service for the - storage API operation that triggered this event. - :type request_id: str - :param e_tag: The etag of the object at the time this event was triggered. - :type e_tag: str - :param content_type: The content type of the blob. This is the same as - what would be returned in the Content-Type header from the blob. - :type content_type: str - :param content_length: The size of the blob in bytes. This is the same as - what would be returned in the Content-Length header from the blob. - :type content_length: long - :param blob_type: The type of blob. - :type blob_type: str - :param url: The path to the blob. - :type url: str - :param sequencer: An opaque string value representing the logical sequence - of events for any particular blob name. Users can use standard string - comparison to understand the relative sequence of two events on the same - blob name. - :type sequencer: str - :param storage_diagnostics: For service use only. Diagnostic data - occasionally included by the Azure Storage service. This property should - be ignored by event consumers. - :type storage_diagnostics: object - """ - - _attribute_map = { - 'api': {'key': 'api', 'type': 'str'}, - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'request_id': {'key': 'requestId', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'content_length': {'key': 'contentLength', 'type': 'long'}, - 'blob_type': {'key': 'blobType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'sequencer': {'key': 'sequencer', 'type': 'str'}, - 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(StorageBlobCreatedEventData, self).__init__(**kwargs) - self.api = kwargs.get('api', None) - self.client_request_id = kwargs.get('client_request_id', None) - self.request_id = kwargs.get('request_id', None) - self.e_tag = kwargs.get('e_tag', None) - self.content_type = kwargs.get('content_type', None) - self.content_length = kwargs.get('content_length', None) - self.blob_type = kwargs.get('blob_type', None) - self.url = kwargs.get('url', None) - self.sequencer = kwargs.get('sequencer', None) - self.storage_diagnostics = kwargs.get('storage_diagnostics', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py deleted file mode 100644 index 78914ab25fba..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageBlobCreatedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Storage.BlobCreated event. - - :param api: The name of the API/operation that triggered this event. - :type api: str - :param client_request_id: A request id provided by the client of the - storage API operation that triggered this event. - :type client_request_id: str - :param request_id: The request id generated by the Storage service for the - storage API operation that triggered this event. - :type request_id: str - :param e_tag: The etag of the object at the time this event was triggered. - :type e_tag: str - :param content_type: The content type of the blob. This is the same as - what would be returned in the Content-Type header from the blob. - :type content_type: str - :param content_length: The size of the blob in bytes. This is the same as - what would be returned in the Content-Length header from the blob. - :type content_length: long - :param blob_type: The type of blob. - :type blob_type: str - :param url: The path to the blob. - :type url: str - :param sequencer: An opaque string value representing the logical sequence - of events for any particular blob name. Users can use standard string - comparison to understand the relative sequence of two events on the same - blob name. - :type sequencer: str - :param storage_diagnostics: For service use only. Diagnostic data - occasionally included by the Azure Storage service. This property should - be ignored by event consumers. - :type storage_diagnostics: object - """ - - _attribute_map = { - 'api': {'key': 'api', 'type': 'str'}, - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'request_id': {'key': 'requestId', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'content_length': {'key': 'contentLength', 'type': 'long'}, - 'blob_type': {'key': 'blobType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'sequencer': {'key': 'sequencer', 'type': 'str'}, - 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, - } - - def __init__(self, *, api: str=None, client_request_id: str=None, request_id: str=None, e_tag: str=None, content_type: str=None, content_length: int=None, blob_type: str=None, url: str=None, sequencer: str=None, storage_diagnostics=None, **kwargs) -> None: - super(StorageBlobCreatedEventData, self).__init__(**kwargs) - self.api = api - self.client_request_id = client_request_id - self.request_id = request_id - self.e_tag = e_tag - self.content_type = content_type - self.content_length = content_length - self.blob_type = blob_type - self.url = url - self.sequencer = sequencer - self.storage_diagnostics = storage_diagnostics diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py deleted file mode 100644 index 1b869057d280..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageBlobDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Storage.BlobDeleted event. - - :param api: The name of the API/operation that triggered this event. - :type api: str - :param client_request_id: A request id provided by the client of the - storage API operation that triggered this event. - :type client_request_id: str - :param request_id: The request id generated by the Storage service for the - storage API operation that triggered this event. - :type request_id: str - :param content_type: The content type of the blob. This is the same as - what would be returned in the Content-Type header from the blob. - :type content_type: str - :param blob_type: The type of blob. - :type blob_type: str - :param url: The path to the blob. - :type url: str - :param sequencer: An opaque string value representing the logical sequence - of events for any particular blob name. Users can use standard string - comparison to understand the relative sequence of two events on the same - blob name. - :type sequencer: str - :param storage_diagnostics: For service use only. Diagnostic data - occasionally included by the Azure Storage service. This property should - be ignored by event consumers. - :type storage_diagnostics: object - """ - - _attribute_map = { - 'api': {'key': 'api', 'type': 'str'}, - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'request_id': {'key': 'requestId', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'blob_type': {'key': 'blobType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'sequencer': {'key': 'sequencer', 'type': 'str'}, - 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(StorageBlobDeletedEventData, self).__init__(**kwargs) - self.api = kwargs.get('api', None) - self.client_request_id = kwargs.get('client_request_id', None) - self.request_id = kwargs.get('request_id', None) - self.content_type = kwargs.get('content_type', None) - self.blob_type = kwargs.get('blob_type', None) - self.url = kwargs.get('url', None) - self.sequencer = kwargs.get('sequencer', None) - self.storage_diagnostics = kwargs.get('storage_diagnostics', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py deleted file mode 100644 index 7565e6572c24..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageBlobDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for an - Microsoft.Storage.BlobDeleted event. - - :param api: The name of the API/operation that triggered this event. - :type api: str - :param client_request_id: A request id provided by the client of the - storage API operation that triggered this event. - :type client_request_id: str - :param request_id: The request id generated by the Storage service for the - storage API operation that triggered this event. - :type request_id: str - :param content_type: The content type of the blob. This is the same as - what would be returned in the Content-Type header from the blob. - :type content_type: str - :param blob_type: The type of blob. - :type blob_type: str - :param url: The path to the blob. - :type url: str - :param sequencer: An opaque string value representing the logical sequence - of events for any particular blob name. Users can use standard string - comparison to understand the relative sequence of two events on the same - blob name. - :type sequencer: str - :param storage_diagnostics: For service use only. Diagnostic data - occasionally included by the Azure Storage service. This property should - be ignored by event consumers. - :type storage_diagnostics: object - """ - - _attribute_map = { - 'api': {'key': 'api', 'type': 'str'}, - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'request_id': {'key': 'requestId', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'blob_type': {'key': 'blobType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'sequencer': {'key': 'sequencer', 'type': 'str'}, - 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, - } - - def __init__(self, *, api: str=None, client_request_id: str=None, request_id: str=None, content_type: str=None, blob_type: str=None, url: str=None, sequencer: str=None, storage_diagnostics=None, **kwargs) -> None: - super(StorageBlobDeletedEventData, self).__init__(**kwargs) - self.api = api - self.client_request_id = client_request_id - self.request_id = request_id - self.content_type = content_type - self.blob_type = blob_type - self.url = url - self.sequencer = sequencer - self.storage_diagnostics = storage_diagnostics diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py deleted file mode 100644 index 2aa366646706..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.EventGrid.SubscriptionDeletedEvent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar event_subscription_id: The Azure resource ID of the deleted event - subscription. - :vartype event_subscription_id: str - """ - - _validation = { - 'event_subscription_id': {'readonly': True}, - } - - _attribute_map = { - 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SubscriptionDeletedEventData, self).__init__(**kwargs) - self.event_subscription_id = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py deleted file mode 100644 index 133338d9d112..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionDeletedEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.EventGrid.SubscriptionDeletedEvent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar event_subscription_id: The Azure resource ID of the deleted event - subscription. - :vartype event_subscription_id: str - """ - - _validation = { - 'event_subscription_id': {'readonly': True}, - } - - _attribute_map = { - 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SubscriptionDeletedEventData, self).__init__(**kwargs) - self.event_subscription_id = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py deleted file mode 100644 index f9d0bfe7c431..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionValidationEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.EventGrid.SubscriptionValidationEvent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar validation_code: The validation code sent by Azure Event Grid to - validate an event subscription. To complete the validation handshake, the - subscriber must either respond with this validation code as part of the - validation response, or perform a GET request on the validationUrl - (available starting version 2018-05-01-preview). - :vartype validation_code: str - :ivar validation_url: The validation URL sent by Azure Event Grid - (available starting version 2018-05-01-preview). To complete the - validation handshake, the subscriber must either respond with the - validationCode as part of the validation response, or perform a GET - request on the validationUrl (available starting version - 2018-05-01-preview). - :vartype validation_url: str - """ - - _validation = { - 'validation_code': {'readonly': True}, - 'validation_url': {'readonly': True}, - } - - _attribute_map = { - 'validation_code': {'key': 'validationCode', 'type': 'str'}, - 'validation_url': {'key': 'validationUrl', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SubscriptionValidationEventData, self).__init__(**kwargs) - self.validation_code = None - self.validation_url = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py deleted file mode 100644 index b4302b98927b..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionValidationEventData(Model): - """Schema of the Data property of an EventGridEvent for a - Microsoft.EventGrid.SubscriptionValidationEvent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar validation_code: The validation code sent by Azure Event Grid to - validate an event subscription. To complete the validation handshake, the - subscriber must either respond with this validation code as part of the - validation response, or perform a GET request on the validationUrl - (available starting version 2018-05-01-preview). - :vartype validation_code: str - :ivar validation_url: The validation URL sent by Azure Event Grid - (available starting version 2018-05-01-preview). To complete the - validation handshake, the subscriber must either respond with the - validationCode as part of the validation response, or perform a GET - request on the validationUrl (available starting version - 2018-05-01-preview). - :vartype validation_url: str - """ - - _validation = { - 'validation_code': {'readonly': True}, - 'validation_url': {'readonly': True}, - } - - _attribute_map = { - 'validation_code': {'key': 'validationCode', 'type': 'str'}, - 'validation_url': {'key': 'validationUrl', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SubscriptionValidationEventData, self).__init__(**kwargs) - self.validation_code = None - self.validation_url = None diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py deleted file mode 100644 index 034d55d1faf1..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionValidationResponse(Model): - """To complete an event subscription validation handshake, a subscriber can - use either the validationCode or the validationUrl received in a - SubscriptionValidationEvent. When the validationCode is used, the - SubscriptionValidationResponse can be used to build the response. - - :param validation_response: The validation response sent by the subscriber - to Azure Event Grid to complete the validation of an event subscription. - :type validation_response: str - """ - - _attribute_map = { - 'validation_response': {'key': 'validationResponse', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SubscriptionValidationResponse, self).__init__(**kwargs) - self.validation_response = kwargs.get('validation_response', None) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py deleted file mode 100644 index dc76e2a5ca6f..000000000000 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SubscriptionValidationResponse(Model): - """To complete an event subscription validation handshake, a subscriber can - use either the validationCode or the validationUrl received in a - SubscriptionValidationEvent. When the validationCode is used, the - SubscriptionValidationResponse can be used to build the response. - - :param validation_response: The validation response sent by the subscriber - to Azure Event Grid to complete the validation of an event subscription. - :type validation_response: str - """ - - _attribute_map = { - 'validation_response': {'key': 'validationResponse', 'type': 'str'}, - } - - def __init__(self, *, validation_response: str=None, **kwargs) -> None: - super(SubscriptionValidationResponse, self).__init__(**kwargs) - self.validation_response = validation_response diff --git a/sdk/eventgrid/azure-eventgrid/dev_requirements.txt b/sdk/eventgrid/azure-eventgrid/dev_requirements.txt index f6457a93d5e8..2d79b6ebd683 100644 --- a/sdk/eventgrid/azure-eventgrid/dev_requirements.txt +++ b/sdk/eventgrid/azure-eventgrid/dev_requirements.txt @@ -1 +1,5 @@ --e ../../../tools/azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-devtools +-e ../../../tools/azure-sdk-tools +-e ../../core/azure-core +-e ../../identity/azure-identity +-e ../azure-mgmt-eventgrid diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1_publish_custom_events_to_a_topic.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1_publish_custom_events_to_a_topic.py new file mode 100644 index 000000000000..d98de8ab82ed --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1_publish_custom_events_to_a_topic.py @@ -0,0 +1,19 @@ +from azure.eventgrid import EventGridPublisherClient, EventGridEvent, CloudEvent +from azure.core.credentials import AzureKeyCredential + +topic_hostname = ".-1.eventgrid.azure.net" +topic_key = "" + +credential = AzureKeyCredential(topic_key) +client = EventGridPublisherClient(topic_hostname, credential) + +client.send([ + EventGridEvent( + event_type="Contoso.Items.ItemReceived", + data={ + "itemSku": "Contoso Item SKU #1" + }, + subject="Door1", + data_version="2.0" + ) +]) \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1b_publish_custom_events_to_a_topic_with_signature.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1b_publish_custom_events_to_a_topic_with_signature.py new file mode 100644 index 000000000000..b320f603ea65 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1b_publish_custom_events_to_a_topic_with_signature.py @@ -0,0 +1,21 @@ +from azure.eventgrid import EventGridPublisherClient, EventGridEvent, CloudEvent, generate_shared_access_signature, EventGridSharedAccessSignatureCredential +from azure.core.credentials import AzureKeyCredential + +topic_hostname = ".-1.eventgrid.azure.net" +topic_key = "" +expiration_date_utc = dt.datetime.now(tzutc()) + timedelta(hours=1) + +signature = generate_shared_access_signature(topic_hostname, topic_key, expiration_date_utc) +credential = EventGridSharedAccessSignatureCredential(signature) +client = EventGridPublisherClient(topic_hostname, credential) + +client.send([ + EventGridEvent( + event_type="Contoso.Items.ItemReceived", + data={ + "itemSku": "Contoso Item SKU #1" + }, + subject="Door1", + data_version="2.0" + ) +]) \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs2_publish_custom_events_to_a_domain_topic.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs2_publish_custom_events_to_a_domain_topic.py new file mode 100644 index 000000000000..3221d4ad30d5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs2_publish_custom_events_to_a_domain_topic.py @@ -0,0 +1,29 @@ +from azure.eventgrid import EventGridPublisherClient, EventGridEvent +from azure.core.credentials import AzureKeyCredential + +domain_hostname = ".-1.eventgrid.azure.net" +domain_key = "" + +credential = AzureKeyCredential(domain_key) +client = EventGridPublisherClient(domain_hostname, credential) + +client.send([ + EventGridEvent( + topic="MyCustomDomainTopic1", + event_type="Contoso.Items.ItemReceived", + data={ + "itemSku": "Contoso Item SKU #1" + }, + subject="Door1", + data_version="2.0" + ), + EventGridEvent( + topic="MyCustomDomainTopic2", + event_type="Contoso.Items.ItemReceived", + data={ + "itemSku": "Contoso Item SKU #2" + }, + subject="Door1", + data_version="2.0" + ) +]) \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_consume_system_events.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_consume_system_events.py new file mode 100644 index 000000000000..ef39037148d4 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_consume_system_events.py @@ -0,0 +1,21 @@ +import os +from azure.eventgrid import EventGridConsumer + +consumer = EventGridConsumer() + +# returns List[DeserializedEvent] +deserialized_events = consumer.deserialize_events(service_bus_received_message) + +# EventGridEvent schema, Storage.BlobCreated event +for event in deserialized_events: + + # both allow access to raw properties as strings + time_string = event.event_time + time_string = event["event_time"] + + # model returns EventGridEvent object + event_grid_event = event.model + + # all model properties are strongly typed + datetime_object = event.model.time + storage_blobcreated_object = event.model.data diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_event_grid_event_system_event.json b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_event_grid_event_system_event.json new file mode 100644 index 000000000000..9825e4d7be35 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_event_grid_event_system_event.json @@ -0,0 +1,23 @@ +{ +"topic": "/subscriptions/{subscription-id}/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", +"subject": "/blobServices/default/containers/oc2d2817345i200097container/blobs/oc2d2817345i20002296blob", +"eventType": "Microsoft.Storage.BlobCreated", +"eventTime": "2017-06-26T18:41:00.9584103Z", +"id": "831e1650-001e-001b-66ab-eeb76e069631", +"data": { + "api": "PutBlockList", + "clientRequestId": "6d79dbfb-0e37-4fc4-981f-442c9ca65760", + "requestId": "831e1650-001e-001b-66ab-eeb76e000000", + "eTag": "0x8D4BCC2E4835CD0", + "contentType": "application/octet-stream", + "contentLength": 524288, + "blobType": "BlockBlob", + "url": "https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob", + "sequencer": "00000000000004420000000000028963", + "storageDiagnostics": { + "batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0" + } +}, +"dataVersion": "", +"metadataVersion": "1" +} \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_system_event.json b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_system_event.json new file mode 100644 index 000000000000..3c802ac5e451 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_system_event.json @@ -0,0 +1,23 @@ +{ + "specversion": "1.0", + "type": "Microsoft.Storage.BlobCreated", + "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}", + "id": "9aeb0fdf-c01e-0131-0922-9eb54906e209", + "time": "2019-11-18T15:13:39.4589254Z", + "subject": "blobServices/default/containers/{storage-container}/blobs/{new-file}", + "dataschema": "#", + "data": { + "api": "PutBlockList", + "clientRequestId": "4c5dd7fb-2c48-4a27-bb30-5361b5de920a", + "requestId": "9aeb0fdf-c01e-0131-0922-9eb549000000", + "eTag": "0x8D76C39E4407333", + "contentType": "image/png", + "contentLength": 30699, + "blobType": "BlockBlob", + "url": "https://gridtesting.blob.core.windows.net/testcontainer/{new-file}", + "sequencer": "000000000000000000000000000099240000000000c41c18", + "storageDiagnostics": { + "batchId": "681fe319-3006-00a8-0022-9e7cde000000" + } + } +} \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_consume_custom_events.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_consume_custom_events.py new file mode 100644 index 000000000000..13d41d0f09ea --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_consume_custom_events.py @@ -0,0 +1,23 @@ +import os +from azure.eventgrid import EventGridConsumer + +consumer = EventGridConsumer() + +# returns List[DeserializedEvent] +deserialized_events = consumer.deserialize_events(service_bus_received_message) + +# EventGridEvent schema, with custom event type +for event in deserialized_events: + + # both allow access to raw properties as strings + time_string = event.event_time + time_string = event["event_time"] + + # model returns EventGridEvent object + event_grid_event = event.model + + # returns { "itemSku": "Contoso Item SKU #1" } + data_dict = event.data + + # custom event not pre-defined in system event registry, returns None + returns_none = event.model.data diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_event_grid_event_custom_event.json b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_event_grid_event_custom_event.json new file mode 100644 index 000000000000..30be4fbdd59b --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_event_grid_event_custom_event.json @@ -0,0 +1,12 @@ +{ + "topic": "customeventexample.eastus-1.eventgrid.azure.net", + "subject": "Door1", + "eventType": "Contoso.Items.ItemReceived", + "eventTime": "2017-06-26T18:41:00.9584103Z", + "id": "831e1650-001e-001b-66ab-eeb76e069631", + "data": { + "itemSku": "Contoso Item SKU #1" + }, + "dataVersion": "2.0", + "metadataVersion": "1" +} \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs5_publish_events_using_cloud_events_1.0_schema.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs5_publish_events_using_cloud_events_1.0_schema.py new file mode 100644 index 000000000000..4474b6ab40fb --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs5_publish_events_using_cloud_events_1.0_schema.py @@ -0,0 +1,19 @@ +from azure.eventgrid import EventGridPublisherClient, CloudEvent +from azure.core.credentials import AzureKeyCredential + +topic_hostname = ".-1.eventgrid.azure.net" +topic_key = "" + +credential = AzureKeyCredential(topic_key) +client = EventGridPublisherClient(topic_hostname, credential) + +client.send([ + CloudEvent( + type="Contoso.Items.ItemReceived", + source="/contoso/items", + data={ + "itemSku": "Contoso Item SKU #1" + }, + subject="Door1" + ) +]) diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_cloud_event_system_event.json b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_cloud_event_system_event.json new file mode 100644 index 000000000000..3c802ac5e451 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_cloud_event_system_event.json @@ -0,0 +1,23 @@ +{ + "specversion": "1.0", + "type": "Microsoft.Storage.BlobCreated", + "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}", + "id": "9aeb0fdf-c01e-0131-0922-9eb54906e209", + "time": "2019-11-18T15:13:39.4589254Z", + "subject": "blobServices/default/containers/{storage-container}/blobs/{new-file}", + "dataschema": "#", + "data": { + "api": "PutBlockList", + "clientRequestId": "4c5dd7fb-2c48-4a27-bb30-5361b5de920a", + "requestId": "9aeb0fdf-c01e-0131-0922-9eb549000000", + "eTag": "0x8D76C39E4407333", + "contentType": "image/png", + "contentLength": 30699, + "blobType": "BlockBlob", + "url": "https://gridtesting.blob.core.windows.net/testcontainer/{new-file}", + "sequencer": "000000000000000000000000000099240000000000c41c18", + "storageDiagnostics": { + "batchId": "681fe319-3006-00a8-0022-9e7cde000000" + } + } +} \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py new file mode 100644 index 000000000000..2001070fb68c --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py @@ -0,0 +1,21 @@ +import os +from azure.eventgrid import EventGridConsumer + +consumer = EventGridConsumer() + +# returns List[DeserializedEvent] +deserialized_events = consumer.deserialize_events(service_bus_received_message) + +# CloudEvent schema +for event in deserialized_events: + + # both allow access to raw properties as strings + time_string = event.time + time_string = event["time"] + + # model returns CloudEvent object + cloud_event = event.model + + # all model properties are strongly typed + datetime_object = event.model.time + storage_blobcreated_object = event.model.data \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_cloud_custom_data_sample.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_cloud_custom_data_sample.py new file mode 100644 index 000000000000..ce477ef69963 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_cloud_custom_data_sample.py @@ -0,0 +1,22 @@ +import json +from azure.eventgrid import EventGridConsumer, CloudEvent + +# all types of CloudEvents below produce same DeserializedEvent +cloud_custom_dict = { + "id":"de0fd76c-4ef4-4dfb-ab3a-8f24a307e033", + "source":"https://egtest.dev/cloudcustomevent", + "data":{"team": "event grid squad"}, + "type":"Azure.Sdk.Sample", + "time":"2020-08-07T02:06:08.11969Z", + "specversion":"1.0" +} +cloud_custom_string = json.dumps(cloud_custom_dict) +cloud_custom_bytes = bytes(cloud_custom_string, "utf-8") + +client = EventGridConsumer() +deserialized_dict_event = client.deserialize_event(cloud_custom_dict) +deserialized_str_event = client.deserialize_event(cloud_custom_string) +deserialized_bytes_event = client.deserialize_event(cloud_custom_bytes) + +print(deserialized_bytes_event.model == deserialized_str_event.model) +print(deserialized_bytes_event.model == deserialized_dict_event.model) \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_eg_storage_blob_created_data_sample.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_eg_storage_blob_created_data_sample.py new file mode 100644 index 000000000000..21735940739f --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/consume_eg_storage_blob_created_data_sample.py @@ -0,0 +1,37 @@ +import json +from azure.eventgrid import EventGridConsumer, EventGridEvent, StorageBlobCreatedEventData + +# all types of EventGridEvents below produce same DeserializedEvent +eg_storage_dict = { + "id":"bbab6625-dc56-4b22-abeb-afcc72e5290c", + "subject":"/blobServices/default/containers/oc2d2817345i200097container/blobs/oc2d2817345i20002296blob", + "data":{ + "api":"PutBlockList", + "clientRequestId":"6d79dbfb-0e37-4fc4-981f-442c9ca65760", + "requestId":"831e1650-001e-001b-66ab-eeb76e000000", + "eTag":"0x8D4BCC2E4835CD0", + "contentType":"application/octet-stream", + "contentLength":524288, + "blobType":"BlockBlob", + "url":"https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob", + "sequencer":"00000000000004420000000000028963", + "storageDiagnostics":{"batchId":"b68529f3-68cd-4744-baa4-3c0498ec19f0"} + }, + "eventType":"Microsoft.Storage.BlobCreated", + "dataVersion":"2.0", + "metadataVersion":"1", + "eventTime":"2020-08-07T02:28:23.867525Z", + "topic":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/t-swpill-test/providers/Microsoft.EventGrid/topics/eventgridegsub" +} + +eg_storage_string = json.dumps(eg_storage_dict) +eg_storage_bytes = bytes(eg_storage_string, "utf-8") + +client = EventGridConsumer() +deserialized_dict_event = client.deserialize_event(eg_storage_dict) +deserialized_str_event = client.deserialize_event(eg_storage_string) +deserialized_bytes_event = client.deserialize_event(eg_storage_bytes) + +print(deserialized_bytes_event.model == deserialized_str_event.model) +print(deserialized_bytes_event.model == deserialized_dict_event.model) +print(deserialized_str_event.model.data.__class__ == StorageBlobCreatedEventData) \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_eventhub.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_eventhub.py new file mode 100644 index 000000000000..b672777afc0b --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_eventhub.py @@ -0,0 +1,47 @@ +import sys +import os + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.eventgrid import EventGridConsumer, CloudEvent, EventGridEvent +from azure.eventhub import EventHubConsumerClient + +""" +An example to show receiving events from an Event Hub. +""" + +CONNECTION_STR = os.environ["EVENT_HUB_CONN_STR"] +EVENTHUB_NAME = os.environ["EVENTHUB_NAME"] + + +def on_event(partition_context, event): + + dict_event = event.body_as_json()[0] + deserialized_event = eg_consumer.deserialize_event(dict_event) + if deserialized_event.model.__class__ == CloudEvent: + dict_event = deserialized_event.to_json() + print("event.type: {}\n".format(dict_event["type"])) + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) + else: + dict_event = deserialized_event.to_json() + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) + +eg_consumer = EventGridConsumer() +consumer_client = EventHubConsumerClient.from_connection_string( + conn_str=CONNECTION_STR, + consumer_group='$Default', + eventhub_name=EVENTHUB_NAME, +) + +with consumer_client: + event_list = consumer_client.receive( + on_event=on_event, + starting_position="-1", # "-1" is from the beginning of the partition. + prefetch=5 + ) diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_service_bus_queue.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_service_bus_queue.py new file mode 100644 index 000000000000..3f1b61057d83 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_service_bus_queue.py @@ -0,0 +1,37 @@ +import sys +import os + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.core.pipeline.policies import AzureKeyCredentialPolicy +from azure.core.credentials import AzureKeyCredential + +from azure.eventgrid import EventGridConsumer, CloudEvent +from azure.servicebus import ServiceBusClient + +connection_str = os.environ['SB_CONN_STR'] +queue_name = os.environ['SERVICE_BUS_QUEUE_NAME'] + +sb_client = ServiceBusClient.from_connection_string(connection_str) +consumer = EventGridConsumer() +with sb_client: + receiver = sb_client.get_queue_receiver(queue_name, prefetch=10) + with receiver: + msgs = receiver.receive(max_batch_size=10, max_wait_time=1) + print("number of messages: {}".format(len(msgs))) + for msg in msgs: + # receive single dict message + deserialized_event = consumer.deserialize_event(str(msg)) + if deserialized_event.model.__class__ == CloudEvent: + dict_event = deserialized_event.to_json() + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) + else: + dict_event = deserialized_event.to_json() + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) + msg.complete() diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_storage_queue.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_storage_queue.py new file mode 100644 index 000000000000..754c561bfbe1 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/consume_cloud_events_from_storage_queue.py @@ -0,0 +1,27 @@ +import os +from azure.storage.queue import QueueServiceClient +from azure.eventgrid import EventGridConsumer, CloudEvent +from base64 import b64decode + +connection_str = os.environ["STORAGE_QUEUE_CONN_STR"] +queue_name = os.environ["STORAGE_QUEUE_NAME"] +queue_service = QueueServiceClient.from_connection_string(conn_str=connection_str) + +queue_client = queue_service.get_queue_client(queue_name) +consumer = EventGridConsumer() + +msgs = queue_client.receive_messages() +for msg in msgs: + # receive single dict message + deserialized_event = consumer.deserialize_event(b64decode(msg.content)) + if deserialized_event.model.__class__ == CloudEvent: + dict_event = deserialized_event.to_json() + print("event.type: {}\n".format(dict_event["type"])) + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) + else: + dict_event = deserialized_event.to_json() + print("event.to_json(): {}\n".format(dict_event)) + print("model: {}\n".format(deserialized_event.model)) + print("model.data: {}\n".format(deserialized_event.model.data)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.funcignore b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.funcignore new file mode 100644 index 000000000000..0678ea2b2270 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.funcignore @@ -0,0 +1,5 @@ +.git* +.vscode +local.settings.json +test +.venv \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.gitignore b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.gitignore new file mode 100644 index 000000000000..a10127be5c96 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/.gitignore @@ -0,0 +1,130 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don’t work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# Azure Functions artifacts +bin +obj +appsettings.json +local.settings.json +.python_packages \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/__init__.py b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/__init__.py new file mode 100644 index 000000000000..95e1da605e45 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/__init__.py @@ -0,0 +1,22 @@ +import json +import logging +import sys + +import azure.functions as func +from azure.eventgrid import EventGridConsumer + +def main(event: func.EventGridEvent): + logging.info(sys.version) + logging.info(event) + result = json.dumps({ + 'id': event.id, + 'data': event.get_json(), + 'topic': event.topic, + 'subject': event.subject, + 'event_type': event.event_type + }) + logging.info(result) + consumer = EventGridConsumer() + deserialized_event = consumer.deserialize_events(result) + ## can only be EventGridEvent + print("model: {}".format(event.model)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/function.json b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/function.json new file mode 100644 index 000000000000..e2764c7fdba4 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/function.json @@ -0,0 +1,10 @@ +{ + "scriptFile": "__init__.py", + "bindings": [ + { + "type": "eventGridTrigger", + "name": "event", + "direction": "in" + } + ] +} diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/host.json b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/host.json new file mode 100644 index 000000000000..8f3cf9db3fbe --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/host.json @@ -0,0 +1,7 @@ +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[1.*, 2.0.0)" + } +} \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/sample.dat b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/sample.dat new file mode 100644 index 000000000000..5e172b50e0d5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/EventGridTrigger1/sample.dat @@ -0,0 +1,20 @@ +{ + 'topic': '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test', + 'subject': 'eventhubs/test', + 'eventType': 'captureFileCreated', + 'eventTime': '2017-07-14T23:10:27.7689666Z', + 'id': '7b11c4ce-1c34-4416-848b-1730e766f126', + 'data': { + 'fileUrl': 'https://test.blob.core.windows.net/debugging/testblob.txt', + 'fileType': 'AzureBlockBlob', + 'partitionId': '1', + 'sizeInBytes': 0, + 'eventCount': 0, + 'firstSequenceNumber': -1, + 'lastSequenceNumber': -1, + 'firstEnqueueTime': '0001-01-01T00:00:00', + 'lastEnqueueTime': '0001-01-01T00:00:00' + }, + "dataVersion": "", + "metadataVersion": "1" +} diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/host.json b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/host.json new file mode 100644 index 000000000000..6ab664374ff1 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/host.json @@ -0,0 +1,15 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + } + } + }, + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[1.*, 2.0.0)" + } +} diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/proxies.json b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/proxies.json new file mode 100644 index 000000000000..b385252f5ed7 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/proxies.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json.schemastore.org/proxies", + "proxies": {} +} diff --git a/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/requirements.txt b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/requirements.txt new file mode 100644 index 000000000000..75db2c4f60f8 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/consume_samples/e2e_samples/functionsapp/requirements.txt @@ -0,0 +1 @@ +azure-functions diff --git a/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_custom_topic_sample.py b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_custom_topic_sample.py new file mode 100644 index 000000000000..cada0ae9e5e5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_custom_topic_sample.py @@ -0,0 +1,39 @@ +import sys +import os +from random import randint, sample +import time + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.core.credentials import AzureKeyCredential +from azure.eventgrid import EventGridPublisherClient, CloudEvent + +key = os.environ.get("CLOUD_ACCESS_KEY") +topic_hostname = os.environ["CLOUD_TOPIC_HOSTNAME"] + +# authenticate client +credential = AzureKeyCredential(key) +client = EventGridPublisherClient(topic_hostname, credential) + +team_members = ["Josh", "Kerri", "Kieran", "Laurent", "Lily", "Matt", "Soren", "Srikanta", "Swathi"] # possible values for data field + +# publish events +while True: + event_list = [] # list of events to publish + # create events and append to list + for j in range(randint(1, 1)): + sample_members = sample(team_members, k=randint(1, 9)) # select random subset of team members + data_dict = {"team": sample_members} + event = CloudEvent( + type="Azure.Sdk.Sample", + source="https://egsample.dev/sampleevent", + data={"team": sample_members} + ) + event_list.append(event) + + # publish list of events + client.send(event_list) + print("Batch of size {} published".format(len(event_list))) + time.sleep(randint(1, 5)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_domain_topic_sample.py b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_domain_topic_sample.py new file mode 100644 index 000000000000..528d57d85887 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_cloud_events_to_domain_topic_sample.py @@ -0,0 +1,40 @@ +import sys +import os +from random import randint, sample +import time + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.core.credentials import AzureKeyCredential +from azure.eventgrid import EventGridPublisherClient, CloudEvent + +domain_key = os.environ["DOMAIN_ACCESS_KEY"] +domain_topic_hostname = os.environ["DOMAIN_TOPIC_HOSTNAME"] +domain_name = os.environ["DOMAIN_NAME"] + +# authenticate client +credential = AzureKeyCredential(domain_key) +client = EventGridPublisherClient(domain_topic_hostname, credential) + +# publish events +while True: + + event_list = [] # list of events to publish + team_members = ["Josh", "Kerri", "Kieran", "Laurent", "Lily", "Matt", "Soren", "Srikanta", "Swathi"] # possible values for data field + + # create events and append to list + for j in range(randint(1, 3)): + sample_members = sample(team_members, k=randint(1, 9)) # select random subset of team members + event = CloudEvent( + type="Azure.Sdk.Demo", + source=domain_name, + data={"team": sample_members} + ) + event_list.append(event) + + # publish list of events + client.send(event_list) + print("Batch of size {} published".format(len(event_list))) + time.sleep(randint(1, 5)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_custom_schema_events_to_topic_sample.py b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_custom_schema_events_to_topic_sample.py new file mode 100644 index 000000000000..ecfbf4eb208d --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_custom_schema_events_to_topic_sample.py @@ -0,0 +1,44 @@ +import sys +import os +from random import randint, sample +import time +import uuid +from msrest.serialization import UTC +import datetime as dt + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.core.credentials import AzureKeyCredential +from azure.eventgrid import EventGridPublisherClient, CustomEvent + +key = os.environ["CUSTOM_SCHEMA_ACCESS_KEY"] +topic_hostname = os.environ["CUSTOM_SCHEMA_TOPIC_HOSTNAME"] + +# authenticate client +credential = AzureKeyCredential(key) +client = EventGridPublisherClient(topic_hostname, credential) + +custom_schema_event = { + "customSubject": "sample", + "customEventType": "sample.event", + "customDataVersion": "2.0", + "customId": uuid.uuid4(), + "customEventTime": dt.datetime.now(UTC()).isoformat(), + "customData": "sample data" +} + +# publish events +while True: + + event_list = [] # list of events to publish + # create events and append to list + for j in range(randint(1, 3)): + event = CustomEvent(custom_schema_event) + event_list.append(event) + + # publish list of events + client.send(event_list) + print("Batch of size {} published".format(len(event_list))) + time.sleep(randint(1, 5)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_event_grid_events_to_custom_topic_sample.py b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_event_grid_events_to_custom_topic_sample.py new file mode 100644 index 000000000000..a8379f5cf84a --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_event_grid_events_to_custom_topic_sample.py @@ -0,0 +1,40 @@ +import sys +import os +from random import randint, sample +import time + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from azure.core.credentials import AzureKeyCredential +from azure.eventgrid import EventGridPublisherClient, EventGridEvent + +key = os.environ["EG_ACCESS_KEY"] +topic_hostname = os.environ["EG_TOPIC_HOSTNAME"] + +# authenticate client +credential = AzureKeyCredential(key) +client = EventGridPublisherClient(topic_hostname, credential) + +team_members = ["Josh", "Kerri", "Kieran", "Laurent", "Lily", "Matt", "Soren", "Srikanta", "Swathi"] # possible values for data field + +# publish events +while True: + + event_list = [] # list of events to publish + # create events and append to list + for j in range(randint(1, 3)): + sample_members = sample(team_members, k=randint(1, 9)) # select random subset of team members + event = EventGridEvent( + subject="Door1", + data={"team": sample_members}, + event_type="Azure.Sdk.Demo", + data_version="2.0" + ) + event_list.append(event) + + # publish list of events + client.send(event_list) + print("Batch of size {} published".format(len(event_list))) + time.sleep(randint(1, 5)) diff --git a/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_with_shared_access_signature_sample.py b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_with_shared_access_signature_sample.py new file mode 100644 index 000000000000..80ba720ccfd6 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/publish_samples/publish_with_shared_access_signature_sample.py @@ -0,0 +1,45 @@ +import sys +import os +from random import randint, sample +import time + +PACKAGE_PARENT = '..' +SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) +sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) + +from dateutil.tz import tzutc +from datetime import timedelta +import datetime as dt + +from azure.eventgrid import EventGridPublisherClient, CloudEvent, generate_shared_access_signature, EventGridSharedAccessSignatureCredential + +key = os.environ["CLOUD_ACCESS_KEY"] +topic_hostname = os.environ["CLOUD_TOPIC_HOSTNAME"] +expiration_date_utc = dt.datetime.now(tzutc()) + timedelta(hours=1) + +signature = generate_shared_access_signature(topic_hostname, key, expiration_date_utc) + +# authenticate client +credential = EventGridSharedAccessSignatureCredential(signature) +client = EventGridPublisherClient(topic_hostname, credential) + +team_members = ["Josh", "Kerri", "Kieran", "Laurent", "Lily", "Matt", "Soren", "Srikanta", "Swathi"] # possible values for data field + +# publish events +while True: + + event_list = [] # list of events to publish + # create events and append to list + for j in range(randint(1, 3)): + sample_members = sample(team_members, k=randint(1, 9)) # select random subset of team members + event = CloudEvent( + type="Azure.Sdk.Demo", + source="https://egdemo.dev/demowithsignature", + data={"team": sample_members} + ) + event_list.append(event) + + # publish list of events + client.send(event_list) + print("Batch of size {} published".format(len(event_list))) + time.sleep(randint(1, 5)) diff --git a/sdk/eventgrid/azure-eventgrid/sdk_packaging.toml b/sdk/eventgrid/azure-eventgrid/sdk_packaging.toml index 892600b2e61c..1e8195545639 100644 --- a/sdk/eventgrid/azure-eventgrid/sdk_packaging.toml +++ b/sdk/eventgrid/azure-eventgrid/sdk_packaging.toml @@ -1,6 +1,7 @@ [packaging] +auto_update = false package_name = "azure-eventgrid" package_pprint_name = "Event Grid" package_doc_id = "event-grid" -is_stable = true +is_stable = false is_arm = false diff --git a/sdk/eventgrid/azure-eventgrid/setup.py b/sdk/eventgrid/azure-eventgrid/setup.py index cf7a6fb13dad..9353b747230e 100644 --- a/sdk/eventgrid/azure-eventgrid/setup.py +++ b/sdk/eventgrid/azure-eventgrid/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -59,27 +61,27 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=find_packages(exclude=[ 'tests', + 'samples', # Exclude packages that will be covered by PEP420 or nspkg 'azure', ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', - 'azure-common~=1.1', + 'azure-core<2.0.0,>=1.7.0', ], extras_require={ ":python_version<'3.0'": ['azure-nspkg'], diff --git a/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md new file mode 100644 index 000000000000..ea630cab81fa --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md @@ -0,0 +1,21 @@ +# Azure EventGrid Client for Python + +> see https://aka.ms/autorest + +### Configuration + +```yaml +title: EventGridPublisherClient +description: EventGrid Python Publisher Client +generated-metadata: false +license-header: MICROSOFT_MIT_NO_VERSION +no-namespace-folders: true +output-folder: ../azure/eventgrid/_generated +source-code-folder-path: ./azure/eventgrid/_generated +input-file: + - https://raw.githubusercontent.com/t-swpill/azure-rest-api-specs/add-cloud-event-publish-to-event-grid/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json + - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json +python: true +v3: true +use: "@autorest/python@5.1.0-preview.1" +``` \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/tests/_mocks.py b/sdk/eventgrid/azure-eventgrid/tests/_mocks.py new file mode 100644 index 000000000000..107d6d6175ed --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/_mocks.py @@ -0,0 +1,77 @@ +import json + + +# storage cloud event +cloud_storage_dict = { + "id":"a0517898-9fa4-4e70-b4a3-afda1dd68672", + "source":"/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}", + "data":{ + "api":"PutBlockList", + "client_request_id":"6d79dbfb-0e37-4fc4-981f-442c9ca65760", + "request_id":"831e1650-001e-001b-66ab-eeb76e000000", + "e_tag":"0x8D4BCC2E4835CD0", + "content_type":"application/octet-stream", + "content_length":524288, + "blob_type":"BlockBlob", + "url":"https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob", + "sequencer":"00000000000004420000000000028963", + "storage_diagnostics":{"batchId":"b68529f3-68cd-4744-baa4-3c0498ec19f0"} + }, + "type":"Microsoft.Storage.BlobCreated", + "time":"2020-08-07T01:11:49.765846Z", + "specversion":"1.0" +} +cloud_storage_string = json.dumps(cloud_storage_dict) +cloud_storage_bytes = cloud_storage_string.encode("utf-8") + +# custom cloud event +cloud_custom_dict = { + "id":"de0fd76c-4ef4-4dfb-ab3a-8f24a307e033", + "source":"https://egtest.dev/cloudcustomevent", + "data":{"team": "event grid squad"}, + "type":"Azure.Sdk.Sample", + "time":"2020-08-07T02:06:08.11969Z", + "specversion":"1.0" +} +cloud_custom_string = json.dumps(cloud_custom_dict) +cloud_custom_bytes = cloud_custom_string.encode("utf-8") + +# storage eg event +eg_storage_dict = { + "id":"bbab6625-dc56-4b22-abeb-afcc72e5290c", + "subject":"/blobServices/default/containers/oc2d2817345i200097container/blobs/oc2d2817345i20002296blob", + "data":{ + "api":"PutBlockList", + "clientRequestId":"6d79dbfb-0e37-4fc4-981f-442c9ca65760", + "requestId":"831e1650-001e-001b-66ab-eeb76e000000", + "eTag":"0x8D4BCC2E4835CD0", + "contentType":"application/octet-stream", + "contentLength":524288, + "blobType":"BlockBlob", + "url":"https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob", + "sequencer":"00000000000004420000000000028963", + "storageDiagnostics":{"batchId":"b68529f3-68cd-4744-baa4-3c0498ec19f0"} + }, + "eventType":"Microsoft.Storage.BlobCreated", + "dataVersion":"2.0", + "metadataVersion":"1", + "eventTime":"2020-08-07T02:28:23.867525Z", + "topic":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/t-swpill-test/providers/Microsoft.EventGrid/topics/eventgridegsub" +} + +eg_storage_string = json.dumps(eg_storage_dict) +eg_storage_bytes = eg_storage_string.encode("utf-8") + +# custom eg event +eg_custom_dict = { + "id":"3a30afef-b604-4b67-973e-7dfff7e178a7", + "subject":"Test EG Custom Event", + "data":{"team":"event grid squad"}, + "eventType":"Azure.Sdk.Sample", + "dataVersion":"2.0", + "metadataVersion":"1", + "eventTime":"2020-08-07T02:19:05.16916Z", + "topic":"/subscriptions/f8aa80ae-d1c8-60ad-9bce-e1a850ba5b67/resourceGroups/sample-resource-group-test/providers/Microsoft.EventGrid/topics/egtopicsamplesub" +} +eg_custom_string = json.dumps(eg_custom_dict) +eg_custom_bytes = eg_custom_string.encode("utf-8") diff --git a/sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py b/sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py new file mode 100644 index 000000000000..d56af2bcebca --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/eventgrid_preparer.py @@ -0,0 +1,98 @@ +import functools +import hashlib +import os +from collections import namedtuple + +from azure.mgmt.eventgrid import EventGridManagementClient +from azure.mgmt.eventgrid.models import Topic, InputSchema, JsonInputSchemaMapping, JsonField, JsonFieldWithDefault +from azure_devtools.scenario_tests.exceptions import AzureTestError + +from devtools_testutils import ( + ResourceGroupPreparer, AzureMgmtPreparer, FakeResource +) + +from devtools_testutils.resource_testcase import RESOURCE_GROUP_PARAM + +EVENTGRID_TOPIC_PARAM = 'eventgrid_topic' +EVENTGRID_TOPIC_LOCATION = 'westus' +CLOUD_EVENT_SCHEMA = InputSchema.cloud_event_schema_v1_0 +CUSTOM_EVENT_SCHEMA = InputSchema.custom_event_schema +ID_JSON_FIELD = JsonField(source_field='customId') +TOPIC_JSON_FIELD = JsonField(source_field='customTopic') +EVENT_TIME_JSON_FIELD = JsonField(source_field='customEventTime') +EVENT_TYPE_JSON_FIELD_WITH_DEFAULT = JsonFieldWithDefault(source_field='customEventType', default_value='') +SUBJECT_JSON_FIELD_WITH_DEFAULT = JsonFieldWithDefault(source_field='customSubject', default_value='') +DATA_VERSION_JSON_FIELD_WITH_DEFAULT = JsonFieldWithDefault(source_field='customDataVersion', default_value='') +CUSTOM_JSON_INPUT_SCHEMA_MAPPING = JsonInputSchemaMapping(id=ID_JSON_FIELD, topic=TOPIC_JSON_FIELD, event_time=EVENT_TIME_JSON_FIELD, event_type=EVENT_TYPE_JSON_FIELD_WITH_DEFAULT, subject=SUBJECT_JSON_FIELD_WITH_DEFAULT, data_version=DATA_VERSION_JSON_FIELD_WITH_DEFAULT) + + +class EventGridTopicPreparer(AzureMgmtPreparer): + def __init__(self, + name_prefix='', + use_cache=False, + parameter_location=EVENTGRID_TOPIC_LOCATION, + parameter_name=EVENTGRID_TOPIC_PARAM, + resource_group_parameter_name=RESOURCE_GROUP_PARAM, + disable_recording=True, playback_fake_resource=None, + client_kwargs=None, random_name_enabled=True): + super(EventGridTopicPreparer, self).__init__(name_prefix, random_name_length=24, + random_name_enabled=random_name_enabled, + disable_recording=disable_recording, + playback_fake_resource=playback_fake_resource, + client_kwargs=client_kwargs) + self.resource_group_parameter_name = resource_group_parameter_name + self.parameter_name = parameter_name + self.parameter_location = parameter_location + self.name_prefix = name_prefix + if random_name_enabled: + self.resource_moniker = self.name_prefix + "egtopic" + + self.set_cache(use_cache, name_prefix) + + def create_resource(self, name, **kwargs): + if self.is_live: + self.client = self.create_mgmt_client(EventGridManagementClient) + group = self._get_resource_group(**kwargs) + + if self.name_prefix.startswith("cloud"): + # Create a new topic and verify that it is created successfully + topic = Topic(location=self.parameter_location, tags=None, input_schema=CLOUD_EVENT_SCHEMA, input_schema_mapping=None) + elif self.name_prefix.startswith("custom"): + # Create a new topic and verify that it is created successfully + topic = Topic(location=self.parameter_location, tags=None, input_schema=CUSTOM_EVENT_SCHEMA, input_schema_mapping=CUSTOM_JSON_INPUT_SCHEMA_MAPPING) + else: + topic = Topic(location=self.parameter_location) + topic_operation = self.client.topics.create_or_update( + group.name, + name, + topic, + {} + ) + self.resource = topic_operation.result() + key = self.client.topics.list_shared_access_keys(group.name, name) + self.primary_key = key.key1 + self.endpoint = self.resource.endpoint + else: + self.resource = FakeResource(name=name, id=name) + self.primary_key = "ZmFrZV9hY29jdW50X2tleQ==" # test key copied from sb_preparer + self.endpoint = "https://{}.westus-1.eventgrid.azure.net/api/events".format(name) + return { + self.parameter_name: self.resource, + '{}_primary_key'.format(self.parameter_name): self.primary_key, + '{}_endpoint'.format(self.parameter_name): self.endpoint, + } + + def remove_resource(self, name, **kwargs): + if self.is_live: + group = self._get_resource_group(**kwargs) + self.client.topics.delete(group.name, name, polling=False) + + def _get_resource_group(self, **kwargs): + try: + return kwargs.get(self.resource_group_parameter_name) + except KeyError: + template = 'To create this event grid topic resource, a resource group is required. Please add ' \ + 'decorator @{} in front of this event grid topic preparer.' + raise AzureTestError(template.format(ResourceGroupPreparer.__name__)) + +CachedEventGridTopicPreparer = functools.partial(EventGridTopicPreparer, use_cache=True) diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_good_credentials.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_good_credentials.yaml new file mode 100644 index 000000000000..089b5bc10bf1 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_good_credentials.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "06d9e910-81c1-4af0-9083-f4cc918301ea", "subject": "sample", "data": + {"sample": "0"}, "eventType": "Sample.Event", "eventTime": "2020-08-05T16:24:03.70737Z", + "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '188' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - xQuFC1jawpZYmAOZrsTGkiUPcXSvDISI66PrlrQcM6Y= + method: POST + uri: https://eventgridtest52vpkcnitf5.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, 05 Aug 2020 16:24:02 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_.yaml new file mode 100644 index 000000000000..e0e1add967bc --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "2b863329-4869-4f0e-b64a-b7ca52bfb872", "subject": "sample", "data": + {"sample": "0"}, "eventType": "Sample.Event", "eventTime": "2020-08-05T16:24:24.902399Z", + "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - 8fgxUonulneikv0EvLHfgMGhw1K5MMsXWe16KNNdWg0= + method: POST + uri: https://eventgridtestwsljzbswegg.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, 05 Aug 2020 16:24:24 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event.yaml new file mode 100644 index 000000000000..a6cd0057d4f4 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "4fd97389-b193-44ca-bcc9-ed52d5195101", "source": "http://samplesource.dev", + "data": {"sample": "cloud"}, "type": "Sample.Cloud.Event", "time": "2020-08-05T21:07:00.18891Z", + "specversion": "1.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '204' + Content-Type: + - application/cloudevents-batch+json; charset=utf-8 + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - cQXFSFmXpb3atzg/cNltZL9GqrNQSeBax/Uw+Y2HKHw= + method: POST + uri: https://cloudeventgridtestztxiam.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, 05 Aug 2020 21:07:00 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_dict.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_dict.yaml new file mode 100644 index 000000000000..cdc77fdc6fdb --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_dict.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "09ba13db-87a6-46e2-a751-788612217a2b", "source": "http://samplesource.dev", + "data": {"sample": "cloudevent"}, "type": "Sample.Cloud.Event", "time": "2020-08-05T21:23:31.005557Z", + "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.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - TBW8YxO+xO4DAfWTwBz+SkOvRRCRe8u6jvfvWkVKvds= + method: POST + uri: https://cloudeventgridtestpgb34o.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, 05 Aug 2020 21:23:31 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_str.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_str.yaml new file mode 100644 index 000000000000..36f0bbf08d9a --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_cloud_event_data_str.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "51053de8-ebfe-47db-95fe-67882c8de067", "source": "http://samplesource.dev", + "data": "cloudevent", "type": "Sample.Cloud.Event", "time": "2020-08-05T21:23:50.780278Z", + "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.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - eUWCGTSgST9ZprGj10Df1Q1cBY6gtu95nDvWfupM7S4= + method: POST + uri: https://cloudeventgridtestbxd5ay.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, 05 Aug 2020 21:23:50 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event.yaml new file mode 100644 index 000000000000..c3a6d273eb80 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "8cf3b6a9-ae8c-41aa-be33-15dd34774b92", "subject": "sample", "data": + {"sample": "0"}, "eventType": "Sample.Event", "eventTime": "2020-08-05T21:07:20.073184Z", + "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '189' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - f68bBwrYetWs4a0MIm4KRj2vZQtFLnBfI2dlStDpn/4= + method: POST + uri: https://eventgridtestat3wftu6mau.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, 05 Aug 2020 21:07:20 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event_data_dict.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event_data_dict.yaml new file mode 100644 index 000000000000..1cc882b0bff9 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_client.test_eg_client_publish_event_grid_event_data_dict.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "98900358-4381-48c5-8205-4b6284397097", "subject": "sample", "data": + {"sample": "eventgridevent"}, "eventType": "Sample.EventGrid.Event", "eventTime": + "2020-08-05T21:24:09.350896Z", "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '212' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.8.3 (Windows-10-10.0.19041-SP0) + aeg-sas-key: + - WyF/d4cVbqGKKFMu9P1zM4RGH8lbIvCSNS9B/7mFxWc= + method: POST + uri: https://eventgridtesthjrorjbmg2q.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, 05 Aug 2020 21:24:08 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_dict.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_dict.yaml new file mode 100644 index 000000000000..bb9ded430109 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_dict.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "45361ea3-f937-47fe-85fc-182c24b14fc5", "source": "http://samplesource.dev", + "data": {"sample": "cloudevent"}, "type": "Sample.Cloud.Event", "time": "2020-08-11T06:39:22.600597Z", + "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: + - flIbhDLap/Ioym6KTtqsPbYUGYpL+AKCiVG/InyRHj4= + 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: + - Tue, 11 Aug 2020 06:39:21 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_str.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_str.yaml new file mode 100644 index 000000000000..8e8eb4bdc441 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_cloud_event_data_str.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "47f96517-0a4b-4c99-bad4-c3314818ed30", "source": "http://samplesource.dev", + "data": "cloudevent", "type": "Sample.Cloud.Event", "time": "2020-08-11T06:39:23.189542Z", + "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: + - flIbhDLap/Ioym6KTtqsPbYUGYpL+AKCiVG/InyRHj4= + 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: + - Tue, 11 Aug 2020 06:39:22 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_custom_schema_event.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_custom_schema_event.yaml new file mode 100644 index 000000000000..df085a6d1652 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_custom_schema_event.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"customSubject": "sample", "customEventType": "sample.event", "customDataVersion": + "2.0", "customId": "1234", "customEventTime": "2020-08-11T06:39:36.974650+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: + - fxkmsikqjbH4ihoDP0Jqebsu6tQAS5+LcZEDKHN40Tc= + 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: + - Tue, 11 Aug 2020 06:39:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml new file mode 100644 index 000000000000..80389ad9f7e5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_dict.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "38eab883-eb07-4ae1-9ff4-12ebaf022113", "subject": "sample", "data": + {"sample": "eventgridevent"}, "eventType": "Sample.EventGrid.Event", "eventTime": + "2020-08-11T06:39:51.000672Z", "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '212' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) + aeg-sas-key: + - mu+h0B1P+GXAS5TCSIJVZ/oZUf+Pur3p90WxHabL2MM= + method: POST + uri: https://eventgridtestegtopic.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: + - Tue, 11 Aug 2020 06:39:50 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_str.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_str.yaml new file mode 100644 index 000000000000..282bd88f7280 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_event_grid_event_data_str.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "56a121b0-92b9-4921-b11b-2a99b0b4c5be", "subject": "sample", "data": + "eventgridevent", "eventType": "Sample.EventGrid.Event", "eventTime": "2020-08-11T06:39:51.543811Z", + "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '200' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) + aeg-sas-key: + - mu+h0B1P+GXAS5TCSIJVZ/oZUf+Pur3p90WxHabL2MM= + method: POST + uri: https://eventgridtestegtopic.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: + - Tue, 11 Aug 2020 06:39:51 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_signature_credential.yaml b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_signature_credential.yaml new file mode 100644 index 000000000000..4948c3eaecbe --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/recordings/test_eg_publisher_client.test_eg_publisher_client_publish_signature_credential.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '[{"id": "849de85a-06ec-4d66-a41c-638ceb4ab7cb", "subject": "sample", "data": + {"sample": "eventgridevent"}, "eventType": "Sample.EventGrid.Event", "eventTime": + "2020-08-11T06:39:51.999494Z", "dataVersion": "2.0"}]' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '212' + Content-Type: + - application/json + User-Agent: + - azsdk-python-eventgridpublisherclient/unknown Python/3.7.3 (Windows-10-10.0.18362-SP0) + aeg-sas-token: + - r=https%3A%2F%2Feventgridtestmsevpyxtqca.westus-1.eventgrid.azure.net%2Fapi%2Fevents%3FapiVersion%3D2018-01-01&e=2020-08-11%2007%3A39%3A51.997500%2B00%3A00&s=uPP02vkTyXgAw66IZMR%2B8xG92iHk1Imn4nnIN8ruM%2Bw%3D + method: POST + uri: https://eventgridtestegtopic.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: + - Tue, 11 Aug 2020 06:39:51 GMT + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/eventgrid/azure-eventgrid/tests/test_azure_eventgrid.py b/sdk/eventgrid/azure-eventgrid/tests/test_azure_eventgrid.py deleted file mode 100644 index 01b3ce458351..000000000000 --- a/sdk/eventgrid/azure-eventgrid/tests/test_azure_eventgrid.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from datetime import datetime - -from azure.eventgrid import EventGridClient -from msrest.authentication import TopicCredentials - -from azure_devtools.scenario_tests import ReplayableTest, AzureTestError - -from devtools_testutils import mgmt_settings_fake as fake_settings - - -class EventGridTest(ReplayableTest): - FILTER_HEADERS = ReplayableTest.FILTER_HEADERS + ['aeg-sas-key'] - - def __init__(self, method_name): - self._fake_settings, self._real_settings = self._load_settings() - super(EventGridTest, self).__init__(method_name) - - @property - def settings(self): - if self.is_live: - if self._real_settings: - return self._real_settings - else: - raise AzureTestError('Need a mgmt_settings_real.py file to run tests live.') - else: - return self._fake_settings - - def _load_settings(self): - try: - from devtools_testutils import mgmt_settings_real as real_settings - return fake_settings, real_settings - except ImportError: - return fake_settings, None - - def test_event_grid_basic(self): - - credentials = TopicCredentials( - self.settings.EVENT_GRID_KEY - ) - event_grid_client = EventGridClient(credentials) - event_grid_client.publish_events( - "lmazuel-eventgrid-test.westus2-1.eventgrid.azure.net", - events=[{ - 'id' : "dbf93d79-3859-4cac-8055-51e3b6b54bea", - 'subject' : "My subject", - 'data': { - 'key': 'I accept any kind of data here' - }, - 'event_type': 'PersonalEventType', - 'event_time': datetime(2018, 1, 30), - 'data_version': 1 - }] - ) - diff --git a/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py b/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py new file mode 100644 index 000000000000..755a7e15df4b --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import logging +import sys +import os +import pytest +import json +import datetime as dt + +from devtools_testutils import AzureMgmtTestCase +from msrest.serialization import UTC +from azure.eventgrid import EventGridConsumer, CloudEvent, EventGridEvent, StorageBlobCreatedEventData +from _mocks import ( + cloud_storage_dict, + cloud_storage_string, + cloud_storage_bytes, + cloud_custom_dict, + cloud_custom_string, + cloud_custom_bytes, + eg_custom_dict, + eg_custom_string, + eg_custom_bytes, + eg_storage_dict, + eg_storage_string, + eg_storage_bytes + ) + +class EventGridConsumerTests(AzureMgmtTestCase): + + # Cloud Event tests + @pytest.mark.liveTest + def test_eg_consumer_cloud_storage_dict(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_storage_dict) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_cloud_storage_string(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_storage_string) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_cloud_storage_bytes(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_storage_bytes) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_cloud_custom_dict(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_custom_dict) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_cloud_custom_string(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_custom_string) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_cloud_custom_bytes(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(cloud_custom_bytes) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == CloudEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict + + # EG Event tests + @pytest.mark.liveTest + def test_eg_consumer_eg_storage_dict(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_storage_dict) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_eg_storage_string(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_storage_string) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_eg_storage_bytes(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_storage_bytes) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data.__class__ == StorageBlobCreatedEventData + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_eg_custom_dict(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_custom_dict) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_eg_custom_string(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_custom_string) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict + + @pytest.mark.liveTest + def test_eg_consumer_eg_custom_bytes(self, **kwargs): + client = EventGridConsumer() + deserialized_event = client.deserialize_event(eg_custom_bytes) + event_json = deserialized_event.to_json() + assert deserialized_event.model.__class__ == EventGridEvent + assert deserialized_event.model.data is None + assert event_json.__class__ == dict diff --git a/sdk/eventgrid/azure-eventgrid/tests/test_eg_publisher_client.py b/sdk/eventgrid/azure-eventgrid/tests/test_eg_publisher_client.py new file mode 100644 index 000000000000..17924d3b06f5 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/tests/test_eg_publisher_client.py @@ -0,0 +1,111 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import logging +import sys +import os +import pytest +from datetime import timedelta +from msrest.serialization import UTC +import datetime as dt + +from devtools_testutils import AzureMgmtTestCase, CachedResourceGroupPreparer + +from azure.core.credentials import AzureKeyCredential +from azure.eventgrid import EventGridPublisherClient, CloudEvent, EventGridEvent, CustomEvent ,EventGridSharedAccessSignatureCredential, generate_shared_access_signature + +from eventgrid_preparer import ( + CachedEventGridTopicPreparer +) + +class EventGridPublisherClientTests(AzureMgmtTestCase): + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='eventgridtest') + def test_eg_publisher_client_publish_event_grid_event_data_dict(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + akc_credential = AzureKeyCredential(eventgrid_topic_primary_key) + client = EventGridPublisherClient(eventgrid_topic_endpoint, akc_credential) + eg_event = EventGridEvent( + subject="sample", + data={"sample": "eventgridevent"}, + event_type="Sample.EventGrid.Event", + data_version="2.0" + ) + client.send([eg_event]) + + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='eventgridtest') + def test_eg_publisher_client_publish_event_grid_event_data_str(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + akc_credential = AzureKeyCredential(eventgrid_topic_primary_key) + client = EventGridPublisherClient(eventgrid_topic_endpoint, akc_credential) + eg_event = EventGridEvent( + subject="sample", + data="eventgridevent", + event_type="Sample.EventGrid.Event", + data_version="2.0" + ) + client.send([eg_event]) + + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='cloudeventgridtest') + def test_eg_publisher_client_publish_cloud_event_data_dict(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + akc_credential = AzureKeyCredential(eventgrid_topic_primary_key) + client = EventGridPublisherClient(eventgrid_topic_endpoint, akc_credential) + cloud_event = CloudEvent( + source = "http://samplesource.dev", + data = {"sample": "cloudevent"}, + type="Sample.Cloud.Event" + ) + client.send([cloud_event]) + + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='cloudeventgridtest') + def test_eg_publisher_client_publish_cloud_event_data_str(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + akc_credential = AzureKeyCredential(eventgrid_topic_primary_key) + client = EventGridPublisherClient(eventgrid_topic_endpoint, akc_credential) + cloud_event = CloudEvent( + source = "http://samplesource.dev", + data = "cloudevent", + type="Sample.Cloud.Event" + ) + client.send([cloud_event]) + + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='eventgridtest') + def test_eg_publisher_client_publish_signature_credential(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + expiration_date_utc = dt.datetime.now(UTC()) + timedelta(hours=1) + signature = generate_shared_access_signature(eventgrid_topic_endpoint, eventgrid_topic_primary_key, expiration_date_utc) + credential = EventGridSharedAccessSignatureCredential(signature) + client = EventGridPublisherClient(eventgrid_topic_endpoint, credential) + eg_event = EventGridEvent( + subject="sample", + data={"sample": "eventgridevent"}, + event_type="Sample.EventGrid.Event", + data_version="2.0" + ) + client.send([eg_event]) + + @pytest.mark.liveTest + @CachedResourceGroupPreparer(name_prefix='eventgridtest') + @CachedEventGridTopicPreparer(name_prefix='customeventgridtest') + def test_eg_publisher_client_publish_custom_schema_event(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): + akc_credential = AzureKeyCredential(eventgrid_topic_primary_key) + client = EventGridPublisherClient(eventgrid_topic_endpoint, akc_credential) + custom_event = CustomEvent( + { + "customSubject": "sample", + "customEventType": "sample.event", + "customDataVersion": "2.0", + "customId": "1234", + "customEventTime": dt.datetime.now(UTC()).isoformat(), + "customData": "sample data" + } + ) + client.send([custom_event]) \ No newline at end of file diff --git a/shared_requirements.txt b/shared_requirements.txt index a8f93695e121..aa2406e0ee72 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -152,8 +152,9 @@ opentelemetry-api==0.10b0 #override azure-servicebus msrest>=0.6.17,<2.0.0 #override azure-servicebus azure-core<2.0.0,>=1.6.0 #override azure-search-documents msrest>=0.6.10 +#override azure-eventgrid azure-core<2.0.0,>=1.7.0 #override azure-synapse-accesscontrol azure-core>=1.6.0,<2.0.0 #override azure-synapse-spark azure-core>=1.6.0,<2.0.0 #override azure-synapse-artifacts azure-core>=1.6.0,<2.0.0 #override azure-data-tables msrest>=0.6.10 -#override azure-ai-anomalydetector azure-core>=1.6.0,<2.0.0 \ No newline at end of file +#override azure-ai-anomalydetector azure-core>=1.6.0,<2.0.0