diff --git a/src/eventgrid/HISTORY.rst b/src/eventgrid/HISTORY.rst index f467f4f5c92..9d02a9b2fab 100644 --- a/src/eventgrid/HISTORY.rst +++ b/src/eventgrid/HISTORY.rst @@ -2,7 +2,10 @@ Release History =============== +1.0.0b2 ++++++++ +* Remove old commands which have been covered in main CLI 1.0.0b1 -++++++ ++++++++ * Add new command group `az eventgrid namespace` \ No newline at end of file diff --git a/src/eventgrid/azext_eventgrid/_client_factory.py b/src/eventgrid/azext_eventgrid/_client_factory.py deleted file mode 100644 index 5125768be55..00000000000 --- a/src/eventgrid/azext_eventgrid/_client_factory.py +++ /dev/null @@ -1,70 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def cf_eventgrid(cli_ctx, **_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_eventgrid.vendored_sdks.eventgrid import EventGridManagementClient - return get_mgmt_service_client(cli_ctx, EventGridManagementClient) - - -def topics_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).topics - - -def domains_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).domains - - -def domain_topics_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).domain_topics - - -def system_topics_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).system_topics - - -def system_topic_event_subscriptions_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).system_topic_event_subscriptions - - -def extension_topics_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).extension_topics - - -def partner_registrations_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).partner_registrations - - -def partner_namespaces_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).partner_namespaces - - -def event_channels_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).event_channels - - -def partner_topics_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).partner_topics - - -def partner_topic_event_subscriptions_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).partner_topic_event_subscriptions - - -def event_subscriptions_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).event_subscriptions - - -def topic_types_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).topic_types - - -def private_endpoint_connections_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).private_endpoint_connections - - -def private_link_resources_factory(cli_ctx, _): - return cf_eventgrid(cli_ctx).private_link_resources diff --git a/src/eventgrid/azext_eventgrid/_help.py b/src/eventgrid/azext_eventgrid/_help.py index 850e4a521b6..bde418204e8 100644 --- a/src/eventgrid/azext_eventgrid/_help.py +++ b/src/eventgrid/azext_eventgrid/_help.py @@ -11,1335 +11,3 @@ type: group short-summary: Manage Azure Event Grid topics, domains, domain topics, system topics partner topics, event subscriptions, system topic event subscriptions and partner topic event subscriptions. """ - -helps['eventgrid domain'] = """ -type: group -short-summary: Manage event domains. -""" - -helps['eventgrid domain create'] = """ -type: command -short-summary: Create a domain. -parameters: - - name: --inbound-ip-rules - short-summary: List of inbound IP rules. - long-summary: | - List of inbound IP rules specifying IP Address in CIDR notation e.g., 10.0.0.0/8 along with corresponding Action to perform based on the match or no match of the IpMask. Possible values include - Allow. -examples: - - name: Create a new domain. - text: az eventgrid domain create -g rg1 --name domain1 -l westus2 - - name: Create a new domain with custom input mappings. - text: az eventgrid domain create -g rg1 --name domain1 -l westus2 --input-schema customeventschema --input-mapping-fields topic=mytopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 - - name: Create a new domain that accepts events published in CloudEvents V1.0 schema and maps a property mytopicfield to the topic name. - text: az eventgrid domain create -g rg1 --name domain1 -l westus2 --input-schema cloudeventschemav1_0 --input-mapping-fields topic=mytopicfield - - name: Create a new domain which allows specific inbound ip rules. - text: az eventgrid domain create -g rg1 --name domain1 -l westus2 --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --sku basic - -""" - -helps['eventgrid domain delete'] = """ -type: command -short-summary: Delete a domain. -examples: - - name: Delete a domain. - text: az eventgrid domain delete -g rg1 --name domain1 -""" - -helps['eventgrid domain private-endpoint-connection'] = """ -type: group -short-summary: Manage private endpoint connection resources of a domain. -""" - -helps['eventgrid domain private-endpoint-connection delete'] = """ -type: command -short-summary: Delete a private endpoint connection for a domain. -examples: - - name: Delete private endpoint connection for a specific domain. - text: az eventgrid domain private-endpoint-connection delete -g rg1 --domain-name domain1 -n connectionName1 -""" - -helps['eventgrid domain private-endpoint-connection show'] = """ -type: command -short-summary: Display the properties of a private endpoint connection for a domain. -examples: - - name: Show a private endpoint connection for a domain. - text: az eventgrid domain private-endpoint-connection show -g rg1 --domain-name domain1 -n connectionName1 -""" - -helps['eventgrid domain private-endpoint-connection list'] = """ -type: command -short-summary: List the properties of all the private endpoint connections for a domain. -examples: - - name: List a private endpoint connection for a domain. - text: az eventgrid domain private-endpoint-connection list -g rg1 -n domain1 -""" - -helps['eventgrid domain private-endpoint-connection approve'] = """ -type: command -short-summary: Approve a private endpoint connection request for a domain. -examples: - - name: Approve a private endpoint connection for a domain. - text: az eventgrid domain private-endpoint-connection approve -g rg1 --domain-name domain1 -n domain1-PrivateEndpoint.6d90cf76-a022-452c-9994-6dac62a50c99 --description "Sample approval description" -""" - -helps['eventgrid domain private-endpoint-connection reject'] = """ -type: command -short-summary: Reject a private endpoint connection request for a domain. -examples: - - name: Reject a private endpoint connection for a domain. - text: az eventgrid domain private-endpoint-connection reject -g rg1 --domain-name domain1 -n domain1-PrivateEndpoint.6d90cf76-a022-452c-9994-6dac62a50c99 --description "Sample rejection description" -""" - -helps['eventgrid domain private-link-resource'] = """ -type: group -short-summary: Manage private link resource of a domain. -""" - -helps['eventgrid domain private-link-resource show'] = """ -type: command -short-summary: Display the properties of a private link resource for a domain. -examples: - - name: Show a private endpoint connection for a domain. - text: az eventgrid domain private-link-resource show -g rg1 --domain-name domain1 -n domain -""" - -helps['eventgrid domain private-link-resource list'] = """ -type: command -short-summary: List the properties of all the private link resources for a domain. -examples: - - name: Show a private endpoint connection for a domain. - text: az eventgrid domain private-link-resource list -g rg1 --domain-name domain1 -""" - - -helps['eventgrid domain key'] = """ -type: group -short-summary: Manage shared access keys of a domain. -""" - -helps['eventgrid domain key list'] = """ -type: command -short-summary: List shared access keys of a domain. -examples: - - name: List shared access keys of a domain. (autogenerated) - text: az eventgrid domain key list --name MyDomain --resource-group MyResourceGroup - crafted: true -""" - -helps['eventgrid domain key regenerate'] = """ -type: command -short-summary: Regenerate a shared access key of a domain. -""" - -helps['eventgrid domain list'] = """ -type: command -short-summary: List available domains. -examples: - - name: List all domains in the current Azure subscription. - text: az eventgrid domain list - - name: List all domains in a resource group. - text: az eventgrid domain list -g rg1 - - name: List all domains in a resource group whose name contains the pattern "XYZ" - text: az eventgrid domain list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all domains in a resource group except the domain with name "name1" - text: az eventgrid domain list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid domain show'] = """ -type: command -short-summary: Get the details of a domain. -examples: - - name: Show the details of a domain. - text: az eventgrid domain show -g rg1 -n domain1 - - name: Show the details of a domain based on resource ID. - text: az eventgrid domain show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1 -""" - -helps['eventgrid domain topic'] = """ -type: group -short-summary: Manage event domain topics. -""" - -helps['eventgrid domain topic create'] = """ -type: command -short-summary: Create a domain topic under a domain. -examples: - - name: Create a new domain topic under domain. - text: az eventgrid domain topic create -g rg1 --domain-name domain1 --name domaintopic1 -""" - -helps['eventgrid domain topic delete'] = """ -type: command -short-summary: Delete a domain topic under a domain. -examples: - - name: Delete a domain topic. - text: az eventgrid domain topic delete -g rg1 --domain-name domain1 --name domaintopic1 -""" - -helps['eventgrid domain topic list'] = """ -type: command -short-summary: List available topics in a domain. -examples: - - name: List all topics in a domain. - text: az eventgrid domain topic list -g rg1 --domain-name domain1 - - name: List all domain topics in a domain whose name contains the pattern "XYZ" - text: az eventgrid domain topic list -g rg1 --domain-name domain1 --odata-query "Contains(name, 'XYZ')" - - name: List all domain topics in a domain except the domain topic with name "name1" - text: az eventgrid domain topic list -g rg1 --domain-name domain1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid domain topic show'] = """ -type: command -short-summary: Get the details of a domain topic. -examples: - - name: Show the details of a domain topic. - text: az eventgrid domain topic show -g rg1 --domain-name domain1 --name topic1 -""" - -helps['eventgrid domain update'] = """ -type: command -short-summary: Update a domain. -parameters: - - name: --inbound-ip-rules - short-summary: List of inbound IP rules. - long-summary: | - List of inbound IP rules specifying IP Address in CIDR notation e.g., 10.0.0.0/8 along with corresponding Action to perform based on the match or no match of the IpMask. Possible values include - Allow. -examples: - - name: Update the properties of an existing domain. - text: az eventgrid domain update -g rg1 --name domain1 --sku Basic --identity noidentity --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --tags Dept=IT --sku basic -""" - -helps['eventgrid partner'] = """ -type: group -short-summary: Manage partner resources. -""" - -helps['eventgrid partner registration'] = """ -type: group -short-summary: Manage partner registrations. -""" - -helps['eventgrid partner registration create'] = """ -type: command -short-summary: Create a new partner registration. -examples: - - name: Create a new partner registration with basic information. - text: az eventgrid partner registration create -g rg1 --name partnerRegistrationName1 --partner-name Contoso --resource-type-name Accounts --authorized-subscription-ids 533ad9de-25db-46e2-b94a-d00c37cf022b 05aa2228-7d34-4635-922d-2b582c422445 - - name: Create a new partner registration with partner information. - text: az eventgrid partner registration create -g rg1 --name partnerRegistrationName1 --partner-name Contoso --resource-type-name Accounts --authorized-subscription-ids 533ad9de-25db-46e2-b94a-d00c37cf022b 05aa2228-7d34-4635-922d-2b582c422445 --description ExampleDescription --display-name ExampleDisplayName1 --logo-uri \'https://www.example.com/logo.png\' --setup-uri \'https://www.example.com\' --long-description \'This is sample description}\' --customer-service-number \'+1 800 123 4567' --customer-service-extension \'125\' --customer-service-uri \'https://www.example.com/customerservice\' -""" - -helps['eventgrid partner registration list'] = """ -type: command -short-summary: List all partner registrations in specific resource group or all under the specified azure subscription. -examples: - - name: List all partner registrations in the current Azure subscription. - text: az eventgrid partner registration list - - name: List all partner registrations in a resource group. - text: az eventgrid partner registration list -g rg1 - - name: List all partner registrations in a resource group whose name contains the pattern "XYZ" - text: az eventgrid partner registration list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all partner registrations in a resource group except the partner registration with name "name1" - text: az eventgrid partner registration list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid partner namespace'] = """ -type: group -short-summary: Manage partner namespaces. -""" - -helps['eventgrid partner namespace create'] = """ -type: command -short-summary: Create a partner namespace. -examples: - - name: Create a new partner namespace. - text: az eventgrid partner namespace create -g rg1 --name namespaceName1 -l westus2 --partner-registration-id 795c9f2f-6d2d-42ff-a570-42fd3043192c -""" - -helps['eventgrid partner namespace list'] = """ -type: command -short-summary: List available partner namespaces. -examples: - - name: List all partner namespaces in the current Azure subscription. - text: az eventgrid partner namespace list - - name: List all partner namespaces in a resource group. - text: az eventgrid partner namespace list -g rg1 - - name: List all partner namespaces in a resource group whose name contains the pattern "XYZ" - text: az eventgrid partner namespace list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all partner namespaces in a resource group except the partner namespace with name "name1" - text: az eventgrid partner namespace list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid partner namespace delete'] = """ -type: command -short-summary: Delete a partner namespace. -examples: - - name: Delete a specific partner namespace. - text: az eventgrid partner namespace delete -g rg1 --name partnernamespace1 -""" - -helps['eventgrid partner namespace show'] = """ -type: command -short-summary: Get the details of a partner namespace. -examples: - - name: Show the details of a partner namespace. - text: az eventgrid partner namespace show -g rg1 -n partnernamespace1 - - name: Show the details of a partner namespace based on resource ID. - text: az eventgrid partner namespace show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/partnenamespaces/partnernamespace1 -""" - -helps['eventgrid partner namespace key'] = """ -type: group -short-summary: Manage shared access keys of a partner namespace. -""" - -helps['eventgrid partner namespace key list'] = """ -type: command -short-summary: List shared access keys of a partner namespace. -examples: - - name: List shared access keys of a partner namespace (autogenerated) - text: az eventgrid partner namespace key list --partner-namespace-name MyNamespace --resource-group MyResourceGroup - crafted: true -""" - -helps['eventgrid partner namespace key regenerate'] = """ -type: command -short-summary: Regenerate a shared access key of a partner namespace. -""" - -helps['eventgrid partner namespace event-channel'] = """ -type: group -short-summary: Manage partner event channels. -""" - -helps['eventgrid partner namespace event-channel create'] = """ -type: command -short-summary: Create an event channel under a partner namespace. -parameters: - - name: --publisher-filter - short-summary: A publisher filter that is used to enable filtering of events based on a specific event property. This set of filters that are specified by the publisher in order to determine which events to be received by the subscriber. - long-summary: | - Usage: --publisher-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --publisher-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --publisher-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --publisher-filter subject StringContains Blue Red - StringBeginsWith: --publisher-filter subject StringBeginsWith Blue Red - StringEndsWith: --publisher-filter subject StringEndsWith img png jpg - NumberIn: --publisher-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --publisher-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --publisher-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --publisher-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --publisher-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --publisher-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --publisher-filter data.property3 BoolEquals true - Multiple publisher filters can be specified by using more than one `--publisher-filter` argument. -examples: - - name: Create a specific event channel. - text: az eventgrid partner namespace event-channel create -g rg1 --partner-namespace-name partnernamespace1 -n eventChannelName1 --source SourceExample1 --destination-subscription-id 61f7c265-374d-499e-866d-5f4cc302b888 --destination-resource-group rg2 --desination-topic-name topicName1 - - name: Create a specific event channel with an activation expiration time and partner topic friendly description. - text: az eventgrid partner namespace event-channel create -g rg1 --partner-namespace-name partnernamespace1 -n eventChannelName1 --source SourceExample1 --destination-subscription-id 61f7c265-374d-499e-866d-5f4cc302b888 --destination-resource-group rg2 --desination-topic-name topicName1 --activation-expiration-date \'2020-05-20T10:00\' --partner-topic-description \'This topic is created by Costoco corp on user behavior.\' - - name: Create a specific event channel with publisher filters. - text: az eventgrid partner namespace event-channel create -g rg1 --partner-namespace-name partnernamespace1 -n eventChannelName1 --source SourceExample1 --destination-subscription-id 61f7c265-374d-499e-866d-5f4cc302b888 --destination-resource-group rg2 --desination-topic-name topicName1 --publisher-filter data.key1 NumberIn 2 3 4 100 200 --publisher-filter data.key2 StringIn 2 3 4 100 200 -""" - -helps['eventgrid partner namespace event-channel list'] = """ -type: command -short-summary: List available partner event-channels. -examples: - - name: List all event-channels in a specific partner namespace. - text: az eventgrid partner namespace event-channel list -g rg1 --partner-namespace-name partnernamespace1 - - name: List all event channel under a partner namespace whose name contains the pattern "XYZ" - text: az eventgrid partner namespace event-channel list -g rg1 --partner-namespace-name partnernamespace1 --odata-query "Contains(name, 'XYZ')" -""" - -helps['eventgrid partner namespace event-channel delete'] = """ -type: command -short-summary: Delete a partner namespace. -examples: - - name: Delete a specific partner namespace. - text: az eventgrid partner namespace event-channel delete -g rg1 --partner-namespace-name partnernamespace1 -n eventChannelName1 -""" - -helps['eventgrid partner namespace event-channel show'] = """ -type: command -short-summary: Get the details of an event channel under a partner namespace. -examples: - - name: Show the details of an event channel. - text: az eventgrid partner namespace event-channel show -g rg1 --partner-namespace-name partnernamespace1 -n eventChannelName1 - - name: Show the details of an event-channel based on resource ID. - text: az eventgrid partner namespace event-channel show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/partnenamespaces/partnernamespace1/eventChannels/eventChannelName1 -""" - - -helps['eventgrid partner topic'] = """ -type: group -short-summary: Manage partner topics. -""" - -helps['eventgrid system-topic'] = """ -type: group -short-summary: Manage system topics. -""" - -helps['eventgrid system-topic create'] = """ -type: command -short-summary: Create a system topic. -examples: - - name: Create a new system topic for storage account source. - text: az eventgrid system-topic create -g rg1 --name systemtopic1 --location westus2 --topic-type microsoft.storage.storageaccounts --source /subscriptions/1b3b4501-23b9-4790-c31b-ddbd88d72123/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/stgaccountname - -""" - -helps['eventgrid system-topic delete'] = """ -type: command -short-summary: Delete a system topic. -examples: - - name: Delete a specific system topic. - text: az eventgrid system-topic delete -g rg1 --name systemtopic1 -""" - -helps['eventgrid system-topic list'] = """ -type: command -short-summary: List available system topics. -examples: - - name: List all system topics in the current Azure subscription. - text: az eventgrid system-topic list - - name: List all system topics in a resource group. - text: az eventgrid system-topic list -g rg1 - - name: List all system topics in a resource group whose name contains the pattern "XYZ" - text: az eventgrid system-topic list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all system topics in a resource group except the system topic with name "name1" - text: az eventgrid system-topic list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid system-topic show'] = """ -type: command -short-summary: Get the details of a system topic. -examples: - - name: Show the details of a system topic. - text: az eventgrid system-topic show -g rg1 -n systemtopic1 - - name: Show the details of a system topic based on resource ID. - text: az eventgrid system-topic show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/systemtopics/systemtopic1 -""" - -helps['eventgrid system-topic update'] = """ -type: command -short-summary: Update a system topic. -examples: - - name: Update the properties of an existing system topic. - text: az eventgrid system-topic update -g rg1 --name systemtopic1 --tags Dept=IT -""" - -helps['eventgrid partner topic list'] = """ -type: command -short-summary: List available partner topics. -examples: - - name: List all partner topics in the current Azure subscription. - text: az eventgrid partner topic list - - name: List all partner topics in a resource group. - text: az eventgrid partner topic list -g rg1 - - name: List all partner topics in a resource group whose name contains the pattern "XYZ" - text: az eventgrid partner topic list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all partner topics in a resource group except the partner topic with name "name1" - text: az eventgrid partner topic list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid partner topic delete'] = """ -type: command -short-summary: Delete a partner topic. -examples: - - name: Delete a specific partner topic. - text: az eventgrid partner topic delete -g rg1 --name partnertopic1 -""" - -helps['eventgrid partner topic show'] = """ -type: command -short-summary: Get the details of a partner topic. -examples: - - name: Show the details of a partner topic. - text: az eventgrid partner topic show -g rg1 -n partnertopic1 - - name: Show the details of a partner topic based on resource ID. - text: az eventgrid partner topic show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/partnetopics/topic1 -""" - -helps['eventgrid partner topic activate'] = """ -type: command -short-summary: Activate a partner topic. -examples: - - name: Activate a specific partner topic. - text: az eventgrid partner topic activate -g rg1 -n partnertopic1 -""" - -helps['eventgrid partner topic deactivate'] = """ -type: command -short-summary: Deactivate a partner topic. -examples: - - name: Deactivate a specific partner topic. - text: az eventgrid partner topic deactivate -g rg1 -n partnertopic1 -""" - -helps['eventgrid system-topic event-subscription'] = """ -type: group -short-summary: Manage event subscriptions of system topic. -""" - -helps['eventgrid system-topic event-subscription create'] = """ -type: command -short-summary: Create a new event subscription for a system topic -parameters: - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. - - name: --deadletter-endpoint - short-summary: The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription. - long-summary: | - Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName - - name: --endpoint-type - short-summary: The type of the destination endpoint. -examples: - - name: Create a new event subscription for an Event Grid system topic, using default filters. - text: | - az eventgrid system-topic event-subscription create --name es1 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for an Event Grid system topic, with a filter specifying a subject prefix. - text: | - az eventgrid system-topic event-subscription create --name es4 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --subject-begins-with mysubject_prefix - - name: Create a new event subscription for an Event Grid system topic, using default filters, and CloudEvent V 1.0 as the delivery schema. - text: | - az eventgrid system-topic event-subscription create -n es2 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --event-delivery-schema cloudeventschemav1_0 - - name: Create a new event subscription for an Event Grid system topic, with a deadletter destination and custom retry policy of maximum 10 delivery attempts and an Event TTL of 2 hours (whichever happens earlier) and expiration date. - text: | - az eventgrid system-topic event-subscription create --name es2 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 \\ - --max-delivery-attempts 10 --event-ttl 120 --expiration-date "2022-10-31" - - name: Create a new event subscription for an Event Grid system topic, using Azure Active Directory enabled Webhook as a destination . - text: | - az eventgrid system-topic event-subscription create --name es1 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --azure-active-directory-tenant-id azureactivedirectorytenantid - --azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri - - name: Create a new event subscription for an Event Grid system topic, using Azure Function as destination. - text: | - az eventgrid system-topic event-subscription create -n es1 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction - -""" - -helps['eventgrid system-topic event-subscription delete'] = """ -type: command -short-summary: Delete an event subscription of a system topic -examples: - - name: Delete an event subscription for an Event Grid system topic. - text: | - az eventgrid system-topic event-subscription delete --name es1 \\ - -g rg1 --system-topic-name systemtopic1 \\ -""" - -helps['eventgrid system-topic event-subscription list'] = """ -type: command -short-summary: List event subscriptions of a specific system topic. -examples: - - name: List all event subscriptions created for an Event Grid system topic. - text: | - az eventgrid system-topic event-subscription list -g rg1 --system-topic-name systemtopic1 -""" - -helps['eventgrid system-topic event-subscription show'] = """ -type: command -short-summary: Get the details of an event subscription of a system topic. -examples: - - name: Show the details of an event subscription for an Event Grid system topic. - text: | - az eventgrid system-topic event-subscription show --name es1 \\ - -g rg1 --system-topic-name systemtopic1 -""" - -helps['eventgrid system-topic event-subscription update'] = """ -type: command -short-summary: Update an event subscription of a system topic. -parameters: - - name: --endpoint-type - short-summary: The type of the destination endpoint. - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. -examples: - - name: Update an event subscription for an Event Grid system topic to specify a new endpoint. - text: | - az eventgrid system-topic event-subscription update --name es1 \\ - -g rg1 --system-topic-name systemtopic1 --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Update an event subscription for an Event Grid system topic to specify a new subject-ends-with filter. - text: | - az eventgrid system-topic event-subscription update --name es2 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --subject-ends-with .jpg - - name: Update an event subscription for an Event Grid system topic to specify a new endpoint and a new subject-ends-with filter a new list of included event types. - text: | - az eventgrid system-topic event-subscription update --name es3 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --subject-ends-with .png \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted - - name: Update an event subscription for an Azure Event Grid system topic, to include a deadletter destination. - text: | - az eventgrid system-topic event-subscription update --name es2 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1 - - name: Update an event subscription for an Azure Event Grid system topic, using advanced filters. - text: | - az eventgrid system-topic event-subscription update --name es3 \\ - -g rg1 --system-topic-name systemtopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --advanced-filter data.blobType StringIn BlockBlob - --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net - -""" - -helps['eventgrid partner topic event-subscription'] = """ -type: group -short-summary: Manage event subscriptions of partner topic. -""" - -helps['eventgrid partner topic event-subscription create'] = """ -type: command -short-summary: Create a new event subscription for a partner topic -parameters: - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. - - name: --deadletter-endpoint - short-summary: The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription. - long-summary: | - Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName - - name: --endpoint-type - short-summary: The type of the destination endpoint. -examples: - - name: Create a new event subscription for an Event Grid partner topic, using default filters. - text: | - az eventgrid partner topic event-subscription create --name es1 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for an Event Grid partner topic, with a filter specifying a subject prefix. - text: | - az eventgrid partner topic event-subscription create --name es4 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --subject-begins-with mysubject_prefix - - name: Create a new event subscription for an Event Grid partner topic, using default filters, and CloudEvent V 1.0 as the delivery schema. - text: | - az eventgrid partner topic event-subscription create -n es2 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --event-delivery-schema cloudeventschemav1_0 - - name: Create a new event subscription for an Event Grid partnertopic, with a deadletter destination and custom retry policy of maximum 10 delivery attempts and an Event TTL of 2 hours (whichever happens earlier) and expiration date. - text: | - az eventgrid partner topic event-subscription create --name es2 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 \\ - --max-delivery-attempts 10 --event-ttl 120 --expiration-date "2022-10-31" - - name: Create a new event subscription for an Event Grid partner topic, using Azure Active Directory enabled Webhook as a destination . - text: | - az eventgrid partner topic event-subscription create --name es1 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --azure-active-directory-tenant-id azureactivedirectorytenantid - --azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri - - name: Create a new event subscription for an Event Grid partner topic, using Azure Function as destination. - text: | - az eventgrid partner topic event-subscription create -n es1 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction - -""" - -helps['eventgrid partner topic event-subscription delete'] = """ -type: command -short-summary: Delete an event subscription of a partner topic -examples: - - name: Delete an event subscription for an Event Grid partner topic. - text: | - az eventgrid partner topic event-subscription delete --name es1 \\ - -g rg1 --partner-topic-name partnertopic1 \\ -""" - -helps['eventgrid partner topic event-subscription list'] = """ -type: command -short-summary: List event subscriptions of a specific partner topic. -examples: - - name: List all event subscriptions created for an Event Grid partner topic. - text: | - az eventgrid partner topic event-subscription list -g rg1 --partner-topic-name partnertopic1 -""" - -helps['eventgrid partner topic event-subscription show'] = """ -type: command -short-summary: Get the details of an event subscription of a partner topic. -examples: - - name: Show the details of an event subscription for an Event Grid partner topic. - text: | - az eventgrid partner topic event-subscription show --name es1 \\ - -g rg1 --partner-topic-name partnertopic1 -""" - -helps['eventgrid partner topic event-subscription update'] = """ -type: command -short-summary: Update an event subscription of a partner topic. -parameters: - - name: --endpoint-type - short-summary: The type of the destination endpoint. - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. -examples: - - name: Update an event subscription for an Event Grid partner topic to specify a new endpoint. - text: | - az eventgrid partner topic event-subscription update --name es1 \\ - -g rg1 --partner-topic-name partnertopic1 --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Update an event subscription for an Event Grid partner topic to specify a new subject-ends-with filter. - text: | - az eventgrid partner topic event-subscription update --name es2 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --subject-ends-with .jpg - - name: Update an event subscription for an Event Grid partner topic to specify a new endpoint and a new subject-ends-with filter a new list of included event types. - text: | - az eventgrid partner topic event-subscription update --name es3 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --subject-ends-with .png \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted - - name: Update an event subscription for an Azure Event Grid partner topic, to include a deadletter destination. - text: | - az eventgrid partner topic event-subscription update --name es2 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1 - - name: Update an event subscription for an Azure Event Grid partner topic, using advanced filters. - text: | - az eventgrid partner topic event-subscription update --name es3 \\ - -g rg1 --partner-topic-name partnertopic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --advanced-filter data.blobType StringIn BlockBlob - --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net - -""" - -helps['eventgrid event-subscription'] = """ -type: group -short-summary: Manage event subscriptions. -long-summary: Manage event subscriptions for an Event Grid topic, domain, domain topic, Azure subscription, resource group or for any other Azure resource that supports event notifications. -""" - -helps['eventgrid event-subscription create'] = """ -type: command -short-summary: Create a new event subscription. -parameters: - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. - - name: --source-resource-id - short-summary: Fully qualified identifier of the Azure resource to which the event subscription needs to be created. - long-summary: | - Usage: --source-resource-id Azure-Resource-ID - For Azure subscription: --source-resource-id /subscriptions/{SubID} - For resource group: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - For EventGrid topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 - For storage account: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1 - For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 - For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1 - - name: --deadletter-endpoint - short-summary: The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription. - long-summary: | - Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName - - name: --endpoint-type - short-summary: The type of the destination endpoint. - - name: --delivery-identity-endpoint-type - short-summary: The type of the destination endpoint with resource identity. -examples: - - name: Create a new event subscription for an Event Grid topic, using default filters. - text: | - az eventgrid event-subscription create --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for an Azure subscription subscription, using default filters. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id /subscriptions/{SubID} \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for a resource group, using default filters. - text: | - az eventgrid event-subscription create --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for a storage account, using default filters. - text: | - az eventgrid event-subscription create --name es3 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription for a storage account, using advanced filters. - text: | - az eventgrid event-subscription create --name es3 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --advanced-filter data.blobType StringIn BlockBlob - --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net - - name: Create a new event subscription for an Azure subscription, with a filter specifying a subject prefix. - text: | - az eventgrid event-subscription create --name es4 \\ - --source-resource-id /subscriptions/{SubID} \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --subject-begins-with mysubject_prefix - - name: Create a new event subscription for a resource group, with a filter specifying a subject suffix. - text: | - az eventgrid event-subscription create --name es5 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --subject-ends-with mysubject_suffix - - name: Create a new event subscription for an Azure subscription, using default filters, and an EventHub as a destination. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id /subscriptions/{SubID} \\ - --endpoint-type eventhub \\ - --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/n1/eventhubs/EH1 - - name: Create a new event subscription for an Azure subscription, using default filters, and an Azure Storage queue as a destination. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id /subscriptions/{SubID} \\ - --endpoint-type storagequeue \\ - --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1 - - name: Create a new event subscription for an Azure subscription, using default filters, and an Azure ServiceBusQueue as a destination. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id /subscriptions/{SubID} \\ - --endpoint-type servicebusqueue \\ - --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ns1/queues/queue1 - - name: Create a new event subscription for an Event Grid domain, using default filters, and CloudEvent V 1.0 as the delivery schema. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --event-delivery-schema cloudeventschemav1_0 - - name: Create a new event subscription for a storage account, with a deadletter destination and custom retry policy of maximum 10 delivery attempts and an Event TTL of 2 hours (whichever happens earlier). - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 \\ - --max-delivery-attempts 10 --event-ttl 120 - - name: Create a new event subscription for a domain topic. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/t1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Create a new event subscription (for a storage account) with an expiration date. - text: | - az eventgrid event-subscription create --name es2 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/sa1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --expiration-date "2018-10-31" - - name: Create a new event subscription for an Event Grid topic, using Azure Active Directory enabled Webhook as a destination . - text: | - az eventgrid event-subscription create --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --azure-active-directory-tenant-id azureactivedirectorytenantid - --azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri - - name: Create a new event subscription for an Event Grid topic, using Azure Function as destination. - text: | - az eventgrid event-subscription create --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \\ - --endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction - - - name: Create a new event subscription for an Event Grid topic, using Eventhub with systemassigned MSI identity as destination and with deadletter with MSI identity - text: | - az eventgrid event-subscription create --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \\ - --delivery-identity-endpoint-type eventhub --delivery-identity systemassigned --delivery-identity-endpoint /subscriptions/{SubId2|}/resourceGroups/{RG2}/providers/Microsoft.eventhub/namespaces/{EventHubNamespace}/eventhubs/{EventhubName} \\ - --deadletter-identity-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 --deadletter-identity systemassigned -n {EventSubscriptionName} - -""" - -helps['eventgrid event-subscription delete'] = """ -type: command -short-summary: Delete an event subscription. -parameters: - - name: --source-resource-id - short-summary: Fully qualified identifier of the Azure resource whose event subscription needs to be deleted. - long-summary: | - Usage: --source-resource-id Azure-Resource-ID - For Azure subscription: --source-resource-id /subscriptions/{SubID} - For resource group: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - For EventGrid topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 - For storage account: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1 - For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 - For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1 -examples: - - name: Delete an event subscription for an Event Grid topic. - text: | - az eventgrid event-subscription delete --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 - - name: Delete an event subscription for an Event Grid domain topic. - text: | - az eventgrid event-subscription delete --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/topic1 - - name: Delete an event subscription for an Event Grid domain. - text: | - az eventgrid event-subscription delete --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1 - - name: Delete an event subscription for an Azure subscription. - text: | - az eventgrid event-subscription delete --name es2 \\ - --source-resource-id /subscriptions/{SubID} - - name: Delete an event subscription for a resource group. - text: | - az eventgrid event-subscription delete --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} - - name: Delete an event subscription for a storage account. - text: | - az eventgrid event-subscription delete --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob -""" - -helps['eventgrid event-subscription list'] = """ -type: command -short-summary: List event subscriptions. -long-summary: | - Event Grid supports both regional and global event subscriptions: Event subscriptions on regional resources (such as Storage accounts or Event Grid topics) are regional, while event subscriptions on global resources (such as an Azure subscription or resource group) are global. - Hence, you can list event subscriptions in a few different ways: - 1. To list by the resource ID of the resource whose event subscriptions you want to list, specify the --source-resource-id parameter. No other parameters must be specified. - 2. To list by a topic-type (e.g. storage accounts), specify the --topic-type parameter along with --location (e.g. "westus2") parameter. For global topic types (e.g. "Microsoft.Resources.Subscriptions"), specify the location value as "global". - 3. To list all event subscriptions in a region (across all topic types), specify only the --location parameter. - 4. For both #2 and #3 above, to filter only by a resource group, you can additionally specify the --resource-group parameter. -parameters: - - name: --topic-type-name - short-summary: Name of the topic-type whose event subscriptions need to be listed. When this is specified, you must also specify --location. - long-summary: | - Example 1: List all Storage event subscriptions in WestUS2 - --resource-group TestRG --topic-type-name Microsoft.Storage.StorageAccounts --location westus2 - Example 2: List all event subscriptions on Azure subscriptions - --topic-type-name Microsoft.Resources.Subscriptions --location global - - name: --source-resource-id - short-summary: Fully qualified identifier of the Azure resource whose event subscription needs to be listed. - long-summary: | - Usage: --source-resource-id Azure-Resource-ID - For Azure subscription: --source-resource-id /subscriptions/{SubID} - For resource group: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - For EventGrid topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 - For storage account: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1 - For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 - For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1 -examples: - - name: List all event subscriptions created for an Event Grid topic. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 - - name: List all event subscriptions created for a storage account. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob - - name: List all event subscriptions created for an Azure subscription. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID} - - name: List all event subscriptions created for a resource group. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} - - name: List all event subscriptions for an Event Grid domain. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 - - name: List all event subscriptions for an Event Grid domain topic. - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1/topics/topic1 - - name: List all Storage event subscriptions (under the currently selected Azure subscription) in westus2. - text: | - az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2 - - name: List all Storage event subscriptions (under the given resource group) in westus2. - text: | - az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2 --resource-group {RG} - - name: List all regional or global event subscriptions (under the currently selected Azure subscription). - text: | - az eventgrid event-subscription list --location westus2 - az eventgrid event-subscription list --location global - - name: List all regional or global event subscriptions under a specified resource group. - text: | - az eventgrid event-subscription list --location westus2 --resource-group {RG} - az eventgrid event-subscription list --location global --resource-group {RG} - - name: List all event subscriptions for an Event Grid domain whose name contains the pattern "XYZ" - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "Contains(name, 'XYZ')" - - name: List all event subscriptions for an Event Grid domain except the event subscription with name "name1" - text: | - az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid event-subscription show'] = """ -type: command -short-summary: Get the details of an event subscription. -parameters: - - name: --source-resource-id - short-summary: Fully qualified identifier of the Azure resource whose event subscription needs to be shown. - long-summary: | - Usage: --source-resource-id Azure-Resource-ID - For Azure subscription: --source-resource-id /subscriptions/{SubID} - For resource group: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - For EventGrid topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 - For storage account: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1 - For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 - For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1 -examples: - - name: Show the details of an event subscription for an Event Grid topic. - text: | - az eventgrid event-subscription show --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/topic1 - - name: Show the details of an event subscription for an Azure subscription. - text: | - az eventgrid event-subscription show --name es2 \\ - --source-resource-id /subscriptions/{SubID} - - name: Show the details of an event subscription for a resource group. - text: | - az eventgrid event-subscription show --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - - name: Show the details of an event subscription for a storage account. - text: | - az eventgrid event-subscription show --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/microsoft.storage/storageaccounts/kalsegblob -""" - -helps['eventgrid event-subscription update'] = """ -type: command -short-summary: Update an event subscription. -parameters: - - name: --source-resource-id - short-summary: Fully qualified identifier of the Azure resource whose event subscription needs to be updated. - long-summary: | - Usage: --source-resource-id Azure-Resource-ID - For Azure subscription: --source-resource-id /subscriptions/{SubID} - For resource group: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 - For EventGrid topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 - For storage account: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageaccounts/sa1 - For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 - For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1 - - name: --endpoint-type - short-summary: The type of the destination endpoint. - - name: --delivery-identity-endpoint-type - short-summary: The type of the destination endpoint with resource identity. - - name: --advanced-filter - short-summary: An advanced filter enables filtering of events based on a specific event property. - long-summary: | - Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...] - StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow - StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow - StringContains: --advanced-filter subject StringContains Blue Red - StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red - StringEndsWith: --advanced-filter subject StringEndsWith img png jpg - NumberIn: --advanced-filter data.property1 NumberIn 5 10 20 - NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 - NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 - NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 - NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 - NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 - BoolEquals: --advanced-filter data.property3 BoolEquals true - Multiple advanced filters can be specified by using more than one `--advanced-filter` argument. -examples: - - name: Update an event subscription for an Event Grid topic to specify a new endpoint. - text: | - az eventgrid event-subscription update --name es1 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Update an event subscription for an Azure subscription to specify a new subject-ends-with filter. - text: | - az eventgrid event-subscription update --name es2 \\ - --source-resource-id /subscriptions/{SubID} \\ - --subject-ends-with .jpg - - name: Update an event subscription for a resource group to specify a new endpoint and a new subject-ends-with filter. - text: | - az eventgrid event-subscription update --name es3 \\ - --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \\ - --subject-ends-with .png \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - - name: Update an event subscription for a storage account to specify a new list of included event types. - text: | - az eventgrid event-subscription update --name es3 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob" \\ - --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted - - name: Update an event subscription for a storage account, to include a deadletter destination. - text: | - az eventgrid event-subscription update --name es2 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob" \\ - --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1 - - name: Update an event subscription for a storage account, using advanced filters. - text: | - az eventgrid event-subscription update --name es3 \\ - --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \\ - --endpoint https://contoso.azurewebsites.net/api/f1?code=code - --advanced-filter data.blobType StringIn BlockBlob - --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net - -""" - -helps['eventgrid extension-topic'] = """ -type: group -short-summary: Manage Azure Event Grid extension topics. -""" - -helps['eventgrid extension-topic show'] = """ -type: command -short-summary: Get the details of an extension topic. -examples: - - name: Show the details of an extension topic. - text: az eventgrid extension-topic show --scope /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName} -""" - -helps['eventgrid topic'] = """ -type: group -short-summary: Manage Azure Event Grid topics. -""" - -helps['eventgrid topic create'] = """ -type: command -short-summary: Create a topic. -parameters: - - name: --inbound-ip-rules - short-summary: List of inbound IP rules. - long-summary: | - List of inbound IP rules specifying IP Address in CIDR notation e.g., 10.0.0.0/8 along with corresponding Action to perform based on the match or no match of the IpMask. Possible values include - Allow. -examples: - - name: Create a new topic. - text: az eventgrid topic create -g rg1 --name topic1 -l westus2 - - name: Create a new topic with custom input mappings. - text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 - - name: Create a new topic that accepts events published in CloudEvents V1.0 schema. - text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema cloudeventschemav1_0 - - name: Create a new topic which allows specific inbound ip rules with Basic Sku and system assigned identity - text: az eventgrid topic create -g rg1 --name topic1 -l westus2 --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --sku Basic --identity systemassigned -""" - -helps['eventgrid topic delete'] = """ -type: command -short-summary: Delete a topic. -examples: - - name: Delete a topic. - text: az eventgrid topic delete -g rg1 --name topic1 -""" - -helps['eventgrid topic private-endpoint-connection'] = """ -type: group -short-summary: Manage private endpoint connections of a topic. -""" - - -helps['eventgrid topic private-endpoint-connection delete'] = """ -type: command -short-summary: Delete a private endpoint connection for a topic. -examples: - - name: Delete private endpoint connection for a specific topic. - text: az eventgrid topic private-endpoint-connection delete -g rg1 --topic-name topic1 -n connectionName1 -""" - -helps['eventgrid topic private-endpoint-connection show'] = """ -type: command -short-summary: Display the properties of a private endpoint connection for a topic. -examples: - - name: Show a private endpoint connection for a topic. - text: az eventgrid topic private-endpoint-connection show -g rg1 --topic-name topic1 -n connectionName1 -""" - -helps['eventgrid topic private-endpoint-connection list'] = """ -type: command -short-summary: List the properties of all the private endpoint connections for a topic. -examples: - - name: List private endpoint connections for a topic. - text: az eventgrid topic private-endpoint-connection list -g rg1 --topic-name topic1 -""" - -helps['eventgrid topic private-endpoint-connection approve'] = """ -type: command -short-summary: Approve a private endpoint connection request for a topic. -examples: - - name: Approve a private endpoint connection for a topic. - text: az eventgrid topic private-endpoint-connection approve -g rg1 --topic-name topic1 -n topic1-PrivateEndpoint.6d90cf76-a022-452c-9994-6dac62a50c99 --description "Sample approval description" -""" - -helps['eventgrid topic private-endpoint-connection reject'] = """ -type: command -short-summary: Reject a private endpoint connection request for a topic. -examples: - - name: Reject a private endpoint connection for a topic. - text: az eventgrid topic private-endpoint-connection reject -g rg1 --topic-name topic1 -n topic1-PrivateEndpoint.6d90cf76-a022-452c-9994-6dac62a50c99 --description "Sample rejection description" -""" - -helps['eventgrid topic private-link-resource'] = """ -type: group -short-summary: Manage private link resource of a topic. -""" - -helps['eventgrid topic private-link-resource show'] = """ -type: command -short-summary: Display the properties of a private link resource for a topic. -examples: - - name: Show a private endpoint connection for a topic. - text: az eventgrid topic private-link-resource show -g rg1 --topic-name topic1 -n topic -""" - -helps['eventgrid topic private-link-resource list'] = """ -type: command -short-summary: List the properties of all the private link resources for a topic. -examples: - - name: Show a private endpoint connection for a topic. - text: az eventgrid topic private-link-resource list -g rg1 --topic-name topic1 -""" - -helps['eventgrid topic key'] = """ -type: group -short-summary: Manage shared access keys of a topic. -""" - -helps['eventgrid topic key list'] = """ -type: command -short-summary: List shared access keys of a topic. -examples: - - name: List shared access keys of a topic (autogenerated) - text: az eventgrid topic key list --name MyTopic --resource-group MyResourceGroup - crafted: true -""" - -helps['eventgrid topic key regenerate'] = """ -type: command -short-summary: Regenerate a shared access key of a topic. -""" - -helps['eventgrid topic list'] = """ -type: command -short-summary: List available topics. -examples: - - name: List all topics in the current Azure subscription. - text: az eventgrid topic list - - name: List all topics in a resource group. - text: az eventgrid topic list -g rg1 - - name: List all topics in a resource group whose name contains the pattern "XYZ" - text: az eventgrid topic list -g rg1 --odata-query "Contains(name, 'XYZ')" - - name: List all topics in a resource group except the domain with name "name1" - text: az eventgrid topic list -g rg1 --odata-query "NOT (name eq 'name1')" -""" - -helps['eventgrid topic show'] = """ -type: command -short-summary: Get the details of a topic. -examples: - - name: Show the details of a topic. - text: az eventgrid topic show -g rg1 -n topic1 - - name: Show the details of a topic based on resource ID. - text: az eventgrid topic show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 -""" - -helps['eventgrid topic update'] = """ -type: command -short-summary: Update a topic. -parameters: - - name: --inbound-ip-rules - short-summary: List of inbound IP rules specifying IP Address in CIDR notation e.g., 10.0.0.0/8 along with corresponding Action to perform based on the match or no match of the IpMask. Possible values include - Allow. - long-summary: List of inbound IP rules specifying IP Address in CIDR notation e.g., 10.0.0.0/8 along with corresponding Action to perform based on the match or no match of the IpMask. Possible values include - Allow. -examples: - - name: Update the properties of an existing topic with new sku, identity and public network access information. - text: az eventgrid topic update -g rg1 --name topic1 --sku Premium --identity systemassigned --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --tags Dept=IT --sku basic -""" - -helps['eventgrid topic-type'] = """ -type: group -short-summary: Get details for topic types. -""" - -helps['eventgrid topic-type list'] = """ -type: command -short-summary: List registered topic types. -""" - -helps['eventgrid topic-type list-event-types'] = """ -type: command -short-summary: List the event types supported by a topic type. -examples: - - name: List all event types supported by Azure Storage Accounts. - text: | - az eventgrid topic-type list-event-types -n Microsoft.Storage.StorageAccounts -""" - -helps['eventgrid topic-type show'] = """ -type: command -short-summary: Get the details for a topic type. -""" diff --git a/src/eventgrid/azext_eventgrid/_params.py b/src/eventgrid/azext_eventgrid/_params.py index d57e52cf150..8cec0b34539 100644 --- a/src/eventgrid/azext_eventgrid/_params.py +++ b/src/eventgrid/azext_eventgrid/_params.py @@ -3,406 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long -from knack.arguments import CLIArgumentType - -from azure.cli.core.commands.parameters import ( - resource_group_name_type, - get_resource_name_completion_list, - get_three_state_flag, - get_location_type, - get_enum_type, - tags_type, - name_type -) - -from .advanced_filter import EventSubscriptionAddFilter -from .event_channel_filter import EventChannelAddFilter -from .inbound_ip_rules import AddInboundIpRule - -included_event_types_type = CLIArgumentType( - help="A space-separated list of event types. Example: Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted. To subscribe to all default event types, do not specify any value for this argument.", - nargs='+' -) - -labels_type = CLIArgumentType( - help="A space-separated list of labels to associate with this event subscription.", - nargs='+' -) - -authorized_subscription_ids_type = CLIArgumentType( - help="A space-separated list of Azure subscription Ids that are authorized to create a partner namespace associated with this partner registration. This is an optional property. Creating partner namespaces is always permitted under the same Azure subscription as the one used for creating the partner registration.", - nargs='+' -) - -input_schema_type = CLIArgumentType( - help="Schema in which incoming events will be published to this topic/domain. If you specify customeventschema as the value for this parameter, you must also provide values for at least one of --input_mapping_default_values / --input_mapping_fields.", - arg_type=get_enum_type(['eventgridschema', 'customeventschema', 'cloudeventschemav1_0'], default='eventgridschema') -) - -public_network_access_type = CLIArgumentType( - help="This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring.", - arg_type=get_enum_type(['enabled', 'disabled']), - options_list=['--public-network-access'] -) - -sku_type = CLIArgumentType( - help="The Sku name of the resource.", - arg_type=get_enum_type(['basic', 'premium']), - options_list=['--sku'] -) - -identity_type = CLIArgumentType( - help="The identity type of the resource (e.g., topic or domain).", - arg_type=get_enum_type(['noidentity', 'systemassigned']), - options_list=['--identity'] -) - -delivery_identity_type = CLIArgumentType( - help="The identity type of the delivery destination resource (e.g., storage queue, or eventhub).", - arg_type=get_enum_type(['systemassigned']), - options_list=['--delivery-identity'] -) - -deadletter_identity_type = CLIArgumentType( - help="The identity type of the deadletter destination resource.", - arg_type=get_enum_type(['systemassigned']), - options_list=['--deadletter-identity'] -) - -input_mapping_fields_type = CLIArgumentType( - help="When input-schema is specified as customeventschema, this parameter is used to specify input mappings based on field names. Specify space separated mappings in 'key=value' format. Allowed key names are 'id', 'topic', 'eventtime', 'subject', 'eventtype', 'dataversion'. The corresponding value names should specify the names of the fields in the custom input schema. If a mapping for either 'id' or 'eventtime' is not provided, Event Grid will auto-generate a default value for these two fields.", - arg_type=tags_type -) - -input_mapping_default_values_type = CLIArgumentType( - help="When input-schema is specified as customeventschema, this parameter can be used to specify input mappings based on default values. You can use this parameter when your custom schema does not include a field that corresponds to one of the three fields supported by this parameter. Specify space separated mappings in 'key=value' format. Allowed key names are 'subject', 'eventtype', 'dataversion'. The corresponding value names should specify the default values to be used for the mapping and they will be used only when the published event doesn't have a valid mapping for a particular field.", - arg_type=tags_type -) - -odata_query_type = CLIArgumentType( - help="The query used to filter the results using OData syntax.", - options_list=['--odata-query'] -) - -topic_name_type = CLIArgumentType( - help='Name of the topic.', - arg_type=name_type, - options_list=['--topic-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/topics')) - -domain_name_type = CLIArgumentType( - help='Name of the domain.', - arg_type=name_type, - options_list=['--domain-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/domains')) - -domain_topic_name_type = CLIArgumentType( - help='Name of the domain topic.', - arg_type=name_type, - options_list=['--domain-topic-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/domains/topic')) - -system_topic_name_type = CLIArgumentType( - help='Name of the system topic.', - arg_type=name_type, - options_list=['--system-topic-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) - -partner_registration_name_type = CLIArgumentType( - help='Name of the partner registration.', - arg_type=name_type, - options_list=['--partner-registration-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/partnerregistrations')) - -partner_namespace_name_type = CLIArgumentType( - help='Name of the partner namespace.', - arg_type=name_type, - options_list=['--partner-namespace-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) - -event_channel_name_type = CLIArgumentType( - help='Name of the event channel.', - arg_type=name_type, - options_list=['--event-channel-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces/eventchannels')) - -partner_topic_name_type = CLIArgumentType( - help='Name of the partner topic.', - arg_type=name_type, - options_list=['--partner-topic-name'], - completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) - -private_endpoint_connection_name_type = CLIArgumentType( - help='Name of the private endpoint connection.', - arg_type=name_type, - options_list=['--private-endpoint-connection-name'] -) - -private_link_resource_name_type = CLIArgumentType( - help='Name of the private link resource.', - arg_type=name_type, - options_list=['--private-link-resource-name'] -) - -partner_topic_source_type = CLIArgumentType( - help='The identifier of the resource that forms the partner source of the events. This represents a unique resource in the partner\'s resource model.', - arg_type=name_type, - options_list=['--partner-topic-source']) - -phone_number_type = CLIArgumentType( - help='The customer service number of the publisher. The expected phone format should start with a \'+\' sign' - ' followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its' - ' length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and' - ' +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43.') - -phone_extension_type = CLIArgumentType( - help='The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.') - - -def load_arguments(self, _): # pylint: disable=too-many-statements - with self.argument_context('eventgrid') as c: - c.argument('resource_group_name', arg_type=resource_group_name_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx)) - c.argument('tags', arg_type=tags_type) - c.argument('included_event_types', arg_type=included_event_types_type) - c.argument('labels', arg_type=labels_type) - c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) - c.argument('delivery_identity_endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default=None)) - c.argument('source_resource_id', help="Fully qualified identifier of the source Azure resource.") - c.argument('endpoint', help="Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint.") - c.argument('delivery_identity_endpoint', help="Endpoint with identity where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint.") - c.argument('event_subscription_name', help="Name of the event subscription.") - c.argument('subject_begins_with', help="An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.") - c.argument('subject_ends_with', help="An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.") - c.argument('topic_type_name', help="Name of the topic type.") - c.argument('is_subject_case_sensitive', arg_type=get_three_state_flag(), options_list=['--subject-case-sensitive'], help="Specify to indicate whether the subject fields should be compared in a case sensitive manner. True if flag present.", ) - c.argument('input_mapping_fields', arg_type=input_mapping_fields_type) - c.argument('input_mapping_default_values', arg_type=input_mapping_default_values_type) - c.argument('input_schema', arg_type=input_schema_type) - c.argument('odata_query', arg_type=odata_query_type) - c.argument('domain_name', arg_type=domain_name_type) - c.argument('domain_topic_name', arg_type=domain_topic_name_type) - c.argument('system_topic_name', arg_type=system_topic_name_type) - c.argument('source', help="The ARM Id for the topic, e.g., /subscriptions/{SubId}/resourceGroups/{RgName}/providers/Microsoft.Storage/storageAccounts/{AccountName}") - c.argument('private_endpoint_connection_name', arg_type=private_endpoint_connection_name_type) - c.argument('private_link_resource_name', arg_type=private_link_resource_name_type) - c.argument('public_network_access', arg_type=public_network_access_type) - c.argument('inbound_ip_rules', action=AddInboundIpRule, nargs='+') - c.argument('sku', arg_type=sku_type) - c.argument('identity', arg_type=identity_type) - c.argument('delivery_identity', arg_type=delivery_identity_type) - c.argument('deadletter_identity', arg_type=deadletter_identity_type) - c.argument('partner_registration_name', arg_type=partner_registration_name_type) - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type) - c.argument('event_channel_name', arg_type=event_channel_name_type) - c.argument('partner_topic_name', arg_type=partner_topic_name_type) - c.argument('authorized_subscription_ids', arg_type=authorized_subscription_ids_type) - c.argument('partner_name', help="Official name of the partner.") - c.argument('display_name', help="Display name for the partner topic type.") - c.argument('resource_type_name', help="Name of the partner topic resource type. This name should be unique among all partner topic types names.") - c.argument('description', help="Description of the partner topic type.") - c.argument('logo_uri', help="URI of the partner logo.") - c.argument('setup_uri', help="URI of the partner website that can be used by Azure customers to setup Event Grid integration on an event source.") - c.argument('partner_registration_id', help="The fully qualified ARM Id of the partner registration that should be associated with this partner namespace. This takes the following format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}.") - c.argument('partner_topic_source', arg_type=partner_topic_source_type) - c.argument('desination_topic_name', help="Name of the partner topic associated with the event channel.") - c.argument('destination_resource_group', help="Azure Resource Group of the customer creating the event channel. The partner topic associated with the event channel will be created under this resource group.") - c.argument('destination_subscription_id', help="Azure subscription Id of the customer creating the event channel. The partner topic associated with the event channel will be created under this Azure subscription.") - c.argument('topic_type', help="Name of the topic type.", completer=get_resource_name_completion_list('Microsoft.EventGrid/topictypes')) - - with self.argument_context('eventgrid topic') as c: - c.argument('topic_name', arg_type=name_type, help='Name of the topic.', id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/topics')) - - with self.argument_context('eventgrid topic key') as c: - c.argument('topic_name', arg_type=name_type, help='Name of the topic', id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/topics')) - - with self.argument_context('eventgrid topic list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid topic private-endpoint-connection') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part='name') - c.argument('private_endpoint_connection_name', arg_type=private_endpoint_connection_name_type, options_list=['--name', '-n'], id_part='privateendpointconnections') - - with self.argument_context('eventgrid topic private-endpoint-connection list') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part=None) - - with self.argument_context('eventgrid topic private-endpoint-connection approve') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part=None) - c.argument('description', help="Comments for the approval.", id_part=None) - - with self.argument_context('eventgrid topic private-endpoint-connection reject') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part=None) - c.argument('description', help="Comments for the rejection.", id_part=None) - - with self.argument_context('eventgrid topic private-link-resource') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part='name') - c.argument('private_link_resource_name', arg_type=private_link_resource_name_type, options_list=['--name', '-n'], id_part='privatelinkresources') - - with self.argument_context('eventgrid topic private-link-resource list') as c: - c.argument('topic_name', arg_type=topic_name_type, id_part=None) - - with self.argument_context('eventgrid domain') as c: - c.argument('domain_name', arg_type=domain_name_type, options_list=['--name', '-n'], id_part='name') - - with self.argument_context('eventgrid domain list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid domain key') as c: - c.argument('domain_name', arg_type=domain_name_type, options_list=['--name', '-n'], id_part=None) - - with self.argument_context('eventgrid domain topic') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part='name') - c.argument('domain_topic_name', arg_type=domain_topic_name_type, options_list=['--name', '-n'], id_part='topics') - - with self.argument_context('eventgrid domain topic list') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part=None) - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid domain private-endpoint-connection') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part='name') - c.argument('private_endpoint_connection_name', arg_type=private_endpoint_connection_name_type, options_list=['--name', '-n'], id_part='privateendpointconnections') - - with self.argument_context('eventgrid domain private-endpoint-connection list') as c: - c.argument('domain_name', arg_type=domain_name_type, options_list=['--name', '-n'], id_part=None) - - with self.argument_context('eventgrid domain private-endpoint-connection approve') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part=None) - c.argument('description', help="Comments for the approval.", id_part=None) - - with self.argument_context('eventgrid domain private-endpoint-connection reject') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part=None) - c.argument('description', help="Comments for the rejection.", id_part=None) - - with self.argument_context('eventgrid domain private-link-resource') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part='name') - c.argument('private_link_resource_name', arg_type=private_link_resource_name_type, options_list=['--name', '-n'], id_part='privatelinkresources') - - with self.argument_context('eventgrid domain private-link-resource list') as c: - c.argument('domain_name', arg_type=domain_name_type, id_part=None) - - with self.argument_context('eventgrid system-topic') as c: - c.argument('system_topic_name', arg_type=system_topic_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) - - with self.argument_context('eventgrid system-topic create') as c: - c.argument('source', help="The ARM Id for the topic, e.g., /subscriptions/{SubId}/resourceGroups/{RgName}/providers/Microsoft.Storage/storageAccounts/{AccountName}") - - with self.argument_context('eventgrid system-topic list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid partner registration') as c: - c.argument('partner_registration_name', arg_type=partner_registration_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnerregistrations')) - c.argument('long_description', help='Description of the custom scenarios and integration. Length of this description should not exceed 2048 characters', id_part=None) - c.argument('customer_service_number', arg_type=phone_number_type, id_part=None) - c.argument('customer_service_extension', arg_type=phone_extension_type, id_part=None) - c.argument('customer_service_uri', help='The customer service URI of the publisher.', id_part=None) - - with self.argument_context('eventgrid partner registration list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid partner namespace') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) - - with self.argument_context('eventgrid partner namespace key') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, help='Name of the partner namespace', id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) - - with self.argument_context('eventgrid partner namespace show') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaces')) - - with self.argument_context('eventgrid partner namespace list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid partner namespace event-channel') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part='name') - c.argument('event_channel_name', arg_type=event_channel_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnernamespaes/eventchannels')) - c.argument('partner_topic_source', arg_type=partner_topic_source_type, options_list=['--source']) - c.argument('activation_expiration_date', help="Date or datetime in UTC ISO 8601 format (e.g., '2022-02-17T01:59:59+00:00' or '2022-02-17') after which the event channel and corresponding partner topic would expire and get auto deleted. If this time is not specified, the expiration date is set to seven days by default.") - c.argument('partner_topic_description', help="Friendly description of the corresponding partner topic. This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.") - c.argument('publisher_filter', action=EventChannelAddFilter, nargs='+') - - with self.argument_context('eventgrid partner namespace event-channel show') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part='name') - - with self.argument_context('eventgrid partner namespace event-channel list') as c: - c.argument('partner_namespace_name', arg_type=partner_namespace_name_type, id_part=None) - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid partner topic') as c: - c.argument('partner_topic_name', arg_type=partner_topic_name_type, options_list=['--name', '-n'], id_part='name', completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) - - with self.argument_context('eventgrid partner topic list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid event-subscription') as c: - c.argument('event_subscription_name', arg_type=name_type, help='Name of the event subscription.') - c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') - c.argument('max_delivery_attempts', help="Maximum number of delivery attempts. Must be a number between 1 and 30.") - c.argument('max_events_per_batch', help="Maximum number of events in a batch. Must be a number between 1 and 5000.") - c.argument('preferred_batch_size_in_kilobytes', help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") - c.argument('event_ttl', help="Event time to live (in minutes). Must be a number between 1 and 1440.") - c.argument('deadletter_endpoint', help="The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.") - c.argument('deadletter_identity_endpoint', help="The Azure resource ID of an Azure Storage blob container destination with identity where EventGrid should deadletter undeliverable events for this event subscription.") - c.argument('advanced_filter', action=EventSubscriptionAddFilter, nargs='+') - c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") - c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('delivery_identity', arg_type=delivery_identity_type) - c.argument('deadletter_identity', arg_type=deadletter_identity_type) - c.argument('delivery_identity_endpoint', help="Endpoint with identity where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint.") - c.argument('delivery_identity_endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default=None)) - - with self.argument_context('eventgrid event-subscription list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid event-subscription show') as c: - c.argument('include_full_endpoint_url', arg_type=get_three_state_flag(), options_list=['--include-full-endpoint-url'], help="Specify to indicate whether the full endpoint URL should be returned. True if flag present.", ) - - with self.argument_context('eventgrid system-topic event-subscription') as c: - c.argument('system_topic_name', arg_type=system_topic_name_type, id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) - c.argument('event_subscription_name', arg_type=name_type, options_list=['--name', '-n'], help='Name of the event subscription.') - c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) - c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') - c.argument('max_delivery_attempts', help="Maximum number of delivery attempts. Must be a number between 1 and 30.") - c.argument('max_events_per_batch', help="Maximum number of events in a batch. Must be a number between 1 and 5000.") - c.argument('preferred_batch_size_in_kilobytes', help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") - c.argument('event_ttl', help="Event time to live (in minutes). Must be a number between 1 and 1440.") - c.argument('deadletter_endpoint', help="The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.") - c.argument('advanced_filter', action=EventSubscriptionAddFilter, nargs='+') - c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") - c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('resource_group_name', arg_type=resource_group_name_type) - - with self.argument_context('eventgrid system-topic event-subscription list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid system-topic event-subscription show') as c: - c.argument('system_topic_name', arg_type=system_topic_name_type, completer=get_resource_name_completion_list('Microsoft.EventGrid/systemtopics')) - c.argument('include_full_endpoint_url', arg_type=get_three_state_flag(), options_list=['--include-full-endpoint-url'], help="Specify to indicate whether the full endpoint URL should be returned. True if flag present.", ) - - with self.argument_context('eventgrid partner topic event-subscription') as c: - c.argument('partner_topic_name', arg_type=partner_topic_name_type, id_part=None, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) - c.argument('event_subscription_name', arg_type=name_type, options_list=['--name', '-n'], help='Name of the event subscription.') - c.argument('endpoint_type', arg_type=get_enum_type(['webhook', 'eventhub', 'storagequeue', 'hybridconnection', 'servicebusqueue', 'servicebustopic', 'azurefunction'], default='webhook')) - c.argument('event_delivery_schema', arg_type=get_enum_type(['eventgridschema', 'custominputschema', 'cloudeventschemav1_0']), help='The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic\'s input schema).') - c.argument('max_delivery_attempts', help="Maximum number of delivery attempts. Must be a number between 1 and 30.") - c.argument('max_events_per_batch', help="Maximum number of events in a batch. Must be a number between 1 and 5000.") - c.argument('preferred_batch_size_in_kilobytes', help="Preferred batch size in kilobytes. Must be a number between 1 and 1024.") - c.argument('event_ttl', help="Event time to live (in minutes). Must be a number between 1 and 1440.") - c.argument('deadletter_endpoint', help="The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.") - c.argument('advanced_filter', action=EventSubscriptionAddFilter, nargs='+') - c.argument('expiration_date', help="Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.") - c.argument('azure_active_directory_tenant_id', help="The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('azure_active_directory_application_id_or_uri', help="The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination") - c.argument('resource_group_name', arg_type=resource_group_name_type) - - with self.argument_context('eventgrid partner topic event-subscription list') as c: - c.argument('odata_query', arg_type=odata_query_type, id_part=None) - - with self.argument_context('eventgrid partner topic event-subscription show') as c: - c.argument('partner_topic_name', arg_type=partner_topic_name_type, completer=get_resource_name_completion_list('Microsoft.EventGrid/partnertopics')) - c.argument('include_full_endpoint_url', arg_type=get_three_state_flag(), options_list=['--include-full-endpoint-url'], help="Specify to indicate whether the full endpoint URL should be returned. True if flag present.", ) - - with self.argument_context('eventgrid topic-type') as c: - c.argument('topic_type_name', arg_type=name_type, help="Name of the topic type.", completer=get_resource_name_completion_list('Microsoft.EventGrid/topictypes')) +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/eventgrid/azext_eventgrid/advanced_filter.py b/src/eventgrid/azext_eventgrid/advanced_filter.py deleted file mode 100644 index 755ef687d0e..00000000000 --- a/src/eventgrid/azext_eventgrid/advanced_filter.py +++ /dev/null @@ -1,97 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import argparse -from knack.util import CLIError - -from azext_eventgrid.vendored_sdks.eventgrid.models import ( - NumberGreaterThanAdvancedFilter, - NumberGreaterThanOrEqualsAdvancedFilter, - NumberInAdvancedFilter, - NumberLessThanAdvancedFilter, - NumberLessThanOrEqualsAdvancedFilter, - NumberNotInAdvancedFilter, - StringBeginsWithAdvancedFilter, - StringContainsAdvancedFilter, - StringEndsWithAdvancedFilter, - StringInAdvancedFilter, - StringNotInAdvancedFilter, - BoolEqualsAdvancedFilter) - -NUMBERIN = "NumberIn" -NUMBERNOTIN = "NumberNotIn" -STRINGIN = "StringIn" -STRINGNOTIN = "StringNotIn" -STRINGBEGINSWITH = "StringBeginsWith" -STRINGCONTAINS = "StringContains" -STRINGENDSWITH = "StringEndsWith" -NUMBERGREATERTHAN = "NumberGreaterThan" -NUMBERGREATERTHANOREQUALS = "NumberGreaterThanOrEquals" -NUMBERLESSTHAN = "NumberLessThan" -NUMBERLESSTHANOREQUALS = "NumberLessThanOrEquals" -BOOLEQUALS = "BoolEquals" - - -# pylint: disable=protected-access -# pylint: disable=too-few-public-methods -class EventSubscriptionAddFilter(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - if len(values) < 3: - raise CLIError('usage error: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]') - - key = values[0] - operator = values[1] - -# operators that support single value - if operator.lower() == NUMBERLESSTHAN.lower(): - _validate_only_single_value_is_specified(NUMBERLESSTHAN, values) - advanced_filter = NumberLessThanAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERLESSTHANOREQUALS.lower(): - _validate_only_single_value_is_specified(NUMBERLESSTHANOREQUALS, values) - advanced_filter = NumberLessThanOrEqualsAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERGREATERTHAN.lower(): - _validate_only_single_value_is_specified(NUMBERGREATERTHAN, values) - advanced_filter = NumberGreaterThanAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERGREATERTHANOREQUALS.lower(): - _validate_only_single_value_is_specified(NUMBERGREATERTHANOREQUALS, values) - advanced_filter = NumberGreaterThanOrEqualsAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == BOOLEQUALS.lower(): - _validate_only_single_value_is_specified(BOOLEQUALS, values) - advanced_filter = BoolEqualsAdvancedFilter(key=key, value=bool(values[2])) - -# operators that support multiple values - elif operator.lower() == NUMBERIN.lower(): - float_values = [float(i) for i in values[2:]] - advanced_filter = NumberInAdvancedFilter(key=key, values=float_values) - elif operator.lower() == NUMBERNOTIN.lower(): - float_values = [float(i) for i in values[2:]] - advanced_filter = NumberNotInAdvancedFilter(key=key, values=float_values) - elif operator.lower() == STRINGIN.lower(): - advanced_filter = StringInAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGNOTIN.lower(): - advanced_filter = StringNotInAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGBEGINSWITH.lower(): - advanced_filter = StringBeginsWithAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGENDSWITH.lower(): - advanced_filter = StringEndsWithAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGCONTAINS.lower(): - advanced_filter = StringContainsAdvancedFilter(key=key, values=values[2:]) - else: - raise CLIError("--advanced-filter: The specified filter operator '{}' is not" - " a valid operator. Supported values are ".format(operator) + - NUMBERIN + "," + NUMBERNOTIN + "," + STRINGIN + "," + - STRINGNOTIN + "," + STRINGBEGINSWITH + "," + - STRINGCONTAINS + "," + STRINGENDSWITH + "," + - NUMBERGREATERTHAN + "," + NUMBERGREATERTHANOREQUALS + "," + - NUMBERLESSTHAN + "," + NUMBERLESSTHANOREQUALS + "," + BOOLEQUALS + ".") - if namespace.advanced_filter is None: - namespace.advanced_filter = [] - namespace.advanced_filter.append(advanced_filter) - - -def _validate_only_single_value_is_specified(operator_type, values): - if len(values) != 3: - raise CLIError("--advanced-filter: For '{}' operator, only one filter value " - "must be specified.".format(operator_type)) diff --git a/src/eventgrid/azext_eventgrid/commands.py b/src/eventgrid/azext_eventgrid/commands.py index 21044711ef8..d60e1bac610 100644 --- a/src/eventgrid/azext_eventgrid/commands.py +++ b/src/eventgrid/azext_eventgrid/commands.py @@ -6,232 +6,8 @@ # pylint: disable=line-too-long # pylint: disable=too-many-statements -from azure.cli.core.commands import CliCommandType -from ._client_factory import ( - topics_factory, - domains_factory, - domain_topics_factory, - system_topics_factory, - system_topic_event_subscriptions_factory, - event_subscriptions_factory, - topic_types_factory, - private_endpoint_connections_factory, - private_link_resources_factory, - extension_topics_factory, - partner_registrations_factory, - partner_namespaces_factory, - event_channels_factory, - partner_topics_factory, - partner_topic_event_subscriptions_factory -) - def load_command_table(self, _): - topics_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._topics_operations#TopicsOperations.{}', - client_factory=topics_factory, - client_arg_name='self' - ) - - extension_topics_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._extension_topics_operations#ExtensionTopicsOperations.{}', - client_factory=extension_topics_factory, - client_arg_name='self' - ) - - domains_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._domains_operations#DomainsOperations.{}', - client_factory=domains_factory, - client_arg_name='self' - ) - - domain_topics_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._domain_topics_operations#DomainTopicsOperations.{}', - client_factory=domain_topics_factory, - client_arg_name='self' - ) - - system_topics_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._system_topics_operations#SystemTopicsOperations.{}', - client_factory=system_topics_factory, - client_arg_name='self' - ) - - system_topic_event_subscriptions_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._system_topic_event_subscriptions_operations#SystemTopicEventSubscriptionsOperations.{}', - client_factory=system_topic_event_subscriptions_factory, - client_arg_name='self' - ) - - partner_registrations_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._partner_registrations_operations#PartnerRegistrationsOperations.{}', - client_factory=partner_registrations_factory, - client_arg_name='self' - ) - - partner_namespaces_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._partner_namespaces_operations#PartnerNamespacesOperations.{}', - client_factory=partner_namespaces_factory, - client_arg_name='self' - ) - - event_channels_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._event_channels_operations#EventChannelsOperations.{}', - client_factory=event_channels_factory, - client_arg_name='self' - ) - - partner_topics_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._partner_topics_operations#PartnerTopicsOperations.{}', - client_factory=partner_topics_factory, - client_arg_name='self' - ) - - partner_topic_event_subscriptions_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._partner_topic_event_subscriptions_operations#PartnerTopicEventSubscriptionsOperations.{}', - client_factory=partner_topic_event_subscriptions_factory, - client_arg_name='self' - ) - - topic_type_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._topic_types_operations#TopicTypesOperations.{}', - client_factory=topic_types_factory, - client_arg_name='self' - ) - - private_endpoint_connections_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._private_endpoint_connections_operations#PrivateEndpointConnectionsOperations.{}', - client_factory=private_endpoint_connections_factory, - client_arg_name='self' - ) - - private_link_resources_mgmt_util = CliCommandType( - operations_tmpl='azext_eventgrid.vendored_sdks.eventgrid.operations._private_link_resources_operations#PrivateLinkResourcesOperations.{}', - client_factory=private_link_resources_factory, - client_arg_name='self' - ) - - with self.command_group('eventgrid topic', topics_mgmt_util, client_factory=topics_factory) as g: - g.show_command('show', 'get') - g.command('key list', 'list_shared_access_keys') - g.command('key regenerate', 'regenerate_key') - g.command('delete', 'delete') - g.custom_command('list', 'cli_topic_list') - g.custom_command('create', 'cli_topic_create_or_update') - g.custom_command('update', 'cli_topic_update') - - with self.command_group('eventgrid extension-topic', extension_topics_mgmt_util, client_factory=extension_topics_factory) as g: - g.show_command('show', 'get') - - with self.command_group('eventgrid domain topic', domain_topics_mgmt_util, client_factory=domain_topics_factory) as g: - g.show_command('show', 'get') - g.custom_command('list', 'cli_domain_topic_list') - g.custom_command('delete', 'cli_domain_topic_delete') - g.custom_command('create', 'cli_domain_topic_create_or_update') - - with self.command_group('eventgrid domain', domains_mgmt_util, client_factory=domains_factory) as g: - g.show_command('show', 'get') - g.command('key list', 'list_shared_access_keys') - g.command('key regenerate', 'regenerate_key') - g.custom_command('list', 'cli_domain_list') - g.custom_command('create', 'cli_domain_create_or_update') - g.command('delete', 'delete') - g.custom_command('update', 'cli_domain_update') - - with self.command_group('eventgrid topic private-endpoint-connection', private_endpoint_connections_mgmt_util, client_factory=private_endpoint_connections_factory) as g: - g.custom_show_command('show', 'cli_topic_private_endpoint_connection_get') - g.custom_command('list', 'cli_topic_private_endpoint_connection_list') - g.custom_command('delete', 'cli_topic_private_endpoint_connection_delete') - g.custom_command('approve', 'cli_topic_private_endpoint_connection_approve') - g.custom_command('reject', 'cli_topic_private_endpoint_connection_reject') - - with self.command_group('eventgrid domain private-endpoint-connection', private_endpoint_connections_mgmt_util, client_factory=private_endpoint_connections_factory) as g: - g.custom_show_command('show', 'cli_domain_private_endpoint_connection_get') - g.custom_command('list', 'cli_domain_private_endpoint_connection_list') - g.custom_command('delete', 'cli_domain_private_endpoint_connection_delete') - g.custom_command('approve', 'cli_domain_private_endpoint_connection_approve') - g.custom_command('reject', 'cli_domain_private_endpoint_connection_reject') - - with self.command_group('eventgrid topic private-link-resource', private_link_resources_mgmt_util, client_factory=private_link_resources_factory) as g: - g.custom_show_command('show', 'cli_topic_private_link_resource_get') - g.custom_command('list', 'cli_topic_private_link_resource_list') - - with self.command_group('eventgrid domain private-link-resource', private_link_resources_mgmt_util, client_factory=private_link_resources_factory) as g: - g.custom_show_command('show', 'cli_domain_private_link_resource_get') - g.custom_command('list', 'cli_domain_private_link_resource_list') - - with self.command_group('eventgrid system-topic', system_topics_mgmt_util, client_factory=system_topics_factory) as g: - g.show_command('show', 'get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_system_topic_list') - g.custom_command('create', 'cli_system_topic_create_or_update') - g.custom_command('update', 'cli_system_topic_update') - - with self.command_group('eventgrid system-topic event-subscription', system_topic_event_subscriptions_mgmt_util, client_factory=system_topic_event_subscriptions_factory) as g: - g.custom_show_command('show', 'cli_system_topic_event_subscription_get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_system_topic_event_subscription_list') - g.custom_command('create', 'cli_system_topic_event_subscription_create_or_update') - g.custom_command('update', 'cli_system_topic_event_subscription_update') - - with self.command_group('eventgrid partner registration', partner_registrations_mgmt_util, client_factory=partner_registrations_factory) as g: - g.show_command('show', 'get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_partner_registration_list') - g.custom_command('create', 'cli_partner_registration_create_or_update') - # g.custom_command('update', 'cli_partner_registration_update') - - with self.command_group('eventgrid partner namespace', partner_namespaces_mgmt_util, client_factory=partner_namespaces_factory) as g: - g.show_command('show', 'get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_partner_namespace_list') - g.custom_command('create', 'cli_partner_namespace_create_or_update') - g.command('key list', 'list_shared_access_keys') - g.command('key regenerate', 'regenerate_key') - # g.custom_command('update', 'cli_partner_namespace_update') - - with self.command_group('eventgrid partner namespace event-channel', event_channels_mgmt_util, client_factory=event_channels_factory) as g: - g.show_command('show', 'get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_event_channel_list') - # g.custom_command('update', 'cli_event_channel_update') - g.custom_command('create', 'cli_event_channel_create_or_update') - - with self.command_group('eventgrid partner topic', partner_topics_mgmt_util, client_factory=partner_topics_factory) as g: - g.show_command('show', 'get') - g.command('delete', 'delete') - g.command('activate', 'activate') - g.command('deactivate', 'deactivate') - g.custom_command('list', 'cli_partner_topic_list') - # g.custom_command('create', 'cli_partner_topic_create_or_update') - # g.custom_command('update', 'cli_partner_topic_update') - - with self.command_group('eventgrid partner topic event-subscription', partner_topic_event_subscriptions_mgmt_util, client_factory=partner_topic_event_subscriptions_factory) as g: - g.custom_show_command('show', 'cli_partner_topic_event_subscription_get') - g.command('delete', 'delete') - g.custom_command('list', 'cli_partner_topic_event_subscription_list') - g.custom_command('create', 'cli_partner_topic_event_subscription_create_or_update') - g.custom_command('update', 'cli_partner_topic_event_subscription_update') - - custom_tmpl = 'azext_eventgrid.custom#{}' - eventgrid_custom = CliCommandType(operations_tmpl=custom_tmpl) - - with self.command_group('eventgrid event-subscription', client_factory=event_subscriptions_factory) as g: - g.custom_command('create', 'cli_eventgrid_event_subscription_create') - g.custom_show_command('show', 'cli_eventgrid_event_subscription_get') - g.custom_command('delete', 'cli_eventgrid_event_subscription_delete') - g.custom_command('list', 'cli_event_subscription_list') - g.generic_update_command('update', - getter_type=eventgrid_custom, - setter_type=eventgrid_custom, - getter_name='event_subscription_getter', - setter_name='event_subscription_setter', - custom_func_name='update_event_subscription') - - with self.command_group('eventgrid topic-type', topic_type_mgmt_util) as g: - g.command('list', 'list') - g.show_command('show', 'get') - g.command('list-event-types', 'list_event_types') with self.command_group('eventgrid namespace'): from .custom import NamespaceListKey, NamespaceRegenerateKey diff --git a/src/eventgrid/azext_eventgrid/custom.py b/src/eventgrid/azext_eventgrid/custom.py index 0186181f289..a403a3e2723 100644 --- a/src/eventgrid/azext_eventgrid/custom.py +++ b/src/eventgrid/azext_eventgrid/custom.py @@ -5,1818 +5,10 @@ # pylint: disable=too-many-lines -import re -from knack.log import get_logger -from knack.util import CLIError -from msrestazure.tools import parse_resource_id -from dateutil.parser import parse # pylint: disable=import-error,relative-import - -from azext_eventgrid.vendored_sdks.eventgrid.models import ( - EventSubscription, - EventSubscriptionUpdateParameters, - WebHookEventSubscriptionDestination, - Topic, - Domain, - JsonInputSchemaMapping, - JsonField, - JsonFieldWithDefault, - RetryPolicy, - EventHubEventSubscriptionDestination, - StorageQueueEventSubscriptionDestination, - HybridConnectionEventSubscriptionDestination, - ServiceBusQueueEventSubscriptionDestination, - ServiceBusTopicEventSubscriptionDestination, - AzureFunctionEventSubscriptionDestination, - StorageBlobDeadLetterDestination, - EventSubscriptionFilter, - TopicUpdateParameters, - DomainUpdateParameters, - ResourceSku, - IdentityInfo, - PartnerRegistration, - PartnerNamespace, - EventChannel, - PartnerTopic, - EventChannelSource, - EventChannelDestination, - SystemTopic, - PrivateEndpointConnection, - ConnectionState, - EventSubscriptionIdentity, - DeliveryWithResourceIdentity, - DeadLetterWithResourceIdentity, - EventChannelFilter) - from azure.cli.core.aaz import has_value from azext_eventgrid.aaz.latest.eventgrid.namespace import ListKey as _NamespaceListKey, RegenerateKey as _NamespaceRegenerateKey from azext_eventgrid.aaz.latest.eventgrid.namespace.ca_certificate import Create as _CaCertificateCreate, Update as _CaCertificateUpdate -logger = get_logger(__name__) - -EVENTGRID_NAMESPACE = "Microsoft.EventGrid" -RESOURCES_NAMESPACE = "Microsoft.Resources" -SUBSCRIPTIONS = "subscriptions" -RESOURCE_GROUPS = "resourcegroups" -EVENTGRID_DOMAINS = "domains" -EVENTGRID_TOPICS = "topics" -EVENTGRID_DOMAIN_TOPICS = "domaintopics" -EVENTGRID_SYSTEM_TOPICS = "systemtopics" -EVENTGRID_PARTNER_REGISTRATIONS = "partnerregistration" -EVENTGRID_PARTNER_NAMESPACES = "partnernamespace" -EVENTGRID_EVENT_CHANNELS = "eventchannel" -EVENTGRID_PARTNER_TOPIC = "partnertopic" -EVENTGRID_PRIVATE_ENDPOINT_CONNECTION = "privateendpointconnections" -EVENTGRID_RESOURCE_SKU = "resourceSku" -SKU_BASIC = "Basic" -SKU_PREMIUM = "Premium" -IDENTITY_NO_IDENTITY = "NoIdentity" -IDENTITY_NONE = "None" -IDENTITY_SYSTEM_ASSIGNED = "SystemAssigned" - -WEBHOOK_DESTINATION = "webhook" -EVENTHUB_DESTINATION = "eventhub" -STORAGEQUEUE_DESTINATION = "storagequeue" -HYBRIDCONNECTION_DESTINATION = "hybridconnection" -SERVICEBUSQUEUE_DESTINATION = "servicebusqueue" -SERVICEBUSTOPIC_DESTINATION = "servicebustopic" -AZUREFUNCTION_DESTINATION = "azurefunction" -EVENTGRID_SCHEMA = "EventGridSchema" -CLOUDEVENTV1_0_SCHEMA = "CloudEventSchemaV1_0" -CUSTOM_EVENT_SCHEMA = "CustomEventSchema" -CUSTOM_INPUT_SCHEMA = "CustomInputSchema" -GLOBAL = "global" - -# Deprecated event delivery schema values -INPUT_EVENT_SCHEMA = "InputEventSchema" -CLOUDEVENTV01SCHEMA = "CloudEventV01Schema" - -# Constants for the target field names of the mapping -TOPIC = "topic" -SUBJECT = "subject" -ID = "id" -EVENTTIME = "eventtime" -EVENTTYPE = "eventtype" -DATAVERSION = "dataversion" - -PHONE_NUMBER_REGEX = "^\\+(?:[0-9] ?){6,15}[0-9]$" -EXTENSION_NUMBER_REGEX = "^(?:[0-9] ?){1,8}[0-9]$" - -DEFAULT_TOP = 100 -MAX_LONG_DESCRIPTION_LEN = 2048 - - -def cli_topic_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_topic_create_or_update( - client, - resource_group_name, - topic_name, - location, - tags=None, - input_schema=EVENTGRID_SCHEMA, - input_mapping_fields=None, - input_mapping_default_values=None, - public_network_access=None, - inbound_ip_rules=None, - sku=SKU_BASIC, - identity=None): - - final_input_schema, input_schema_mapping = _get_input_schema_and_mapping( - input_schema, - input_mapping_fields, - input_mapping_default_values) - sku_name = _get_sku(sku) - sku_info = ResourceSku(name=sku_name) - identity_info = None - - if (identity is not None and identity.lower() != IDENTITY_NONE.lower()): - identity_type_name = _get_identity_type(identity) - identity_info = IdentityInfo(type=identity_type_name) - else: - identity_info = IdentityInfo(type=IDENTITY_NONE) - - topic_info = Topic( - location=location, - tags=tags, - input_schema=final_input_schema, - input_schema_mapping=input_schema_mapping, - public_network_access=public_network_access, - inbound_ip_rules=inbound_ip_rules, - sku=sku_info, - identity=identity_info) - - return client.create_or_update( - resource_group_name, - topic_name, - topic_info) - - -def cli_topic_update( - client, - resource_group_name, - topic_name, - tags=None, - public_network_access=None, - inbound_ip_rules=None, - sku=None, - identity=None): - sku_info = None - if sku is not None: - sku_name = _get_sku(sku) - sku_info = ResourceSku(name=sku_name) - - identity_info = None - - if (identity is not None and identity.lower() != IDENTITY_NONE.lower()): - identity_type_name = _get_identity_type(identity) - identity_info = IdentityInfo(type=identity_type_name) - - topic_update_parameters = TopicUpdateParameters( - tags=tags, - public_network_access=public_network_access, - inbound_ip_rules=inbound_ip_rules, - sku=sku_info, - identity=identity_info) - - return client.update( - resource_group_name=resource_group_name, - topic_name=topic_name, - topic_update_parameters=topic_update_parameters) - - -def cli_domain_update( - client, - resource_group_name, - domain_name, - tags=None, - public_network_access=None, - inbound_ip_rules=None, - sku=None, - identity=None): - sku_info = None - if sku is not None: - sku_name = _get_sku(sku) - sku_info = ResourceSku(name=sku_name) - - identity_info = None - if (identity is not None and identity.lower() != IDENTITY_NONE.lower()): - identity_type_name = _get_identity_type(identity) - identity_info = IdentityInfo(type=identity_type_name) - - domain_update_parameters = DomainUpdateParameters( - tags=tags, - public_network_access=public_network_access, - inbound_ip_rules=inbound_ip_rules, - sku=sku_info, - identity=identity_info) - - return client.update( - resource_group_name, - domain_name, - domain_update_parameters) - - -def cli_domain_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_domain_create_or_update( - client, - resource_group_name, - domain_name, - location, - tags=None, - input_schema=EVENTGRID_SCHEMA, - input_mapping_fields=None, - input_mapping_default_values=None, - public_network_access=None, - inbound_ip_rules=None, - sku=SKU_BASIC, - identity=None): - final_input_schema, input_schema_mapping = _get_input_schema_and_mapping( - input_schema, - input_mapping_fields, - input_mapping_default_values) - sku_name = _get_sku(sku) - sku_info = ResourceSku(name=sku_name) - - identity_info = None - - if (identity is not None and identity.lower() != IDENTITY_NONE.lower()): - identity_type_name = _get_identity_type(identity) - identity_info = IdentityInfo(type=identity_type_name) - else: - identity_info = IdentityInfo(type=IDENTITY_NONE) - - domain_info = Domain( - location=location, - tags=tags, - input_schema=final_input_schema, - input_schema_mapping=input_schema_mapping, - public_network_access=public_network_access, - inbound_ip_rules=inbound_ip_rules, - sku=sku_info, - identity=identity_info) - - return client.create_or_update( - resource_group_name, - domain_name, - domain_info) - - -def cli_domain_topic_create_or_update( - client, - resource_group_name, - domain_name, - domain_topic_name): - return client.create_or_update( - resource_group_name, - domain_name, - domain_topic_name) - - -def cli_domain_topic_delete( - client, - resource_group_name, - domain_name, - domain_topic_name): - return client.delete( - resource_group_name, - domain_name, - domain_topic_name) - - -def cli_domain_topic_list( - client, - resource_group_name, - domain_name, - odata_query=None): - return client.list_by_domain(resource_group_name, domain_name, odata_query, DEFAULT_TOP) - - -def cli_system_topic_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_partner_registration_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_partner_registration_create_or_update( - client, - resource_group_name, - partner_registration_name, - partner_name, - resource_type_name, - display_name=None, - description=None, - long_description=None, - customer_service_number=None, - customer_service_extension=None, - customer_service_uri=None, - logo_uri=None, - setup_uri=None, - authorized_subscription_ids=None, - tags=None): - - if long_description is not None and len(long_description) >= MAX_LONG_DESCRIPTION_LEN: - raise CLIError('The long description cannot exceed ' + str(MAX_LONG_DESCRIPTION_LEN) + ' characters.') - - if customer_service_number is not None: - searchObj = re.search(PHONE_NUMBER_REGEX, customer_service_number) - if searchObj is None: - raise CLIError('Invalid customer service phone number. The expected phone format should start with' - ' a \'+\' sign followed by the country code. The remaining digits are then followed.' - ' Only digits and spaces are allowed and its length cannot exceed 16 digits including' - ' country code. Examples of valid phone numbers are: +1 515 123 4567 and' - ' +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567,' - ' 1 515 123 4567 and +966 121 5115 24 7 551 1234 43.') - - if customer_service_extension is not None: - searchObj = re.search(EXTENSION_NUMBER_REGEX, customer_service_extension) - if searchObj is None: - raise CLIError('Invalid customer service extension number. Only digits are allowed' - ' and number of digits should not exceed 10.') - - partner_registration_info = PartnerRegistration( - location=GLOBAL, - partner_name=partner_name, - partner_resource_type_name=resource_type_name, - logo_uri=logo_uri, - setup_uri=setup_uri, - partner_resource_type_display_name=display_name, - partner_resource_type_description=description, - long_description=long_description, - partner_customer_service_number=customer_service_number, - partner_customer_service_extension=customer_service_extension, - customer_service_uri=customer_service_uri, - authorized_azure_subscription_ids=authorized_subscription_ids, - tags=tags) - - return client.create_or_update( - resource_group_name, - partner_registration_name, - partner_registration_info) - -# TODO: to be added once operation is enabled. -# -# def cli_partner_registration_update( -# client, -# resource_group_name, -# partner_registration_name, -# tags=None): - -# return client.update( -# resource_group_name=resource_group_name, -# partner_registration_name=partner_registration_name, -# tags=tags) - - -def cli_partner_namespace_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_partner_namespace_create_or_update( - client, - resource_group_name, - partner_namespace_name, - location, - partner_registration_id, - tags=None): - - partner_namespace_info = PartnerNamespace( - location=location, - partner_registration_fully_qualified_id=partner_registration_id, - tags=tags) - - return client.create_or_update( - resource_group_name, - partner_namespace_name, - partner_namespace_info) - - -# TODO: to be added once operation is enabled. -# def cli_partner_namespace_update( -# client, -# resource_group_name, -# partner_namespace_name, -# tags=None): -# -# return client.update( -# resource_group_name=resource_group_name, -# partner_namespace_name=partner_namespace_name, -# tags=tags) - - -def cli_event_channel_list( - client, - resource_group_name, - partner_namespace_name, - odata_query=None): - - return client.list_by_partner_namespace(resource_group_name, partner_namespace_name, odata_query, DEFAULT_TOP) - - -def cli_event_channel_create_or_update( - client, - resource_group_name, - partner_namespace_name, - event_channel_name, - partner_topic_source, - destination_subscription_id, - destination_resource_group, - desination_topic_name, - activation_expiration_date=None, - partner_topic_description=None, - publisher_filter=None): - - source_info = EventChannelSource(source=partner_topic_source) - - destination_info = EventChannelDestination( - azure_subscription_id=destination_subscription_id, - resource_group=destination_resource_group, - partner_topic_name=desination_topic_name) - - event_channel_filter = None - if publisher_filter is not None: - event_channel_filter = EventChannelFilter(advanced_filters=publisher_filter) - - event_channel_info = EventChannel( - source=source_info, - destination=destination_info, - expiration_time_if_not_activated_utc=activation_expiration_date, - partner_topic_friendly_description=partner_topic_description, - filter=event_channel_filter) - - return client.create_or_update( - resource_group_name, - partner_namespace_name, - event_channel_name, - event_channel_info) - - -# def cli_event_channel_update( -# client, -# resource_group_name, -# event_channel_name, -# tags=None): -# -# return client.update( -# resource_group_name=resource_group_name, -# event_channel_name=event_channel_name, -# tags=tags) - - -def cli_partner_topic_list( - client, - resource_group_name=None, - odata_query=None): - - if resource_group_name: - return client.list_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - - return client.list_by_subscription(odata_query, DEFAULT_TOP) - - -def cli_partner_topic_create_or_update( - client, - resource_group_name, - partner_topic_name, - location, - tags=None): - - partner_topic_info = PartnerTopic( - location=location, - tags=tags) - - return client.create_or_update( - resource_group_name, - partner_topic_name, - partner_topic_info) - -# def cli_partner_topic_update( -# client, -# resource_group_name, -# partner_topic_name, -# tags=None): -# -# return client.update( -# resource_group_name=resource_group_name, -# partner_topic_name=partner_topic_name, -# tags=tags) - - -def cli_partner_topic_event_subscription_create_or_update( # pylint: disable=too-many-locals - client, - resource_group_name, - partner_topic_name, - event_subscription_name, - endpoint=None, - endpoint_type=None, - included_event_types=None, - subject_begins_with=None, - subject_ends_with=None, - is_subject_case_sensitive=False, - max_delivery_attempts=30, - event_ttl=1440, - max_events_per_batch=None, - preferred_batch_size_in_kilobytes=None, - event_delivery_schema=None, - deadletter_endpoint=None, - labels=None, - expiration_date=None, - advanced_filter=None, - azure_active_directory_tenant_id=None, - azure_active_directory_application_id_or_uri=None): - - event_subscription_info = _get_event_subscription_info( - endpoint=endpoint, - endpoint_type=endpoint_type, - included_event_types=included_event_types, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - is_subject_case_sensitive=is_subject_case_sensitive, - max_delivery_attempts=max_delivery_attempts, - event_ttl=event_ttl, - max_events_per_batch=max_events_per_batch, - preferred_batch_size_in_kilobytes=preferred_batch_size_in_kilobytes, - event_delivery_schema=event_delivery_schema, - deadletter_endpoint=deadletter_endpoint, - labels=labels, - expiration_date=expiration_date, - advanced_filter=advanced_filter, - azure_active_directory_tenant_id=azure_active_directory_tenant_id, - azure_active_directory_application_id_or_uri=azure_active_directory_application_id_or_uri, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None) - - return client.create_or_update( - resource_group_name, - partner_topic_name, - event_subscription_name, - event_subscription_info) - - -def cli_eventgrid_partner_topic_event_subscription_delete( - client, - resource_group_name, - partner_topic_name, - event_subscription_name): - return client.delete( - resource_group_name, - partner_topic_name, - event_subscription_name) - - -def cli_partner_topic_event_subscription_get( - client, - resource_group_name, - partner_topic_name, - event_subscription_name, - include_full_endpoint_url=False): - - retrieved_event_subscription = client.get(resource_group_name, partner_topic_name, event_subscription_name) - destination = retrieved_event_subscription.destination - if include_full_endpoint_url and isinstance(destination, WebHookEventSubscriptionDestination): - full_endpoint_url = client.get_full_url(resource_group_name, partner_topic_name, event_subscription_name) - destination.endpoint_url = full_endpoint_url.endpoint_url - - return retrieved_event_subscription - - -def cli_partner_topic_event_subscription_list( # pylint: disable=too-many-return-statements - client, - resource_group_name, - partner_topic_name, - odata_query=None): - - return client.list_by_partner_topic(resource_group_name, partner_topic_name, odata_query, DEFAULT_TOP) - - -def cli_system_topic_create_or_update( - client, - resource_group_name, - system_topic_name, - location, - topic_type, - source, - tags=None): - - system_topic_info = SystemTopic( - location=location, - tags=tags, - topic_type=topic_type, - source=source) - - return client.create_or_update( - resource_group_name, - system_topic_name, - system_topic_info) - - -def cli_system_topic_update( - client, - resource_group_name, - system_topic_name, - tags=None): - - return client.update( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - tags=tags) - - -def cli_system_topic_event_subscription_create_or_update( # pylint: disable=too-many-locals - client, - resource_group_name, - system_topic_name, - event_subscription_name, - endpoint=None, - endpoint_type=None, - included_event_types=None, - subject_begins_with=None, - subject_ends_with=None, - is_subject_case_sensitive=False, - max_delivery_attempts=30, - event_ttl=1440, - max_events_per_batch=None, - preferred_batch_size_in_kilobytes=None, - event_delivery_schema=None, - deadletter_endpoint=None, - labels=None, - expiration_date=None, - advanced_filter=None, - azure_active_directory_tenant_id=None, - azure_active_directory_application_id_or_uri=None): - - event_subscription_info = _get_event_subscription_info( - endpoint=endpoint, - endpoint_type=endpoint_type, - included_event_types=included_event_types, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - is_subject_case_sensitive=is_subject_case_sensitive, - max_delivery_attempts=max_delivery_attempts, - event_ttl=event_ttl, - max_events_per_batch=max_events_per_batch, - preferred_batch_size_in_kilobytes=preferred_batch_size_in_kilobytes, - event_delivery_schema=event_delivery_schema, - deadletter_endpoint=deadletter_endpoint, - labels=labels, - expiration_date=expiration_date, - advanced_filter=advanced_filter, - azure_active_directory_tenant_id=azure_active_directory_tenant_id, - azure_active_directory_application_id_or_uri=azure_active_directory_application_id_or_uri, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None) - - return client.create_or_update( - resource_group_name, - system_topic_name, - event_subscription_name, - event_subscription_info) - - -def cli_eventgrid_system_topic_event_subscription_delete( - client, - resource_group_name, - system_topic_name, - event_subscription_name): - return client.delete( - resource_group_name, - system_topic_name, - event_subscription_name) - - -def cli_system_topic_event_subscription_get( - client, - resource_group_name, - system_topic_name, - event_subscription_name, - include_full_endpoint_url=False): - - retrieved_event_subscription = client.get(resource_group_name, system_topic_name, event_subscription_name) - destination = retrieved_event_subscription.destination - if include_full_endpoint_url and isinstance(destination, WebHookEventSubscriptionDestination): - full_endpoint_url = client.get_full_url(resource_group_name, system_topic_name, event_subscription_name) - destination.endpoint_url = full_endpoint_url.endpoint_url - - return retrieved_event_subscription - - -def cli_system_topic_event_subscription_list( # pylint: disable=too-many-return-statements - client, - resource_group_name, - system_topic_name, - odata_query=None): - - return client.list_by_system_topic(resource_group_name, system_topic_name, odata_query, DEFAULT_TOP) - - -def cli_eventgrid_event_subscription_create( # pylint: disable=too-many-locals - client, - event_subscription_name, - endpoint=None, - source_resource_id=None, - endpoint_type=WEBHOOK_DESTINATION, - included_event_types=None, - subject_begins_with=None, - subject_ends_with=None, - is_subject_case_sensitive=False, - max_delivery_attempts=30, - event_ttl=1440, - max_events_per_batch=None, - preferred_batch_size_in_kilobytes=None, - event_delivery_schema=None, - deadletter_endpoint=None, - labels=None, - expiration_date=None, - advanced_filter=None, - azure_active_directory_tenant_id=None, - azure_active_directory_application_id_or_uri=None, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None): - - event_subscription_info = _get_event_subscription_info( - endpoint=endpoint, - endpoint_type=endpoint_type, - included_event_types=included_event_types, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - is_subject_case_sensitive=is_subject_case_sensitive, - max_delivery_attempts=max_delivery_attempts, - event_ttl=event_ttl, - max_events_per_batch=max_events_per_batch, - preferred_batch_size_in_kilobytes=preferred_batch_size_in_kilobytes, - event_delivery_schema=event_delivery_schema, - deadletter_endpoint=deadletter_endpoint, - labels=labels, - expiration_date=expiration_date, - advanced_filter=advanced_filter, - azure_active_directory_tenant_id=azure_active_directory_tenant_id, - azure_active_directory_application_id_or_uri=azure_active_directory_application_id_or_uri, - delivery_identity=delivery_identity, - delivery_identity_endpoint=delivery_identity_endpoint, - delivery_identity_endpoint_type=delivery_identity_endpoint_type, - deadletter_identity=deadletter_identity, - deadletter_identity_endpoint=deadletter_identity_endpoint) - - return client.create_or_update( - source_resource_id, - event_subscription_name, - event_subscription_info) - - -def cli_eventgrid_event_subscription_delete( - client, - event_subscription_name, - source_resource_id=None): - return client.delete( - source_resource_id, - event_subscription_name) - - -def event_subscription_setter( - client, - parameters, - event_subscription_name, - source_resource_id=None): - - return client.update( - source_resource_id, - event_subscription_name, - parameters) - - -def cli_eventgrid_event_subscription_get( - client, - event_subscription_name, - source_resource_id=None, - include_full_endpoint_url=False): - - retrieved_event_subscription = client.get(source_resource_id, event_subscription_name) - destination = retrieved_event_subscription.destination - if include_full_endpoint_url and isinstance(destination, WebHookEventSubscriptionDestination): - full_endpoint_url = client.get_full_url(source_resource_id, event_subscription_name) - destination.endpoint_url = full_endpoint_url.endpoint_url - - return retrieved_event_subscription - - -def cli_event_subscription_list( # pylint: disable=too-many-return-statements - client, - source_resource_id=None, - location=None, - resource_group_name=None, - topic_type_name=None, - odata_query=None): - if source_resource_id is not None: - # If Source Resource ID is specified, we need to list event subscriptions for that particular resource. - # Since a full resource ID is specified, it should override all other defaults such as default location and RG - # No other parameters must be specified - if topic_type_name is not None: - raise CLIError('usage error: Since --source-resource-id is specified, none of the other parameters must ' - 'be specified.') - - return _list_event_subscriptions_by_resource_id(client, source_resource_id, odata_query, DEFAULT_TOP) - - if location is None: - # Since resource-id was not specified, location must be specified: e.g. "westus2" or "global". If not error - # OUT. - raise CLIError('usage error: --source-resource-id ID | --location LOCATION' - ' [--resource-group RG] [--topic-type-name TOPIC_TYPE_NAME]') - - if topic_type_name is None: - # No topic-type is specified: return event subscriptions across all topic types for this location. - if location.lower() == GLOBAL.lower(): - if resource_group_name: - return client.list_global_by_resource_group(resource_group_name, odata_query, DEFAULT_TOP) - return client.list_global_by_subscription(odata_query, DEFAULT_TOP) - - if resource_group_name: - return client.list_regional_by_resource_group(resource_group_name, location, odata_query, DEFAULT_TOP) - return client.list_regional_by_subscription(location, odata_query, DEFAULT_TOP) - - # Topic type name is specified - if location.lower() == GLOBAL.lower(): - if not _is_topic_type_global_resource(topic_type_name): - raise CLIError('Invalid usage: Global cannot be specified for the location ' - 'as the specified topic type is a regional topic type with ' - 'regional event subscriptions. Specify a location value such ' - 'as westus. Global can be used only for global topic types: ' - 'Microsoft.Resources.Subscriptions and Microsoft.Resources.ResourceGroups.') - if resource_group_name: - return client.list_global_by_resource_group_for_topic_type( - resource_group_name, - topic_type_name, - odata_query, - DEFAULT_TOP) - return client.list_global_by_subscription_for_topic_type(topic_type_name, odata_query, DEFAULT_TOP) - - if resource_group_name: - return client.list_regional_by_resource_group_for_topic_type( - resource_group_name, - location, - topic_type_name, - odata_query, - DEFAULT_TOP) - return client.list_regional_by_subscription_for_topic_type( - location, - topic_type_name, - odata_query, - DEFAULT_TOP) - - -def cli_topic_private_endpoint_connection_get( - client, - resource_group_name, - topic_name, - private_endpoint_connection_name): - - return client.get(resource_group_name, EVENTGRID_TOPICS, topic_name, private_endpoint_connection_name) - - -def cli_topic_private_endpoint_connection_delete( - client, - resource_group_name, - topic_name, - private_endpoint_connection_name): - - return client.delete(resource_group_name, EVENTGRID_TOPICS, topic_name, private_endpoint_connection_name) - - -def cli_topic_private_endpoint_connection_list( - client, - resource_group_name, - topic_name): - - return client.list_by_resource(resource_group_name, EVENTGRID_TOPICS, topic_name) - - -def cli_topic_private_endpoint_connection_approve( - client, - resource_group_name, - topic_name, - private_endpoint_connection_name, - description=None): - - status = ConnectionState(description=description, status='Approved') - private_endpoint_conn = PrivateEndpointConnection(private_link_service_connection_state=status) - return client.update( - resource_group_name, - EVENTGRID_TOPICS, - topic_name, - private_endpoint_connection_name, - private_endpoint_conn) - - -def cli_topic_private_endpoint_connection_reject( - client, - resource_group_name, - topic_name, - private_endpoint_connection_name, - description=None): - - status = ConnectionState(description=description, status='Rejected') - private_endpoint_conn = PrivateEndpointConnection(private_link_service_connection_state=status) - return client.update( - resource_group_name, - EVENTGRID_TOPICS, - topic_name, - private_endpoint_connection_name, - private_endpoint_conn) - - -def cli_domain_private_endpoint_connection_get( - client, - resource_group_name, - domain_name, - private_endpoint_connection_name): - - return client.get(resource_group_name, EVENTGRID_DOMAINS, domain_name, private_endpoint_connection_name) - - -def cli_domain_private_endpoint_connection_list( - client, - resource_group_name, - domain_name): - - return client.list_by_resource(resource_group_name, EVENTGRID_DOMAINS, domain_name) - - -def cli_domain_private_endpoint_connection_delete( - client, - resource_group_name, - domain_name, - private_endpoint_connection_name): - - return client.delete(resource_group_name, EVENTGRID_DOMAINS, domain_name, private_endpoint_connection_name) - - -def cli_domain_private_endpoint_connection_approve( - client, - resource_group_name, - domain_name, - private_endpoint_connection_name, - description=None): - - status = ConnectionState(description=description, status='Approved') - private_endpoint_conn = PrivateEndpointConnection(private_link_service_connection_state=status) - return client.update( - resource_group_name, - EVENTGRID_DOMAINS, - domain_name, - private_endpoint_connection_name, - private_endpoint_conn) - - -def cli_domain_private_endpoint_connection_reject( - client, - resource_group_name, - domain_name, - private_endpoint_connection_name, - description=None): - - status = ConnectionState(description=description, status='Rejected') - private_endpoint_conn = PrivateEndpointConnection(private_link_service_connection_state=status) - return client.update( - resource_group_name, - EVENTGRID_DOMAINS, - domain_name, - private_endpoint_connection_name, - private_endpoint_conn) - - -def cli_topic_private_link_resource_get( - client, - resource_group_name, - topic_name, - private_link_resource_name): - - return client.get(resource_group_name, EVENTGRID_TOPICS, topic_name, private_link_resource_name) - - -def cli_topic_private_link_resource_list( - client, - resource_group_name, - topic_name): - - return client.list_by_resource(resource_group_name, EVENTGRID_TOPICS, topic_name) - - -def cli_domain_private_link_resource_get( - client, - resource_group_name, - domain_name, - private_link_resource_name): - - return client.get(resource_group_name, EVENTGRID_DOMAINS, domain_name, private_link_resource_name) - - -def cli_domain_private_link_resource_list( - client, - resource_group_name, - domain_name): - - return client.list_by_resource(resource_group_name, EVENTGRID_DOMAINS, domain_name) - - -def _get_event_subscription_info( # pylint: disable=too-many-locals,too-many-statements,too-many-branches - endpoint=None, - endpoint_type=WEBHOOK_DESTINATION, - included_event_types=None, - subject_begins_with=None, - subject_ends_with=None, - is_subject_case_sensitive=False, - max_delivery_attempts=30, - event_ttl=1440, - max_events_per_batch=None, - preferred_batch_size_in_kilobytes=None, - event_delivery_schema=None, - deadletter_endpoint=None, - labels=None, - expiration_date=None, - advanced_filter=None, - azure_active_directory_tenant_id=None, - azure_active_directory_application_id_or_uri=None, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None): - - if endpoint is None and delivery_identity_endpoint is None or \ - endpoint is not None and delivery_identity_endpoint is not None: - raise CLIError('usage error: either --endpoint or --delivery-identity-endpoint should ' - 'be specified at one time, not both.') - - if deadletter_endpoint is not None and deadletter_identity_endpoint is not None: - raise CLIError('usage error: either --deadletter_endpoint or --deadletter_identity_endpoint ' - 'should be specified at one time, not both') - - if included_event_types is not None and len(included_event_types) == 1 and included_event_types[0].lower() == 'all': - logger.warning('The usage of \"All\" for --included-event-types is not allowed starting from Azure Event Grid' - ' API Version 2019-02-01-preview. However, the call here is still permitted by replacing' - ' \"All\" with None in order to return all the event types (for the custom topics and' - ' domains case) or default event types (for other topic types case). In any future calls,' - ' please consider leaving --included-event-types unspecified or use None instead.') - included_event_types = None - - # Construct RetryPolicy based on max_delivery_attempts and event_ttl - max_delivery_attempts = int(max_delivery_attempts) - event_ttl = int(event_ttl) - _validate_retry_policy(max_delivery_attempts, event_ttl) - retry_policy = RetryPolicy(max_delivery_attempts=max_delivery_attempts, event_time_to_live_in_minutes=event_ttl) - - if max_events_per_batch is not None: - if endpoint_type not in (WEBHOOK_DESTINATION, AZUREFUNCTION_DESTINATION): - raise CLIError('usage error: max-events-per-batch is applicable only for ' - 'endpoint types WebHook and AzureFunction.') - max_events_per_batch = int(max_events_per_batch) - if max_events_per_batch > 5000: - raise CLIError('usage error: max-events-per-batch must be a number between 1 and 5000.') - - if preferred_batch_size_in_kilobytes is not None: - if endpoint_type not in (WEBHOOK_DESTINATION, AZUREFUNCTION_DESTINATION): - raise CLIError('usage error: preferred-batch-size-in-kilobytes is applicable only for ' - 'endpoint types WebHook and AzureFunction.') - preferred_batch_size_in_kilobytes = int(preferred_batch_size_in_kilobytes) - if preferred_batch_size_in_kilobytes > 1024: - raise CLIError('usage error: preferred-batch-size-in-kilobytes must be a number ' - 'between 1 and 1024.') - - if azure_active_directory_tenant_id is not None: - if endpoint_type is not WEBHOOK_DESTINATION: - raise CLIError('usage error: azure-active-directory-tenant-id is applicable only for ' - 'endpoint types WebHook.') - if azure_active_directory_application_id_or_uri is None: - raise CLIError('usage error: azure-active-directory-application-id-or-uri is missing. ' - 'It should include an Azure Active Directory Application Id or Uri.') - - if azure_active_directory_application_id_or_uri is not None: - if endpoint_type is not WEBHOOK_DESTINATION: - raise CLIError('usage error: azure-active-directory-application-id-or-uri is applicable only for ' - 'endpoint types WebHook.') - if azure_active_directory_tenant_id is None: - raise CLIError('usage error: azure-active-directory-tenant-id is missing. ' - 'It should include an Azure Active Directory Tenant Id.') - - condition1 = delivery_identity is not None and \ - (delivery_identity_endpoint is None or delivery_identity_endpoint_type is None) - condition2 = delivery_identity is None and \ - (delivery_identity_endpoint is not None or delivery_identity_endpoint_type is not None) - if endpoint is None and (condition1 or condition2): - raise CLIError('usage error: one or more delivery identity information is missing. ' - 'If delivery_identity is specified, both delivery_identity_endpoint and ' - 'delivery_identity_endpoint_type should be specified.') - - condition1 = deadletter_identity is not None and deadletter_identity_endpoint is None - condition2 = deadletter_identity is None and deadletter_identity_endpoint is not None - if condition1 or condition2: - raise CLIError('usage error: one or more deadletter identity information is missing. If ' - 'deadletter_identity is specified, deadletter_identity_endpoint should be specified.') - - tennant_id = None - application_id = None - - condition1 = endpoint_type is not None and endpoint_type.lower() == WEBHOOK_DESTINATION.lower() - condition2 = delivery_identity_endpoint_type is not None and \ - delivery_identity_endpoint_type.lower() == WEBHOOK_DESTINATION.lower() # pylint: line-too-long - if condition1 or condition2: - tennant_id = azure_active_directory_tenant_id - application_id = azure_active_directory_application_id_or_uri - - destination = None - if endpoint is not None: - destination = _get_endpoint_destination( - endpoint_type, - endpoint, - max_events_per_batch, - preferred_batch_size_in_kilobytes, - tennant_id, - application_id) - - delivery_with_resource_identity = None - - if delivery_identity_endpoint is not None: - identity_type_name = _get_event_subscription_identity_type(delivery_identity) - delivery_identity_info = EventSubscriptionIdentity(type=identity_type_name) - destination_with_identity = _get_endpoint_destination( - delivery_identity_endpoint_type, - delivery_identity_endpoint, - max_events_per_batch, - preferred_batch_size_in_kilobytes, - tennant_id, - application_id) - delivery_with_resource_identity = DeliveryWithResourceIdentity( - identity=delivery_identity_info, - destination=destination_with_identity) - - event_subscription_filter = EventSubscriptionFilter( - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - included_event_types=included_event_types, - is_subject_case_sensitive=is_subject_case_sensitive, - advanced_filters=advanced_filter) - - deadletter_destination = None - if deadletter_endpoint is not None: - deadletter_destination = _get_deadletter_destination(deadletter_endpoint) - - deadletter_with_resource_identity = None - - if deadletter_identity_endpoint is not None: - deadletter_destination_with_identity = _get_deadletter_destination(deadletter_identity_endpoint) - deadletter_identity_type_name = _get_event_subscription_identity_type(deadletter_identity) - deadletter_delivery_identity_info = EventSubscriptionIdentity(type=deadletter_identity_type_name) - deadletter_with_resource_identity = DeadLetterWithResourceIdentity( - identity=deadletter_delivery_identity_info, - dead_letter_destination=deadletter_destination_with_identity) - - if expiration_date is not None: - expiration_date = parse(expiration_date) - - event_subscription_info = EventSubscription( - destination=destination, - filter=event_subscription_filter, - labels=labels, - event_delivery_schema=_get_event_delivery_schema(event_delivery_schema), - retry_policy=retry_policy, - expiration_time_utc=expiration_date, - dead_letter_destination=deadletter_destination, - delivery_with_resource_identity=delivery_with_resource_identity, - dead_letter_with_resource_identity=deadletter_with_resource_identity) - - _warn_if_manual_handshake_needed(endpoint_type, endpoint) - - return event_subscription_info - - -def event_subscription_getter( - client, - event_subscription_name, - source_resource_id=None): - return client.get(source_resource_id, event_subscription_name) - - -def get_input_schema_mapping( - input_mapping_fields=None, - input_mapping_default_values=None): - input_schema_mapping = None - - if input_mapping_fields is not None or input_mapping_default_values is not None: - input_schema_mapping = JsonInputSchemaMapping() - - input_schema_mapping.id = JsonField() - input_schema_mapping.topic = JsonField() - input_schema_mapping.event_time = JsonField() - input_schema_mapping.subject = JsonFieldWithDefault() - input_schema_mapping.event_type = JsonFieldWithDefault() - input_schema_mapping.data_version = JsonFieldWithDefault() - - if input_mapping_fields is not None: - for field_mapping_pair in input_mapping_fields: - field_mapping = field_mapping_pair.split("=") - target = field_mapping[0] - source = field_mapping[1] - - if target.lower() == ID.lower(): - input_schema_mapping.id.source_field = source - elif target.lower() == EVENTTIME.lower(): - input_schema_mapping.event_time.source_field = source - elif target.lower() == TOPIC.lower(): - input_schema_mapping.topic.source_field = source - elif target.lower() == SUBJECT.lower(): - input_schema_mapping.subject.source_field = source - elif target.lower() == DATAVERSION.lower(): - input_schema_mapping.data_version.source_field = source - elif target.lower() == EVENTTYPE.lower(): - input_schema_mapping.event_type.source_field = source - - if input_mapping_default_values is not None: - for default_value_mapping_pair in input_mapping_default_values: - default_value_mapping = default_value_mapping_pair.split("=") - target = default_value_mapping[0] - source = default_value_mapping[1] - - if target.lower() == SUBJECT.lower(): - input_schema_mapping.subject.default_value = source - elif target.lower() == DATAVERSION.lower(): - input_schema_mapping.data_version.default_value = source - elif target.lower() == EVENTTYPE.lower(): - input_schema_mapping.event_type.default_value = source - - return input_schema_mapping - - -def cli_system_topic_event_subscription_update( - client, - resource_group_name, - system_topic_name, - event_subscription_name, - endpoint=None, - endpoint_type=WEBHOOK_DESTINATION, - subject_begins_with=None, - subject_ends_with=None, - included_event_types=None, - advanced_filter=None, - labels=None, - deadletter_endpoint=None): - - instance = client.get(resource_group_name, system_topic_name, event_subscription_name) - - params = _update_event_subscription_internal( - instance=instance, - endpoint=endpoint, - endpoint_type=endpoint_type, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - included_event_types=included_event_types, - advanced_filter=advanced_filter, - labels=labels, - deadletter_endpoint=deadletter_endpoint, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None) - - return client.update( - resource_group_name, - system_topic_name, - event_subscription_name, - params) - - -def cli_partner_topic_event_subscription_update( - client, - resource_group_name, - partner_topic_name, - event_subscription_name, - endpoint=None, - endpoint_type=WEBHOOK_DESTINATION, - subject_begins_with=None, - subject_ends_with=None, - included_event_types=None, - advanced_filter=None, - labels=None, - deadletter_endpoint=None): - - instance = client.get(resource_group_name, partner_topic_name, event_subscription_name) - - params = _update_event_subscription_internal( - instance=instance, - endpoint=endpoint, - endpoint_type=endpoint_type, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - included_event_types=included_event_types, - advanced_filter=advanced_filter, - labels=labels, - deadletter_endpoint=deadletter_endpoint, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None) - - return client.update( - resource_group_name, - partner_topic_name, - event_subscription_name, - params) - - -def update_event_subscription( - instance, - endpoint=None, - endpoint_type=WEBHOOK_DESTINATION, - subject_begins_with=None, - subject_ends_with=None, - included_event_types=None, - advanced_filter=None, - labels=None, - deadletter_endpoint=None, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None): - return _update_event_subscription_internal( - instance=instance, - endpoint=endpoint, - endpoint_type=endpoint_type, - subject_begins_with=subject_begins_with, - subject_ends_with=subject_ends_with, - included_event_types=included_event_types, - advanced_filter=advanced_filter, - labels=labels, - deadletter_endpoint=deadletter_endpoint, - delivery_identity=delivery_identity, - delivery_identity_endpoint=delivery_identity_endpoint, - delivery_identity_endpoint_type=delivery_identity_endpoint_type, - deadletter_identity=deadletter_identity, - deadletter_identity_endpoint=deadletter_identity_endpoint) - - -def _update_event_subscription_internal( # pylint: disable=too-many-locals,too-many-statements - instance, - endpoint=None, - endpoint_type=WEBHOOK_DESTINATION, - subject_begins_with=None, - subject_ends_with=None, - included_event_types=None, - advanced_filter=None, - labels=None, - deadletter_endpoint=None, - delivery_identity=None, - delivery_identity_endpoint=None, - delivery_identity_endpoint_type=None, - deadletter_identity=None, - deadletter_identity_endpoint=None): - - condition1 = delivery_identity is not None and \ - (delivery_identity_endpoint is None or delivery_identity_endpoint_type is None) - condition2 = delivery_identity is None and \ - (delivery_identity_endpoint is not None or delivery_identity_endpoint_type is not None) - if endpoint is None and (condition1 or condition2): - raise CLIError('usage error: one or more delivery identity information is missing. ' - 'If delivery_identity is specified, both delivery_identity_endpoint and ' - 'delivery_identity_endpoint_type should be specified.') - - condition1 = deadletter_identity is not None and deadletter_identity_endpoint is None - condition2 = deadletter_identity is None and deadletter_identity_endpoint is not None - if condition1 or condition2: - raise CLIError('usage error: one or more deadletter identity information is missing. If ' - 'deadletter_identity is specified, deadletter_identity_endpoint should be specified.') - - event_subscription_destination = instance.destination - event_subscription_destination_with_resource_identity = None - - if instance.delivery_with_resource_identity is not None: - event_subscription_destination_with_resource_identity = instance.delivery_with_resource_identity.destination - - deadletter_destination = None - event_subscription_labels = instance.labels - event_subscription_filter = instance.filter - - event_delivery_schema = instance.event_delivery_schema - retry_policy = instance.retry_policy - - if endpoint_type.lower() != WEBHOOK_DESTINATION.lower() and endpoint is None: - raise CLIError('Invalid usage: Since --endpoint-type is specified, a valid endpoint must also be specified.') - - tennant_id = None - application_id = None - - # for the update path, endpoint_type can be None but it does not mean that this is webhook, - # as it can be other types too. - if event_subscription_destination is not None and \ - hasattr(event_subscription_destination, 'azure_active_directory_tenant_id'): - tennant_id = event_subscription_destination.azure_active_directory_tenant_id - - if event_subscription_destination is not None and \ - hasattr(event_subscription_destination, 'azure_active_directory_application_id_or_uri'): - application_id = event_subscription_destination.azure_active_directory_application_id_or_uri - - if event_subscription_destination_with_resource_identity is not None and \ - hasattr(event_subscription_destination_with_resource_identity, 'azure_active_directory_tenant_id'): - tennant_id = event_subscription_destination_with_resource_identity.azure_active_directory_tenant_id - - if event_subscription_destination_with_resource_identity is not None and \ - hasattr(event_subscription_destination_with_resource_identity, 'azure_active_directory_application_id_or_uri'): - application_id = \ - event_subscription_destination_with_resource_identity.azure_active_directory_application_id_or_uri - - max_events_per_batch = 0 - preferred_batch_size_in_kilobytes = 0 - - if event_subscription_destination is not None and \ - event_subscription_destination.endpoint_type is not None and (event_subscription_destination.endpoint_type.lower() == WEBHOOK_DESTINATION.lower() or event_subscription_destination.endpoint_type.lower() == AZUREFUNCTION_DESTINATION.lower()): # pylint: disable=line-too-long - max_events_per_batch = event_subscription_destination.max_events_per_batch - preferred_batch_size_in_kilobytes = event_subscription_destination.preferred_batch_size_in_kilobytes - - if event_subscription_destination_with_resource_identity is not None and \ - event_subscription_destination_with_resource_identity.endpoint_type is not None and (event_subscription_destination_with_resource_identity.endpoint_type.lower() == WEBHOOK_DESTINATION.lower() or event_subscription_destination_with_resource_identity.endpoint_type.lower() == AZUREFUNCTION_DESTINATION.lower()): # pylint: disable=line-too-long - max_events_per_batch = event_subscription_destination_with_resource_identity.max_events_per_batch - preferred_batch_size_in_kilobytes = event_subscription_destination_with_resource_identity.preferred_batch_size_in_kilobytes # pylint: disable=line-too-long - - if endpoint is not None: - event_subscription_destination = _get_endpoint_destination( - endpoint_type, - endpoint, - max_events_per_batch, - preferred_batch_size_in_kilobytes, - tennant_id, - application_id) - - delivery_with_resource_identity = None - - if delivery_identity_endpoint is not None: - identity_type_name = _get_event_subscription_identity_type(delivery_identity) - delivery_identity_info = EventSubscriptionIdentity(type=identity_type_name) - destination_with_identity = _get_endpoint_destination( - delivery_identity_endpoint_type, - delivery_identity_endpoint, - 0, - 0, - tennant_id, - application_id) - delivery_with_resource_identity = DeliveryWithResourceIdentity( - identity=delivery_identity_info, - destination=destination_with_identity) - - if deadletter_endpoint is not None: - deadletter_destination = _get_deadletter_destination(deadletter_endpoint) - - deadletter_with_resource_identity = None - - if deadletter_identity_endpoint is not None: - deadletter_destination_with_identity = _get_deadletter_destination(deadletter_identity_endpoint) - deadletter_identity_type_name = _get_event_subscription_identity_type(deadletter_identity) - deadletter_delivery_identity_info = EventSubscriptionIdentity(type=deadletter_identity_type_name) - deadletter_with_resource_identity = DeadLetterWithResourceIdentity( - identity=deadletter_delivery_identity_info, - dead_letter_destination=deadletter_destination_with_identity) - - if subject_begins_with is not None: - event_subscription_filter.subject_begins_with = subject_begins_with - - if subject_ends_with is not None: - event_subscription_filter.subject_ends_with = subject_ends_with - - if included_event_types is not None: - event_subscription_filter.included_event_types = included_event_types - - if advanced_filter is not None: - event_subscription_filter.advanced_filters = advanced_filter - - if labels is not None: - event_subscription_labels = labels - - params = EventSubscriptionUpdateParameters( - destination=event_subscription_destination, - filter=event_subscription_filter, - labels=event_subscription_labels, - retry_policy=retry_policy, - dead_letter_destination=deadletter_destination, - event_delivery_schema=event_delivery_schema, - delivery_with_resource_identity=delivery_with_resource_identity, - dead_letter_with_resource_identity=deadletter_with_resource_identity) - - return params - - -def _get_endpoint_destination( - endpoint_type, - endpoint, - max_events_per_batch, - preferred_batch_size_in_kilobytes, - azure_active_directory_tenant_id, - azure_active_directory_application_id_or_uri): - - if endpoint_type.lower() == WEBHOOK_DESTINATION.lower(): - destination = WebHookEventSubscriptionDestination( - endpoint_url=endpoint, - max_events_per_batch=max_events_per_batch, - preferred_batch_size_in_kilobytes=preferred_batch_size_in_kilobytes, - azure_active_directory_tenant_id=azure_active_directory_tenant_id, - azure_active_directory_application_id_or_uri=azure_active_directory_application_id_or_uri) - elif endpoint_type.lower() == EVENTHUB_DESTINATION.lower(): - destination = EventHubEventSubscriptionDestination(resource_id=endpoint) - elif endpoint_type.lower() == HYBRIDCONNECTION_DESTINATION.lower(): - destination = HybridConnectionEventSubscriptionDestination(resource_id=endpoint) - elif endpoint_type.lower() == STORAGEQUEUE_DESTINATION.lower(): - destination = _get_storage_queue_destination(endpoint) - elif endpoint_type.lower() == SERVICEBUSQUEUE_DESTINATION.lower(): - destination = ServiceBusQueueEventSubscriptionDestination(resource_id=endpoint) - elif endpoint_type.lower() == SERVICEBUSTOPIC_DESTINATION.lower(): - destination = ServiceBusTopicEventSubscriptionDestination(resource_id=endpoint) - elif endpoint_type.lower() == AZUREFUNCTION_DESTINATION.lower(): - destination = AzureFunctionEventSubscriptionDestination( - resource_id=endpoint, - max_events_per_batch=max_events_per_batch, - preferred_batch_size_in_kilobytes=preferred_batch_size_in_kilobytes) - return destination - - -def _get_storage_queue_destination(endpoint): - # Supplied endpoint would be in the following format: - # /subscriptions/.../storageAccounts/sa1/queueServices/default/queues/{queueName})) - # and we need to break it up into: - # /subscriptions/.../storageAccounts/sa1 and queueName - queue_items = re.split( - "/queueServices/default/queues/", endpoint, flags=re.IGNORECASE) - - if len(queue_items) != 2 or queue_items[0] is None or queue_items[1] is None: - raise CLIError('Argument Error: Expected format of --endpoint for storage queue is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/queueServices/default/queues/queueName') - - destination = StorageQueueEventSubscriptionDestination( - resource_id=queue_items[0], queue_name=queue_items[1]) - - return destination - - -def _get_deadletter_destination(deadletter_endpoint): - blob_items = re.split( - "/blobServices/default/containers/", deadletter_endpoint, flags=re.IGNORECASE) - - if len(blob_items) != 2 or blob_items[0] is None or blob_items[1] is None: - raise CLIError('Argument Error: Expected format of --deadletter-endpoint is:' + - '/subscriptions/id/resourceGroups/rg/providers/Microsoft.Storage/' + - 'storageAccounts/sa1/blobServices/default/containers/containerName') - - return StorageBlobDeadLetterDestination(resource_id=blob_items[0], blob_container_name=blob_items[1]) - - -def _validate_retry_policy(max_delivery_attempts, event_ttl): - if max_delivery_attempts < 1 or max_delivery_attempts > 30: - raise CLIError('--max-delivery-attempts should be a number between 1 and 30.') - - if event_ttl < 1 or event_ttl > 1440: - raise CLIError('--event-ttl should be a number between 1 and 1440.') - - -def _get_event_delivery_schema(event_delivery_schema): - if event_delivery_schema is None: - return None - if event_delivery_schema.lower() == EVENTGRID_SCHEMA.lower(): - event_delivery_schema = EVENTGRID_SCHEMA - elif event_delivery_schema.lower() == CUSTOM_INPUT_SCHEMA.lower(): - event_delivery_schema = CUSTOM_INPUT_SCHEMA - elif event_delivery_schema.lower() == CLOUDEVENTV1_0_SCHEMA.lower(): - event_delivery_schema = CLOUDEVENTV1_0_SCHEMA - else: - raise CLIError('usage error: --event-delivery-schema supported values are' - ' :' + EVENTGRID_SCHEMA + ',' + CUSTOM_INPUT_SCHEMA + - ',' + CLOUDEVENTV1_0_SCHEMA) - - return event_delivery_schema - - -def _warn_if_manual_handshake_needed(endpoint_type, endpoint): - # If the endpoint belongs to a service that we know implements the subscription validation - # handshake, there's no need to show this message, hence we check for those services - # before showing this message. This list includes Azure Automation, EventGrid Trigger based - # Azure functions, and Azure Logic Apps. - if endpoint is not None and endpoint_type.lower() == WEBHOOK_DESTINATION.lower() and \ - "azure-automation" not in endpoint.lower() and \ - "eventgridextension" not in endpoint.lower() and \ - "logic.azure" not in endpoint.lower(): - logger.warning('If the provided endpoint does not support subscription validation ' - 'handshake, navigate to the validation URL that you receive in the ' - 'subscription validation event, in order to complete the event ' - 'subscription creation or update. For more details, ' - 'please visit http://aka.ms/esvalidation') - - -def _get_sku(sku_name): - if sku_name.lower() == 'basic': - result = SKU_BASIC - elif sku_name.lower() == 'premium': - result = SKU_PREMIUM - - return result - - -def _get_identity_type(identity_type_name=IDENTITY_NONE): - if identity_type_name.lower() == IDENTITY_NO_IDENTITY.lower(): - result = IDENTITY_NONE - elif identity_type_name.lower() == IDENTITY_SYSTEM_ASSIGNED.lower(): - result = IDENTITY_SYSTEM_ASSIGNED - - return result - - -def _get_event_subscription_identity_type(identity_type_name): - result = None - if identity_type_name.lower() == IDENTITY_SYSTEM_ASSIGNED.lower(): - result = IDENTITY_SYSTEM_ASSIGNED - - return result - - -def _get_input_schema_and_mapping( - input_schema=EVENTGRID_SCHEMA, - input_mapping_fields=None, - input_mapping_default_values=None): - if input_schema.lower() == EVENTGRID_SCHEMA.lower(): - input_schema = EVENTGRID_SCHEMA - elif input_schema.lower() == CUSTOM_EVENT_SCHEMA.lower(): - input_schema = CUSTOM_EVENT_SCHEMA - elif input_schema.lower() == CLOUDEVENTV1_0_SCHEMA.lower(): - input_schema = CLOUDEVENTV1_0_SCHEMA - else: - raise CLIError('The provided --input-schema is not valid. The supported values are: ' + - EVENTGRID_SCHEMA + ',' + CUSTOM_EVENT_SCHEMA + ',' + CLOUDEVENTV1_0_SCHEMA) - - if input_schema == EVENTGRID_SCHEMA: - # Ensure that custom input mappings are not specified - if input_mapping_fields is not None or input_mapping_default_values is not None: - raise CLIError('--input-mapping-default-values and --input-mapping-fields should not be ' + - 'specified when --input-schema is set to eventgridschema.') - - if input_schema == CLOUDEVENTV1_0_SCHEMA: - # Ensure that input_mapping_default_values is not specified. - if input_mapping_default_values is not None: - raise CLIError('--input-mapping-default-values should be ' + - 'specified only when --input-schema is set to customeventschema.') - - if input_schema == CUSTOM_EVENT_SCHEMA: - # Ensure that custom input mappings are specified - if input_mapping_fields is None and input_mapping_default_values is None: - raise CLIError('Either --input-mapping-default-values or --input-mapping-fields must be ' + - 'specified when --input-schema is set to customeventschema.') - - input_schema_mapping = get_input_schema_mapping( - input_mapping_fields, - input_mapping_default_values) - - return input_schema, input_schema_mapping - - -def _list_event_subscriptions_by_resource_id(client, resource_id, oDataQuery, top): - # parse_resource_id doesn't handle resource_ids for Azure subscriptions and RGs - # so, first try to look for those two patterns. - if resource_id is not None: - id_parts = list(filter(None, resource_id.split('/'))) - if len(id_parts) < 5: - # Azure subscriptions or Resource group - if id_parts[0].lower() != "subscriptions": - raise CLIError('The specified value for resource-id is not in the' - ' expected format. It should start with /subscriptions.') - - subscription_id = id_parts[1] - _validate_subscription_id_matches_default_subscription_id( - default_subscription_id=client.config.subscription_id, - provided_subscription_id=subscription_id) - - if len(id_parts) == 2: - return client.list_global_by_subscription_for_topic_type( - "Microsoft.Resources.Subscriptions", - oDataQuery, - top) - - if len(id_parts) == 4 and id_parts[2].lower() == "resourcegroups": - resource_group_name = id_parts[3] - if resource_group_name is None: - raise CLIError('The specified value for resource-id is not' - ' in the expected format. A valid value for' - ' resource group must be provided.') - return client.list_global_by_resource_group_for_topic_type( - resource_group_name, - "Microsoft.Resources.ResourceGroups", - oDataQuery, - top) - - id_parts = parse_resource_id(resource_id) - subscription_id = id_parts.get('subscription') - _validate_subscription_id_matches_default_subscription_id( - default_subscription_id=client.config.subscription_id, - provided_subscription_id=subscription_id) - - rg_name = id_parts.get('resource_group') - resource_name = id_parts.get('name') - namespace = id_parts.get('namespace') - resource_type = id_parts.get('type') - - if (subscription_id is None or rg_name is None or resource_name is None or - namespace is None or resource_type is None): - raise CLIError('The specified value for resource-id is not' - ' in the expected format.') - - # If this is for a domain topic, invoke the appropriate operation - if (namespace.lower() == EVENTGRID_NAMESPACE.lower() and resource_type.lower() == EVENTGRID_DOMAINS.lower()): - child_resource_type = id_parts.get('child_type_1') - child_resource_name = id_parts.get('child_name_1') - - if (child_resource_type is not None and child_resource_type.lower() == EVENTGRID_TOPICS.lower() and - child_resource_name is not None): - return client.list_by_domain_topic(rg_name, resource_name, child_resource_name, oDataQuery, top) - - # Not a domain topic, invoke the standard list_by_resource - return client.list_by_resource( - rg_name, - namespace, - resource_type, - resource_name, - oDataQuery, - top) - - -def _is_topic_type_global_resource(topic_type_name): - # TODO: Add here if any other global topic types get added in the future. - TOPIC_TYPE_AZURE_SUBSCRIPTIONS = "Microsoft.Resources.Subscriptions" - TOPIC_TYPE_AZURE_RESOURCE_GROUP = "Microsoft.Resources.ResourceGroups" - TOPIC_TYPE_MAPS_ACCOUNTS = "Microsoft.Maps.Accounts" - - if (topic_type_name.lower() == TOPIC_TYPE_AZURE_SUBSCRIPTIONS.lower() or - topic_type_name.lower() == TOPIC_TYPE_MAPS_ACCOUNTS or - topic_type_name.lower() == TOPIC_TYPE_AZURE_RESOURCE_GROUP.lower()): - return True - - return False - - -def _validate_subscription_id_matches_default_subscription_id( - default_subscription_id, - provided_subscription_id): - # The CLI/SDK infrastructure doesn't support overriding the subscription ID. - # Hence, we validate that the provided subscription ID is the same as the default - # configured subscription. - if provided_subscription_id.lower() != default_subscription_id.lower(): - raise CLIError('The subscription ID in the specified resource-id' - ' does not match the default subscription ID. To set the default subscription ID,' - ' use az account set ID_OR_NAME, or use the global argument --subscription ') - class NamespaceListKey(_NamespaceListKey): def _output(self, *args, **kwargs): diff --git a/src/eventgrid/azext_eventgrid/event_channel_filter.py b/src/eventgrid/azext_eventgrid/event_channel_filter.py deleted file mode 100644 index 99b65ac4910..00000000000 --- a/src/eventgrid/azext_eventgrid/event_channel_filter.py +++ /dev/null @@ -1,97 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import argparse -from knack.util import CLIError - -from azext_eventgrid.vendored_sdks.eventgrid.models import ( - NumberGreaterThanAdvancedFilter, - NumberGreaterThanOrEqualsAdvancedFilter, - NumberInAdvancedFilter, - NumberLessThanAdvancedFilter, - NumberLessThanOrEqualsAdvancedFilter, - NumberNotInAdvancedFilter, - StringBeginsWithAdvancedFilter, - StringContainsAdvancedFilter, - StringEndsWithAdvancedFilter, - StringInAdvancedFilter, - StringNotInAdvancedFilter, - BoolEqualsAdvancedFilter) - -NUMBERIN = "NumberIn" -NUMBERNOTIN = "NumberNotIn" -STRINGIN = "StringIn" -STRINGNOTIN = "StringNotIn" -STRINGBEGINSWITH = "StringBeginsWith" -STRINGCONTAINS = "StringContains" -STRINGENDSWITH = "StringEndsWith" -NUMBERGREATERTHAN = "NumberGreaterThan" -NUMBERGREATERTHANOREQUALS = "NumberGreaterThanOrEquals" -NUMBERLESSTHAN = "NumberLessThan" -NUMBERLESSTHANOREQUALS = "NumberLessThanOrEquals" -BOOLEQUALS = "BoolEquals" - - -# pylint: disable=protected-access -# pylint: disable=too-few-public-methods -class EventChannelAddFilter(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - if len(values) < 3: - raise CLIError('usage error: --publisher-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]') - - key = values[0] - operator = values[1] - -# operators that support single value - if operator.lower() == NUMBERLESSTHAN.lower(): - _validate_only_single_value_is_specified(NUMBERLESSTHAN, values) - publisher_filter = NumberLessThanAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERLESSTHANOREQUALS.lower(): - _validate_only_single_value_is_specified(NUMBERLESSTHANOREQUALS, values) - publisher_filter = NumberLessThanOrEqualsAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERGREATERTHAN.lower(): - _validate_only_single_value_is_specified(NUMBERGREATERTHAN, values) - publisher_filter = NumberGreaterThanAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == NUMBERGREATERTHANOREQUALS.lower(): - _validate_only_single_value_is_specified(NUMBERGREATERTHANOREQUALS, values) - publisher_filter = NumberGreaterThanOrEqualsAdvancedFilter(key=key, value=float(values[2])) - elif operator.lower() == BOOLEQUALS.lower(): - _validate_only_single_value_is_specified(BOOLEQUALS, values) - publisher_filter = BoolEqualsAdvancedFilter(key=key, value=bool(values[2])) - -# operators that support multiple values - elif operator.lower() == NUMBERIN.lower(): - float_values = [float(i) for i in values[2:]] - publisher_filter = NumberInAdvancedFilter(key=key, values=float_values) - elif operator.lower() == NUMBERNOTIN.lower(): - float_values = [float(i) for i in values[2:]] - publisher_filter = NumberNotInAdvancedFilter(key=key, values=float_values) - elif operator.lower() == STRINGIN.lower(): - publisher_filter = StringInAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGNOTIN.lower(): - publisher_filter = StringNotInAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGBEGINSWITH.lower(): - publisher_filter = StringBeginsWithAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGENDSWITH.lower(): - publisher_filter = StringEndsWithAdvancedFilter(key=key, values=values[2:]) - elif operator.lower() == STRINGCONTAINS.lower(): - publisher_filter = StringContainsAdvancedFilter(key=key, values=values[2:]) - else: - raise CLIError("--publisher-filter: The specified filter operator '{}' is not" - " a valid operator. Supported values are ".format(operator) + - NUMBERIN + "," + NUMBERNOTIN + "," + STRINGIN + "," + - STRINGNOTIN + "," + STRINGBEGINSWITH + "," + - STRINGCONTAINS + "," + STRINGENDSWITH + "," + - NUMBERGREATERTHAN + "," + NUMBERGREATERTHANOREQUALS + "," + - NUMBERLESSTHAN + "," + NUMBERLESSTHANOREQUALS + "," + BOOLEQUALS + ".") - if namespace.publisher_filter is None: - namespace.publisher_filter = [] - namespace.publisher_filter.append(publisher_filter) - - -def _validate_only_single_value_is_specified(operator_type, values): - if len(values) != 3: - raise CLIError("--publisher-filter: For '{}' operator, only one filter value " - "must be specified.".format(operator_type)) diff --git a/src/eventgrid/azext_eventgrid/inbound_ip_rules.py b/src/eventgrid/azext_eventgrid/inbound_ip_rules.py deleted file mode 100644 index 7b1d63fe038..00000000000 --- a/src/eventgrid/azext_eventgrid/inbound_ip_rules.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import argparse -from knack.util import CLIError - -from azext_eventgrid.vendored_sdks.eventgrid.models import ( - InboundIpRule) - - -# pylint: disable=protected-access -# pylint: disable=too-few-public-methods -class AddInboundIpRule(argparse._AppendAction): - def __call__(self, parser, namespace, values, option_string=None): - if len(values) < 2: - raise CLIError('usage error: --inbound-ip-rules has IP Address in CIDR notation and corresponding Action.') - - ipmask = values[0] - action = values[1] - inbound_ip_rule = InboundIpRule(ip_mask=ipmask, action=action) - - if namespace.inbound_ip_rules is None: - namespace.inbound_ip_rules = [] - namespace.inbound_ip_rules.append(inbound_ip_rule) diff --git a/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_namespace_client_and_client_group.yaml b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_namespace_client_and_client_group.yaml new file mode 100644 index 00000000000..5428813fec9 --- /dev/null +++ b/src/eventgrid/azext_eventgrid/tests/latest/recordings/test_namespace_client_and_client_group.yaml @@ -0,0 +1,959 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_eventgrid_namespace_client_and_client_group000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001","name":"test_eventgrid_namespace_client_and_client_group000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_namespace_client_and_client_group","date":"2024-12-16T08:24:34Z","module":"eventgrid"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '455' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:25:28 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: B601CAC5E09242EDBF281B5FAA41C979 Ref B: MAA201060516051 Ref C: 2024-12-16T08:25:29Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"topicSpacesConfiguration": {"maximumSessionExpiryInHours": + 1, "state": "Enabled"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + Content-Length: + - '122' + Content-Type: + - application/json + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Creating","topicSpacesConfiguration":{"state":"Enabled","hostname":null,"maximumSessionExpiryInHours":1},"isZoneRedundant":true,"publicNetworkAccess":"Enabled","inboundIpRules":null,"minimumTlsVersionAllowed":"1.2"},"sku":null,"systemData":null,"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002","name":"name000002","type":"Microsoft.EventGrid/namespaces"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:25:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-writes: + - '2999' + x-ms-ratelimit-remaining-subscription-writes: + - '199' + x-msedge-ref: + - 'Ref A: 049CFF3C50754EB98C8487F7540F791F Ref B: MAA201060516023 Ref C: 2024-12-16T08:25:30Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + response: + body: + string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview","name":"acf87f77-f5b4-46df-b988-2c888d4857f2","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:25:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: B2899D14AC99485AAFCBD0E7DC0976E4 Ref B: MAA201060516023 Ref C: 2024-12-16T08:25:36Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + response: + body: + string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview","name":"acf87f77-f5b4-46df-b988-2c888d4857f2","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:26:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 85601D30E0734805B4713BDC7B69B3C6 Ref B: MAA201060516023 Ref C: 2024-12-16T08:26:07Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + response: + body: + string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview","name":"acf87f77-f5b4-46df-b988-2c888d4857f2","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:26:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 2FF6B94F92734812848BFE118974B9DE Ref B: MAA201060516023 Ref C: 2024-12-16T08:26:39Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + response: + body: + string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview","name":"acf87f77-f5b4-46df-b988-2c888d4857f2","status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 2AEB9B8BB93742E79C010075F371A726 Ref B: MAA201060516023 Ref C: 2024-12-16T08:27:11Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview&t=638699343359310510&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9DTzFQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA1LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQ08xUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNS5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0NPMVBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3J0MB0GA1UdDgQWBBT07kfCxeuv0whuO9NP27UpdS8ZAzAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDUuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=k9uwPoScLEYiZdtvVPpsZGtZD3C8WjsTTTbQzeTjwCa27C8FroEvSd6xP_8wUBBDJ2v8yPWpGGCuZ5dbWsgMhacjwsg1FCr86XpuINXMC9EXAYM2lP4Gm7-MFHmTNlfAUZnkLpWdHanhiIvv5BhX3ocUrXxfJMaUkRA0AzXVPBuC7_aw6Fq0xJWYr4631pepZfhgQ_36JOTgDzk5Vkte2yd9gUzsUlho3W7_l73nUbMGJxjKWpAme-zlPoHj-tnM0p5a_OFnz7F9JCgSpMgTeP0hb5wEhz8yEBC2mb64kG7CKW1EH1kFj-bgHUqZyUids65d28HfTPPUa7lO4a0s6Q&h=clLgfx4rl-f1rkDRiQPdA2i96MlroONIiSZNQbdEDw0 + response: + body: + string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventGrid/locations/eastus/operationsStatus/ACF87F77-F5B4-46DF-B988-2C888D4857F2?api-version=2023-06-01-preview","name":"acf87f77-f5b4-46df-b988-2c888d4857f2","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '287' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: D134EA64792C4F05AED4CA568200C50F Ref B: MAA201060516023 Ref C: 2024-12-16T08:27:42Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --topic-spaces-configuration + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","topicsConfiguration":{"hostname":"name000002.eastus-1.eventgrid.azure.net"},"topicSpacesConfiguration":{"state":"Enabled","hostname":"name000002.eastus-1.ts.eventgrid.azure.net","maximumSessionExpiryInHours":1,"maximumClientSessionsPerAuthenticationName":1},"isZoneRedundant":true,"publicNetworkAccess":"Enabled","inboundIpRules":null,"minimumTlsVersionAllowed":"1.2"},"sku":{"name":"Standard","capacity":1},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:25:33.0872679Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:25:33.0872679Z"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002","name":"name000002","type":"Microsoft.EventGrid/namespaces"}' + headers: + cache-control: + - no-cache + content-length: + - '967' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: D983A3E7424A49969C0297EF5C3DB3C2 Ref B: MAA201060516023 Ref C: 2024-12-16T08:27:44Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"attributes": {"room": "345", "floor": 5}, "clientCertificateAuthentication": + {"validationScheme": "SubjectMatchesAuthenticationName"}, "state": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client create + Connection: + - keep-alive + Content-Length: + - '172' + Content-Type: + - application/json + ParameterSetName: + - -g --namespace-name -n --attributes --client-certificate-authentication + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":null,"authenticationName":"client000003","clientCertificateAuthentication":{"validationScheme":"SubjectMatchesAuthenticationName"},"state":"Enabled","attributes":{"room":"345","floor":5},"provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:27:48.1611979Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:27:48.1611979Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003","name":"client000003","type":"Microsoft.EventGrid/namespaces/clients"}' + headers: + cache-control: + - no-cache + content-length: + - '780' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + x-msedge-ref: + - 'Ref A: A82A7F490AB34E798AA855B9A2CA29FB Ref B: MAA201060515029 Ref C: 2024-12-16T08:27:47Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client update + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name -n --attributes --description + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":null,"authenticationName":"client000003","clientCertificateAuthentication":{"validationScheme":"SubjectMatchesAuthenticationName"},"state":"Enabled","attributes":{"room":"345","floor":5},"provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:27:48.1611979Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:27:48.1611979Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003","name":"client000003","type":"Microsoft.EventGrid/namespaces/clients"}' + headers: + cache-control: + - no-cache + content-length: + - '780' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + x-msedge-ref: + - 'Ref A: AF4446BACF93493AB9867BBCBE79CAA9 Ref B: MAA201060516019 Ref C: 2024-12-16T08:27:51Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"attributes": {"room": "456", "floor": 6}, "authenticationName": + "client000003", "clientCertificateAuthentication": {"validationScheme": "SubjectMatchesAuthenticationName"}, + "description": "test", "state": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client update + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json + ParameterSetName: + - -g --namespace-name -n --attributes --description + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test","authenticationName":"client000003","clientCertificateAuthentication":{"validationScheme":"SubjectMatchesAuthenticationName"},"state":"Enabled","attributes":{"room":"456","floor":6},"provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:27:48.1611979Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:27:54.2366253Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003","name":"client000003","type":"Microsoft.EventGrid/namespaces/clients"}' + headers: + cache-control: + - no-cache + content-length: + - '782' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + x-msedge-ref: + - 'Ref A: B93871E2BCCF45C499CDAA2ABF288C4D Ref B: MAA201060516019 Ref C: 2024-12-16T08:27:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client show + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name -n + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test","authenticationName":"client000003","clientCertificateAuthentication":{"validationScheme":"SubjectMatchesAuthenticationName"},"state":"Enabled","attributes":{"room":"456","floor":6},"provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:27:48.1611979Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:27:54.2366253Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003","name":"client000003","type":"Microsoft.EventGrid/namespaces/clients"}' + headers: + cache-control: + - no-cache + content-length: + - '782' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:27:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + x-msedge-ref: + - 'Ref A: 2880B14D46C04BB491A7BC6B88B0D6C3 Ref B: MAA201060515017 Ref C: 2024-12-16T08:27:57Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client list + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients?api-version=2023-06-01-preview + response: + body: + string: '{"value":[{"properties":{"description":"test","authenticationName":"client000003","clientCertificateAuthentication":{"validationScheme":"SubjectMatchesAuthenticationName"},"state":"Enabled","attributes":{"room":"456","floor":6},"provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:27:48.1611979Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:27:54.2366253Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003","name":"client000003","type":"Microsoft.EventGrid/namespaces/clients"}]}' + headers: + cache-control: + - no-cache + content-length: + - '794' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + x-msedge-ref: + - 'Ref A: 9BF16DF8A4C74C098308E3F3E6AD321A Ref B: MAA201060514011 Ref C: 2024-12-16T08:27:59Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "test", "query": "attributes.floor = 6"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group create + Connection: + - keep-alive + Content-Length: + - '72' + Content-Type: + - application/json + ParameterSetName: + - -g --namespace-name -n --description --group-query + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test","query":"attributes.floor = 6","provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:28:03.012104Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:28:03.012104Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004","name":"group000004","type":"Microsoft.EventGrid/namespaces/clientGroups"}' + headers: + cache-control: + - no-cache + content-length: + - '637' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-writes: + - '2999' + x-ms-ratelimit-remaining-subscription-writes: + - '199' + x-msedge-ref: + - 'Ref A: B65632E6DC13408D81F81C3529450D05 Ref B: MAA201060515019 Ref C: 2024-12-16T08:28:02Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group update + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name -n --description --group-query + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test","query":"attributes.floor = 6","provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:28:03.012104Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:28:03.012104Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004","name":"group000004","type":"Microsoft.EventGrid/namespaces/clientGroups"}' + headers: + cache-control: + - no-cache + content-length: + - '637' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 84833810138F4214814BC13FB6A6FF8A Ref B: MAA201060514035 Ref C: 2024-12-16T08:28:05Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "test1", "query": "attributes.floor = 7"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group update + Connection: + - keep-alive + Content-Length: + - '73' + Content-Type: + - application/json + ParameterSetName: + - -g --namespace-name -n --description --group-query + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test1","query":"attributes.floor = 7","provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:28:03.012104Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:28:08.7550654Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004","name":"group000004","type":"Microsoft.EventGrid/namespaces/clientGroups"}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:10 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-writes: + - '2999' + x-ms-ratelimit-remaining-subscription-writes: + - '199' + x-msedge-ref: + - 'Ref A: 9FBD7132E4C44AC8866C450D09A31209 Ref B: MAA201060514035 Ref C: 2024-12-16T08:28:08Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group show + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name -n + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004?api-version=2023-06-01-preview + response: + body: + string: '{"properties":{"description":"test1","query":"attributes.floor = 7","provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:28:03.012104Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:28:08.7550654Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004","name":"group000004","type":"Microsoft.EventGrid/namespaces/clientGroups"}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 6E1F8EDB138843D3B43BE49112C73D0E Ref B: MAA201060514023 Ref C: 2024-12-16T08:28:11Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group list + Connection: + - keep-alive + ParameterSetName: + - -g --namespace-name + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups?api-version=2023-06-01-preview + response: + body: + string: '{"value":[{"properties":{"description":"Default group with all clients.","query":"true","provisioningState":"Succeeded"},"systemData":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/$all","name":"$all","type":"Microsoft.EventGrid/namespaces/clientGroups"},{"properties":{"description":"test1","query":"attributes.floor + = 7","provisioningState":"Succeeded"},"systemData":{"createdBy":"yishiwang@microsoft.com","createdByType":"User","createdAt":"2024-12-16T08:28:03.012104Z","lastModifiedBy":"yishiwang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-12-16T08:28:08.7550654Z"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TEST_EVENTGRID_NAMESPACE_CLIENT_AND_CLIENT_GROUPUS2HZQYJI2IGUVZA5Z5J5E3CQMJ/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004","name":"group000004","type":"Microsoft.EventGrid/namespaces/clientGroups"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1068' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 16 Dec 2024 08:28:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '3749' + x-msedge-ref: + - 'Ref A: 8AB4D5861ED7445699F99623A16E5560 Ref B: MAA201060514053 Ref C: 2024-12-16T08:28:14Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client-group delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --namespace-name -n -y + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clientGroups/group000004?api-version=2023-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 16 Dec 2024 08:28:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '199' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '2999' + x-msedge-ref: + - 'Ref A: B4025F62E1E841899E4EF7174BDC876F Ref B: MAA201060516035 Ref C: 2024-12-16T08:28:16Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - eventgrid namespace client delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --namespace-name -y + User-Agent: + - AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.9.13 (Windows-10-10.0.23570-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_eventgrid_namespace_client_and_client_group000001/providers/Microsoft.EventGrid/namespaces/name000002/clients/client000003?api-version=2023-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 16 Dec 2024 08:28:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '199' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '2999' + x-msedge-ref: + - 'Ref A: 2CF0C2567B364750A5DACA51E22DE018 Ref B: MAA201060514031 Ref C: 2024-12-16T08:28:19Z' + status: + code: 200 + message: OK +version: 1 diff --git a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py index 9c337f02ed5..a06fa3c1755 100644 --- a/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py +++ b/src/eventgrid/azext_eventgrid/tests/latest/test_eventgrid_commands.py @@ -4,1483 +4,7 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -import unittest -import uuid - -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer -from knack.util import CLIError -from datetime import datetime, timedelta - - -class EventGridTests(ScenarioTest): - @unittest.skip('Will be re-enabled once global operations are enabled for 2020-01-01-preview API version') - def test_topic_types(self): - - self.kwargs.update({ - 'topic_type_name': 'Microsoft.Resources.Subscriptions' - }) - - self.cmd('az eventgrid topic-type list', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/topicTypes') - ]) - self.cmd('az eventgrid topic-type show --name {topic_type_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/topicTypes'), - self.check('name', self.kwargs['topic_type_name']) - ]) - self.cmd('az eventgrid topic-type list-event-types --name {topic_type_name}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/topicTypes/eventTypes') - ]) - - @ResourceGroupPreparer() - def test_create_domain(self, resource_group): - - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - domain_name = self.create_random_name(prefix='cli', length=40) - domain_name2 = self.create_random_name(prefix='cli', length=40) - domain_name3 = self.create_random_name(prefix='cli', length=40) - domain_name4 = self.create_random_name(prefix='cli', length=40) - - domain_topic_name1 = self.create_random_name(prefix='cli', length=40) - domain_topic_name2 = self.create_random_name(prefix='cli', length=40) - - event_subscription_name = self.create_random_name(prefix='cli', length=40) - - self.kwargs.update({ - 'domain_name': domain_name, - 'domain_name2': domain_name2, - 'domain_name3': domain_name3, - 'domain_name4': domain_name4, - 'domain_topic_name1': domain_topic_name1, - 'domain_topic_name2': domain_topic_name2, - 'location': 'centraluseuap', - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl - }) - - self.kwargs['resource_id'] = self.cmd('az eventgrid domain create --name {domain_name} --resource-group {rg} --location {location}', checks=[ - self.check('type', 'Microsoft.EventGrid/domains'), - self.check('name', self.kwargs['domain_name']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - ]).get_output_in_json()['id'] - - self.cmd('az eventgrid domain show --name {domain_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/domains'), - self.check('name', self.kwargs['domain_name']), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - ]) - - # Test various failure conditions - # Input mappings cannot be provided when input schema is not customeventschema - with self.assertRaises(CLIError): - self.cmd('az eventgrid domain create --name {domain_name2} --resource-group {rg} --location {location} --input-schema eventgridschema --input-mapping-fields domain=mydomainField') - - # Input mappings must be provided when input schema is customeventschema - with self.assertRaises(CLIError): - self.cmd('az eventgrid domain create --name {domain_name2} --resource-group {rg} --location {location} --input-schema customeventschema') - - self.cmd('az eventgrid domain create --name {domain_name2} --resource-group {rg} --location {location} --input-schema CloudEventSchemaV1_0', checks=[ - self.check('type', 'Microsoft.EventGrid/domains'), - self.check('name', self.kwargs['domain_name2']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - ]) - - # Comment this test until we fix service side bug. - # self.cmd('az eventgrid domain create --name {domain_name3} --resource-group {rg} --location {location} --input-schema Customeventschema --input-mapping-fields domain=mydomainField eventType=myEventTypeField topic=myTopic --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 --identity=NoidentiTY', checks=[ - # self.check('type', 'Microsoft.EventGrid/domains'), - # self.check('name', self.kwargs['domain_name3']), - # self.check('provisioningState', 'Succeeded'), - # self.check('identity.type', 'None'), - # self.check('identity.userAssignedIdentities', None), - # self.check('identity.principalId', None), - # self.check('identity.tenantId', None), - # ]) - - outputdomain = self.cmd('az eventgrid domain create --name {domain_name4} --resource-group {rg} --location {location} --inbound-ip-rules 19.12.43.90/15 allow --inbound-ip-rules 19.12.43.70/11 allow --public-network-access disabled --identity systemassigned').get_output_in_json() - self.check(outputdomain['type'], 'Microsoft.EventGrid/domains') - self.check(outputdomain['name'], self.kwargs['domain_name4']) - self.check(outputdomain['publicNetworkAccess'], 'Disabled') - self.check(outputdomain['inboundIpRules'][0], '19.12.43.90/102') - self.check(outputdomain['inboundIpRules'][1], '19.12.43.70/81') - self.check(outputdomain['provisioningState'], 'Succeeded') - self.check(outputdomain['sku'], 'Basic') - self.check(outputdomain['publicNetworkAccess'], 'Disabled') - self.check(outputdomain['identity'], 'SystemAssigned') - - self.cmd('az eventgrid domain update --name {domain_name4} --resource-group {rg} --tags Dept=IT --sku baSIc', checks=[ - self.check('name', self.kwargs['domain_name4']), - self.check('tags', {'Dept': 'IT'}), - self.check('sku', {'name': 'Basic'}), - self.check('type', 'Microsoft.EventGrid/domains'), - self.check('publicNetworkAccess', 'Disabled'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid domain list --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/domains'), - self.check('[0].name', self.kwargs['domain_name']), - self.check('[0].provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid domain update --name {domain_name4} --resource-group {rg} --tags Dept=Finance --identity NoIDENTIty', checks=[ - self.check('name', self.kwargs['domain_name4']), - self.check('tags', {'Dept': 'Finance'}), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - self.check('type', 'Microsoft.EventGrid/domains'), - self.check('publicNetworkAccess', 'Disabled'), - self.check('provisioningState', 'Succeeded') - ]) - - out2 = self.cmd('az eventgrid domain list --resource-group {rg} --odata-query "name eq \'{domain_name}\'"').get_output_in_json() - self.assertIsNotNone(out2[0]['type']) - self.assertIsNotNone(out2[0]['name']) - self.check(out2[0]['type'], 'Microsoft.EventGrid/domains') - self.check(out2[0]['name'], self.kwargs['domain_name']) - self.check(out2[0]['provisioningState'], 'Succeeded') - - output = self.cmd('az eventgrid domain key list --name {domain_name} --resource-group {rg}').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - output = self.cmd('az eventgrid domain key regenerate --name {domain_name} --resource-group {rg} --key-name key1').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - self.cmd('az eventgrid domain key regenerate --name {domain_name} --resource-group {rg} --key-name key2').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - # Event subscriptions to domain with All for --included-event-types. - - self.cmd('az eventgrid event-subscription create --source-resource-id {resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --included-event-types All', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {resource_id} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {resource_id} --name {event_subscription_name} --include-full-endpoint-url', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription update --source-resource-id {resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {resource_id}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {resource_id} --name {event_subscription_name}') - - # Event subscriptions to a domain topic - self.kwargs.update({ - 'domain_topic_resource_id': self.kwargs['resource_id'] + "/topics/" + self.kwargs['domain_topic_name1'] - }) - - self.cmd('az eventgrid event-subscription create --source-resource-id {domain_topic_resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {domain_topic_resource_id} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - ]) - - # Create domain topics under domain - - self.kwargs['resource_id_domain_topic2'] = self.cmd('az eventgrid domain topic create --resource-group {rg} --domain-name {domain_name} --name {domain_topic_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/domains/topics'), - self.check('name', self.kwargs['domain_topic_name2']), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid domain topic show --resource-group {rg} --domain-name {domain_name} --name {domain_topic_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/domains/topics'), - self.check('name', self.kwargs['domain_topic_name2']), - self.check('provisioningState', 'Succeeded') - ]) - - # Now that an event subscription to a domain topic has been created, it would have internally resulted in creation of - # the corresponding auto-managed domain topic. Hence, we should now be able to list the set of domain topics under the domain. - # In the future, we can expand this to support CRUD operations for domain topics (i.e. manual management of domain topics) directly. - self.cmd('az eventgrid domain topic list --resource-group {rg} --domain-name {domain_name}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/domains/topics') - ]) - - self.cmd('az eventgrid domain topic list --resource-group {rg} --domain-name {domain_name} --odata-query "name ne \'{domain_topic_name2}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/domains/topics') - ]) - - self.cmd('az eventgrid domain topic show --resource-group {rg} --domain-name {domain_name} --name {domain_topic_name1}', checks=[ - self.check('type', 'Microsoft.EventGrid/domains/topics'), - self.check('id', self.kwargs['domain_topic_resource_id']), - self.check('name', self.kwargs['domain_topic_name1']), - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {domain_topic_resource_id} --name {event_subscription_name} --include-full-endpoint-url', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription update --source-resource-id {domain_topic_resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {domain_topic_resource_id}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {domain_topic_resource_id} --odata-query "CONTAINS(name, \'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {domain_topic_resource_id} --name {event_subscription_name}') - - self.cmd('az eventgrid domain topic delete --domain-name {domain_name} --name {domain_topic_name1} --resource-group {rg}') - self.cmd('az eventgrid domain topic delete --domain-name {domain_name} --name {domain_topic_name2} --resource-group {rg}') - - self.cmd('az eventgrid domain delete --name {domain_name} --resource-group {rg}') - self.cmd('az eventgrid domain delete --name {domain_name2} --resource-group {rg}') - self.cmd('az eventgrid domain delete --name {domain_name3} --resource-group {rg}') - - @ResourceGroupPreparer() - def test_create_topic(self, resource_group): - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - topic_name = self.create_random_name(prefix='cli', length=40) - topic_name2 = self.create_random_name(prefix='cli', length=40) - topic_name3 = self.create_random_name(prefix='cli', length=40) - topic_name4 = self.create_random_name(prefix='cli', length=40) - event_subscription_name = self.create_random_name(prefix='cli', length=40) - - self.kwargs.update({ - 'topic_name': topic_name, - 'topic_name2': topic_name2, - 'topic_name3': topic_name3, - 'topic_name4': topic_name4, - 'location': 'centraluseuap', - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl - }) - - scope = self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location}', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - ]).get_output_in_json()['id'] - - self.cmd('az eventgrid topic show --name {topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - ]) - - self.kwargs.update({ - 'scope': scope, - }) - - # Test various failure conditions - - # Input mappings cannot be provided when input schema is not customeventschema - with self.assertRaises(CLIError): - self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema eventgridschema --input-mapping-fields topic=myTopicField') - - # Input mappings must be provided when input schema is customeventschema - with self.assertRaises(CLIError): - self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema customeventschema') - - self.cmd('az eventgrid topic create --name {topic_name2} --resource-group {rg} --location {location} --input-schema CloudEventSchemaV1_0', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name2']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}) - ]) - - # commenting this out until we fix bug in service. - # self.cmd('az eventgrid topic create --name {topic_name3} --resource-group {rg} --location {location} --input-schema Customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0 --identity noIDentitY', checks=[ - # self.check('type', 'Microsoft.EventGrid/topics'), - # self.check('name', self.kwargs['topic_name3']), - # self.check('provisioningState', 'Succeeded'), - # self.check('identity', None) - # ]) - - outputtopic = self.cmd('az eventgrid topic create --name {topic_name4} --resource-group {rg} --location {location} --public-network-access disabled --inbound-ip-rules 19.12.43.90/12 allow --inbound-ip-rules 19.12.43.70/20 allow --sku BASic --identity systemassigned').get_output_in_json() - self.check(outputtopic['type'], 'Microsoft.EventGrid/topics') - self.check(outputtopic['name'], self.kwargs['topic_name4']) - self.check(outputtopic['publicNetworkAccess'], 'Disabled') - self.check(outputtopic['inboundIpRules'][0], '19.12.43.90/102') - self.check(outputtopic['inboundIpRules'][1], '19.12.43.70/81') - self.check(outputtopic['provisioningState'], 'Succeeded') - self.check(outputtopic['sku'], 'Basic') - self.check(outputtopic['identity'], 'SystemAssigned') - - self.cmd('az eventgrid topic update --name {topic_name4} --resource-group {rg} --tags Dept=IT', checks=[ - self.check('name', self.kwargs['topic_name4']), - self.check('tags', {'Dept': 'IT'}), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'SystemAssigned'), - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('publicNetworkAccess', 'Disabled'), - self.check('provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid topic update --name {topic_name4} --resource-group {rg} --tags Dept=Finance --sku BaSIC --identity NoIDENTIty', checks=[ - self.check('name', self.kwargs['topic_name4']), - self.check('tags', {'Dept': 'Finance'}), - self.check('sku', {'name': 'Basic'}), - self.check('identity.type', 'None'), - self.check('identity.userAssignedIdentities', None), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('publicNetworkAccess', 'Disabled'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid topic list --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/topics'), - self.check('[0].name', self.kwargs['topic_name']), - ]) - - self.cmd('az eventgrid topic list --resource-group {rg} --odata-query "name eq \'{topic_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/topics'), - self.check('[0].name', self.kwargs['topic_name']), - ]) - - output = self.cmd('az eventgrid topic key list --name {topic_name} --resource-group {rg}').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - output = self.cmd('az eventgrid topic key regenerate --name {topic_name} --resource-group {rg} --key-name key1').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - self.cmd('az eventgrid topic key regenerate --name {topic_name} --resource-group {rg} --key-name key2').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {scope} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {scope} --name {event_subscription_name} --include-full-endpoint-url', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription update --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {scope}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {scope} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.EventGrid.Topics --location {location}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.EventGrid.Topics --location {location} --odata-query "CONTAINS(name,\'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {scope} --name {event_subscription_name}') - - self.cmd('az eventgrid topic delete --name {topic_name} --resource-group {rg}') - - @ResourceGroupPreparer() - def test_create_system_topic(self, resource_group): - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - system_topic_name = self.create_random_name(prefix='cli', length=40) - system_topic_name2 = self.create_random_name(prefix='cli', length=40) - system_topic_name3 = self.create_random_name(prefix='cli', length=40) - system_topic_name4 = self.create_random_name(prefix='cli', length=40) - event_subscription_name = self.create_random_name(prefix='cli', length=40) - - self.kwargs.update({ - 'system_topic_name': system_topic_name, - 'system_topic_name2': system_topic_name2, - 'system_topic_name3': system_topic_name3, - 'system_topic_name4': system_topic_name4, - 'location': 'centraluseuap', - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl - }) - - scope = self.cmd('az eventgrid system-topic create --name {system_topic_name} --resource-group devexprg --location {location} --topic-type microsoft.storage.storageaccounts --source /subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/devexprg/providers/Microsoft.Storage/storageAccounts/clistgaccount', checks=[ - self.check('type', 'Microsoft.EventGrid/systemTopics'), - self.check('name', self.kwargs['system_topic_name']), - self.check('provisioningState', 'Succeeded') - ]).get_output_in_json()['id'] - - self.cmd('az eventgrid system-topic show --name {system_topic_name} --resource-group devexprg', checks=[ - self.check('type', 'Microsoft.EventGrid/systemTopics'), - self.check('name', self.kwargs['system_topic_name']) - ]) - - self.kwargs.update({ - 'scope': scope, - }) - - self.cmd('az eventgrid system-topic update --name {system_topic_name} --resource-group devexprg --tags Dept=IT', checks=[ - self.check('name', self.kwargs['system_topic_name']), - self.check('tags', {'Dept': 'IT'}), - self.check('type', 'Microsoft.EventGrid/systemTopics'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid system-topic list --resource-group devexprg', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/systemTopics') - ]) - - self.cmd('az eventgrid system-topic list --resource-group devexprg', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/systemTopics'), - self.check('[0].name', self.kwargs['system_topic_name']), - ]) - - # Disable until service fix is availabler - # self.cmd('az eventgrid system-topic list --resource-group devexprg --odata-query "name eq \'{system_topic_name}\'"', checks=[ - # self.check('[0].type', 'Microsoft.EventGrid/systemTopics'), - # self.check('[0].name', self.kwargs['system_topic_name']), - # ]) - - self.cmd('az eventgrid system-topic event-subscription create --resource-group devexprg --system-topic-name {system_topic_name} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --endpoint-type webhook', checks=[ - self.check('type', 'Microsoft.EventGrid/systemTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid system-topic event-subscription create --resource-group devexprg --system-topic-name {system_topic_name} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --endpoint-type webhook --labels label_1 label_2', checks=[ - self.check('type', 'Microsoft.EventGrid/systemTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']) - ]) - - self.cmd('az eventgrid system-topic event-subscription show --resource-group devexprg --system-topic-name {system_topic_name} --name {event_subscription_name} --include-full-endpoint-url', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid system-topic event-subscription show --resource-group devexprg --system-topic-name {system_topic_name} --name {event_subscription_name}', checks=[ - self.check('destination.endpointUrl', None), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid system-topic event-subscription update -g devexprg --system-topic-name {system_topic_name} -n {event_subscription_name} --endpoint \"{endpoint_url}\" --endpoint-type webhook --labels label11 label22', checks=[ - self.check('type', 'Microsoft.EventGrid/systemTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid system-topic event-subscription list --resource-group devexprg --system-topic-name {system_topic_name}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/systemTopics/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - # Comment this one until we fix the pagable property in swagger - # self.cmd('az eventgrid system-topic event-subscription list --resource-group {rg} --system-topic-name {system_topic_name} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - # self.check('[0].type', 'Microsoft.EventGrid/systemTopics/eventSubscriptions'), - # self.check('[0].provisioningState', 'Succeeded'), - # ]) - - self.cmd('az eventgrid system-topic event-subscription delete -g devexprg --name {event_subscription_name} --system-topic-name {system_topic_name} ') - - self.cmd('az eventgrid system-topic delete -n {system_topic_name} -g devexprg') - - @ResourceGroupPreparer() - @unittest.skip('Will be re-enabled once global operations are enabled for 2020-01-01-preview API version') - def test_create_event_subscriptions_to_arm_resource_group(self, resource_group): - event_subscription_name = 'eventsubscription2' - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - scope = self.cmd('az group show -n {} -ojson'.format(resource_group)).get_output_in_json()['id'] - - self.kwargs.update({ - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl, - 'scope': scope - }) - - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --subject-begins-with mysubject_prefix', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']), - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {scope} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('filter.subjectBeginsWith', 'mysubject_prefix') - ]) - self.cmd('az eventgrid event-subscription show --source-resource-id {scope} --include-full-endpoint-url --name {event_subscription_name}', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - ]) - - self.cmd('az eventgrid event-subscription update --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --subject-ends-with .jpg', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']), - self.check('filter.subjectEndsWith', '.jpg'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {scope}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {scope} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Resources.ResourceGroups --location global', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Resources.ResourceGroups --location global --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location global --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location global --resource-group {rg} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {scope} --name {event_subscription_name}') - - @ResourceGroupPreparer(name_prefix='clieventgridrg', location='centraluseuap') - @StorageAccountPreparer(name_prefix='clieventgrid', location='centraluseuap') - def test_create_event_subscriptions_to_resource(self, resource_group, resource_group_location, storage_account): - event_subscription_name = self.create_random_name(prefix='cli', length=40) - endpoint_url = 'https://eventgridclitestapp.azurewebsites.net/api/SubscriptionValidation?code=4CTlhouPm0c3PWuTQ8t6Myh/FYegVUPqXUmdtL2byRytFPlt98L/pw==' - endpoint_baseurl = 'https://eventgridclitestapp.azurewebsites.net/api/SubscriptionValidation' - - self.kwargs.update({ - 'event_subscription_name': event_subscription_name, - 'location': 'centraluseuap', - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl - }) - - self.kwargs['source_resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] - self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') - - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\"', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - ]) - self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --source-resource-id {source_resource_id} --name {event_subscription_name}', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - ]) - - self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --subject-ends-with .jpg', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']), - self.check('filter.subjectEndsWith', '.jpg') - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {source_resource_id}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location {location}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location {location} --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location {location} --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location {location}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {source_resource_id} --odata-query "CONTAINS(name,\'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location {location} --odata-query "CONTAINS(name,\'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location {location} --resource-group {rg} --odata-query "CONTAINS(name,\'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location {location} --resource-group {rg} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --location {location} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name}') - - @ResourceGroupPreparer() - @StorageAccountPreparer(name_prefix='clieventgrid', location='centraluseuap') - def test_create_event_subscriptions_with_filters(self, resource_group): - event_subscription_name = 'eventsubscription2' - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - subject_ends_with = 'mysubject_suffix' - event_type_1 = 'blobCreated' - event_type_2 = 'blobUpdated' - label_1 = 'Finance' - label_2 = 'HR' - - self.kwargs.update({ - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl, - 'subject_ends_with': subject_ends_with, - 'event_type_1': event_type_1, - 'event_type_2': event_type_2, - 'label_1': label_1, - 'location': 'centraluseuap', - 'label_2': label_2 - }) - - self.kwargs['source_resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] - self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') - - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --subject-ends-with {subject_ends_with} --included-event-types {event_type_1} {event_type_2} --subject-case-sensitive --labels {label_1} {label_2}') - - # TODO: Add a verification that filter.isSubjectCaseSensitive is true after resolving why it shows as null in the response - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('filter.subjectEndsWith', self.kwargs['subject_ends_with']), - self.check('filter.includedEventTypes[0]', self.kwargs['event_type_1']), - self.check('filter.includedEventTypes[1]', self.kwargs['event_type_2']), - self.check('labels[0]', self.kwargs['label_1']), - self.check('labels[1]', self.kwargs['label_2']), - ]) - - self.cmd('az eventgrid event-subscription show --include-full-endpoint-url --source-resource-id {source_resource_id} --name {event_subscription_name}', checks=[ - self.check('destination.endpointUrl', self.kwargs['endpoint_url']), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {source_resource_id}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription list --source-resource-id {source_resource_id} --odata-query "CONTAINS(name,\'{event_subscription_name}\')"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name}') - self.cmd('az storage account delete -y -g {rg} -n {sa}') - - @ResourceGroupPreparer() - @StorageAccountPreparer(name_prefix='clieventgrid', location='centraluseuap') - def test_create_event_subscriptions_with_20180501_features(self, resource_group): - event_subscription_name1 = 'CliTestEventsubscription1' - event_subscription_name2 = 'CliTestEventsubscription2' - event_subscription_name3 = 'CliTestEventsubscription3' - event_subscription_name4 = 'CliTestEventsubscription4' - event_subscription_name5 = 'CliTestEventsubscription5' - storagequeue_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Storage/storageAccounts/devexpstg/queueServices/default/queues/stogqueuedestination' - deadletter_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Storage/storageAccounts/devexpstg/blobServices/default/containers/dlq' - hybridconnection_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Relay/namespaces/DevExpRelayNamespace/hybridConnections/hydbridconnectiondestination' - servicebusqueue_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.ServiceBus/namespaces/devexpservicebus/queues/devexpdestination' - eventhub_with_identity_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.eventhub/namespaces/devexpeh/eventhubs/eventhub1' - source_resource_id_with_identity = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/topics/tpoicWithNoIdentity2' - deadletter_endpoint_id_with_identity = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Storage/storageAccounts/devexpstg/blobServices/default/containers/dlqwithidentity' - - self.kwargs.update({ - 'event_subscription_name1': event_subscription_name1, - 'event_subscription_name2': event_subscription_name2, - 'event_subscription_name3': event_subscription_name3, - 'event_subscription_name4': event_subscription_name4, - 'event_subscription_name5': event_subscription_name5, - 'storagequeue_endpoint_id': storagequeue_endpoint_id, - 'source_resource_id_with_identity': source_resource_id_with_identity, - 'eventhub_with_identity_endpoint_id': eventhub_with_identity_endpoint_id, - 'deadletter_endpoint_id': deadletter_endpoint_id, - 'deadletter_endpoint_id_with_identity': deadletter_endpoint_id_with_identity, - 'hybridconnection_endpoint_id': hybridconnection_endpoint_id, - 'location': 'centraluseuap', - 'servicebusqueue_endpoint_id': servicebusqueue_endpoint_id, - }) - - self.kwargs['source_resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] - self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') - - # Failure cases - # Invalid Event TTL value - with self.assertRaises(CLIError): - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --event-ttl 2000 --deadletter-endpoint {deadletter_endpoint_id}') - - # Invalid max delivery attempts value - with self.assertRaises(CLIError): - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name1} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --max-delivery-attempts 31 --deadletter-endpoint {deadletter_endpoint_id}') - - # Create a storage queue destination based event subscription with cloud event schema as the delivery schema - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name1} --endpoint-type stoRAgequeue --endpoint {storagequeue_endpoint_id} --event-delivery-schema cloudeventschemav1_0 --deadletter-endpoint {deadletter_endpoint_id} --subject-begins-with SomeRandomText1 --subject-ends-with SomeRandomText2') - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name1}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - # Create a hybridconnection destination based event subscription with default eventgrid event schema as the delivery schema - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name2} --endpoint-type HybRidConnection --endpoint {hybridconnection_endpoint_id} --deadletter-endpoint {deadletter_endpoint_id} --max-delivery-attempts 20 --event-ttl 1000 --subject-begins-with SomeRandomText1 --subject-ends-with SomeRandomText2') - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - # Create a servicebusqueue destination based event subscription with default eventgrid event schema as the delivery schema - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name3} --endpoint-type SErvIcEBusQueUE --endpoint {servicebusqueue_endpoint_id} --deadletter-endpoint {deadletter_endpoint_id} --max-delivery-attempts 10 --event-ttl 1200 --subject-begins-with SomeRandomText1 --subject-ends-with SomeRandomText2') - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name3}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - # Create an event hub destination based event subscription with default eventgrid event schema as the delivery schema and with system assigned identity and systemassigned deadletter destination - # self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id_with_identity} --delivery-identity-endpoint-type eventhub --delivery-identity systemassigned --delivery-identity-endpoint {eventhub_with_identity_endpoint_id} -n {event_subscription_name4} --deadletter-identity-endpoint {deadletter_endpoint_id_with_identity} --deadletter-identity systemassigned') - - # self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id_with_identity} --name {event_subscription_name4}', checks=[ - # self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - # self.check('provisioningState', 'Succeeded'), - # self.check('destination', None), - # self.check('deliveryWithResourceIdentity.identity.userAssignedIdentity', None), - # self.check('deliveryWithResourceIdentity.identity.type', 'SystemAssigned'), - # self.check('deliveryWithResourceIdentity.destination.endpointType', 'EventHub'), - # self.check('deliveryWithResourceIdentity.destination.resourceId', self.kwargs['eventhub_with_identity_endpoint_id']), - # self.check('deadLetterDestination', None), - # self.check('deadLetterWithResourceIdentity.identity.userAssignedIdentity', None), - # self.check('deadLetterWithResourceIdentity.identity.type', 'SystemAssigned'), - # self.check('deadLetterWithResourceIdentity.deadLetterDestination.endpointType', 'StorageBlob') - # ]) - - # Update an event hub destination based event subscription with default eventgrid event schema as the delivery schema and with system assigned identity - # self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id_with_identity} -n {event_subscription_name4} --deadletter-endpoint {deadletter_endpoint_id}') - - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name1}') - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name2}') - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name3}') - # self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name4}') - self.cmd('az storage account delete -y -g {rg} -n {sa}') - - @ResourceGroupPreparer(name_prefix='clieventgridrg', location='centraluseuap') - @StorageAccountPreparer(name_prefix='clieventgrid', location='centraluseuap') - def test_create_event_subscriptions_with_20200101_features(self, resource_group): - event_subscription_name1 = 'CliTestEventGridEventsubscription1' - event_subscription_name2 = 'CliTestEventGridEventsubscription2' - event_subscription_name3 = 'CliTestEventGridEventsubscription3' - event_subscription_name4 = 'CliTestEventGridEventsubscription4' - servicebustopic_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.ServiceBus/namespaces/devexpservicebus/topics/devexptopic1' - azurefunction_endpoint_id_cloudevent = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Web/sites/eventgridclitestapp/functions/EventGridTrigger1' - - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - endpoint_url_for_validation = 'https://devexpfuncappdestination.azurewebsites.net/api/DevExpFunc?code=7jTiaEBVeYjC8X6gPDUhIhAnFRjaxZaGyS3hBbr09bmj3heQNhvrbA==' - endpoint_baseurl_for_validation = 'https://devexpfuncappdestination.azurewebsites.net/api/DevExpFunc' - - # Make sure to replace these with proper values for re-recording the tests. - azure_active_directory_tenant_id = '72f988bf-86f1-41af-91ab-2d7cd011db47' - azure_active_directory_application_id_or_uri = '03d47d4a-7c50-43e0-ba90-89d090cc4582' - - self.kwargs.update({ - 'event_subscription_name1': event_subscription_name1, - 'event_subscription_name2': event_subscription_name2, - 'event_subscription_name3': event_subscription_name3, - 'event_subscription_name4': event_subscription_name4, - 'servicebustopic_endpoint_id': servicebustopic_endpoint_id, - 'azurefunction_endpoint_id_cloudevent': azurefunction_endpoint_id_cloudevent, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl, - 'endpoint_url_for_validation': endpoint_url_for_validation, - 'endpoint_baseurl_for_validation': endpoint_baseurl_for_validation, - 'azure_active_directory_tenant_id': azure_active_directory_tenant_id, - 'azure_active_directory_application_id_or_uri': azure_active_directory_application_id_or_uri, - 'location': 'centraluseuap' - }) - - self.kwargs['source_resource_id'] = self.cmd('storage account create -g {rg} -n {sa} --sku Standard_LRS -l {location}').get_output_in_json()['id'] - self.cmd('az storage account update -g {rg} -n {sa} --set kind=StorageV2') - - # Create a servicebustopic destination based event subscription with CloudEvent 1.0 as the delivery schema - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name1} --endpoint-type SErvIcEBusTOPic --endpoint {servicebustopic_endpoint_id} --subject-begins-with SomeRandomText1 --event-delivery-schema CloudEVENTSchemaV1_0') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name1}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - # Create an AzureFunction destination based event subscription with additional batching parameters - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name2} --endpoint-type azUREFunction --endpoint {azurefunction_endpoint_id_cloudevent} --subject-begins-with SomeRandomText1 --max-events-per-batch 10 --preferred-batch-size-in-kilobytes 128') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - # Create an AzureFunction destination based event subscription with additional batching parameters for destination type webhook. - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name4} --endpoint-type webhook --endpoint \"{endpoint_url_for_validation}\" --subject-begins-with SomeRandomText1 --max-events-per-batch 10 --preferred-batch-size-in-kilobytes 128') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name4}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - # Create an Webhook destination based event subscription with azure active directory settings - self.cmd('az eventgrid event-subscription create --source-resource-id {source_resource_id} --name {event_subscription_name3} --endpoint-type webhook --endpoint \"{endpoint_url_for_validation}\" --subject-begins-with SomeRandomText1 --max-events-per-batch 10 --preferred-batch-size-in-kilobytes 128 --azure-active-directory-tenant-id \"{azure_active_directory_tenant_id}\" --azure-active-directory-application-id-or-uri \"{azure_active_directory_application_id_or_uri}\"') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name3}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - # Update a servicebustopic destination based event subscription with CloudEvent 1.0 as the delivery schema - self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id} --name {event_subscription_name1} --subject-begins-with SomeRandomText1234') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name1}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - # Update an AzureFunction destination based event subscription - self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id} --name {event_subscription_name2} --endpoint-type azUREFunction --endpoint {azurefunction_endpoint_id_cloudevent} --subject-begins-with SomeRandomText2234431') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - # Update an AzureFunction destination based event subscription with additional batching parameters for destination type webhook. - self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id} --name {event_subscription_name4} --endpoint-type webhook --endpoint \"{endpoint_url_for_validation}\" --subject-begins-with SomeRandomText112341') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name4}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - # Update an Webhook destination based event subscription with azure active directory settings - self.cmd('az eventgrid event-subscription update --source-resource-id {source_resource_id} --name {event_subscription_name3} --endpoint \"{endpoint_url_for_validation}\" --subject-begins-with SomeRandomText123412') - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name3}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name1}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name2}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid event-subscription show --source-resource-id {source_resource_id} --name {event_subscription_name3}', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded') - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name1}') - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name2}') - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name3}') - self.cmd('az eventgrid event-subscription delete --source-resource-id {source_resource_id} --name {event_subscription_name4}') - self.cmd('az storage account delete -y -g {rg} -n {sa}') - - @ResourceGroupPreparer() - def test_advanced_filters(self, resource_group): - endpoint_url = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=' - endpoint_baseurl = 'https://devexpfuncappdestination.azurewebsites.net/runtime/webhooks/EventGrid' - - topic_name = self.create_random_name(prefix='cli', length=40) - event_subscription_name = self.create_random_name(prefix='cli', length=40) - - self.kwargs.update({ - 'topic_name': topic_name, - 'location': 'centraluseuap', - 'event_subscription_name': event_subscription_name, - 'endpoint_url': endpoint_url, - 'endpoint_baseurl': endpoint_baseurl - }) - - self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location}', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('provisioningState', 'Succeeded'), - ]) - - scope = self.cmd('az eventgrid topic show --name {topic_name} --resource-group {rg} -ojson').get_output_in_json()['id'] - - self.kwargs.update({ - 'scope': scope - }) - - # Error cases - with self.assertRaises(CLIError): - # No operator/values provided - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint {endpoint_url} --advanced-filter eventType') - - with self.assertRaises(CLIError): - # No filter value provided - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint {endpoint_url} --advanced-filter data.key2 NumberIn') - - with self.assertRaises(CLIError): - # Invalid operator type provided - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint {endpoint_url} --advanced-filter data.key2 FooNumberLessThan 2 3') - - with self.assertRaises(CLIError): - # Multiple values provided for a single value filter - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint {endpoint_url} --advanced-filter data.key2 NumberLessThan 2 3') - - # One advanced filter for NumberIn operator - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --advanced-filter data.key2 NumberIn 2 3 4 100 200', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - # Two advanced filters for NumberIn, StringIn operators - self.cmd('az eventgrid event-subscription create --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --advanced-filter data.key1 NumberIn 2 3 4 100 200 --advanced-filter data.key2 StringIn 2 3 4 100 200', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - # Two advanced filters for NumberIn, StringIn operators - self.cmd('az eventgrid event-subscription update --source-resource-id {scope} --name {event_subscription_name} --endpoint \"{endpoint_url}\" --advanced-filter data.key1 NumberIn 21 13 400 101 --advanced-filter data.key2 StringIn 122 3 214 1100 2', checks=[ - self.check('type', 'Microsoft.EventGrid/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']), - self.check('destination.endpointBaseUrl', self.kwargs['endpoint_baseurl']) - ]) - - self.cmd('az eventgrid event-subscription delete --source-resource-id {scope} --name {event_subscription_name}') - self.cmd('az eventgrid topic delete --name {topic_name} --resource-group {rg}') - - @ResourceGroupPreparer() - def test_private_link(self, resource_group): - vnet_name = self.create_random_name(prefix='cli', length=20) - subnet_name = self.create_random_name(prefix='cli', length=20) - private_endpoint_name = self.create_random_name(prefix='cli', length=20) - connection_name = self.create_random_name(prefix='cli', length=20) - topic_name = self.create_random_name(prefix='cli', length=40) - resource_group_net = 'DevExpRg' - - self.kwargs.update({ - 'resource_group_net': resource_group_net, - 'vnet_name': vnet_name, - 'subnet_name': subnet_name, - 'private_endpoint_name': private_endpoint_name, - 'connection_name': connection_name, - 'topic_name': topic_name, - 'location': 'centraluseuap' - }) - - # self.cmd('group create -n {resource_group_net} -l eastus') - - self.cmd('az network vnet create --resource-group {resource_group_net} --location {location} --name {vnet_name} --address-prefix 10.0.0.0/16') - self.cmd('az network vnet subnet create --resource-group {resource_group_net} --vnet-name {vnet_name} --name {subnet_name} --address-prefixes 10.0.0.0/24') - self.cmd('az network vnet subnet update --resource-group {resource_group_net} --vnet-name {vnet_name} --name {subnet_name} --disable-private-endpoint-network-policies true') - - scope = self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location} --public-network-access disabled', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}), - self.check('publicNetworkAccess', 'Disabled'), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - self.check('identity.type', None), - self.check('identity.userAssignedIdentities', None) - ]).get_output_in_json()['id'] - - scope = self.cmd('az eventgrid topic create --name {topic_name} --resource-group {rg} --location {location} --public-network-access disabled', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('sku', {'name': 'Basic'}), - self.check('publicNetworkAccess', 'Disabled'), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - self.check('identity.type', None), - self.check('identity.userAssignedIdentities', None) - ]).get_output_in_json()['id'] - - self.cmd('az eventgrid topic show --name {topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/topics'), - self.check('name', self.kwargs['topic_name']), - self.check('sku', {'name': 'Basic'}), - self.check('publicNetworkAccess', 'Disabled'), - self.check('identity.principalId', None), - self.check('identity.tenantId', None), - self.check('identity.type', None), - self.check('identity.userAssignedIdentities', None) - ]) - - self.kwargs.update({ - 'scope': scope, - }) - - # Create private endpoint - self.cmd('az network private-endpoint create --resource-group {resource_group_net} --name {private_endpoint_name} --vnet-name {vnet_name} --subnet {subnet_name} --private-connection-resource-id {scope} --location {location} --group-ids topic --connection-name {connection_name}') - - self.cmd('az eventgrid topic private-endpoint-connection list --resource-group {rg} --topic-name {topic_name}') - self.cmd('az eventgrid topic private-link-resource list --resource-group {rg} --topic-name {topic_name}') - - self.cmd('az network private-endpoint delete --resource-group {resource_group_net} --name {private_endpoint_name}') - self.cmd('az network vnet subnet delete --resource-group {resource_group_net} --vnet-name {vnet_name} --name {subnet_name}') - self.cmd('az network vnet delete --resource-group {resource_group_net} --name {vnet_name}') - self.cmd('az eventgrid topic delete --name {topic_name} --resource-group {rg}') - - @ResourceGroupPreparer() - def test_Partner_scenarios(self, resource_group): - storagequeue_endpoint_id = '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/DevExpRg/providers/Microsoft.Storage/storageAccounts/devexpstg/queueServices/default/queues/stogqueuedestination' - - partner_registration_name = self.create_random_name(prefix='cli', length=40) - partner_namespace_name = self.create_random_name(prefix='cli', length=40) - event_channel_name = self.create_random_name(prefix='cli', length=40) - partner_topic_name = self.create_random_name(prefix='cli', length=40) - event_subscription_name = self.create_random_name(prefix='cli', length=40) - partner_name = self.create_random_name(prefix='cli', length=40) - resource_type_name = self.create_random_name(prefix='cli', length=40) - description = self.create_random_name(prefix='cli', length=40) - display_name = self.create_random_name(prefix='cli', length=40) - guid1 = uuid.uuid1() - guid2 = uuid.uuid1() - guid3 = uuid.uuid1() - destination_subscription_id = '5b4b650e-28b9-4790-b3ab-ddbd88d727c4' - source = self.create_random_name(prefix='cli', length=40) - exp_time = datetime.utcnow() + timedelta(hours=24) - exp_time = exp_time.isoformat() - creation_time = datetime.utcnow().isoformat() - - long_description = 'This is long description sample' - customer_service_number1 = '+1 800 123 4567' - customer_service_extension1 = '1234' - customer_service_uri = 'https://www.example.com/cusomerService' - - customer_service_number2 = '+1 962 7 1234 5678' - customer_service_extension2 = '9876' - - self.kwargs.update({ - 'partner_registration_name': partner_registration_name, - 'partner_namespace_name': partner_namespace_name, - 'event_channel_name': event_channel_name, - 'partner_topic_name': partner_topic_name, - 'location': 'centraluseuap', - 'event_subscription_name': event_subscription_name, - 'storagequeue_endpoint_id': storagequeue_endpoint_id, - 'partner_name': partner_name, - 'resource_type_name': resource_type_name, - 'guid1': guid1, - 'guid2': guid2, - 'guid3': guid3, - 'description': description, - 'display_name': display_name, - 'destination_subscription_id': destination_subscription_id, - 'source': source, - 'exp_time': exp_time, - 'creation_time': creation_time, - 'long_description': long_description, - 'customer_service_number1': customer_service_number1, - 'customer_service_extension1': customer_service_extension1, - 'customer_service_uri': customer_service_uri, - 'customer_service_number2': customer_service_number2, - 'customer_service_extension2': customer_service_extension2, - }) - - partner_topic_friendly_description = 'This partner topic was created by Partner {part_name} at {create_time}.'.format(part_name=partner_name, create_time=creation_time) - - self.kwargs.update({ - 'partner_topic_friendly_description': partner_topic_friendly_description - }) - - scope = self.cmd('az eventgrid partner registration create --name {partner_registration_name} --resource-group {rg} --partner-name {partner_name} --resource-type-name {resource_type_name} --authorized-subscription-ids {guid1} --long-description \'{long_description}\' --customer-service-number \'{customer_service_number1}\' --customer-service-extension \'{customer_service_extension1}\' --customer-service-uri \'{customer_service_uri}\'', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerRegistrations'), - self.check('name', self.kwargs['partner_registration_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('authorizedAzureSubscriptionIds[0]', guid1), - self.check('partnerResourceTypeDescription', None), - self.check('partnerResourceTypeDisplayName', None), - self.check('partnerResourceTypeName', resource_type_name), - self.check('partnerName', partner_name), - self.check('longDescription', long_description), - self.check('partnerCustomerServiceNumber', customer_service_number1), - self.check('partnerCustomerServiceExtension', customer_service_extension1), - self.check('customerServiceUri', customer_service_uri), - ]).get_output_in_json()['id'] - - scope = self.cmd('az eventgrid partner registration create --name {partner_registration_name} --resource-group {rg} --partner-name {partner_name} --resource-type-name {resource_type_name} --description {description} --display-name {display_name} --authorized-subscription-ids {guid2} {guid3} --long-description \'{long_description}\' --customer-service-number \'{customer_service_number2}\' --customer-service-extension \'{customer_service_extension2}\' --customer-service-uri \'{customer_service_uri}\'', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerRegistrations'), - self.check('name', self.kwargs['partner_registration_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('authorizedAzureSubscriptionIds[0]', guid2), - self.check('partnerResourceTypeDescription', description), - self.check('partnerResourceTypeDisplayName', display_name), - self.check('partnerResourceTypeName', resource_type_name), - self.check('partnerName', partner_name), - self.check('longDescription', long_description), - self.check('partnerCustomerServiceNumber', customer_service_number2), - self.check('partnerCustomerServiceExtension', customer_service_extension2), - self.check('customerServiceUri', customer_service_uri), - ]).get_output_in_json()['id'] - - self.cmd('az eventgrid partner registration show --name {partner_registration_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerRegistrations'), - self.check('name', self.kwargs['partner_registration_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('authorizedAzureSubscriptionIds[0]', guid2), - self.check('partnerResourceTypeDescription', description), - self.check('partnerResourceTypeDisplayName', display_name), - self.check('partnerResourceTypeName', resource_type_name), - self.check('partnerName', partner_name), - self.check('longDescription', long_description), - self.check('partnerCustomerServiceNumber', customer_service_number2), - self.check('partnerCustomerServiceExtension', customer_service_extension2), - self.check('customerServiceUri', customer_service_uri), - ]) - - self.kwargs.update({ - 'scope': scope - }) - - # self.cmd('az eventgrid partner registration update --name {partner_registration_name} --resource-group {rg} --tags Dept=IT', checks=[ - # self.check('name', self.kwargs['partner_registration_name']), - # self.check('tags', {'Dept': 'IT'}), - # self.check('type', 'Microsoft.EventGrid/partnerRegistrations'), - # self.check('provisioningState', 'Succeeded') - # ]) - - self.cmd('az eventgrid partner registration list --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerRegistrations') - ]) - - self.cmd('az eventgrid partner registration list --resource-group {rg} --odata-query "name eq \'{partner_registration_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerRegistrations'), - self.check('[0].name', self.kwargs['partner_registration_name']) - ]) - - self.cmd('az eventgrid partner namespace create --name {partner_namespace_name} --resource-group {rg} --location {location} --partner-registration-id {scope}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces'), - self.check('name', self.kwargs['partner_namespace_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('partnerRegistrationFullyQualifiedId', scope) - ]) - - self.cmd('az eventgrid partner namespace show --name {partner_namespace_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces'), - self.check('name', self.kwargs['partner_namespace_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('partnerRegistrationFullyQualifiedId', scope) - ]) - - outputnamespace = self.cmd('az eventgrid partner namespace create --name {partner_namespace_name} --resource-group {rg} --tags Dept=IT --partner-registration-id {scope} --location {location}').get_output_in_json() - self.check(outputnamespace['type'], 'Microsoft.EventGrid/partnerNamespaces'), - self.check(outputnamespace['name'], self.kwargs['partner_namespace_name']), - self.check(outputnamespace['provisioningState'], 'Succeeded') - self.check(outputnamespace['location'], self.kwargs['location']), - self.check(outputnamespace['partnerRegistrationFullyQualifiedId'], scope) - - # self.cmd('az eventgrid partner namespace update --name {partner_namespace_name} --resource-group {rg} --tags Dept=Finance', checks=[ - # self.check('name', self.kwargs['partner_namespace_name']), - # self.check('tags', {'Dept': 'Finance'}), - # self.check('type', 'Microsoft.EventGrid/partnerNamespaces'), - # self.check('provisioningState', 'Succeeded') - # ]) - - self.cmd('az eventgrid partner namespace list --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerNamespaces'), - self.check('[0].name', self.kwargs['partner_namespace_name']), - ]) - - self.cmd('az eventgrid partner namespace list --resource-group {rg} --odata-query "name eq \'{partner_namespace_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerNamespaces'), - self.check('[0].name', self.kwargs['partner_namespace_name']), - ]) - - output = self.cmd('az eventgrid partner namespace key list --partner-namespace-name {partner_namespace_name} --resource-group {rg}').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - output = self.cmd('az eventgrid partner namespace key regenerate --partner-namespace-name {partner_namespace_name} --resource-group {rg} --key-name key1').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - self.cmd('az eventgrid partner namespace key regenerate --partner-namespace-name {partner_namespace_name} --resource-group {rg} --key-name key2').get_output_in_json() - self.assertIsNotNone(output['key1']) - self.assertIsNotNone(output['key2']) - - self.cmd('az eventgrid partner namespace event-channel create --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name} --destination-subscription-id {destination_subscription_id} --destination-resource-group {rg} --desination-topic-name {partner_topic_name} --source {source}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('partnerTopicReadinessState', 'NotActivatedByUserYet') - ]) - - self.cmd('az eventgrid partner namespace event-channel show --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('partnerTopicReadinessState', 'NotActivatedByUserYet') - ]) - - outputeventchannel = self.cmd('az eventgrid partner namespace event-channel create --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name} --destination-subscription-id {destination_subscription_id} --destination-resource-group {rg} --desination-topic-name {partner_topic_name} --source {source} --activation-expiration-date \'{exp_time}\' --partner-topic-description \'{partner_topic_friendly_description}\' --publisher-filter data.key1 NumberIn 2 3 4 100 200 --publisher-filter data.key2 StringIn 2 3 4 100 200').get_output_in_json() - - self.check(outputeventchannel['type'], 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check(outputeventchannel['name'], self.kwargs['event_channel_name']), - self.check(outputeventchannel['provisioningState'], 'Succeeded'), - self.check(outputeventchannel['expirationTimeIfNotActivatedUtc'], exp_time), - self.check(outputeventchannel['partnerTopicFriendlyDescription'], partner_topic_friendly_description), - self.check(outputeventchannel['partnerTopicReadinessState'], 'NotActivatedByUserYet') - - self.cmd('az eventgrid partner namespace event-channel show --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # Comment for recorded test to pass. - # self.check('expirationTimeIfNotActivatedUtc', exp_time + '+00:00'), - # self.check('partnerTopicFriendlyDescription', partner_topic_friendly_description), - self.check('partnerTopicReadinessState', 'NotActivatedByUserYet'), - ]) - - # self.cmd('az eventgrid partner namespace update --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name} --tags Dept=Finance', checks=[ - # self.check('name', self.kwargs['event_channel_name']), - # self.check('tags', {'Dept': 'Finance'}), - # self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - # self.check('provisioningState', 'Succeeded') - # ]) - - self.cmd('az eventgrid partner namespace event-channel list --resource-group {rg} --partner-namespace-name {partner_namespace_name}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('[0].name', self.kwargs['event_channel_name']), - ]) - - self.cmd('az eventgrid partner topic show --name {partner_topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerTopics'), - self.check('name', self.kwargs['partner_topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('activationState', 'NeverActivated'), - # self.check('partnerTopicFriendlyDescription', partner_topic_friendly_description), - ]) - - # self.cmd('az eventgrid partner topic update --name {partner_topic_name} --resource-group {rg} --tags Dept=Finance', checks=[ - # self.check('name', self.kwargs['partner_topic_name']), - # self.check('tags', {'Dept': 'Finance'}), - # self.check('type', 'Microsoft.EventGrid/partnerTopics'), - # self.check('provisioningState', 'Succeeded') - # ]) - - self.cmd('az eventgrid partner topic list --resource-group {rg}', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerTopics'), - self.check('[0].name', self.kwargs['partner_topic_name']), - ]) - - self.cmd('az eventgrid partner topic list --resource-group {rg} --odata-query "name eq \'{partner_topic_name}\'"', checks=[ - self.check('[0].type', 'Microsoft.EventGrid/partnerTopics'), - self.check('[0].name', self.kwargs['partner_topic_name']), - ]) - - self.cmd('az eventgrid partner topic activate --name {partner_topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerTopics'), - self.check('name', self.kwargs['partner_topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('activationState', 'Activated') - ]) - - self.cmd('az eventgrid partner namespace event-channel show --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('expirationTimeIfNotActivatedUtc', exp_time + '+00:00'), - # self.check('partnerTopicFriendlyDescription', partner_topic_friendly_description), - # self.check('partnerTopicReadinessState', 'ActivatedByUser'), - ]) - - self.cmd('az eventgrid partner topic deactivate --name {partner_topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerTopics'), - self.check('name', self.kwargs['partner_topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('activationState', 'Deactivated') - ]) - - self.cmd('az eventgrid partner namespace event-channel show --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('expirationTimeIfNotActivatedUtc', exp_time + '+00:00'), - # self.check('partnerTopicFriendlyDescription', partner_topic_friendly_description), - # self.check('partnerTopicReadinessState', 'DeactivatedByUser'), - ]) - - self.cmd('az eventgrid partner topic activate --name {partner_topic_name} --resource-group {rg}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerTopics'), - self.check('name', self.kwargs['partner_topic_name']), - self.check('provisioningState', 'Succeeded'), - self.check('location', self.kwargs['location']), - self.check('activationState', 'Activated') - ]) - - self.cmd('az eventgrid partner namespace event-channel show --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}', checks=[ - self.check('type', 'Microsoft.EventGrid/partnerNamespaces/eventChannels'), - self.check('name', self.kwargs['event_channel_name']), - self.check('provisioningState', 'Succeeded'), - # self.check('expirationTimeIfNotActivatedUtc', exp_time + '+00:00'), - # self.check('partnerTopicFriendlyDescription', partner_topic_friendly_description), - # self.check('partnerTopicReadinessState', 'ActivatedByUser'), - ]) - - self.cmd('az eventgrid partner topic event-subscription create --resource-group {rg} --partner-topic-name {partner_topic_name} --name {event_subscription_name} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id}', checks=[ - # self.check('type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']) - ]) - - self.cmd('az eventgrid partner topic event-subscription create --resource-group {rg} --partner-topic-name {partner_topic_name} --name {event_subscription_name} --endpoint-type storagequeue --endpoint {storagequeue_endpoint_id} --labels label_1 label_2', checks=[ - # self.check('type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']) - ]) - - self.cmd('az eventgrid partner topic event-subscription show --resource-group {rg} --partner-topic-name {partner_topic_name} --name {event_subscription_name}', checks=[ - # self.check('type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - ]) - - self.cmd('az eventgrid partner topic event-subscription update -g {rg} --partner-topic-name {partner_topic_name} -n {event_subscription_name} --labels label11 label22', checks=[ - # self.check('type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - self.check('provisioningState', 'Succeeded'), - self.check('name', self.kwargs['event_subscription_name']) - ]) - - self.cmd('az eventgrid partner topic event-subscription list --resource-group {rg} --partner-topic-name {partner_topic_name}', checks=[ - # self.check('[0].type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - self.check('[0].provisioningState', 'Succeeded'), - ]) - - # self.cmd('az eventgrid partner topic event-subscription list --resource-group {rg} --partner-topic-name {partner_topic_name} --odata-query "name eq \'{event_subscription_name}\'"', checks=[ - # self.check('[0].type', 'Microsoft.EventGrid/partnerTopics/eventSubscriptions'), - # self.check('[0].provisioningState', 'Succeeded'), - # ]) - - self.cmd('az eventgrid partner topic event-subscription delete -g {rg} --name {event_subscription_name} --partner-topic-name {partner_topic_name} ') - self.cmd('az eventgrid partner topic delete --name {partner_topic_name} --resource-group {rg}') - self.cmd('az eventgrid partner namespace event-channel delete --resource-group {rg} --partner-namespace-name {partner_namespace_name} --name {event_channel_name}') - self.cmd('az eventgrid partner namespace delete --name {partner_namespace_name} --resource-group {rg}') - self.cmd('az eventgrid partner registration delete -n {partner_registration_name} -g {rg}') +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer class EventGridNamespaceTests(ScenarioTest): @@ -1537,7 +61,6 @@ def test_namespace_client_and_client_group(self): }) self.cmd('eventgrid namespace create -g {rg} -n {namespace} --topic-spaces-configuration "{{maximumSessionExpiryInHours:1,state:enabled}}"', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{namespace}'), self.check('sku.capacity', 1), self.check('sku.name', 'Standard'), @@ -1546,14 +69,12 @@ def test_namespace_client_and_client_group(self): self.check('topicSpacesConfiguration.state', 'Enabled') ]) self.cmd('eventgrid namespace client create -g {rg} --namespace-name {namespace} -n {client} --attributes "{{\'room\':\'345\',\'floor\':5}}" --client-certificate-authentication "{{validationScheme:SubjectMatchesAuthenticationName}}"', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client}'), self.check('attributes.floor', 5), self.check('attributes.room', '345'), self.check('clientCertificateAuthentication.validationScheme', 'SubjectMatchesAuthenticationName') ]) self.cmd('eventgrid namespace client update -g {rg} --namespace-name {namespace} -n {client} --attributes "{{\'room\':\'456\',\'floor\':6}}" --description test', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client}'), self.check('attributes.floor', 6), self.check('attributes.room', '456'), @@ -1561,15 +82,13 @@ def test_namespace_client_and_client_group(self): self.check('description', 'test') ]) self.cmd('eventgrid namespace client show -g {rg} --namespace-name {namespace} -n {client}', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client}'), self.check('attributes.floor', 6), self.check('attributes.room', '456'), self.check('clientCertificateAuthentication.validationScheme', 'SubjectMatchesAuthenticationName'), self.check('description', 'test') ]) - self.cmd('eventgrid namespace list -g {rg} --namespace-name {namespace}', checks=[ - self.check('[0].resourceGroup', '{rg}'), + self.cmd('eventgrid namespace client list -g {rg} --namespace-name {namespace}', checks=[ self.check('[0].name', '{client}'), self.check('[0].attributes.floor', 6), self.check('[0].attributes.room', '456'), @@ -1577,31 +96,27 @@ def test_namespace_client_and_client_group(self): self.check('[0].description', 'test') ]) self.cmd('eventgrid namespace client-group create -g {rg} --namespace-name {namespace} -n {client_group} --description test --group-query "attributes.floor = 6"', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client_group}'), self.check('description', 'test'), self.check('query', 'attributes.floor = 6') ]) self.cmd('eventgrid namespace client-group update -g {rg} --namespace-name {namespace} -n {client_group} --description test1 --group-query "attributes.floor = 7"', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client_group}'), self.check('description', 'test1'), self.check('query', 'attributes.floor = 7') ]) self.cmd('eventgrid namespace client-group show -g {rg} --namespace-name {namespace} -n {client_group}', checks=[ - self.check('resourceGroup', '{rg}'), self.check('name', '{client_group}'), self.check('description', 'test1'), self.check('query', 'attributes.floor = 7') ]) self.cmd('eventgrid namespace client-group list -g {rg} --namespace-name {namespace}', checks=[ - self.check('[0].resourceGroup', '{rg}'), - self.check('[0].name', '{client_group}'), - self.check('[0].description', 'test1'), - self.check('[0].query', 'attributes.floor = 7') + self.check('[1].name', '{client_group}'), + self.check('[1].description', 'test1'), + self.check('[1].query', 'attributes.floor = 7') ]) self.cmd('eventgrid namespace client-group delete -g {rg} --namespace-name {namespace} -n {client_group} -y') - self.cmd('eventgrid namespace client delete -g {rg} -n {namespace} -y') + self.cmd('eventgrid namespace client delete -g {rg} -n {client} --namespace-name {namespace} -y') @ResourceGroupPreparer(name_prefix='test_eventgrid_topic', location='eastus') def test_topic(self): diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/__init__.py b/src/eventgrid/azext_eventgrid/vendored_sdks/__init__.py deleted file mode 100644 index 7183870ee56..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/__init__.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/__init__.py deleted file mode 100644 index 23d74ebeeb6..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/__init__.py +++ /dev/null @@ -1,19 +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 ._configuration import EventGridManagementClientConfiguration -from ._event_grid_management_client import EventGridManagementClient -__all__ = ['EventGridManagementClient', 'EventGridManagementClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION - diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_configuration.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_configuration.py deleted file mode 100644 index b27d26eb482..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_configuration.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 msrestazure import AzureConfiguration - -from .version import VERSION - - -class EventGridManagementClientConfiguration(AzureConfiguration): - """Configuration for EventGridManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials that uniquely identify a - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(EventGridManagementClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-eventgrid/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_event_grid_management_client.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_event_grid_management_client.py deleted file mode 100644 index 829072a9770..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/_event_grid_management_client.py +++ /dev/null @@ -1,126 +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 Serializer, Deserializer - -from ._configuration import EventGridManagementClientConfiguration -from .operations import DomainsOperations -from .operations import DomainTopicsOperations -from .operations import EventChannelsOperations -from .operations import EventSubscriptionsOperations -from .operations import SystemTopicEventSubscriptionsOperations -from .operations import PartnerTopicEventSubscriptionsOperations -from .operations import Operations -from .operations import PartnerNamespacesOperations -from .operations import PartnerRegistrationsOperations -from .operations import PartnerTopicsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import SystemTopicsOperations -from .operations import TopicsOperations -from .operations import ExtensionTopicsOperations -from .operations import TopicTypesOperations -from . import models - - -class EventGridManagementClient(SDKClient): - """Azure EventGrid Management Client - - :ivar config: Configuration for client. - :vartype config: EventGridManagementClientConfiguration - - :ivar domains: Domains operations - :vartype domains: azure.mgmt.eventgrid.operations.DomainsOperations - :ivar domain_topics: DomainTopics operations - :vartype domain_topics: azure.mgmt.eventgrid.operations.DomainTopicsOperations - :ivar event_channels: EventChannels operations - :vartype event_channels: azure.mgmt.eventgrid.operations.EventChannelsOperations - :ivar event_subscriptions: EventSubscriptions operations - :vartype event_subscriptions: azure.mgmt.eventgrid.operations.EventSubscriptionsOperations - :ivar system_topic_event_subscriptions: SystemTopicEventSubscriptions operations - :vartype system_topic_event_subscriptions: azure.mgmt.eventgrid.operations.SystemTopicEventSubscriptionsOperations - :ivar partner_topic_event_subscriptions: PartnerTopicEventSubscriptions operations - :vartype partner_topic_event_subscriptions: azure.mgmt.eventgrid.operations.PartnerTopicEventSubscriptionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.eventgrid.operations.Operations - :ivar partner_namespaces: PartnerNamespaces operations - :vartype partner_namespaces: azure.mgmt.eventgrid.operations.PartnerNamespacesOperations - :ivar partner_registrations: PartnerRegistrations operations - :vartype partner_registrations: azure.mgmt.eventgrid.operations.PartnerRegistrationsOperations - :ivar partner_topics: PartnerTopics operations - :vartype partner_topics: azure.mgmt.eventgrid.operations.PartnerTopicsOperations - :ivar private_endpoint_connections: PrivateEndpointConnections operations - :vartype private_endpoint_connections: azure.mgmt.eventgrid.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResources operations - :vartype private_link_resources: azure.mgmt.eventgrid.operations.PrivateLinkResourcesOperations - :ivar system_topics: SystemTopics operations - :vartype system_topics: azure.mgmt.eventgrid.operations.SystemTopicsOperations - :ivar topics: Topics operations - :vartype topics: azure.mgmt.eventgrid.operations.TopicsOperations - :ivar extension_topics: ExtensionTopics operations - :vartype extension_topics: azure.mgmt.eventgrid.operations.ExtensionTopicsOperations - :ivar topic_types: TopicTypes operations - :vartype topic_types: azure.mgmt.eventgrid.operations.TopicTypesOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials that uniquely identify a - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = EventGridManagementClientConfiguration(credentials, subscription_id, base_url) - super(EventGridManagementClient, 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 = '2020-04-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.domains = DomainsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.domain_topics = DomainTopicsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.event_channels = EventChannelsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.event_subscriptions = EventSubscriptionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.system_topic_event_subscriptions = SystemTopicEventSubscriptionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.partner_topic_event_subscriptions = PartnerTopicEventSubscriptionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.partner_namespaces = PartnerNamespacesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.partner_registrations = PartnerRegistrationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.partner_topics = PartnerTopicsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.system_topics = SystemTopicsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.topics = TopicsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.extension_topics = ExtensionTopicsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.topic_types = TopicTypesOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/__init__.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/__init__.py deleted file mode 100644 index 8c67cc73bd6..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/__init__.py +++ /dev/null @@ -1,320 +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 ._models_py3 import AdvancedFilter - from ._models_py3 import AzureFunctionEventSubscriptionDestination - from ._models_py3 import BoolEqualsAdvancedFilter - from ._models_py3 import ConnectionState - from ._models_py3 import DeadLetterDestination - from ._models_py3 import DeadLetterWithResourceIdentity - from ._models_py3 import DeliveryWithResourceIdentity - from ._models_py3 import Domain - from ._models_py3 import DomainRegenerateKeyRequest - from ._models_py3 import DomainSharedAccessKeys - from ._models_py3 import DomainTopic - from ._models_py3 import DomainUpdateParameters - from ._models_py3 import EventChannel - from ._models_py3 import EventChannelDestination - from ._models_py3 import EventChannelFilter - from ._models_py3 import EventChannelSource - from ._models_py3 import EventHubEventSubscriptionDestination - from ._models_py3 import EventSubscription - from ._models_py3 import EventSubscriptionDestination - from ._models_py3 import EventSubscriptionFilter - from ._models_py3 import EventSubscriptionFullUrl - from ._models_py3 import EventSubscriptionIdentity - from ._models_py3 import EventSubscriptionUpdateParameters - from ._models_py3 import EventType - from ._models_py3 import ExtensionTopic - from ._models_py3 import HybridConnectionEventSubscriptionDestination - from ._models_py3 import IdentityInfo - from ._models_py3 import InboundIpRule - from ._models_py3 import InputSchemaMapping - from ._models_py3 import JsonField - from ._models_py3 import JsonFieldWithDefault - from ._models_py3 import JsonInputSchemaMapping - from ._models_py3 import NumberGreaterThanAdvancedFilter - from ._models_py3 import NumberGreaterThanOrEqualsAdvancedFilter - from ._models_py3 import NumberInAdvancedFilter - from ._models_py3 import NumberLessThanAdvancedFilter - from ._models_py3 import NumberLessThanOrEqualsAdvancedFilter - from ._models_py3 import NumberNotInAdvancedFilter - from ._models_py3 import Operation - from ._models_py3 import OperationInfo - from ._models_py3 import PartnerNamespace - from ._models_py3 import PartnerNamespaceRegenerateKeyRequest - from ._models_py3 import PartnerNamespaceSharedAccessKeys - from ._models_py3 import PartnerNamespaceUpdateParameters - from ._models_py3 import PartnerRegistration - from ._models_py3 import PartnerRegistrationEventTypesListResult - from ._models_py3 import PartnerRegistrationUpdateParameters - from ._models_py3 import PartnerTopic - from ._models_py3 import PartnerTopicType - from ._models_py3 import PartnerTopicTypesListResult - from ._models_py3 import PartnerTopicUpdateParameters - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateLinkResource - from ._models_py3 import Resource - from ._models_py3 import ResourceSku - from ._models_py3 import RetryPolicy - from ._models_py3 import ServiceBusQueueEventSubscriptionDestination - from ._models_py3 import ServiceBusTopicEventSubscriptionDestination - from ._models_py3 import StorageBlobDeadLetterDestination - from ._models_py3 import StorageQueueEventSubscriptionDestination - from ._models_py3 import StringBeginsWithAdvancedFilter - from ._models_py3 import StringContainsAdvancedFilter - from ._models_py3 import StringEndsWithAdvancedFilter - from ._models_py3 import StringInAdvancedFilter - from ._models_py3 import StringNotInAdvancedFilter - from ._models_py3 import SystemTopic - from ._models_py3 import SystemTopicUpdateParameters - from ._models_py3 import Topic - from ._models_py3 import TopicRegenerateKeyRequest - from ._models_py3 import TopicSharedAccessKeys - from ._models_py3 import TopicTypeInfo - from ._models_py3 import TopicUpdateParameters - from ._models_py3 import TrackedResource - from ._models_py3 import UserIdentityProperties - from ._models_py3 import WebHookEventSubscriptionDestination -except (SyntaxError, ImportError): - from ._models import AdvancedFilter - from ._models import AzureFunctionEventSubscriptionDestination - from ._models import BoolEqualsAdvancedFilter - from ._models import ConnectionState - from ._models import DeadLetterDestination - from ._models import DeadLetterWithResourceIdentity - from ._models import DeliveryWithResourceIdentity - from ._models import Domain - from ._models import DomainRegenerateKeyRequest - from ._models import DomainSharedAccessKeys - from ._models import DomainTopic - from ._models import DomainUpdateParameters - from ._models import EventChannel - from ._models import EventChannelDestination - from ._models import EventChannelFilter - from ._models import EventChannelSource - from ._models import EventHubEventSubscriptionDestination - from ._models import EventSubscription - from ._models import EventSubscriptionDestination - from ._models import EventSubscriptionFilter - from ._models import EventSubscriptionFullUrl - from ._models import EventSubscriptionIdentity - from ._models import EventSubscriptionUpdateParameters - from ._models import EventType - from ._models import ExtensionTopic - from ._models import HybridConnectionEventSubscriptionDestination - from ._models import IdentityInfo - from ._models import InboundIpRule - from ._models import InputSchemaMapping - from ._models import JsonField - from ._models import JsonFieldWithDefault - from ._models import JsonInputSchemaMapping - from ._models import NumberGreaterThanAdvancedFilter - from ._models import NumberGreaterThanOrEqualsAdvancedFilter - from ._models import NumberInAdvancedFilter - from ._models import NumberLessThanAdvancedFilter - from ._models import NumberLessThanOrEqualsAdvancedFilter - from ._models import NumberNotInAdvancedFilter - from ._models import Operation - from ._models import OperationInfo - from ._models import PartnerNamespace - from ._models import PartnerNamespaceRegenerateKeyRequest - from ._models import PartnerNamespaceSharedAccessKeys - from ._models import PartnerNamespaceUpdateParameters - from ._models import PartnerRegistration - from ._models import PartnerRegistrationEventTypesListResult - from ._models import PartnerRegistrationUpdateParameters - from ._models import PartnerTopic - from ._models import PartnerTopicType - from ._models import PartnerTopicTypesListResult - from ._models import PartnerTopicUpdateParameters - from ._models import PrivateEndpoint - from ._models import PrivateEndpointConnection - from ._models import PrivateLinkResource - from ._models import Resource - from ._models import ResourceSku - from ._models import RetryPolicy - from ._models import ServiceBusQueueEventSubscriptionDestination - from ._models import ServiceBusTopicEventSubscriptionDestination - from ._models import StorageBlobDeadLetterDestination - from ._models import StorageQueueEventSubscriptionDestination - from ._models import StringBeginsWithAdvancedFilter - from ._models import StringContainsAdvancedFilter - from ._models import StringEndsWithAdvancedFilter - from ._models import StringInAdvancedFilter - from ._models import StringNotInAdvancedFilter - from ._models import SystemTopic - from ._models import SystemTopicUpdateParameters - from ._models import Topic - from ._models import TopicRegenerateKeyRequest - from ._models import TopicSharedAccessKeys - from ._models import TopicTypeInfo - from ._models import TopicUpdateParameters - from ._models import TrackedResource - from ._models import UserIdentityProperties - from ._models import WebHookEventSubscriptionDestination -from ._paged_models import DomainPaged -from ._paged_models import DomainTopicPaged -from ._paged_models import EventChannelPaged -from ._paged_models import EventSubscriptionPaged -from ._paged_models import EventTypePaged -from ._paged_models import OperationPaged -from ._paged_models import PartnerNamespacePaged -from ._paged_models import PartnerRegistrationPaged -from ._paged_models import PartnerTopicPaged -from ._paged_models import PrivateEndpointConnectionPaged -from ._paged_models import PrivateLinkResourcePaged -from ._paged_models import SystemTopicPaged -from ._paged_models import TopicPaged -from ._paged_models import TopicTypeInfoPaged -from ._event_grid_management_client_enums import ( - PersistedConnectionStatus, - ResourceProvisioningState, - DomainProvisioningState, - InputSchema, - PublicNetworkAccess, - IpActionType, - Sku, - IdentityType, - DomainTopicProvisioningState, - EventChannelProvisioningState, - PartnerTopicReadinessState, - EventSubscriptionProvisioningState, - EventSubscriptionIdentityType, - EventDeliverySchema, - PartnerNamespaceProvisioningState, - PartnerRegistrationProvisioningState, - PartnerRegistrationVisibilityState, - PartnerTopicProvisioningState, - PartnerTopicActivationState, - PartnerTopicTypeAuthorizationState, - TopicProvisioningState, - ResourceRegionType, - TopicTypeProvisioningState, -) - -__all__ = [ - 'AdvancedFilter', - 'AzureFunctionEventSubscriptionDestination', - 'BoolEqualsAdvancedFilter', - 'ConnectionState', - 'DeadLetterDestination', - 'DeadLetterWithResourceIdentity', - 'DeliveryWithResourceIdentity', - 'Domain', - 'DomainRegenerateKeyRequest', - 'DomainSharedAccessKeys', - 'DomainTopic', - 'DomainUpdateParameters', - 'EventChannel', - 'EventChannelDestination', - 'EventChannelFilter', - 'EventChannelSource', - 'EventHubEventSubscriptionDestination', - 'EventSubscription', - 'EventSubscriptionDestination', - 'EventSubscriptionFilter', - 'EventSubscriptionFullUrl', - 'EventSubscriptionIdentity', - 'EventSubscriptionUpdateParameters', - 'EventType', - 'ExtensionTopic', - 'HybridConnectionEventSubscriptionDestination', - 'IdentityInfo', - 'InboundIpRule', - 'InputSchemaMapping', - 'JsonField', - 'JsonFieldWithDefault', - 'JsonInputSchemaMapping', - 'NumberGreaterThanAdvancedFilter', - 'NumberGreaterThanOrEqualsAdvancedFilter', - 'NumberInAdvancedFilter', - 'NumberLessThanAdvancedFilter', - 'NumberLessThanOrEqualsAdvancedFilter', - 'NumberNotInAdvancedFilter', - 'Operation', - 'OperationInfo', - 'PartnerNamespace', - 'PartnerNamespaceRegenerateKeyRequest', - 'PartnerNamespaceSharedAccessKeys', - 'PartnerNamespaceUpdateParameters', - 'PartnerRegistration', - 'PartnerRegistrationEventTypesListResult', - 'PartnerRegistrationUpdateParameters', - 'PartnerTopic', - 'PartnerTopicType', - 'PartnerTopicTypesListResult', - 'PartnerTopicUpdateParameters', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateLinkResource', - 'Resource', - 'ResourceSku', - 'RetryPolicy', - 'ServiceBusQueueEventSubscriptionDestination', - 'ServiceBusTopicEventSubscriptionDestination', - 'StorageBlobDeadLetterDestination', - 'StorageQueueEventSubscriptionDestination', - 'StringBeginsWithAdvancedFilter', - 'StringContainsAdvancedFilter', - 'StringEndsWithAdvancedFilter', - 'StringInAdvancedFilter', - 'StringNotInAdvancedFilter', - 'SystemTopic', - 'SystemTopicUpdateParameters', - 'Topic', - 'TopicRegenerateKeyRequest', - 'TopicSharedAccessKeys', - 'TopicTypeInfo', - 'TopicUpdateParameters', - 'TrackedResource', - 'UserIdentityProperties', - 'WebHookEventSubscriptionDestination', - 'DomainPaged', - 'DomainTopicPaged', - 'EventChannelPaged', - 'EventSubscriptionPaged', - 'OperationPaged', - 'PartnerNamespacePaged', - 'PartnerRegistrationPaged', - 'PartnerTopicPaged', - 'PrivateEndpointConnectionPaged', - 'PrivateLinkResourcePaged', - 'SystemTopicPaged', - 'TopicPaged', - 'EventTypePaged', - 'TopicTypeInfoPaged', - 'PersistedConnectionStatus', - 'ResourceProvisioningState', - 'DomainProvisioningState', - 'InputSchema', - 'PublicNetworkAccess', - 'IpActionType', - 'Sku', - 'IdentityType', - 'DomainTopicProvisioningState', - 'EventChannelProvisioningState', - 'PartnerTopicReadinessState', - 'EventSubscriptionProvisioningState', - 'EventSubscriptionIdentityType', - 'EventDeliverySchema', - 'PartnerNamespaceProvisioningState', - 'PartnerRegistrationProvisioningState', - 'PartnerRegistrationVisibilityState', - 'PartnerTopicProvisioningState', - 'PartnerTopicActivationState', - 'PartnerTopicTypeAuthorizationState', - 'TopicProvisioningState', - 'ResourceRegionType', - 'TopicTypeProvisioningState', -] diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_event_grid_management_client_enums.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_event_grid_management_client_enums.py deleted file mode 100644 index 99687c96b4e..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_event_grid_management_client_enums.py +++ /dev/null @@ -1,201 +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 PersistedConnectionStatus(str, Enum): - - pending = "Pending" - approved = "Approved" - rejected = "Rejected" - disconnected = "Disconnected" - - -class ResourceProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class DomainProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class InputSchema(str, Enum): - - event_grid_schema = "EventGridSchema" - custom_event_schema = "CustomEventSchema" - cloud_event_schema_v1_0 = "CloudEventSchemaV1_0" - - -class PublicNetworkAccess(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class IpActionType(str, Enum): - - allow = "Allow" - - -class Sku(str, Enum): - - basic = "Basic" - premium = "Premium" - - -class IdentityType(str, Enum): - - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned, UserAssigned" - - -class DomainTopicProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class EventChannelProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class PartnerTopicReadinessState(str, Enum): - - not_activated_by_user_yet = "NotActivatedByUserYet" - activated_by_user = "ActivatedByUser" - deactivated_by_user = "DeactivatedByUser" - deleted_by_user = "DeletedByUser" - - -class EventSubscriptionProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - awaiting_manual_action = "AwaitingManualAction" - - -class EventSubscriptionIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - - -class EventDeliverySchema(str, Enum): - - event_grid_schema = "EventGridSchema" - custom_input_schema = "CustomInputSchema" - cloud_event_schema_v1_0 = "CloudEventSchemaV1_0" - - -class PartnerNamespaceProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class PartnerRegistrationProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class PartnerRegistrationVisibilityState(str, Enum): - - hidden = "Hidden" - public_preview = "PublicPreview" - generally_available = "GenerallyAvailable" - - -class PartnerTopicProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class PartnerTopicActivationState(str, Enum): - - never_activated = "NeverActivated" - activated = "Activated" - deactivated = "Deactivated" - - -class PartnerTopicTypeAuthorizationState(str, Enum): - - not_applicable = "NotApplicable" - not_authorized = "NotAuthorized" - authorized = "Authorized" - - -class TopicProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" - - -class ResourceRegionType(str, Enum): - - regional_resource = "RegionalResource" - global_resource = "GlobalResource" - - -class TopicTypeProvisioningState(str, Enum): - - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - succeeded = "Succeeded" - canceled = "Canceled" - failed = "Failed" diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models.py deleted file mode 100644 index abaa4eba8ca..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models.py +++ /dev/null @@ -1,2826 +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 AdvancedFilter(Model): - """This is the base type that represents an advanced filter. To configure an - advanced filter, do not directly instantiate an object of this class. - Instead, instantiate an object of a derived class such as - BoolEqualsAdvancedFilter, NumberInAdvancedFilter, - StringEqualsAdvancedFilter etc. depending on the type of the key based on - which you want to filter. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: NumberInAdvancedFilter, NumberNotInAdvancedFilter, - NumberLessThanAdvancedFilter, NumberGreaterThanAdvancedFilter, - NumberLessThanOrEqualsAdvancedFilter, - NumberGreaterThanOrEqualsAdvancedFilter, BoolEqualsAdvancedFilter, - StringInAdvancedFilter, StringNotInAdvancedFilter, - StringBeginsWithAdvancedFilter, StringEndsWithAdvancedFilter, - StringContainsAdvancedFilter - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - } - - _subtype_map = { - 'operator_type': {'NumberIn': 'NumberInAdvancedFilter', 'NumberNotIn': 'NumberNotInAdvancedFilter', 'NumberLessThan': 'NumberLessThanAdvancedFilter', 'NumberGreaterThan': 'NumberGreaterThanAdvancedFilter', 'NumberLessThanOrEquals': 'NumberLessThanOrEqualsAdvancedFilter', 'NumberGreaterThanOrEquals': 'NumberGreaterThanOrEqualsAdvancedFilter', 'BoolEquals': 'BoolEqualsAdvancedFilter', 'StringIn': 'StringInAdvancedFilter', 'StringNotIn': 'StringNotInAdvancedFilter', 'StringBeginsWith': 'StringBeginsWithAdvancedFilter', 'StringEndsWith': 'StringEndsWithAdvancedFilter', 'StringContains': 'StringContainsAdvancedFilter'} - } - - def __init__(self, **kwargs): - super(AdvancedFilter, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.operator_type = None - - -class EventSubscriptionDestination(Model): - """Information about the destination for an event subscription. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: WebHookEventSubscriptionDestination, - EventHubEventSubscriptionDestination, - StorageQueueEventSubscriptionDestination, - HybridConnectionEventSubscriptionDestination, - ServiceBusQueueEventSubscriptionDestination, - ServiceBusTopicEventSubscriptionDestination, - AzureFunctionEventSubscriptionDestination - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination', 'ServiceBusQueue': 'ServiceBusQueueEventSubscriptionDestination', 'ServiceBusTopic': 'ServiceBusTopicEventSubscriptionDestination', 'AzureFunction': 'AzureFunctionEventSubscriptionDestination'} - } - - def __init__(self, **kwargs): - super(EventSubscriptionDestination, self).__init__(**kwargs) - self.endpoint_type = None - - -class AzureFunctionEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the azure function destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Azure Function destination of an event subscription. - :type resource_id: str - :param max_events_per_batch: Maximum number of events per batch. - :type max_events_per_batch: int - :param preferred_batch_size_in_kilobytes: Preferred batch size in - Kilobytes. - :type preferred_batch_size_in_kilobytes: int - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, - 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(AzureFunctionEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.max_events_per_batch = kwargs.get('max_events_per_batch', None) - self.preferred_batch_size_in_kilobytes = kwargs.get('preferred_batch_size_in_kilobytes', None) - self.endpoint_type = 'AzureFunction' - - -class BoolEqualsAdvancedFilter(AdvancedFilter): - """BoolEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The boolean filter value. - :type value: bool - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BoolEqualsAdvancedFilter, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.operator_type = 'BoolEquals' - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ConnectionState(Model): - """ConnectionState information. - - :param status: Status of the connection. Possible values include: - 'Pending', 'Approved', 'Rejected', 'Disconnected' - :type status: str or - ~azure.mgmt.eventgrid.models.PersistedConnectionStatus - :param description: Description of the connection state. - :type description: str - :param actions_required: Actions required (if any). - :type actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) - - -class DeadLetterDestination(Model): - """Information about the dead letter destination for an event subscription. To - configure a deadletter destination, do not directly instantiate an object - of this class. Instead, instantiate an object of a derived class. - Currently, StorageBlobDeadLetterDestination is the only class that derives - from this class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: StorageBlobDeadLetterDestination - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'StorageBlob': 'StorageBlobDeadLetterDestination'} - } - - def __init__(self, **kwargs): - super(DeadLetterDestination, self).__init__(**kwargs) - self.endpoint_type = None - - -class DeadLetterWithResourceIdentity(Model): - """Information about the deadletter destination with resource identity. - - :param identity: The identity to use when dead-lettering events. - :type identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity - :param dead_letter_destination: Information about the destination where - events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'EventSubscriptionIdentity'}, - 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, - } - - def __init__(self, **kwargs): - super(DeadLetterWithResourceIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.dead_letter_destination = kwargs.get('dead_letter_destination', None) - - -class DeliveryWithResourceIdentity(Model): - """Information about the delivery for an event subscription with resource - identity. - - :param identity: The identity to use when delivering events. - :type identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'EventSubscriptionIdentity'}, - 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, - } - - def __init__(self, **kwargs): - super(DeliveryWithResourceIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.destination = kwargs.get('destination', None) - - -class Resource(Model): - """Definition of a Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """Definition of a Tracked Resource. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class Domain(TrackedResource): - """EventGrid Domain. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param private_endpoint_connections: List of private endpoint connections. - :type private_endpoint_connections: - list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - :ivar provisioning_state: Provisioning state of the domain. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.DomainProvisioningState - :ivar endpoint: Endpoint for the domain. - :vartype endpoint: str - :param input_schema: This determines the format that Event Grid should - expect for incoming events published to the domain. Possible values - include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. - Default value: "EventGridSchema" . - :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema - :param input_schema_mapping: Information about the InputSchemaMapping - which specified the info about mapping event payload. - :type input_schema_mapping: - ~azure.mgmt.eventgrid.models.InputSchemaMapping - :ivar metric_resource_id: Metric resource id for the domain. - :vartype metric_resource_id: str - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the domain. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, - 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - } - - def __init__(self, **kwargs): - super(Domain, self).__init__(**kwargs) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.provisioning_state = None - self.endpoint = None - self.input_schema = kwargs.get('input_schema', "EventGridSchema") - self.input_schema_mapping = kwargs.get('input_schema_mapping', None) - self.metric_resource_id = None - self.public_network_access = kwargs.get('public_network_access', None) - self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - - -class DomainRegenerateKeyRequest(Model): - """Domain regenerate share access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate key1 or key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DomainRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class DomainSharedAccessKeys(Model): - """Shared access keys of the Domain. - - :param key1: Shared access key1 for the domain. - :type key1: str - :param key2: Shared access key2 for the domain. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DomainSharedAccessKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class DomainTopic(Resource): - """Domain Topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param provisioning_state: Provisioning state of the domain topic. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.DomainTopicProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DomainTopic, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class DomainUpdateParameters(Model): - """Properties of the Domain update. - - :param tags: Tags of the domains resource. - :type tags: dict[str, str] - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - :param sku: The Sku pricing tier for the domain. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - } - - def __init__(self, **kwargs): - super(DomainUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - - -class EventChannel(Resource): - """Event Channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param source: Source of the event channel. This represents a unique - resource in the partner's resource model. - :type source: ~azure.mgmt.eventgrid.models.EventChannelSource - :param destination: Represents the destination of an event channel. - :type destination: ~azure.mgmt.eventgrid.models.EventChannelDestination - :ivar provisioning_state: Provisioning state of the event channel. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.EventChannelProvisioningState - :ivar partner_topic_readiness_state: The readiness state of the - corresponding partner topic. Possible values include: - 'NotActivatedByUserYet', 'ActivatedByUser', 'DeactivatedByUser', - 'DeletedByUser' - :vartype partner_topic_readiness_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicReadinessState - :param expiration_time_if_not_activated_utc: Expiration time of the event - channel. If this timer expires while the corresponding partner topic is - never activated, - the event channel and corresponding partner topic are deleted. - :type expiration_time_if_not_activated_utc: datetime - :param filter: Information about the filter for the event channel. - :type filter: ~azure.mgmt.eventgrid.models.EventChannelFilter - :param partner_topic_friendly_description: Friendly description about the - topic. This can be set by the publisher/partner to show custom description - for the customer partner topic. - This will be helpful to remove any ambiguity of the origin of creation of - the partner topic for the customer. - :type partner_topic_friendly_description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'partner_topic_readiness_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'EventChannelSource'}, - 'destination': {'key': 'properties.destination', 'type': 'EventChannelDestination'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_topic_readiness_state': {'key': 'properties.partnerTopicReadinessState', 'type': 'str'}, - 'expiration_time_if_not_activated_utc': {'key': 'properties.expirationTimeIfNotActivatedUtc', 'type': 'iso-8601'}, - 'filter': {'key': 'properties.filter', 'type': 'EventChannelFilter'}, - 'partner_topic_friendly_description': {'key': 'properties.partnerTopicFriendlyDescription', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventChannel, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.destination = kwargs.get('destination', None) - self.provisioning_state = None - self.partner_topic_readiness_state = None - self.expiration_time_if_not_activated_utc = kwargs.get('expiration_time_if_not_activated_utc', None) - self.filter = kwargs.get('filter', None) - self.partner_topic_friendly_description = kwargs.get('partner_topic_friendly_description', None) - - -class EventChannelDestination(Model): - """Properties of the destination of an event channel. - - :param azure_subscription_id: Azure subscription ID of the customer - creating the event channel. The partner topic - associated with the event channel will be created under this Azure - subscription. - :type azure_subscription_id: str - :param resource_group: Azure Resource Group of the customer creating the - event channel. The partner topic - associated with the event channel will be created under this resource - group. - :type resource_group: str - :param partner_topic_name: Name of the partner topic associated with the - event channel. - :type partner_topic_name: str - """ - - _attribute_map = { - 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'partner_topic_name': {'key': 'partnerTopicName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventChannelDestination, self).__init__(**kwargs) - self.azure_subscription_id = kwargs.get('azure_subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.partner_topic_name = kwargs.get('partner_topic_name', None) - - -class EventChannelFilter(Model): - """Filter for the Event Channel. - - :param advanced_filters: An array of advanced filters that are used for - filtering event channels. - :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] - """ - - _attribute_map = { - 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, - } - - def __init__(self, **kwargs): - super(EventChannelFilter, self).__init__(**kwargs) - self.advanced_filters = kwargs.get('advanced_filters', None) - - -class EventChannelSource(Model): - """Properties of the source of an event channel. - - :param source: The identifier of the resource that's the source of the - events. - This represents a unique resource in the partner's resource model. - :type source: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventChannelSource, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - - -class EventHubEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the event hub destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - an Event Hub destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventHubEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.endpoint_type = 'EventHub' - - -class EventSubscription(Resource): - """Event Subscription. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :ivar topic: Name of the topic of the event subscription. - :vartype topic: str - :ivar provisioning_state: Provisioning state of the event subscription. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed', 'AwaitingManualAction' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - :param delivery_with_resource_identity: Information about the destination - where events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type delivery_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity - :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter - :param labels: List of user defined labels. - :type labels: list[str] - :param expiration_time_utc: Expiration time of the event subscription. - :type expiration_time_utc: datetime - :param event_delivery_schema: The event delivery schema for the event - subscription. Possible values include: 'EventGridSchema', - 'CustomInputSchema', 'CloudEventSchemaV1_0' - :type event_delivery_schema: str or - ~azure.mgmt.eventgrid.models.EventDeliverySchema - :param retry_policy: The retry policy for events. This can be used to - configure maximum number of delivery attempts and time to live for events. - :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy - :param dead_letter_destination: The dead letter destination of the event - subscription. Any event that cannot be delivered to its' destination is - sent to the dead letter destination. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - :param dead_letter_with_resource_identity: The dead letter destination of - the event subscription. Any event that cannot be delivered to its' - destination is sent to the dead letter destination. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'topic': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'topic': {'key': 'properties.topic', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, - 'delivery_with_resource_identity': {'key': 'properties.deliveryWithResourceIdentity', 'type': 'DeliveryWithResourceIdentity'}, - 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, - 'labels': {'key': 'properties.labels', 'type': '[str]'}, - 'expiration_time_utc': {'key': 'properties.expirationTimeUtc', 'type': 'iso-8601'}, - 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, - 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, - 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, - 'dead_letter_with_resource_identity': {'key': 'properties.deadLetterWithResourceIdentity', 'type': 'DeadLetterWithResourceIdentity'}, - } - - def __init__(self, **kwargs): - super(EventSubscription, self).__init__(**kwargs) - self.topic = None - self.provisioning_state = None - self.destination = kwargs.get('destination', None) - self.delivery_with_resource_identity = kwargs.get('delivery_with_resource_identity', None) - self.filter = kwargs.get('filter', None) - self.labels = kwargs.get('labels', None) - self.expiration_time_utc = kwargs.get('expiration_time_utc', None) - self.event_delivery_schema = kwargs.get('event_delivery_schema', None) - self.retry_policy = kwargs.get('retry_policy', None) - self.dead_letter_destination = kwargs.get('dead_letter_destination', None) - self.dead_letter_with_resource_identity = kwargs.get('dead_letter_with_resource_identity', None) - - -class EventSubscriptionFilter(Model): - """Filter for the Event Subscription. - - :param subject_begins_with: An optional string to filter events for an - event subscription based on a resource path prefix. - The format of this depends on the publisher of the events. - Wildcard characters are not supported in this path. - :type subject_begins_with: str - :param subject_ends_with: An optional string to filter events for an event - subscription based on a resource path suffix. - Wildcard characters are not supported in this path. - :type subject_ends_with: str - :param included_event_types: A list of applicable event types that need to - be part of the event subscription. If it is desired to subscribe to all - default event types, set the IncludedEventTypes to null. - :type included_event_types: list[str] - :param is_subject_case_sensitive: Specifies if the SubjectBeginsWith and - SubjectEndsWith properties of the filter - should be compared in a case sensitive manner. Default value: False . - :type is_subject_case_sensitive: bool - :param advanced_filters: An array of advanced filters that are used for - filtering event subscriptions. - :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] - """ - - _attribute_map = { - 'subject_begins_with': {'key': 'subjectBeginsWith', 'type': 'str'}, - 'subject_ends_with': {'key': 'subjectEndsWith', 'type': 'str'}, - 'included_event_types': {'key': 'includedEventTypes', 'type': '[str]'}, - 'is_subject_case_sensitive': {'key': 'isSubjectCaseSensitive', 'type': 'bool'}, - 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, - } - - def __init__(self, **kwargs): - super(EventSubscriptionFilter, self).__init__(**kwargs) - self.subject_begins_with = kwargs.get('subject_begins_with', None) - self.subject_ends_with = kwargs.get('subject_ends_with', None) - self.included_event_types = kwargs.get('included_event_types', None) - self.is_subject_case_sensitive = kwargs.get('is_subject_case_sensitive', False) - self.advanced_filters = kwargs.get('advanced_filters', None) - - -class EventSubscriptionFullUrl(Model): - """Full endpoint url of an event subscription. - - :param endpoint_url: The URL that represents the endpoint of the - destination of an event subscription. - :type endpoint_url: str - """ - - _attribute_map = { - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventSubscriptionFullUrl, self).__init__(**kwargs) - self.endpoint_url = kwargs.get('endpoint_url', None) - - -class EventSubscriptionIdentity(Model): - """The identity information with the event subscription. - - :param type: The type of managed identity used. The type 'SystemAssigned, - UserAssigned' includes both an implicitly created identity and a set of - user-assigned identities. The type 'None' will remove any identity. - Possible values include: 'SystemAssigned', 'UserAssigned' - :type type: str or - ~azure.mgmt.eventgrid.models.EventSubscriptionIdentityType - :param user_assigned_identity: The user identity associated with the - resource. - :type user_assigned_identity: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EventSubscriptionIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class EventSubscriptionUpdateParameters(Model): - """Properties of the Event Subscription update. - - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - :param delivery_with_resource_identity: Information about the destination - where events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (topic / domain) to - acquire the authentication tokens being used during delivery / - dead-lettering. - :type delivery_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity - :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter - :param labels: List of user defined labels. - :type labels: list[str] - :param expiration_time_utc: Information about the expiration time for the - event subscription. - :type expiration_time_utc: datetime - :param event_delivery_schema: The event delivery schema for the event - subscription. Possible values include: 'EventGridSchema', - 'CustomInputSchema', 'CloudEventSchemaV1_0' - :type event_delivery_schema: str or - ~azure.mgmt.eventgrid.models.EventDeliverySchema - :param retry_policy: The retry policy for events. This can be used to - configure maximum number of delivery attempts and time to live for events. - :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy - :param dead_letter_destination: The dead letter destination of the event - subscription. Any event that cannot be delivered to its' destination is - sent to the dead letter destination. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - :param dead_letter_with_resource_identity: The dead letter destination of - the event subscription. Any event that cannot be delivered to its' - destination is sent to the dead letter destination. - Uses the managed identity setup on the parent resource (topic / domain) to - acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity - """ - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, - 'delivery_with_resource_identity': {'key': 'deliveryWithResourceIdentity', 'type': 'DeliveryWithResourceIdentity'}, - 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, - 'labels': {'key': 'labels', 'type': '[str]'}, - 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, - 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, - 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, - 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, - 'dead_letter_with_resource_identity': {'key': 'deadLetterWithResourceIdentity', 'type': 'DeadLetterWithResourceIdentity'}, - } - - def __init__(self, **kwargs): - super(EventSubscriptionUpdateParameters, self).__init__(**kwargs) - self.destination = kwargs.get('destination', None) - self.delivery_with_resource_identity = kwargs.get('delivery_with_resource_identity', None) - self.filter = kwargs.get('filter', None) - self.labels = kwargs.get('labels', None) - self.expiration_time_utc = kwargs.get('expiration_time_utc', None) - self.event_delivery_schema = kwargs.get('event_delivery_schema', None) - self.retry_policy = kwargs.get('retry_policy', None) - self.dead_letter_destination = kwargs.get('dead_letter_destination', None) - self.dead_letter_with_resource_identity = kwargs.get('dead_letter_with_resource_identity', None) - - -class EventType(Resource): - """Event Type for a subject under a topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param display_name: Display name of the event type. - :type display_name: str - :param description: Description of the event type. - :type description: str - :param schema_url: Url of the schema for this event type. - :type schema_url: str - :param is_in_default_set: IsInDefaultSet flag of the event type. - :type is_in_default_set: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'schema_url': {'key': 'properties.schemaUrl', 'type': 'str'}, - 'is_in_default_set': {'key': 'properties.isInDefaultSet', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(EventType, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - self.schema_url = kwargs.get('schema_url', None) - self.is_in_default_set = kwargs.get('is_in_default_set', None) - - -class ExtensionTopic(Resource): - """Event grid Extension Topic. This is used for getting Event Grid related - metrics for Azure resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param description: Description of the extension topic. - :type description: str - :param system_topic: System topic resource id which is mapped to the - source. - :type system_topic: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'system_topic': {'key': 'properties.systemTopic', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExtensionTopic, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.system_topic = kwargs.get('system_topic', None) - - -class HybridConnectionEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the HybridConnection destination for an event - subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of an hybrid connection that is - the destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HybridConnectionEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.endpoint_type = 'HybridConnection' - - -class IdentityInfo(Model): - """The identity information for the resource. - - :param type: The type of managed identity used. The type 'SystemAssigned, - UserAssigned' includes both an implicitly created identity and a set of - user-assigned identities. The type 'None' will remove any identity. - Possible values include: 'None', 'SystemAssigned', 'UserAssigned', - 'SystemAssigned, UserAssigned' - :type type: str or ~azure.mgmt.eventgrid.models.IdentityType - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity dictionary key references will be ARM - resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - This property is currently not used and reserved for future usage. - :type user_assigned_identities: dict[str, - ~azure.mgmt.eventgrid.models.UserIdentityProperties] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, **kwargs): - super(IdentityInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = kwargs.get('principal_id', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class InboundIpRule(Model): - """InboundIpRule. - - :param ip_mask: IP Address in CIDR notation e.g., 10.0.0.0/8. - :type ip_mask: str - :param action: Action to perform based on the match or no match of the - IpMask. Possible values include: 'Allow' - :type action: str or ~azure.mgmt.eventgrid.models.IpActionType - """ - - _attribute_map = { - 'ip_mask': {'key': 'ipMask', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(InboundIpRule, self).__init__(**kwargs) - self.ip_mask = kwargs.get('ip_mask', None) - self.action = kwargs.get('action', None) - - -class InputSchemaMapping(Model): - """By default, Event Grid expects events to be in the Event Grid event schema. - Specifying an input schema mapping enables publishing to Event Grid using a - custom input schema. Currently, the only supported type of - InputSchemaMapping is 'JsonInputSchemaMapping'. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JsonInputSchemaMapping - - All required parameters must be populated in order to send to Azure. - - :param input_schema_mapping_type: Required. Constant filled by server. - :type input_schema_mapping_type: str - """ - - _validation = { - 'input_schema_mapping_type': {'required': True}, - } - - _attribute_map = { - 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, - } - - _subtype_map = { - 'input_schema_mapping_type': {'Json': 'JsonInputSchemaMapping'} - } - - def __init__(self, **kwargs): - super(InputSchemaMapping, self).__init__(**kwargs) - self.input_schema_mapping_type = None - - -class JsonField(Model): - """This is used to express the source of an input schema mapping for a single - target field in the Event Grid Event schema. This is currently used in the - mappings for the 'id', 'topic' and 'eventtime' properties. This represents - a field in the input event schema. - - :param source_field: Name of a field in the input event schema that's to - be used as the source of a mapping. - :type source_field: str - """ - - _attribute_map = { - 'source_field': {'key': 'sourceField', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JsonField, self).__init__(**kwargs) - self.source_field = kwargs.get('source_field', None) - - -class JsonFieldWithDefault(Model): - """This is used to express the source of an input schema mapping for a single - target field - in the Event Grid Event schema. This is currently used in the mappings for - the 'subject', - 'eventtype' and 'dataversion' properties. This represents a field in the - input event schema - along with a default value to be used, and at least one of these two - properties should be provided. - - :param source_field: Name of a field in the input event schema that's to - be used as the source of a mapping. - :type source_field: str - :param default_value: The default value to be used for mapping when a - SourceField is not provided or if there's no property with the specified - name in the published JSON event payload. - :type default_value: str - """ - - _attribute_map = { - 'source_field': {'key': 'sourceField', 'type': 'str'}, - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JsonFieldWithDefault, self).__init__(**kwargs) - self.source_field = kwargs.get('source_field', None) - self.default_value = kwargs.get('default_value', None) - - -class JsonInputSchemaMapping(InputSchemaMapping): - """This enables publishing to Event Grid using a custom input schema. This can - be used to map properties from a custom input JSON schema to the Event Grid - event schema. - - All required parameters must be populated in order to send to Azure. - - :param input_schema_mapping_type: Required. Constant filled by server. - :type input_schema_mapping_type: str - :param id: The mapping information for the Id property of the Event Grid - Event. - :type id: ~azure.mgmt.eventgrid.models.JsonField - :param topic: The mapping information for the Topic property of the Event - Grid Event. - :type topic: ~azure.mgmt.eventgrid.models.JsonField - :param event_time: The mapping information for the EventTime property of - the Event Grid Event. - :type event_time: ~azure.mgmt.eventgrid.models.JsonField - :param event_type: The mapping information for the EventType property of - the Event Grid Event. - :type event_type: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - :param subject: The mapping information for the Subject property of the - Event Grid Event. - :type subject: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - :param data_version: The mapping information for the DataVersion property - of the Event Grid Event. - :type data_version: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - """ - - _validation = { - 'input_schema_mapping_type': {'required': True}, - } - - _attribute_map = { - 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, - 'id': {'key': 'properties.id', 'type': 'JsonField'}, - 'topic': {'key': 'properties.topic', 'type': 'JsonField'}, - 'event_time': {'key': 'properties.eventTime', 'type': 'JsonField'}, - 'event_type': {'key': 'properties.eventType', 'type': 'JsonFieldWithDefault'}, - 'subject': {'key': 'properties.subject', 'type': 'JsonFieldWithDefault'}, - 'data_version': {'key': 'properties.dataVersion', 'type': 'JsonFieldWithDefault'}, - } - - def __init__(self, **kwargs): - super(JsonInputSchemaMapping, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.topic = kwargs.get('topic', None) - self.event_time = kwargs.get('event_time', None) - self.event_type = kwargs.get('event_type', None) - self.subject = kwargs.get('subject', None) - self.data_version = kwargs.get('data_version', None) - self.input_schema_mapping_type = 'Json' - - -class NumberGreaterThanAdvancedFilter(AdvancedFilter): - """NumberGreaterThan Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(NumberGreaterThanAdvancedFilter, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.operator_type = 'NumberGreaterThan' - - -class NumberGreaterThanOrEqualsAdvancedFilter(AdvancedFilter): - """NumberGreaterThanOrEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(NumberGreaterThanOrEqualsAdvancedFilter, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.operator_type = 'NumberGreaterThanOrEquals' - - -class NumberInAdvancedFilter(AdvancedFilter): - """NumberIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[float] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[float]'}, - } - - def __init__(self, **kwargs): - super(NumberInAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'NumberIn' - - -class NumberLessThanAdvancedFilter(AdvancedFilter): - """NumberLessThan Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(NumberLessThanAdvancedFilter, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.operator_type = 'NumberLessThan' - - -class NumberLessThanOrEqualsAdvancedFilter(AdvancedFilter): - """NumberLessThanOrEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(NumberLessThanOrEqualsAdvancedFilter, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.operator_type = 'NumberLessThanOrEquals' - - -class NumberNotInAdvancedFilter(AdvancedFilter): - """NumberNotIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[float] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[float]'}, - } - - def __init__(self, **kwargs): - super(NumberNotInAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'NumberNotIn' - - -class Operation(Model): - """Represents an operation returned by the GetOperations request. - - :param name: Name of the operation - :type name: str - :param display: Display name of the operation - :type display: ~azure.mgmt.eventgrid.models.OperationInfo - :param origin: Origin of the operation - :type origin: str - :param properties: Properties of the operation - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class OperationInfo(Model): - """Information about an operation. - - :param provider: Name of the provider - :type provider: str - :param resource: Name of the resource type - :type resource: str - :param operation: Name of the operation - :type operation: str - :param description: Description of the operation - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationInfo, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class PartnerNamespace(TrackedResource): - """EventGrid Partner Namespace. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the partner namespace. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerNamespaceProvisioningState - :param partner_registration_fully_qualified_id: The fully qualified ARM Id - of the partner registration that should be associated with this partner - namespace. This takes the following format: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. - :type partner_registration_fully_qualified_id: str - :ivar endpoint: Endpoint for the partner namespace. - :vartype endpoint: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_registration_fully_qualified_id': {'key': 'properties.partnerRegistrationFullyQualifiedId', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerNamespace, self).__init__(**kwargs) - self.provisioning_state = None - self.partner_registration_fully_qualified_id = kwargs.get('partner_registration_fully_qualified_id', None) - self.endpoint = None - - -class PartnerNamespaceRegenerateKeyRequest(Model): - """PartnerNamespace regenerate shared access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate (key1 or key2). - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerNamespaceRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class PartnerNamespaceSharedAccessKeys(Model): - """Shared access keys of the partner namespace. - - :param key1: Shared access key1 for the partner namespace. - :type key1: str - :param key2: Shared access key2 for the partner namespace. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerNamespaceSharedAccessKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class PartnerNamespaceUpdateParameters(Model): - """Properties of the PartnerNamespace update. - - :param tags: Tags of the partner namespace. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(PartnerNamespaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PartnerRegistration(TrackedResource): - """Information about a partner registration. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the partner registration. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerRegistrationProvisioningState - :param partner_name: Official name of the partner name. For example: - "Contoso". - :type partner_name: str - :param partner_resource_type_name: Name of the partner resource type. - :type partner_resource_type_name: str - :param partner_resource_type_display_name: Display name of the partner - resource type. - :type partner_resource_type_display_name: str - :param partner_resource_type_description: Short description of the partner - resource type. The length of this description should not exceed 256 - characters. - :type partner_resource_type_description: str - :param long_description: Long description for the custom scenarios and - integration to be displayed in the portal if needed. - Length of this description should not exceed 2048 characters. - :type long_description: str - :param partner_customer_service_number: The customer service number of the - publisher. The expected phone format should start with a '+' sign - followed by the country code. The remaining digits are then followed. Only - digits and spaces are allowed and its - length cannot exceed 16 digits including country code. Examples of valid - phone numbers are: +1 515 123 4567 and - +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) - 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 - :type partner_customer_service_number: str - :param partner_customer_service_extension: The extension of the customer - service number of the publisher. Only digits are allowed and number of - digits should not exceed 10. - :type partner_customer_service_extension: str - :param customer_service_uri: The extension of the customer service URI of - the publisher. - :type customer_service_uri: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param logo_uri: URI of the logo. - :type logo_uri: str - :param visibility_state: Visibility state of the partner registration. - Possible values include: 'Hidden', 'PublicPreview', 'GenerallyAvailable' - :type visibility_state: str or - ~azure.mgmt.eventgrid.models.PartnerRegistrationVisibilityState - :param authorized_azure_subscription_ids: List of Azure subscription Ids - that are authorized to create a partner namespace - associated with this partner registration. This is an optional property. - Creating - partner namespaces is always permitted under the same Azure subscription - as the one used - for creating the partner registration. - :type authorized_azure_subscription_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, - 'partner_resource_type_name': {'key': 'properties.partnerResourceTypeName', 'type': 'str'}, - 'partner_resource_type_display_name': {'key': 'properties.partnerResourceTypeDisplayName', 'type': 'str'}, - 'partner_resource_type_description': {'key': 'properties.partnerResourceTypeDescription', 'type': 'str'}, - 'long_description': {'key': 'properties.longDescription', 'type': 'str'}, - 'partner_customer_service_number': {'key': 'properties.partnerCustomerServiceNumber', 'type': 'str'}, - 'partner_customer_service_extension': {'key': 'properties.partnerCustomerServiceExtension', 'type': 'str'}, - 'customer_service_uri': {'key': 'properties.customerServiceUri', 'type': 'str'}, - 'setup_uri': {'key': 'properties.setupUri', 'type': 'str'}, - 'logo_uri': {'key': 'properties.logoUri', 'type': 'str'}, - 'visibility_state': {'key': 'properties.visibilityState', 'type': 'str'}, - 'authorized_azure_subscription_ids': {'key': 'properties.authorizedAzureSubscriptionIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PartnerRegistration, self).__init__(**kwargs) - self.provisioning_state = None - self.partner_name = kwargs.get('partner_name', None) - self.partner_resource_type_name = kwargs.get('partner_resource_type_name', None) - self.partner_resource_type_display_name = kwargs.get('partner_resource_type_display_name', None) - self.partner_resource_type_description = kwargs.get('partner_resource_type_description', None) - self.long_description = kwargs.get('long_description', None) - self.partner_customer_service_number = kwargs.get('partner_customer_service_number', None) - self.partner_customer_service_extension = kwargs.get('partner_customer_service_extension', None) - self.customer_service_uri = kwargs.get('customer_service_uri', None) - self.setup_uri = kwargs.get('setup_uri', None) - self.logo_uri = kwargs.get('logo_uri', None) - self.visibility_state = kwargs.get('visibility_state', None) - self.authorized_azure_subscription_ids = kwargs.get('authorized_azure_subscription_ids', None) - - -class PartnerRegistrationEventTypesListResult(Model): - """Result of the List Partner Registration Event Types operation. - - :param value: A collection of partner registration event types. - :type value: list[~azure.mgmt.eventgrid.models.EventType] - :param next_link: A link for the next page of partner registration event - types. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EventType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerRegistrationEventTypesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PartnerRegistrationUpdateParameters(Model): - """Properties of the Partner Registration update. - - :param tags: Tags of the partner registration resource. - :type tags: dict[str, str] - :param partner_topic_type_name: Name of the partner topic type. - :type partner_topic_type_name: str - :param partner_topic_type_display_name: Display name of the partner topic - type. - :type partner_topic_type_display_name: str - :param partner_topic_type_description: Description of the partner topic - type. - :type partner_topic_type_description: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param logo_uri: URI of the partner logo. - :type logo_uri: str - :param authorized_azure_subscription_ids: List of IDs of Azure AD - applications that are authorized to create a partner namespace - associated with this partner registration. This is an optional property. - Creating - partner namespaces is always permitted under the same Azure subscription - as the one used - for creating the partner registration. - :type authorized_azure_subscription_ids: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'partner_topic_type_name': {'key': 'partnerTopicTypeName', 'type': 'str'}, - 'partner_topic_type_display_name': {'key': 'partnerTopicTypeDisplayName', 'type': 'str'}, - 'partner_topic_type_description': {'key': 'partnerTopicTypeDescription', 'type': 'str'}, - 'setup_uri': {'key': 'setupUri', 'type': 'str'}, - 'logo_uri': {'key': 'logoUri', 'type': 'str'}, - 'authorized_azure_subscription_ids': {'key': 'authorizedAzureSubscriptionIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PartnerRegistrationUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.partner_topic_type_name = kwargs.get('partner_topic_type_name', None) - self.partner_topic_type_display_name = kwargs.get('partner_topic_type_display_name', None) - self.partner_topic_type_description = kwargs.get('partner_topic_type_description', None) - self.setup_uri = kwargs.get('setup_uri', None) - self.logo_uri = kwargs.get('logo_uri', None) - self.authorized_azure_subscription_ids = kwargs.get('authorized_azure_subscription_ids', None) - - -class PartnerTopic(TrackedResource): - """EventGrid Partner 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param source: Source associated with this partner topic. This represents - a unique partner resource. - :type source: str - :param expiration_time_if_not_activated_utc: Expiration time of the - partner topic. If this timer expires while the partner topic is still - never activated, - the partner topic and corresponding event channel are deleted. - :type expiration_time_if_not_activated_utc: datetime - :ivar provisioning_state: Provisioning state of the partner topic. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicProvisioningState - :param activation_state: Activation state of the partner topic. Possible - values include: 'NeverActivated', 'Activated', 'Deactivated' - :type activation_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicActivationState - :param partner_topic_friendly_description: Friendly description about the - topic. This can be set by the publisher/partner to show custom description - for the customer partner topic. - This will be helpful to remove any ambiguity of the origin of creation of - the partner topic for the customer. - :type partner_topic_friendly_description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'expiration_time_if_not_activated_utc': {'key': 'properties.expirationTimeIfNotActivatedUtc', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'activation_state': {'key': 'properties.activationState', 'type': 'str'}, - 'partner_topic_friendly_description': {'key': 'properties.partnerTopicFriendlyDescription', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerTopic, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.expiration_time_if_not_activated_utc = kwargs.get('expiration_time_if_not_activated_utc', None) - self.provisioning_state = None - self.activation_state = kwargs.get('activation_state', None) - self.partner_topic_friendly_description = kwargs.get('partner_topic_friendly_description', None) - - -class PartnerTopicType(Resource): - """Properties of a partner topic type. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param partner_name: Official name of the partner. - :type partner_name: str - :param topic_type_name: Name of the partner topic type. This name should - be unique among all partner topic types names. - :type topic_type_name: str - :param display_name: Display Name for the partner topic type. - :type display_name: str - :param description: Description of the partner topic type. - :type description: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param authorization_state: Status of whether the customer has authorized - a partner to create partner topics - in the customer's subscription. Possible values include: 'NotApplicable', - 'NotAuthorized', 'Authorized' - :type authorization_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicTypeAuthorizationState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, - 'topic_type_name': {'key': 'properties.topicTypeName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'setup_uri': {'key': 'properties.setupUri', 'type': 'str'}, - 'authorization_state': {'key': 'properties.authorizationState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerTopicType, self).__init__(**kwargs) - self.partner_name = kwargs.get('partner_name', None) - self.topic_type_name = kwargs.get('topic_type_name', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - self.setup_uri = kwargs.get('setup_uri', None) - self.authorization_state = kwargs.get('authorization_state', None) - - -class PartnerTopicTypesListResult(Model): - """Result of the List Partner Topic Types operation. - - :param value: A collection of partner topic types. - :type value: list[~azure.mgmt.eventgrid.models.PartnerTopicType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PartnerTopicType]'}, - } - - def __init__(self, **kwargs): - super(PartnerTopicTypesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PartnerTopicUpdateParameters(Model): - """Properties of the Partner Topic update. - - :param tags: Tags of the partner topic. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(PartnerTopicUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class PrivateEndpoint(Model): - """PrivateEndpoint information. - - :param id: The ARM identifier for Private Endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(Resource): - """PrivateEndpointConnection. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param private_endpoint: The Private Endpoint resource for this - Connection. - :type private_endpoint: ~azure.mgmt.eventgrid.models.PrivateEndpoint - :param group_ids: GroupIds from the private link service resource. - :type group_ids: list[str] - :param private_link_service_connection_state: Details about the state of - the connection. - :type private_link_service_connection_state: - ~azure.mgmt.eventgrid.models.ConnectionState - :param provisioning_state: Provisioning state of the Private Endpoint - Connection. Possible values include: 'Creating', 'Updating', 'Deleting', - 'Succeeded', 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.ResourceProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateLinkResource(Model): - """Information of the private link resource. - - :param group_id: - :type group_id: str - :param display_name: - :type display_name: str - :param required_members: - :type required_members: list[str] - :param required_zone_names: - :type required_zone_names: list[str] - :param id: Fully qualified identifier of the resource. - :type id: str - :param name: Name of the resource - :type name: str - :param type: Type of the resource - :type type: str - """ - - _attribute_map = { - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = kwargs.get('group_id', None) - self.display_name = kwargs.get('display_name', None) - self.required_members = kwargs.get('required_members', None) - self.required_zone_names = kwargs.get('required_zone_names', None) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class ResourceSku(Model): - """Describes an EventGrid Resource Sku. - - :param name: The Sku name of the resource. The possible values are: Basic - or Premium. Possible values include: 'Basic', 'Premium' - :type name: str or ~azure.mgmt.eventgrid.models.Sku - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class RetryPolicy(Model): - """Information about the retry policy for an event subscription. - - :param max_delivery_attempts: Maximum number of delivery retry attempts - for events. - :type max_delivery_attempts: int - :param event_time_to_live_in_minutes: Time To Live (in minutes) for - events. - :type event_time_to_live_in_minutes: int - """ - - _attribute_map = { - 'max_delivery_attempts': {'key': 'maxDeliveryAttempts', 'type': 'int'}, - 'event_time_to_live_in_minutes': {'key': 'eventTimeToLiveInMinutes', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(RetryPolicy, self).__init__(**kwargs) - self.max_delivery_attempts = kwargs.get('max_delivery_attempts', None) - self.event_time_to_live_in_minutes = kwargs.get('event_time_to_live_in_minutes', None) - - -class ServiceBusQueueEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the service bus destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Service Bus destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceBusQueueEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.endpoint_type = 'ServiceBusQueue' - - -class ServiceBusTopicEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the service bus topic destination for an event - subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Service Bus Topic destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceBusTopicEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.endpoint_type = 'ServiceBusTopic' - - -class StorageBlobDeadLetterDestination(DeadLetterDestination): - """Information about the storage blob based dead letter destination. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of the storage account that is - the destination of the deadletter events - :type resource_id: str - :param blob_container_name: The name of the Storage blob container that is - the destination of the deadletter events - :type blob_container_name: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'blob_container_name': {'key': 'properties.blobContainerName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageBlobDeadLetterDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.blob_container_name = kwargs.get('blob_container_name', None) - self.endpoint_type = 'StorageBlob' - - -class StorageQueueEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the storage queue destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of the storage account that - contains the queue that is the destination of an event subscription. - :type resource_id: str - :param queue_name: The name of the Storage queue under a storage account - that is the destination of an event subscription. - :type queue_name: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'queue_name': {'key': 'properties.queueName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageQueueEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.queue_name = kwargs.get('queue_name', None) - self.endpoint_type = 'StorageQueue' - - -class StringBeginsWithAdvancedFilter(AdvancedFilter): - """StringBeginsWith Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(StringBeginsWithAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'StringBeginsWith' - - -class StringContainsAdvancedFilter(AdvancedFilter): - """StringContains Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(StringContainsAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'StringContains' - - -class StringEndsWithAdvancedFilter(AdvancedFilter): - """StringEndsWith Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(StringEndsWithAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'StringEndsWith' - - -class StringInAdvancedFilter(AdvancedFilter): - """StringIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(StringInAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'StringIn' - - -class StringNotInAdvancedFilter(AdvancedFilter): - """StringNotIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(StringNotInAdvancedFilter, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.operator_type = 'StringNotIn' - - -class SystemTopic(TrackedResource): - """EventGrid System 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the system topic. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.ResourceProvisioningState - :param source: Source for the system topic. - :type source: str - :param topic_type: TopicType for the system topic. - :type topic_type: str - :ivar metric_resource_id: Metric resource id for the system topic. - :vartype metric_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'topic_type': {'key': 'properties.topicType', 'type': 'str'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SystemTopic, self).__init__(**kwargs) - self.provisioning_state = None - self.source = kwargs.get('source', None) - self.topic_type = kwargs.get('topic_type', None) - self.metric_resource_id = None - - -class SystemTopicUpdateParameters(Model): - """Properties of the System Topic update. - - :param tags: Tags of the system topic. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(SystemTopicUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class Topic(TrackedResource): - """EventGrid 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param private_endpoint_connections: - :type private_endpoint_connections: - list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - :ivar provisioning_state: Provisioning state of the topic. Possible values - include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', - 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicProvisioningState - :ivar endpoint: Endpoint for the topic. - :vartype endpoint: str - :param input_schema: This determines the format that Event Grid should - expect for incoming events published to the topic. Possible values - include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. - Default value: "EventGridSchema" . - :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema - :param input_schema_mapping: This enables publishing using custom event - schemas. An InputSchemaMapping can be specified to map various properties - of a source schema to various required properties of the EventGridEvent - schema. - :type input_schema_mapping: - ~azure.mgmt.eventgrid.models.InputSchemaMapping - :ivar metric_resource_id: Metric resource id for the topic. - :vartype metric_resource_id: str - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the topic. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, - 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - } - - def __init__(self, **kwargs): - super(Topic, self).__init__(**kwargs) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.provisioning_state = None - self.endpoint = None - self.input_schema = kwargs.get('input_schema', "EventGridSchema") - self.input_schema_mapping = kwargs.get('input_schema_mapping', None) - self.metric_resource_id = None - self.public_network_access = kwargs.get('public_network_access', None) - self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - - -class TopicRegenerateKeyRequest(Model): - """Topic regenerate share access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate key1 or key2 - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TopicRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - - -class TopicSharedAccessKeys(Model): - """Shared access keys of the Topic. - - :param key1: Shared access key1 for the topic. - :type key1: str - :param key2: Shared access key2 for the topic. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TopicSharedAccessKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) - - -class TopicTypeInfo(Resource): - """Properties of a topic type info. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param provider: Namespace of the provider of the topic type. - :type provider: str - :param display_name: Display Name for the topic type. - :type display_name: str - :param description: Description of the topic type. - :type description: str - :param resource_region_type: Region type of the resource. Possible values - include: 'RegionalResource', 'GlobalResource' - :type resource_region_type: str or - ~azure.mgmt.eventgrid.models.ResourceRegionType - :param provisioning_state: Provisioning state of the topic type. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState - :param supported_locations: List of locations supported by this topic - type. - :type supported_locations: list[str] - :param source_resource_format: Source resource format. - :type source_resource_format: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provider': {'key': 'properties.provider', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'resource_region_type': {'key': 'properties.resourceRegionType', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'supported_locations': {'key': 'properties.supportedLocations', 'type': '[str]'}, - 'source_resource_format': {'key': 'properties.sourceResourceFormat', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TopicTypeInfo, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - self.resource_region_type = kwargs.get('resource_region_type', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.supported_locations = kwargs.get('supported_locations', None) - self.source_resource_format = kwargs.get('source_resource_format', None) - - -class TopicUpdateParameters(Model): - """Properties of the Topic update. - - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param identity: Resource identity information. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the topic. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - } - - def __init__(self, **kwargs): - super(TopicUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) - self.sku = kwargs.get('sku', None) - - -class UserIdentityProperties(Model): - """The information about the user identity. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) - - -class WebHookEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the webhook destination for an event subscription. - - 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 endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param endpoint_url: The URL that represents the endpoint of the - destination of an event subscription. - :type endpoint_url: str - :ivar endpoint_base_url: The base URL that represents the endpoint of the - destination of an event subscription. - :vartype endpoint_base_url: str - :param max_events_per_batch: Maximum number of events per batch. - :type max_events_per_batch: int - :param preferred_batch_size_in_kilobytes: Preferred batch size in - Kilobytes. - :type preferred_batch_size_in_kilobytes: int - :param azure_active_directory_tenant_id: The Azure Active Directory Tenant - ID to get the access token that will be included as the bearer token in - delivery requests. - :type azure_active_directory_tenant_id: str - :param azure_active_directory_application_id_or_uri: The Azure Active - Directory Application ID or URI to get the access token that will be - included as the bearer token in delivery requests. - :type azure_active_directory_application_id_or_uri: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'endpoint_base_url': {'readonly': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_url': {'key': 'properties.endpointUrl', 'type': 'str'}, - 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, - 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, - 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, - 'azure_active_directory_tenant_id': {'key': 'properties.azureActiveDirectoryTenantId', 'type': 'str'}, - 'azure_active_directory_application_id_or_uri': {'key': 'properties.azureActiveDirectoryApplicationIdOrUri', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(WebHookEventSubscriptionDestination, self).__init__(**kwargs) - self.endpoint_url = kwargs.get('endpoint_url', None) - self.endpoint_base_url = None - self.max_events_per_batch = kwargs.get('max_events_per_batch', None) - self.preferred_batch_size_in_kilobytes = kwargs.get('preferred_batch_size_in_kilobytes', None) - self.azure_active_directory_tenant_id = kwargs.get('azure_active_directory_tenant_id', None) - self.azure_active_directory_application_id_or_uri = kwargs.get('azure_active_directory_application_id_or_uri', None) - self.endpoint_type = 'WebHook' diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models_py3.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models_py3.py deleted file mode 100644 index 202b84a676a..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_models_py3.py +++ /dev/null @@ -1,2826 +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 AdvancedFilter(Model): - """This is the base type that represents an advanced filter. To configure an - advanced filter, do not directly instantiate an object of this class. - Instead, instantiate an object of a derived class such as - BoolEqualsAdvancedFilter, NumberInAdvancedFilter, - StringEqualsAdvancedFilter etc. depending on the type of the key based on - which you want to filter. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: NumberInAdvancedFilter, NumberNotInAdvancedFilter, - NumberLessThanAdvancedFilter, NumberGreaterThanAdvancedFilter, - NumberLessThanOrEqualsAdvancedFilter, - NumberGreaterThanOrEqualsAdvancedFilter, BoolEqualsAdvancedFilter, - StringInAdvancedFilter, StringNotInAdvancedFilter, - StringBeginsWithAdvancedFilter, StringEndsWithAdvancedFilter, - StringContainsAdvancedFilter - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - } - - _subtype_map = { - 'operator_type': {'NumberIn': 'NumberInAdvancedFilter', 'NumberNotIn': 'NumberNotInAdvancedFilter', 'NumberLessThan': 'NumberLessThanAdvancedFilter', 'NumberGreaterThan': 'NumberGreaterThanAdvancedFilter', 'NumberLessThanOrEquals': 'NumberLessThanOrEqualsAdvancedFilter', 'NumberGreaterThanOrEquals': 'NumberGreaterThanOrEqualsAdvancedFilter', 'BoolEquals': 'BoolEqualsAdvancedFilter', 'StringIn': 'StringInAdvancedFilter', 'StringNotIn': 'StringNotInAdvancedFilter', 'StringBeginsWith': 'StringBeginsWithAdvancedFilter', 'StringEndsWith': 'StringEndsWithAdvancedFilter', 'StringContains': 'StringContainsAdvancedFilter'} - } - - def __init__(self, *, key: str=None, **kwargs) -> None: - super(AdvancedFilter, self).__init__(**kwargs) - self.key = key - self.operator_type = None - - -class EventSubscriptionDestination(Model): - """Information about the destination for an event subscription. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: WebHookEventSubscriptionDestination, - EventHubEventSubscriptionDestination, - StorageQueueEventSubscriptionDestination, - HybridConnectionEventSubscriptionDestination, - ServiceBusQueueEventSubscriptionDestination, - ServiceBusTopicEventSubscriptionDestination, - AzureFunctionEventSubscriptionDestination - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination', 'ServiceBusQueue': 'ServiceBusQueueEventSubscriptionDestination', 'ServiceBusTopic': 'ServiceBusTopicEventSubscriptionDestination', 'AzureFunction': 'AzureFunctionEventSubscriptionDestination'} - } - - def __init__(self, **kwargs) -> None: - super(EventSubscriptionDestination, self).__init__(**kwargs) - self.endpoint_type = None - - -class AzureFunctionEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the azure function destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Azure Function destination of an event subscription. - :type resource_id: str - :param max_events_per_batch: Maximum number of events per batch. - :type max_events_per_batch: int - :param preferred_batch_size_in_kilobytes: Preferred batch size in - Kilobytes. - :type preferred_batch_size_in_kilobytes: int - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, - 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, - } - - def __init__(self, *, resource_id: str=None, max_events_per_batch: int=None, preferred_batch_size_in_kilobytes: int=None, **kwargs) -> None: - super(AzureFunctionEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.max_events_per_batch = max_events_per_batch - self.preferred_batch_size_in_kilobytes = preferred_batch_size_in_kilobytes - self.endpoint_type = 'AzureFunction' - - -class BoolEqualsAdvancedFilter(AdvancedFilter): - """BoolEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The boolean filter value. - :type value: bool - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bool'}, - } - - def __init__(self, *, key: str=None, value: bool=None, **kwargs) -> None: - super(BoolEqualsAdvancedFilter, self).__init__(key=key, **kwargs) - self.value = value - self.operator_type = 'BoolEquals' - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ConnectionState(Model): - """ConnectionState information. - - :param status: Status of the connection. Possible values include: - 'Pending', 'Approved', 'Rejected', 'Disconnected' - :type status: str or - ~azure.mgmt.eventgrid.models.PersistedConnectionStatus - :param description: Description of the connection state. - :type description: str - :param actions_required: Actions required (if any). - :type actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: - super(ConnectionState, self).__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class DeadLetterDestination(Model): - """Information about the dead letter destination for an event subscription. To - configure a deadletter destination, do not directly instantiate an object - of this class. Instead, instantiate an object of a derived class. - Currently, StorageBlobDeadLetterDestination is the only class that derives - from this class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: StorageBlobDeadLetterDestination - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - } - - _subtype_map = { - 'endpoint_type': {'StorageBlob': 'StorageBlobDeadLetterDestination'} - } - - def __init__(self, **kwargs) -> None: - super(DeadLetterDestination, self).__init__(**kwargs) - self.endpoint_type = None - - -class DeadLetterWithResourceIdentity(Model): - """Information about the deadletter destination with resource identity. - - :param identity: The identity to use when dead-lettering events. - :type identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity - :param dead_letter_destination: Information about the destination where - events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'EventSubscriptionIdentity'}, - 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, - } - - def __init__(self, *, identity=None, dead_letter_destination=None, **kwargs) -> None: - super(DeadLetterWithResourceIdentity, self).__init__(**kwargs) - self.identity = identity - self.dead_letter_destination = dead_letter_destination - - -class DeliveryWithResourceIdentity(Model): - """Information about the delivery for an event subscription with resource - identity. - - :param identity: The identity to use when delivering events. - :type identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'EventSubscriptionIdentity'}, - 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, - } - - def __init__(self, *, identity=None, destination=None, **kwargs) -> None: - super(DeliveryWithResourceIdentity, self).__init__(**kwargs) - self.identity = identity - self.destination = destination - - -class Resource(Model): - """Definition of a Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """Definition of a Tracked Resource. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.location = location - self.tags = tags - - -class Domain(TrackedResource): - """EventGrid Domain. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param private_endpoint_connections: List of private endpoint connections. - :type private_endpoint_connections: - list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - :ivar provisioning_state: Provisioning state of the domain. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.DomainProvisioningState - :ivar endpoint: Endpoint for the domain. - :vartype endpoint: str - :param input_schema: This determines the format that Event Grid should - expect for incoming events published to the domain. Possible values - include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. - Default value: "EventGridSchema" . - :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema - :param input_schema_mapping: Information about the InputSchemaMapping - which specified the info about mapping event payload. - :type input_schema_mapping: - ~azure.mgmt.eventgrid.models.InputSchemaMapping - :ivar metric_resource_id: Metric resource id for the domain. - :vartype metric_resource_id: str - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the domain. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, - 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - } - - def __init__(self, *, location: str, tags=None, private_endpoint_connections=None, input_schema="EventGridSchema", input_schema_mapping=None, public_network_access=None, inbound_ip_rules=None, sku=None, identity=None, **kwargs) -> None: - super(Domain, self).__init__(location=location, tags=tags, **kwargs) - self.private_endpoint_connections = private_endpoint_connections - self.provisioning_state = None - self.endpoint = None - self.input_schema = input_schema - self.input_schema_mapping = input_schema_mapping - self.metric_resource_id = None - self.public_network_access = public_network_access - self.inbound_ip_rules = inbound_ip_rules - self.sku = sku - self.identity = identity - - -class DomainRegenerateKeyRequest(Model): - """Domain regenerate share access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate key1 or key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(DomainRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = key_name - - -class DomainSharedAccessKeys(Model): - """Shared access keys of the Domain. - - :param key1: Shared access key1 for the domain. - :type key1: str - :param key2: Shared access key2 for the domain. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(DomainSharedAccessKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class DomainTopic(Resource): - """Domain Topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param provisioning_state: Provisioning state of the domain topic. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.DomainTopicProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, provisioning_state=None, **kwargs) -> None: - super(DomainTopic, self).__init__(**kwargs) - self.provisioning_state = provisioning_state - - -class DomainUpdateParameters(Model): - """Properties of the Domain update. - - :param tags: Tags of the domains resource. - :type tags: dict[str, str] - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - :param sku: The Sku pricing tier for the domain. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - } - - def __init__(self, *, tags=None, public_network_access=None, inbound_ip_rules=None, identity=None, sku=None, **kwargs) -> None: - super(DomainUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.public_network_access = public_network_access - self.inbound_ip_rules = inbound_ip_rules - self.identity = identity - self.sku = sku - - -class EventChannel(Resource): - """Event Channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param source: Source of the event channel. This represents a unique - resource in the partner's resource model. - :type source: ~azure.mgmt.eventgrid.models.EventChannelSource - :param destination: Represents the destination of an event channel. - :type destination: ~azure.mgmt.eventgrid.models.EventChannelDestination - :ivar provisioning_state: Provisioning state of the event channel. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.EventChannelProvisioningState - :ivar partner_topic_readiness_state: The readiness state of the - corresponding partner topic. Possible values include: - 'NotActivatedByUserYet', 'ActivatedByUser', 'DeactivatedByUser', - 'DeletedByUser' - :vartype partner_topic_readiness_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicReadinessState - :param expiration_time_if_not_activated_utc: Expiration time of the event - channel. If this timer expires while the corresponding partner topic is - never activated, - the event channel and corresponding partner topic are deleted. - :type expiration_time_if_not_activated_utc: datetime - :param filter: Information about the filter for the event channel. - :type filter: ~azure.mgmt.eventgrid.models.EventChannelFilter - :param partner_topic_friendly_description: Friendly description about the - topic. This can be set by the publisher/partner to show custom description - for the customer partner topic. - This will be helpful to remove any ambiguity of the origin of creation of - the partner topic for the customer. - :type partner_topic_friendly_description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'partner_topic_readiness_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'EventChannelSource'}, - 'destination': {'key': 'properties.destination', 'type': 'EventChannelDestination'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_topic_readiness_state': {'key': 'properties.partnerTopicReadinessState', 'type': 'str'}, - 'expiration_time_if_not_activated_utc': {'key': 'properties.expirationTimeIfNotActivatedUtc', 'type': 'iso-8601'}, - 'filter': {'key': 'properties.filter', 'type': 'EventChannelFilter'}, - 'partner_topic_friendly_description': {'key': 'properties.partnerTopicFriendlyDescription', 'type': 'str'}, - } - - def __init__(self, *, source=None, destination=None, expiration_time_if_not_activated_utc=None, filter=None, partner_topic_friendly_description: str=None, **kwargs) -> None: - super(EventChannel, self).__init__(**kwargs) - self.source = source - self.destination = destination - self.provisioning_state = None - self.partner_topic_readiness_state = None - self.expiration_time_if_not_activated_utc = expiration_time_if_not_activated_utc - self.filter = filter - self.partner_topic_friendly_description = partner_topic_friendly_description - - -class EventChannelDestination(Model): - """Properties of the destination of an event channel. - - :param azure_subscription_id: Azure subscription ID of the customer - creating the event channel. The partner topic - associated with the event channel will be created under this Azure - subscription. - :type azure_subscription_id: str - :param resource_group: Azure Resource Group of the customer creating the - event channel. The partner topic - associated with the event channel will be created under this resource - group. - :type resource_group: str - :param partner_topic_name: Name of the partner topic associated with the - event channel. - :type partner_topic_name: str - """ - - _attribute_map = { - 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'partner_topic_name': {'key': 'partnerTopicName', 'type': 'str'}, - } - - def __init__(self, *, azure_subscription_id: str=None, resource_group: str=None, partner_topic_name: str=None, **kwargs) -> None: - super(EventChannelDestination, self).__init__(**kwargs) - self.azure_subscription_id = azure_subscription_id - self.resource_group = resource_group - self.partner_topic_name = partner_topic_name - - -class EventChannelFilter(Model): - """Filter for the Event Channel. - - :param advanced_filters: An array of advanced filters that are used for - filtering event channels. - :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] - """ - - _attribute_map = { - 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, - } - - def __init__(self, *, advanced_filters=None, **kwargs) -> None: - super(EventChannelFilter, self).__init__(**kwargs) - self.advanced_filters = advanced_filters - - -class EventChannelSource(Model): - """Properties of the source of an event channel. - - :param source: The identifier of the resource that's the source of the - events. - This represents a unique resource in the partner's resource model. - :type source: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - } - - def __init__(self, *, source: str=None, **kwargs) -> None: - super(EventChannelSource, self).__init__(**kwargs) - self.source = source - - -class EventHubEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the event hub destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - an Event Hub destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, **kwargs) -> None: - super(EventHubEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.endpoint_type = 'EventHub' - - -class EventSubscription(Resource): - """Event Subscription. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :ivar topic: Name of the topic of the event subscription. - :vartype topic: str - :ivar provisioning_state: Provisioning state of the event subscription. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed', 'AwaitingManualAction' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - :param delivery_with_resource_identity: Information about the destination - where events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type delivery_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity - :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter - :param labels: List of user defined labels. - :type labels: list[str] - :param expiration_time_utc: Expiration time of the event subscription. - :type expiration_time_utc: datetime - :param event_delivery_schema: The event delivery schema for the event - subscription. Possible values include: 'EventGridSchema', - 'CustomInputSchema', 'CloudEventSchemaV1_0' - :type event_delivery_schema: str or - ~azure.mgmt.eventgrid.models.EventDeliverySchema - :param retry_policy: The retry policy for events. This can be used to - configure maximum number of delivery attempts and time to live for events. - :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy - :param dead_letter_destination: The dead letter destination of the event - subscription. Any event that cannot be delivered to its' destination is - sent to the dead letter destination. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - :param dead_letter_with_resource_identity: The dead letter destination of - the event subscription. Any event that cannot be delivered to its' - destination is sent to the dead letter destination. - Uses the managed identity setup on the parent resource (namely, topic or - domain) to acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'topic': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'topic': {'key': 'properties.topic', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, - 'delivery_with_resource_identity': {'key': 'properties.deliveryWithResourceIdentity', 'type': 'DeliveryWithResourceIdentity'}, - 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, - 'labels': {'key': 'properties.labels', 'type': '[str]'}, - 'expiration_time_utc': {'key': 'properties.expirationTimeUtc', 'type': 'iso-8601'}, - 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, - 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, - 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, - 'dead_letter_with_resource_identity': {'key': 'properties.deadLetterWithResourceIdentity', 'type': 'DeadLetterWithResourceIdentity'}, - } - - def __init__(self, *, destination=None, delivery_with_resource_identity=None, filter=None, labels=None, expiration_time_utc=None, event_delivery_schema=None, retry_policy=None, dead_letter_destination=None, dead_letter_with_resource_identity=None, **kwargs) -> None: - super(EventSubscription, self).__init__(**kwargs) - self.topic = None - self.provisioning_state = None - self.destination = destination - self.delivery_with_resource_identity = delivery_with_resource_identity - self.filter = filter - self.labels = labels - self.expiration_time_utc = expiration_time_utc - self.event_delivery_schema = event_delivery_schema - self.retry_policy = retry_policy - self.dead_letter_destination = dead_letter_destination - self.dead_letter_with_resource_identity = dead_letter_with_resource_identity - - -class EventSubscriptionFilter(Model): - """Filter for the Event Subscription. - - :param subject_begins_with: An optional string to filter events for an - event subscription based on a resource path prefix. - The format of this depends on the publisher of the events. - Wildcard characters are not supported in this path. - :type subject_begins_with: str - :param subject_ends_with: An optional string to filter events for an event - subscription based on a resource path suffix. - Wildcard characters are not supported in this path. - :type subject_ends_with: str - :param included_event_types: A list of applicable event types that need to - be part of the event subscription. If it is desired to subscribe to all - default event types, set the IncludedEventTypes to null. - :type included_event_types: list[str] - :param is_subject_case_sensitive: Specifies if the SubjectBeginsWith and - SubjectEndsWith properties of the filter - should be compared in a case sensitive manner. Default value: False . - :type is_subject_case_sensitive: bool - :param advanced_filters: An array of advanced filters that are used for - filtering event subscriptions. - :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] - """ - - _attribute_map = { - 'subject_begins_with': {'key': 'subjectBeginsWith', 'type': 'str'}, - 'subject_ends_with': {'key': 'subjectEndsWith', 'type': 'str'}, - 'included_event_types': {'key': 'includedEventTypes', 'type': '[str]'}, - 'is_subject_case_sensitive': {'key': 'isSubjectCaseSensitive', 'type': 'bool'}, - 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, - } - - def __init__(self, *, subject_begins_with: str=None, subject_ends_with: str=None, included_event_types=None, is_subject_case_sensitive: bool=False, advanced_filters=None, **kwargs) -> None: - super(EventSubscriptionFilter, self).__init__(**kwargs) - self.subject_begins_with = subject_begins_with - self.subject_ends_with = subject_ends_with - self.included_event_types = included_event_types - self.is_subject_case_sensitive = is_subject_case_sensitive - self.advanced_filters = advanced_filters - - -class EventSubscriptionFullUrl(Model): - """Full endpoint url of an event subscription. - - :param endpoint_url: The URL that represents the endpoint of the - destination of an event subscription. - :type endpoint_url: str - """ - - _attribute_map = { - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - } - - def __init__(self, *, endpoint_url: str=None, **kwargs) -> None: - super(EventSubscriptionFullUrl, self).__init__(**kwargs) - self.endpoint_url = endpoint_url - - -class EventSubscriptionIdentity(Model): - """The identity information with the event subscription. - - :param type: The type of managed identity used. The type 'SystemAssigned, - UserAssigned' includes both an implicitly created identity and a set of - user-assigned identities. The type 'None' will remove any identity. - Possible values include: 'SystemAssigned', 'UserAssigned' - :type type: str or - ~azure.mgmt.eventgrid.models.EventSubscriptionIdentityType - :param user_assigned_identity: The user identity associated with the - resource. - :type user_assigned_identity: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__(self, *, type=None, user_assigned_identity: str=None, **kwargs) -> None: - super(EventSubscriptionIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identity = user_assigned_identity - - -class EventSubscriptionUpdateParameters(Model): - """Properties of the Event Subscription update. - - :param destination: Information about the destination where events have to - be delivered for the event subscription. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type destination: - ~azure.mgmt.eventgrid.models.EventSubscriptionDestination - :param delivery_with_resource_identity: Information about the destination - where events have to be delivered for the event subscription. - Uses the managed identity setup on the parent resource (topic / domain) to - acquire the authentication tokens being used during delivery / - dead-lettering. - :type delivery_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity - :param filter: Information about the filter for the event subscription. - :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter - :param labels: List of user defined labels. - :type labels: list[str] - :param expiration_time_utc: Information about the expiration time for the - event subscription. - :type expiration_time_utc: datetime - :param event_delivery_schema: The event delivery schema for the event - subscription. Possible values include: 'EventGridSchema', - 'CustomInputSchema', 'CloudEventSchemaV1_0' - :type event_delivery_schema: str or - ~azure.mgmt.eventgrid.models.EventDeliverySchema - :param retry_policy: The retry policy for events. This can be used to - configure maximum number of delivery attempts and time to live for events. - :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy - :param dead_letter_destination: The dead letter destination of the event - subscription. Any event that cannot be delivered to its' destination is - sent to the dead letter destination. - Uses Azure Event Grid's identity to acquire the authentication tokens - being used during delivery / dead-lettering. - :type dead_letter_destination: - ~azure.mgmt.eventgrid.models.DeadLetterDestination - :param dead_letter_with_resource_identity: The dead letter destination of - the event subscription. Any event that cannot be delivered to its' - destination is sent to the dead letter destination. - Uses the managed identity setup on the parent resource (topic / domain) to - acquire the authentication tokens being used during delivery / - dead-lettering. - :type dead_letter_with_resource_identity: - ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity - """ - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, - 'delivery_with_resource_identity': {'key': 'deliveryWithResourceIdentity', 'type': 'DeliveryWithResourceIdentity'}, - 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, - 'labels': {'key': 'labels', 'type': '[str]'}, - 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, - 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, - 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, - 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, - 'dead_letter_with_resource_identity': {'key': 'deadLetterWithResourceIdentity', 'type': 'DeadLetterWithResourceIdentity'}, - } - - def __init__(self, *, destination=None, delivery_with_resource_identity=None, filter=None, labels=None, expiration_time_utc=None, event_delivery_schema=None, retry_policy=None, dead_letter_destination=None, dead_letter_with_resource_identity=None, **kwargs) -> None: - super(EventSubscriptionUpdateParameters, self).__init__(**kwargs) - self.destination = destination - self.delivery_with_resource_identity = delivery_with_resource_identity - self.filter = filter - self.labels = labels - self.expiration_time_utc = expiration_time_utc - self.event_delivery_schema = event_delivery_schema - self.retry_policy = retry_policy - self.dead_letter_destination = dead_letter_destination - self.dead_letter_with_resource_identity = dead_letter_with_resource_identity - - -class EventType(Resource): - """Event Type for a subject under a topic. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param display_name: Display name of the event type. - :type display_name: str - :param description: Description of the event type. - :type description: str - :param schema_url: Url of the schema for this event type. - :type schema_url: str - :param is_in_default_set: IsInDefaultSet flag of the event type. - :type is_in_default_set: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'schema_url': {'key': 'properties.schemaUrl', 'type': 'str'}, - 'is_in_default_set': {'key': 'properties.isInDefaultSet', 'type': 'bool'}, - } - - def __init__(self, *, display_name: str=None, description: str=None, schema_url: str=None, is_in_default_set: bool=None, **kwargs) -> None: - super(EventType, self).__init__(**kwargs) - self.display_name = display_name - self.description = description - self.schema_url = schema_url - self.is_in_default_set = is_in_default_set - - -class ExtensionTopic(Resource): - """Event grid Extension Topic. This is used for getting Event Grid related - metrics for Azure resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param description: Description of the extension topic. - :type description: str - :param system_topic: System topic resource id which is mapped to the - source. - :type system_topic: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'system_topic': {'key': 'properties.systemTopic', 'type': 'str'}, - } - - def __init__(self, *, description: str=None, system_topic: str=None, **kwargs) -> None: - super(ExtensionTopic, self).__init__(**kwargs) - self.description = description - self.system_topic = system_topic - - -class HybridConnectionEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the HybridConnection destination for an event - subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of an hybrid connection that is - the destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, **kwargs) -> None: - super(HybridConnectionEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.endpoint_type = 'HybridConnection' - - -class IdentityInfo(Model): - """The identity information for the resource. - - :param type: The type of managed identity used. The type 'SystemAssigned, - UserAssigned' includes both an implicitly created identity and a set of - user-assigned identities. The type 'None' will remove any identity. - Possible values include: 'None', 'SystemAssigned', 'UserAssigned', - 'SystemAssigned, UserAssigned' - :type type: str or ~azure.mgmt.eventgrid.models.IdentityType - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity dictionary key references will be ARM - resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - This property is currently not used and reserved for future usage. - :type user_assigned_identities: dict[str, - ~azure.mgmt.eventgrid.models.UserIdentityProperties] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, *, type=None, principal_id: str=None, tenant_id: str=None, user_assigned_identities=None, **kwargs) -> None: - super(IdentityInfo, self).__init__(**kwargs) - self.type = type - self.principal_id = principal_id - self.tenant_id = tenant_id - self.user_assigned_identities = user_assigned_identities - - -class InboundIpRule(Model): - """InboundIpRule. - - :param ip_mask: IP Address in CIDR notation e.g., 10.0.0.0/8. - :type ip_mask: str - :param action: Action to perform based on the match or no match of the - IpMask. Possible values include: 'Allow' - :type action: str or ~azure.mgmt.eventgrid.models.IpActionType - """ - - _attribute_map = { - 'ip_mask': {'key': 'ipMask', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - } - - def __init__(self, *, ip_mask: str=None, action=None, **kwargs) -> None: - super(InboundIpRule, self).__init__(**kwargs) - self.ip_mask = ip_mask - self.action = action - - -class InputSchemaMapping(Model): - """By default, Event Grid expects events to be in the Event Grid event schema. - Specifying an input schema mapping enables publishing to Event Grid using a - custom input schema. Currently, the only supported type of - InputSchemaMapping is 'JsonInputSchemaMapping'. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JsonInputSchemaMapping - - All required parameters must be populated in order to send to Azure. - - :param input_schema_mapping_type: Required. Constant filled by server. - :type input_schema_mapping_type: str - """ - - _validation = { - 'input_schema_mapping_type': {'required': True}, - } - - _attribute_map = { - 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, - } - - _subtype_map = { - 'input_schema_mapping_type': {'Json': 'JsonInputSchemaMapping'} - } - - def __init__(self, **kwargs) -> None: - super(InputSchemaMapping, self).__init__(**kwargs) - self.input_schema_mapping_type = None - - -class JsonField(Model): - """This is used to express the source of an input schema mapping for a single - target field in the Event Grid Event schema. This is currently used in the - mappings for the 'id', 'topic' and 'eventtime' properties. This represents - a field in the input event schema. - - :param source_field: Name of a field in the input event schema that's to - be used as the source of a mapping. - :type source_field: str - """ - - _attribute_map = { - 'source_field': {'key': 'sourceField', 'type': 'str'}, - } - - def __init__(self, *, source_field: str=None, **kwargs) -> None: - super(JsonField, self).__init__(**kwargs) - self.source_field = source_field - - -class JsonFieldWithDefault(Model): - """This is used to express the source of an input schema mapping for a single - target field - in the Event Grid Event schema. This is currently used in the mappings for - the 'subject', - 'eventtype' and 'dataversion' properties. This represents a field in the - input event schema - along with a default value to be used, and at least one of these two - properties should be provided. - - :param source_field: Name of a field in the input event schema that's to - be used as the source of a mapping. - :type source_field: str - :param default_value: The default value to be used for mapping when a - SourceField is not provided or if there's no property with the specified - name in the published JSON event payload. - :type default_value: str - """ - - _attribute_map = { - 'source_field': {'key': 'sourceField', 'type': 'str'}, - 'default_value': {'key': 'defaultValue', 'type': 'str'}, - } - - def __init__(self, *, source_field: str=None, default_value: str=None, **kwargs) -> None: - super(JsonFieldWithDefault, self).__init__(**kwargs) - self.source_field = source_field - self.default_value = default_value - - -class JsonInputSchemaMapping(InputSchemaMapping): - """This enables publishing to Event Grid using a custom input schema. This can - be used to map properties from a custom input JSON schema to the Event Grid - event schema. - - All required parameters must be populated in order to send to Azure. - - :param input_schema_mapping_type: Required. Constant filled by server. - :type input_schema_mapping_type: str - :param id: The mapping information for the Id property of the Event Grid - Event. - :type id: ~azure.mgmt.eventgrid.models.JsonField - :param topic: The mapping information for the Topic property of the Event - Grid Event. - :type topic: ~azure.mgmt.eventgrid.models.JsonField - :param event_time: The mapping information for the EventTime property of - the Event Grid Event. - :type event_time: ~azure.mgmt.eventgrid.models.JsonField - :param event_type: The mapping information for the EventType property of - the Event Grid Event. - :type event_type: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - :param subject: The mapping information for the Subject property of the - Event Grid Event. - :type subject: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - :param data_version: The mapping information for the DataVersion property - of the Event Grid Event. - :type data_version: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault - """ - - _validation = { - 'input_schema_mapping_type': {'required': True}, - } - - _attribute_map = { - 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, - 'id': {'key': 'properties.id', 'type': 'JsonField'}, - 'topic': {'key': 'properties.topic', 'type': 'JsonField'}, - 'event_time': {'key': 'properties.eventTime', 'type': 'JsonField'}, - 'event_type': {'key': 'properties.eventType', 'type': 'JsonFieldWithDefault'}, - 'subject': {'key': 'properties.subject', 'type': 'JsonFieldWithDefault'}, - 'data_version': {'key': 'properties.dataVersion', 'type': 'JsonFieldWithDefault'}, - } - - def __init__(self, *, id=None, topic=None, event_time=None, event_type=None, subject=None, data_version=None, **kwargs) -> None: - super(JsonInputSchemaMapping, self).__init__(**kwargs) - self.id = id - self.topic = topic - self.event_time = event_time - self.event_type = event_type - self.subject = subject - self.data_version = data_version - self.input_schema_mapping_type = 'Json' - - -class NumberGreaterThanAdvancedFilter(AdvancedFilter): - """NumberGreaterThan Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: - super(NumberGreaterThanAdvancedFilter, self).__init__(key=key, **kwargs) - self.value = value - self.operator_type = 'NumberGreaterThan' - - -class NumberGreaterThanOrEqualsAdvancedFilter(AdvancedFilter): - """NumberGreaterThanOrEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: - super(NumberGreaterThanOrEqualsAdvancedFilter, self).__init__(key=key, **kwargs) - self.value = value - self.operator_type = 'NumberGreaterThanOrEquals' - - -class NumberInAdvancedFilter(AdvancedFilter): - """NumberIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[float] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[float]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(NumberInAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'NumberIn' - - -class NumberLessThanAdvancedFilter(AdvancedFilter): - """NumberLessThan Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: - super(NumberLessThanAdvancedFilter, self).__init__(key=key, **kwargs) - self.value = value - self.operator_type = 'NumberLessThan' - - -class NumberLessThanOrEqualsAdvancedFilter(AdvancedFilter): - """NumberLessThanOrEquals Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param value: The filter value. - :type value: float - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'float'}, - } - - def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: - super(NumberLessThanOrEqualsAdvancedFilter, self).__init__(key=key, **kwargs) - self.value = value - self.operator_type = 'NumberLessThanOrEquals' - - -class NumberNotInAdvancedFilter(AdvancedFilter): - """NumberNotIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[float] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[float]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(NumberNotInAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'NumberNotIn' - - -class Operation(Model): - """Represents an operation returned by the GetOperations request. - - :param name: Name of the operation - :type name: str - :param display: Display name of the operation - :type display: ~azure.mgmt.eventgrid.models.OperationInfo - :param origin: Origin of the operation - :type origin: str - :param properties: Properties of the operation - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.properties = properties - - -class OperationInfo(Model): - """Information about an operation. - - :param provider: Name of the provider - :type provider: str - :param resource: Name of the resource type - :type resource: str - :param operation: Name of the operation - :type operation: str - :param description: Description of the operation - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: - super(OperationInfo, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class PartnerNamespace(TrackedResource): - """EventGrid Partner Namespace. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the partner namespace. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerNamespaceProvisioningState - :param partner_registration_fully_qualified_id: The fully qualified ARM Id - of the partner registration that should be associated with this partner - namespace. This takes the following format: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. - :type partner_registration_fully_qualified_id: str - :ivar endpoint: Endpoint for the partner namespace. - :vartype endpoint: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_registration_fully_qualified_id': {'key': 'properties.partnerRegistrationFullyQualifiedId', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, partner_registration_fully_qualified_id: str=None, **kwargs) -> None: - super(PartnerNamespace, self).__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = None - self.partner_registration_fully_qualified_id = partner_registration_fully_qualified_id - self.endpoint = None - - -class PartnerNamespaceRegenerateKeyRequest(Model): - """PartnerNamespace regenerate shared access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate (key1 or key2). - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(PartnerNamespaceRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = key_name - - -class PartnerNamespaceSharedAccessKeys(Model): - """Shared access keys of the partner namespace. - - :param key1: Shared access key1 for the partner namespace. - :type key1: str - :param key2: Shared access key2 for the partner namespace. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(PartnerNamespaceSharedAccessKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class PartnerNamespaceUpdateParameters(Model): - """Properties of the PartnerNamespace update. - - :param tags: Tags of the partner namespace. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(PartnerNamespaceUpdateParameters, self).__init__(**kwargs) - self.tags = tags - - -class PartnerRegistration(TrackedResource): - """Information about a partner registration. - - 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the partner registration. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerRegistrationProvisioningState - :param partner_name: Official name of the partner name. For example: - "Contoso". - :type partner_name: str - :param partner_resource_type_name: Name of the partner resource type. - :type partner_resource_type_name: str - :param partner_resource_type_display_name: Display name of the partner - resource type. - :type partner_resource_type_display_name: str - :param partner_resource_type_description: Short description of the partner - resource type. The length of this description should not exceed 256 - characters. - :type partner_resource_type_description: str - :param long_description: Long description for the custom scenarios and - integration to be displayed in the portal if needed. - Length of this description should not exceed 2048 characters. - :type long_description: str - :param partner_customer_service_number: The customer service number of the - publisher. The expected phone format should start with a '+' sign - followed by the country code. The remaining digits are then followed. Only - digits and spaces are allowed and its - length cannot exceed 16 digits including country code. Examples of valid - phone numbers are: +1 515 123 4567 and - +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) - 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 - :type partner_customer_service_number: str - :param partner_customer_service_extension: The extension of the customer - service number of the publisher. Only digits are allowed and number of - digits should not exceed 10. - :type partner_customer_service_extension: str - :param customer_service_uri: The extension of the customer service URI of - the publisher. - :type customer_service_uri: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param logo_uri: URI of the logo. - :type logo_uri: str - :param visibility_state: Visibility state of the partner registration. - Possible values include: 'Hidden', 'PublicPreview', 'GenerallyAvailable' - :type visibility_state: str or - ~azure.mgmt.eventgrid.models.PartnerRegistrationVisibilityState - :param authorized_azure_subscription_ids: List of Azure subscription Ids - that are authorized to create a partner namespace - associated with this partner registration. This is an optional property. - Creating - partner namespaces is always permitted under the same Azure subscription - as the one used - for creating the partner registration. - :type authorized_azure_subscription_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, - 'partner_resource_type_name': {'key': 'properties.partnerResourceTypeName', 'type': 'str'}, - 'partner_resource_type_display_name': {'key': 'properties.partnerResourceTypeDisplayName', 'type': 'str'}, - 'partner_resource_type_description': {'key': 'properties.partnerResourceTypeDescription', 'type': 'str'}, - 'long_description': {'key': 'properties.longDescription', 'type': 'str'}, - 'partner_customer_service_number': {'key': 'properties.partnerCustomerServiceNumber', 'type': 'str'}, - 'partner_customer_service_extension': {'key': 'properties.partnerCustomerServiceExtension', 'type': 'str'}, - 'customer_service_uri': {'key': 'properties.customerServiceUri', 'type': 'str'}, - 'setup_uri': {'key': 'properties.setupUri', 'type': 'str'}, - 'logo_uri': {'key': 'properties.logoUri', 'type': 'str'}, - 'visibility_state': {'key': 'properties.visibilityState', 'type': 'str'}, - 'authorized_azure_subscription_ids': {'key': 'properties.authorizedAzureSubscriptionIds', 'type': '[str]'}, - } - - def __init__(self, *, location: str, tags=None, partner_name: str=None, partner_resource_type_name: str=None, partner_resource_type_display_name: str=None, partner_resource_type_description: str=None, long_description: str=None, partner_customer_service_number: str=None, partner_customer_service_extension: str=None, customer_service_uri: str=None, setup_uri: str=None, logo_uri: str=None, visibility_state=None, authorized_azure_subscription_ids=None, **kwargs) -> None: - super(PartnerRegistration, self).__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = None - self.partner_name = partner_name - self.partner_resource_type_name = partner_resource_type_name - self.partner_resource_type_display_name = partner_resource_type_display_name - self.partner_resource_type_description = partner_resource_type_description - self.long_description = long_description - self.partner_customer_service_number = partner_customer_service_number - self.partner_customer_service_extension = partner_customer_service_extension - self.customer_service_uri = customer_service_uri - self.setup_uri = setup_uri - self.logo_uri = logo_uri - self.visibility_state = visibility_state - self.authorized_azure_subscription_ids = authorized_azure_subscription_ids - - -class PartnerRegistrationEventTypesListResult(Model): - """Result of the List Partner Registration Event Types operation. - - :param value: A collection of partner registration event types. - :type value: list[~azure.mgmt.eventgrid.models.EventType] - :param next_link: A link for the next page of partner registration event - types. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EventType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: - super(PartnerRegistrationEventTypesListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartnerRegistrationUpdateParameters(Model): - """Properties of the Partner Registration update. - - :param tags: Tags of the partner registration resource. - :type tags: dict[str, str] - :param partner_topic_type_name: Name of the partner topic type. - :type partner_topic_type_name: str - :param partner_topic_type_display_name: Display name of the partner topic - type. - :type partner_topic_type_display_name: str - :param partner_topic_type_description: Description of the partner topic - type. - :type partner_topic_type_description: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param logo_uri: URI of the partner logo. - :type logo_uri: str - :param authorized_azure_subscription_ids: List of IDs of Azure AD - applications that are authorized to create a partner namespace - associated with this partner registration. This is an optional property. - Creating - partner namespaces is always permitted under the same Azure subscription - as the one used - for creating the partner registration. - :type authorized_azure_subscription_ids: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'partner_topic_type_name': {'key': 'partnerTopicTypeName', 'type': 'str'}, - 'partner_topic_type_display_name': {'key': 'partnerTopicTypeDisplayName', 'type': 'str'}, - 'partner_topic_type_description': {'key': 'partnerTopicTypeDescription', 'type': 'str'}, - 'setup_uri': {'key': 'setupUri', 'type': 'str'}, - 'logo_uri': {'key': 'logoUri', 'type': 'str'}, - 'authorized_azure_subscription_ids': {'key': 'authorizedAzureSubscriptionIds', 'type': '[str]'}, - } - - def __init__(self, *, tags=None, partner_topic_type_name: str=None, partner_topic_type_display_name: str=None, partner_topic_type_description: str=None, setup_uri: str=None, logo_uri: str=None, authorized_azure_subscription_ids=None, **kwargs) -> None: - super(PartnerRegistrationUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.partner_topic_type_name = partner_topic_type_name - self.partner_topic_type_display_name = partner_topic_type_display_name - self.partner_topic_type_description = partner_topic_type_description - self.setup_uri = setup_uri - self.logo_uri = logo_uri - self.authorized_azure_subscription_ids = authorized_azure_subscription_ids - - -class PartnerTopic(TrackedResource): - """EventGrid Partner 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param source: Source associated with this partner topic. This represents - a unique partner resource. - :type source: str - :param expiration_time_if_not_activated_utc: Expiration time of the - partner topic. If this timer expires while the partner topic is still - never activated, - the partner topic and corresponding event channel are deleted. - :type expiration_time_if_not_activated_utc: datetime - :ivar provisioning_state: Provisioning state of the partner topic. - Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicProvisioningState - :param activation_state: Activation state of the partner topic. Possible - values include: 'NeverActivated', 'Activated', 'Deactivated' - :type activation_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicActivationState - :param partner_topic_friendly_description: Friendly description about the - topic. This can be set by the publisher/partner to show custom description - for the customer partner topic. - This will be helpful to remove any ambiguity of the origin of creation of - the partner topic for the customer. - :type partner_topic_friendly_description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'expiration_time_if_not_activated_utc': {'key': 'properties.expirationTimeIfNotActivatedUtc', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'activation_state': {'key': 'properties.activationState', 'type': 'str'}, - 'partner_topic_friendly_description': {'key': 'properties.partnerTopicFriendlyDescription', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, source: str=None, expiration_time_if_not_activated_utc=None, activation_state=None, partner_topic_friendly_description: str=None, **kwargs) -> None: - super(PartnerTopic, self).__init__(location=location, tags=tags, **kwargs) - self.source = source - self.expiration_time_if_not_activated_utc = expiration_time_if_not_activated_utc - self.provisioning_state = None - self.activation_state = activation_state - self.partner_topic_friendly_description = partner_topic_friendly_description - - -class PartnerTopicType(Resource): - """Properties of a partner topic type. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param partner_name: Official name of the partner. - :type partner_name: str - :param topic_type_name: Name of the partner topic type. This name should - be unique among all partner topic types names. - :type topic_type_name: str - :param display_name: Display Name for the partner topic type. - :type display_name: str - :param description: Description of the partner topic type. - :type description: str - :param setup_uri: URI of the partner website that can be used by Azure - customers to setup Event Grid - integration on an event source. - :type setup_uri: str - :param authorization_state: Status of whether the customer has authorized - a partner to create partner topics - in the customer's subscription. Possible values include: 'NotApplicable', - 'NotAuthorized', 'Authorized' - :type authorization_state: str or - ~azure.mgmt.eventgrid.models.PartnerTopicTypeAuthorizationState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, - 'topic_type_name': {'key': 'properties.topicTypeName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'setup_uri': {'key': 'properties.setupUri', 'type': 'str'}, - 'authorization_state': {'key': 'properties.authorizationState', 'type': 'str'}, - } - - def __init__(self, *, partner_name: str=None, topic_type_name: str=None, display_name: str=None, description: str=None, setup_uri: str=None, authorization_state=None, **kwargs) -> None: - super(PartnerTopicType, self).__init__(**kwargs) - self.partner_name = partner_name - self.topic_type_name = topic_type_name - self.display_name = display_name - self.description = description - self.setup_uri = setup_uri - self.authorization_state = authorization_state - - -class PartnerTopicTypesListResult(Model): - """Result of the List Partner Topic Types operation. - - :param value: A collection of partner topic types. - :type value: list[~azure.mgmt.eventgrid.models.PartnerTopicType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PartnerTopicType]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(PartnerTopicTypesListResult, self).__init__(**kwargs) - self.value = value - - -class PartnerTopicUpdateParameters(Model): - """Properties of the Partner Topic update. - - :param tags: Tags of the partner topic. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(PartnerTopicUpdateParameters, self).__init__(**kwargs) - self.tags = tags - - -class PrivateEndpoint(Model): - """PrivateEndpoint information. - - :param id: The ARM identifier for Private Endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = id - - -class PrivateEndpointConnection(Resource): - """PrivateEndpointConnection. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param private_endpoint: The Private Endpoint resource for this - Connection. - :type private_endpoint: ~azure.mgmt.eventgrid.models.PrivateEndpoint - :param group_ids: GroupIds from the private link service resource. - :type group_ids: list[str] - :param private_link_service_connection_state: Details about the state of - the connection. - :type private_link_service_connection_state: - ~azure.mgmt.eventgrid.models.ConnectionState - :param provisioning_state: Provisioning state of the Private Endpoint - Connection. Possible values include: 'Creating', 'Updating', 'Deleting', - 'Succeeded', 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.ResourceProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, private_endpoint=None, group_ids=None, private_link_service_connection_state=None, provisioning_state=None, **kwargs) -> None: - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.private_endpoint = private_endpoint - self.group_ids = group_ids - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateLinkResource(Model): - """Information of the private link resource. - - :param group_id: - :type group_id: str - :param display_name: - :type display_name: str - :param required_members: - :type required_members: list[str] - :param required_zone_names: - :type required_zone_names: list[str] - :param id: Fully qualified identifier of the resource. - :type id: str - :param name: Name of the resource - :type name: str - :param type: Type of the resource - :type type: str - """ - - _attribute_map = { - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, group_id: str=None, display_name: str=None, required_members=None, required_zone_names=None, id: str=None, name: str=None, type: str=None, **kwargs) -> None: - super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = group_id - self.display_name = display_name - self.required_members = required_members - self.required_zone_names = required_zone_names - self.id = id - self.name = name - self.type = type - - -class ResourceSku(Model): - """Describes an EventGrid Resource Sku. - - :param name: The Sku name of the resource. The possible values are: Basic - or Premium. Possible values include: 'Basic', 'Premium' - :type name: str or ~azure.mgmt.eventgrid.models.Sku - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name=None, **kwargs) -> None: - super(ResourceSku, self).__init__(**kwargs) - self.name = name - - -class RetryPolicy(Model): - """Information about the retry policy for an event subscription. - - :param max_delivery_attempts: Maximum number of delivery retry attempts - for events. - :type max_delivery_attempts: int - :param event_time_to_live_in_minutes: Time To Live (in minutes) for - events. - :type event_time_to_live_in_minutes: int - """ - - _attribute_map = { - 'max_delivery_attempts': {'key': 'maxDeliveryAttempts', 'type': 'int'}, - 'event_time_to_live_in_minutes': {'key': 'eventTimeToLiveInMinutes', 'type': 'int'}, - } - - def __init__(self, *, max_delivery_attempts: int=None, event_time_to_live_in_minutes: int=None, **kwargs) -> None: - super(RetryPolicy, self).__init__(**kwargs) - self.max_delivery_attempts = max_delivery_attempts - self.event_time_to_live_in_minutes = event_time_to_live_in_minutes - - -class ServiceBusQueueEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the service bus destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Service Bus destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, **kwargs) -> None: - super(ServiceBusQueueEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.endpoint_type = 'ServiceBusQueue' - - -class ServiceBusTopicEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the service bus topic destination for an event - subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource Id that represents the endpoint of - the Service Bus Topic destination of an event subscription. - :type resource_id: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, **kwargs) -> None: - super(ServiceBusTopicEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.endpoint_type = 'ServiceBusTopic' - - -class StorageBlobDeadLetterDestination(DeadLetterDestination): - """Information about the storage blob based dead letter destination. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of the storage account that is - the destination of the deadletter events - :type resource_id: str - :param blob_container_name: The name of the Storage blob container that is - the destination of the deadletter events - :type blob_container_name: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'blob_container_name': {'key': 'properties.blobContainerName', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, blob_container_name: str=None, **kwargs) -> None: - super(StorageBlobDeadLetterDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.blob_container_name = blob_container_name - self.endpoint_type = 'StorageBlob' - - -class StorageQueueEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the storage queue destination for an event subscription. - - All required parameters must be populated in order to send to Azure. - - :param endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param resource_id: The Azure Resource ID of the storage account that - contains the queue that is the destination of an event subscription. - :type resource_id: str - :param queue_name: The name of the Storage queue under a storage account - that is the destination of an event subscription. - :type queue_name: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'queue_name': {'key': 'properties.queueName', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str=None, queue_name: str=None, **kwargs) -> None: - super(StorageQueueEventSubscriptionDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.queue_name = queue_name - self.endpoint_type = 'StorageQueue' - - -class StringBeginsWithAdvancedFilter(AdvancedFilter): - """StringBeginsWith Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(StringBeginsWithAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'StringBeginsWith' - - -class StringContainsAdvancedFilter(AdvancedFilter): - """StringContains Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(StringContainsAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'StringContains' - - -class StringEndsWithAdvancedFilter(AdvancedFilter): - """StringEndsWith Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(StringEndsWithAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'StringEndsWith' - - -class StringInAdvancedFilter(AdvancedFilter): - """StringIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(StringInAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'StringIn' - - -class StringNotInAdvancedFilter(AdvancedFilter): - """StringNotIn Advanced Filter. - - All required parameters must be populated in order to send to Azure. - - :param key: The field/property in the event based on which you want to - filter. - :type key: str - :param operator_type: Required. Constant filled by server. - :type operator_type: str - :param values: The set of filter values. - :type values: list[str] - """ - - _validation = { - 'operator_type': {'required': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'operator_type': {'key': 'operatorType', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__(self, *, key: str=None, values=None, **kwargs) -> None: - super(StringNotInAdvancedFilter, self).__init__(key=key, **kwargs) - self.values = values - self.operator_type = 'StringNotIn' - - -class SystemTopic(TrackedResource): - """EventGrid System 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state of the system topic. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.ResourceProvisioningState - :param source: Source for the system topic. - :type source: str - :param topic_type: TopicType for the system topic. - :type topic_type: str - :ivar metric_resource_id: Metric resource id for the system topic. - :vartype metric_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'topic_type': {'key': 'properties.topicType', 'type': 'str'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, source: str=None, topic_type: str=None, **kwargs) -> None: - super(SystemTopic, self).__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = None - self.source = source - self.topic_type = topic_type - self.metric_resource_id = None - - -class SystemTopicUpdateParameters(Model): - """Properties of the System Topic update. - - :param tags: Tags of the system topic. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(SystemTopicUpdateParameters, self).__init__(**kwargs) - self.tags = tags - - -class Topic(TrackedResource): - """EventGrid 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. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param location: Required. Location of the resource. - :type location: str - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param private_endpoint_connections: - :type private_endpoint_connections: - list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - :ivar provisioning_state: Provisioning state of the topic. Possible values - include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', - 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicProvisioningState - :ivar endpoint: Endpoint for the topic. - :vartype endpoint: str - :param input_schema: This determines the format that Event Grid should - expect for incoming events published to the topic. Possible values - include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0'. - Default value: "EventGridSchema" . - :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema - :param input_schema_mapping: This enables publishing using custom event - schemas. An InputSchemaMapping can be specified to map various properties - of a source schema to various required properties of the EventGridEvent - schema. - :type input_schema_mapping: - ~azure.mgmt.eventgrid.models.InputSchemaMapping - :ivar metric_resource_id: Metric resource id for the topic. - :vartype metric_resource_id: str - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the topic. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - :param identity: Identity information for the resource. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'metric_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, - 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, - 'metric_resource_id': {'key': 'properties.metricResourceId', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - } - - def __init__(self, *, location: str, tags=None, private_endpoint_connections=None, input_schema="EventGridSchema", input_schema_mapping=None, public_network_access=None, inbound_ip_rules=None, sku=None, identity=None, **kwargs) -> None: - super(Topic, self).__init__(location=location, tags=tags, **kwargs) - self.private_endpoint_connections = private_endpoint_connections - self.provisioning_state = None - self.endpoint = None - self.input_schema = input_schema - self.input_schema_mapping = input_schema_mapping - self.metric_resource_id = None - self.public_network_access = public_network_access - self.inbound_ip_rules = inbound_ip_rules - self.sku = sku - self.identity = identity - - -class TopicRegenerateKeyRequest(Model): - """Topic regenerate share access key request. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. Key name to regenerate key1 or key2 - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(TopicRegenerateKeyRequest, self).__init__(**kwargs) - self.key_name = key_name - - -class TopicSharedAccessKeys(Model): - """Shared access keys of the Topic. - - :param key1: Shared access key1 for the topic. - :type key1: str - :param key2: Shared access key2 for the topic. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(TopicSharedAccessKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 - - -class TopicTypeInfo(Resource): - """Properties of a topic type info. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource - :vartype name: str - :ivar type: Type of the resource - :vartype type: str - :param provider: Namespace of the provider of the topic type. - :type provider: str - :param display_name: Display Name for the topic type. - :type display_name: str - :param description: Description of the topic type. - :type description: str - :param resource_region_type: Region type of the resource. Possible values - include: 'RegionalResource', 'GlobalResource' - :type resource_region_type: str or - ~azure.mgmt.eventgrid.models.ResourceRegionType - :param provisioning_state: Provisioning state of the topic type. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState - :param supported_locations: List of locations supported by this topic - type. - :type supported_locations: list[str] - :param source_resource_format: Source resource format. - :type source_resource_format: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provider': {'key': 'properties.provider', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'resource_region_type': {'key': 'properties.resourceRegionType', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'supported_locations': {'key': 'properties.supportedLocations', 'type': '[str]'}, - 'source_resource_format': {'key': 'properties.sourceResourceFormat', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, display_name: str=None, description: str=None, resource_region_type=None, provisioning_state=None, supported_locations=None, source_resource_format: str=None, **kwargs) -> None: - super(TopicTypeInfo, self).__init__(**kwargs) - self.provider = provider - self.display_name = display_name - self.description = description - self.resource_region_type = resource_region_type - self.provisioning_state = provisioning_state - self.supported_locations = supported_locations - self.source_resource_format = source_resource_format - - -class TopicUpdateParameters(Model): - """Properties of the Topic update. - - :param tags: Tags of the resource. - :type tags: dict[str, str] - :param identity: Resource identity information. - :type identity: ~azure.mgmt.eventgrid.models.IdentityInfo - :param public_network_access: This determines if traffic is allowed over - public network. By default it is enabled. - You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.eventgrid.models.PublicNetworkAccess - :param inbound_ip_rules: This can be used to restrict traffic from - specific IPs instead of all IPs. Note: These are considered only if - PublicNetworkAccess is enabled. - :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] - :param sku: The Sku pricing tier for the topic. - :type sku: ~azure.mgmt.eventgrid.models.ResourceSku - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'IdentityInfo'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - } - - def __init__(self, *, tags=None, identity=None, public_network_access=None, inbound_ip_rules=None, sku=None, **kwargs) -> None: - super(TopicUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.identity = identity - self.public_network_access = public_network_access - self.inbound_ip_rules = inbound_ip_rules - self.sku = sku - - -class UserIdentityProperties(Model): - """The information about the user identity. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id - - -class WebHookEventSubscriptionDestination(EventSubscriptionDestination): - """Information about the webhook destination for an event subscription. - - 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 endpoint_type: Required. Constant filled by server. - :type endpoint_type: str - :param endpoint_url: The URL that represents the endpoint of the - destination of an event subscription. - :type endpoint_url: str - :ivar endpoint_base_url: The base URL that represents the endpoint of the - destination of an event subscription. - :vartype endpoint_base_url: str - :param max_events_per_batch: Maximum number of events per batch. - :type max_events_per_batch: int - :param preferred_batch_size_in_kilobytes: Preferred batch size in - Kilobytes. - :type preferred_batch_size_in_kilobytes: int - :param azure_active_directory_tenant_id: The Azure Active Directory Tenant - ID to get the access token that will be included as the bearer token in - delivery requests. - :type azure_active_directory_tenant_id: str - :param azure_active_directory_application_id_or_uri: The Azure Active - Directory Application ID or URI to get the access token that will be - included as the bearer token in delivery requests. - :type azure_active_directory_application_id_or_uri: str - """ - - _validation = { - 'endpoint_type': {'required': True}, - 'endpoint_base_url': {'readonly': True}, - } - - _attribute_map = { - 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, - 'endpoint_url': {'key': 'properties.endpointUrl', 'type': 'str'}, - 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, - 'max_events_per_batch': {'key': 'properties.maxEventsPerBatch', 'type': 'int'}, - 'preferred_batch_size_in_kilobytes': {'key': 'properties.preferredBatchSizeInKilobytes', 'type': 'int'}, - 'azure_active_directory_tenant_id': {'key': 'properties.azureActiveDirectoryTenantId', 'type': 'str'}, - 'azure_active_directory_application_id_or_uri': {'key': 'properties.azureActiveDirectoryApplicationIdOrUri', 'type': 'str'}, - } - - def __init__(self, *, endpoint_url: str=None, max_events_per_batch: int=None, preferred_batch_size_in_kilobytes: int=None, azure_active_directory_tenant_id: str=None, azure_active_directory_application_id_or_uri: str=None, **kwargs) -> None: - super(WebHookEventSubscriptionDestination, self).__init__(**kwargs) - self.endpoint_url = endpoint_url - self.endpoint_base_url = None - self.max_events_per_batch = max_events_per_batch - self.preferred_batch_size_in_kilobytes = preferred_batch_size_in_kilobytes - self.azure_active_directory_tenant_id = azure_active_directory_tenant_id - self.azure_active_directory_application_id_or_uri = azure_active_directory_application_id_or_uri - self.endpoint_type = 'WebHook' diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_paged_models.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_paged_models.py deleted file mode 100644 index 20d75dc4b16..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/_paged_models.py +++ /dev/null @@ -1,196 +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.paging import Paged - - -class DomainPaged(Paged): - """ - A paging container for iterating over a list of :class:`Domain ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Domain]'} - } - - def __init__(self, *args, **kwargs): - - super(DomainPaged, self).__init__(*args, **kwargs) -class DomainTopicPaged(Paged): - """ - A paging container for iterating over a list of :class:`DomainTopic ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DomainTopic]'} - } - - def __init__(self, *args, **kwargs): - - super(DomainTopicPaged, self).__init__(*args, **kwargs) -class EventChannelPaged(Paged): - """ - A paging container for iterating over a list of :class:`EventChannel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EventChannel]'} - } - - def __init__(self, *args, **kwargs): - - super(EventChannelPaged, self).__init__(*args, **kwargs) -class EventSubscriptionPaged(Paged): - """ - A paging container for iterating over a list of :class:`EventSubscription ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EventSubscription]'} - } - - def __init__(self, *args, **kwargs): - - super(EventSubscriptionPaged, self).__init__(*args, **kwargs) -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) -class PartnerNamespacePaged(Paged): - """ - A paging container for iterating over a list of :class:`PartnerNamespace ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PartnerNamespace]'} - } - - def __init__(self, *args, **kwargs): - - super(PartnerNamespacePaged, self).__init__(*args, **kwargs) -class PartnerRegistrationPaged(Paged): - """ - A paging container for iterating over a list of :class:`PartnerRegistration ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PartnerRegistration]'} - } - - def __init__(self, *args, **kwargs): - - super(PartnerRegistrationPaged, self).__init__(*args, **kwargs) -class PartnerTopicPaged(Paged): - """ - A paging container for iterating over a list of :class:`PartnerTopic ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PartnerTopic]'} - } - - def __init__(self, *args, **kwargs): - - super(PartnerTopicPaged, self).__init__(*args, **kwargs) -class PrivateEndpointConnectionPaged(Paged): - """ - A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} - } - - def __init__(self, *args, **kwargs): - - super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) -class PrivateLinkResourcePaged(Paged): - """ - A paging container for iterating over a list of :class:`PrivateLinkResource ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} - } - - def __init__(self, *args, **kwargs): - - super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) -class SystemTopicPaged(Paged): - """ - A paging container for iterating over a list of :class:`SystemTopic ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SystemTopic]'} - } - - def __init__(self, *args, **kwargs): - - super(SystemTopicPaged, self).__init__(*args, **kwargs) -class TopicPaged(Paged): - """ - A paging container for iterating over a list of :class:`Topic ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Topic]'} - } - - def __init__(self, *args, **kwargs): - - super(TopicPaged, self).__init__(*args, **kwargs) -class EventTypePaged(Paged): - """ - A paging container for iterating over a list of :class:`EventType ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EventType]'} - } - - def __init__(self, *args, **kwargs): - - super(EventTypePaged, self).__init__(*args, **kwargs) -class TopicTypeInfoPaged(Paged): - """ - A paging container for iterating over a list of :class:`TopicTypeInfo ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[TopicTypeInfo]'} - } - - def __init__(self, *args, **kwargs): - - super(TopicTypeInfoPaged, self).__init__(*args, **kwargs) diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/__init__.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/__init__.py deleted file mode 100644 index 6a4607f4a8b..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/__init__.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 ._domains_operations import DomainsOperations -from ._domain_topics_operations import DomainTopicsOperations -from ._event_channels_operations import EventChannelsOperations -from ._event_subscriptions_operations import EventSubscriptionsOperations -from ._system_topic_event_subscriptions_operations import SystemTopicEventSubscriptionsOperations -from ._partner_topic_event_subscriptions_operations import PartnerTopicEventSubscriptionsOperations -from ._operations import Operations -from ._partner_namespaces_operations import PartnerNamespacesOperations -from ._partner_registrations_operations import PartnerRegistrationsOperations -from ._partner_topics_operations import PartnerTopicsOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._system_topics_operations import SystemTopicsOperations -from ._topics_operations import TopicsOperations -from ._extension_topics_operations import ExtensionTopicsOperations -from ._topic_types_operations import TopicTypesOperations - -__all__ = [ - 'DomainsOperations', - 'DomainTopicsOperations', - 'EventChannelsOperations', - 'EventSubscriptionsOperations', - 'SystemTopicEventSubscriptionsOperations', - 'PartnerTopicEventSubscriptionsOperations', - 'Operations', - 'PartnerNamespacesOperations', - 'PartnerRegistrationsOperations', - 'PartnerTopicsOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'SystemTopicsOperations', - 'TopicsOperations', - 'ExtensionTopicsOperations', - 'TopicTypesOperations', -] diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domain_topics_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domain_topics_operations.py deleted file mode 100644 index a070465d5fc..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domain_topics_operations.py +++ /dev/null @@ -1,389 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class DomainTopicsOperations(object): - """DomainTopicsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): - """Get a domain topic. - - Get properties of a domain topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param domain_topic_name: Name of the topic. - :type domain_topic_name: str - :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: DomainTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.DomainTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str'), - 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('DomainTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} - - - def _create_or_update_initial( - self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str'), - 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('DomainTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update a domain topic. - - Asynchronously creates or updates a new domain topic with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param domain_topic_name: Name of the domain topic. - :type domain_topic_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns DomainTopic or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.DomainTopic] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.DomainTopic]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - domain_name=domain_name, - domain_topic_name=domain_topic_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('DomainTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} - - - def _delete_initial( - self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str'), - 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a domain topic. - - Delete existing domain topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param domain_topic_name: Name of the domain topic. - :type domain_topic_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - domain_name=domain_name, - domain_topic_name=domain_topic_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} - - def list_by_domain( - self, resource_group_name, domain_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List domain topics. - - List all the topics in a domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Domain name. - :type domain_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of DomainTopic - :rtype: - ~azure.mgmt.eventgrid.models.DomainTopicPaged[~azure.mgmt.eventgrid.models.DomainTopic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_domain.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.DomainTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domains_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domains_operations.py deleted file mode 100644 index 0b21e61ec83..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_domains_operations.py +++ /dev/null @@ -1,708 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class DomainsOperations(object): - """DomainsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): - """Get a domain. - - Get properties of a domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :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: Domain or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.Domain or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Domain', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} - - - def _create_or_update_initial( - self, resource_group_name, domain_name, domain_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(domain_info, 'Domain') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('Domain', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, domain_name, domain_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update a domain. - - Asynchronously creates or updates a new domain with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param domain_info: Domain information. - :type domain_info: ~azure.mgmt.eventgrid.models.Domain - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Domain or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Domain] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Domain]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - domain_name=domain_name, - domain_info=domain_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Domain', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} - - - def _delete_initial( - self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, domain_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a domain. - - Delete existing domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - domain_name=domain_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} - - - def _update_initial( - self, resource_group_name, domain_name, domain_update_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(domain_update_parameters, 'DomainUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('Domain', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, domain_name, domain_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Update a domain. - - Asynchronously updates a domain with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param domain_update_parameters: Domain update information. - :type domain_update_parameters: - ~azure.mgmt.eventgrid.models.DomainUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Domain or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Domain] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Domain]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - domain_name=domain_name, - domain_update_parameters=domain_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Domain', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List domains under an Azure subscription. - - List all the domains under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of Domain - :rtype: - ~azure.mgmt.eventgrid.models.DomainPaged[~azure.mgmt.eventgrid.models.Domain] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.DomainPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List domains under a resource group. - - List all the domains under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of Domain - :rtype: - ~azure.mgmt.eventgrid.models.DomainPaged[~azure.mgmt.eventgrid.models.Domain] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.DomainPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains'} - - def list_shared_access_keys( - self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): - """List keys for a domain. - - List the two keys used to publish to a domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :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: DomainSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.DomainSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_shared_access_keys.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('DomainSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys'} - - def regenerate_key( - self, resource_group_name, domain_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerate key for a domain. - - Regenerate a shared access key for a domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the domain. - :type domain_name: str - :param key_name: Key name to regenerate key1 or key2. - :type key_name: str - :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: DomainSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.DomainSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key_request = models.DomainRegenerateKeyRequest(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(regenerate_key_request, 'DomainRegenerateKeyRequest') - - # 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]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('DomainSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_channels_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_channels_operations.py deleted file mode 100644 index ef4d815ffdf..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_channels_operations.py +++ /dev/null @@ -1,362 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class EventChannelsOperations(object): - """EventChannelsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, partner_namespace_name, event_channel_name, custom_headers=None, raw=False, **operation_config): - """Get an event channel. - - Get properties of an event channel. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param event_channel_name: Name of the event channel. - :type event_channel_name: str - :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: EventChannel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventChannel or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str'), - 'eventChannelName': self._serialize.url("event_channel_name", event_channel_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventChannel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'} - - def create_or_update( - self, resource_group_name, partner_namespace_name, event_channel_name, event_channel_info, custom_headers=None, raw=False, **operation_config): - """Create an event channel. - - Asynchronously creates a new event channel with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param event_channel_name: Name of the event channel. - :type event_channel_name: str - :param event_channel_info: EventChannel information. - :type event_channel_info: ~azure.mgmt.eventgrid.models.EventChannel - :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: EventChannel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventChannel or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str'), - 'eventChannelName': self._serialize.url("event_channel_name", event_channel_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_channel_info, 'EventChannel') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventChannel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'} - - - def _delete_initial( - self, resource_group_name, partner_namespace_name, event_channel_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str'), - 'eventChannelName': self._serialize.url("event_channel_name", event_channel_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, partner_namespace_name, event_channel_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete an event channel. - - Delete existing event channel. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param event_channel_name: Name of the event channel. - :type event_channel_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - partner_namespace_name=partner_namespace_name, - event_channel_name=event_channel_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'} - - def list_by_partner_namespace( - self, resource_group_name, partner_namespace_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List event channels. - - List all the event channels in a partner namespace. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventChannel - :rtype: - ~azure.mgmt.eventgrid.models.EventChannelPaged[~azure.mgmt.eventgrid.models.EventChannel] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_partner_namespace.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventChannelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_partner_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_subscriptions_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_subscriptions_operations.py deleted file mode 100644 index 7e9d680ff5c..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_event_subscriptions_operations.py +++ /dev/null @@ -1,1441 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class EventSubscriptionsOperations(object): - """EventSubscriptionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get an event subscription. - - Get properties of an event subscription. - - :param scope: The scope of the event subscription. The scope can be a - subscription, or a resource group, or a top level resource belonging - to a resource provider namespace, or an EventGrid topic. For example, - use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for a resource, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' - for an EventGrid topic. - :type scope: str - :param event_subscription_name: Name of the event subscription. - :type event_subscription_name: str - :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: EventSubscription or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} - - - def _create_or_update_initial( - self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_info, 'EventSubscription') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an event subscription. - - Asynchronously creates a new event subscription or updates an existing - event subscription based on the specified scope. - - :param scope: The identifier of the resource to which the event - subscription needs to be created or updated. The scope can be a - subscription, or a resource group, or a top level resource belonging - to a resource provider namespace, or an EventGrid topic. For example, - use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for a resource, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' - for an EventGrid topic. - :type scope: str - :param event_subscription_name: Name of the event subscription. Event - subscription names must be between 3 and 64 characters in length and - should use alphanumeric letters only. - :type event_subscription_name: str - :param event_subscription_info: Event subscription properties - containing the destination and filter information. - :type event_subscription_info: - ~azure.mgmt.eventgrid.models.EventSubscription - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - scope=scope, - event_subscription_name=event_subscription_name, - event_subscription_info=event_subscription_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} - - - def _delete_initial( - self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, scope, event_subscription_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete an event subscription. - - Delete an existing event subscription. - - :param scope: The scope of the event subscription. The scope can be a - subscription, or a resource group, or a top level resource belonging - to a resource provider namespace, or an EventGrid topic. For example, - use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for a resource, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' - for an EventGrid topic. - :type scope: str - :param event_subscription_name: Name of the event subscription. - :type event_subscription_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - scope=scope, - event_subscription_name=event_subscription_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} - - - def _update_initial( - self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_update_parameters, 'EventSubscriptionUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Update an event subscription. - - Asynchronously updates an existing event subscription. - - :param scope: The scope of existing event subscription. The scope can - be a subscription, or a resource group, or a top level resource - belonging to a resource provider namespace, or an EventGrid topic. For - example, use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for a resource, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' - for an EventGrid topic. - :type scope: str - :param event_subscription_name: Name of the event subscription to be - updated. - :type event_subscription_name: str - :param event_subscription_update_parameters: Updated event - subscription information. - :type event_subscription_update_parameters: - ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - scope=scope, - event_subscription_name=event_subscription_name, - event_subscription_update_parameters=event_subscription_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} - - def get_full_url( - self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get full URL of an event subscription. - - Get the full endpoint URL for an event subscription. - - :param scope: The scope of the event subscription. The scope can be a - subscription, or a resource group, or a top level resource belonging - to a resource provider namespace, or an EventGrid topic. For example, - use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for a resource, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' - for an EventGrid topic. - :type scope: str - :param event_subscription_name: Name of the event subscription. - :type event_subscription_name: str - :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: EventSubscriptionFullUrl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_full_url.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscriptionFullUrl', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_full_url.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl'} - - def list_global_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """Get an aggregated list of all global event subscriptions under an Azure - subscription. - - List all aggregated global event subscriptions under a specific Azure - subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_global_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_global_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions'} - - def list_global_by_subscription_for_topic_type( - self, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all global event subscriptions for a topic type. - - List all global event subscriptions under an Azure subscription for a - topic type. - - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_global_by_subscription_for_topic_type.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_global_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} - - def list_global_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all global event subscriptions under an Azure subscription and - resource group. - - List all global event subscriptions under a specific Azure subscription - and resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_global_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_global_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions'} - - def list_global_by_resource_group_for_topic_type( - self, resource_group_name, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all global event subscriptions under a resource group for a topic - type. - - List all global event subscriptions under a resource group for a - specific topic type. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_global_by_resource_group_for_topic_type.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_global_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} - - def list_regional_by_subscription( - self, location, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all regional event subscriptions under an Azure subscription. - - List all event subscriptions from the given location under a specific - Azure subscription. - - :param location: Name of the location. - :type location: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_regional_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_regional_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} - - def list_regional_by_resource_group( - self, resource_group_name, location, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all regional event subscriptions under an Azure subscription and - resource group. - - List all event subscriptions from the given location under a specific - Azure subscription and resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param location: Name of the location. - :type location: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_regional_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_regional_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} - - def list_regional_by_subscription_for_topic_type( - self, location, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all regional event subscriptions under an Azure subscription for a - topic type. - - List all event subscriptions from the given location under a specific - Azure subscription and topic type. - - :param location: Name of the location. - :type location: str - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_regional_by_subscription_for_topic_type.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_regional_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} - - def list_regional_by_resource_group_for_topic_type( - self, resource_group_name, location, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all regional event subscriptions under an Azure subscription and - resource group for a topic type. - - List all event subscriptions from the given location under a specific - Azure subscription and resource group and topic type. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param location: Name of the location. - :type location: str - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_regional_by_resource_group_for_topic_type.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_regional_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} - - def list_by_resource( - self, resource_group_name, provider_namespace, resource_type_name, resource_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all event subscriptions for a specific topic. - - List all event subscriptions that have been created for a specific - topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param provider_namespace: Namespace of the provider of the topic. - :type provider_namespace: str - :param resource_type_name: Name of the resource type. - :type resource_type_name: str - :param resource_name: Name of the resource. - :type resource_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), - 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions'} - - def list_by_domain_topic( - self, resource_group_name, domain_name, topic_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List all event subscriptions for a specific domain topic. - - List all event subscriptions that have been created for a specific - domain topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param domain_name: Name of the top level domain. - :type domain_name: str - :param topic_name: Name of the domain topic. - :type topic_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_domain_topic.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_domain_topic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_extension_topics_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_extension_topics_operations.py deleted file mode 100644 index 1187598fafb..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_extension_topics_operations.py +++ /dev/null @@ -1,106 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class ExtensionTopicsOperations(object): - """ExtensionTopicsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, scope, custom_headers=None, raw=False, **operation_config): - """Get properties of an extension topic. - - Get the properties of an extension topic. - - :param scope: The identifier of the resource to which extension topic - is queried. The scope can be a subscription, or a resource group, or a - top level resource belonging to a resource provider namespace. For - example, use '/subscriptions/{subscriptionId}/' for a subscription, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for a resource group, and - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' - for Azure resource. - :type scope: str - :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: ExtensionTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.ExtensionTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExtensionTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/extensionTopics/default'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_operations.py deleted file mode 100644 index 476428ba25b..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_operations.py +++ /dev/null @@ -1,105 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class Operations(object): - """Operations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List available operations. - - List the available operations supported by the Microsoft.EventGrid - resource provider. - - :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: An iterator like instance of Operation - :rtype: - ~azure.mgmt.eventgrid.models.OperationPaged[~azure.mgmt.eventgrid.models.Operation] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.EventGrid/operations'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_namespaces_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_namespaces_operations.py deleted file mode 100644 index 4195f26749c..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_namespaces_operations.py +++ /dev/null @@ -1,713 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class PartnerNamespacesOperations(object): - """PartnerNamespacesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, partner_namespace_name, custom_headers=None, raw=False, **operation_config): - """Get a partner namespace. - - Get properties of a partner namespace. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :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: PartnerNamespace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerNamespace or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'} - - - def _create_or_update_initial( - self, resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(partner_namespace_info, 'PartnerNamespace') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('PartnerNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create a partner namespace. - - Asynchronously creates a new partner namespace with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param partner_namespace_info: PartnerNamespace information. - :type partner_namespace_info: - ~azure.mgmt.eventgrid.models.PartnerNamespace - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns PartnerNamespace or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.PartnerNamespace] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.PartnerNamespace]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - partner_namespace_name=partner_namespace_name, - partner_namespace_info=partner_namespace_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('PartnerNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'} - - - def _delete_initial( - self, resource_group_name, partner_namespace_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, partner_namespace_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a partner namespace. - - Delete existing partner namespace. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - partner_namespace_name=partner_namespace_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'} - - - def _update_initial( - self, resource_group_name, partner_namespace_name, tags=None, custom_headers=None, raw=False, **operation_config): - partner_namespace_update_parameters = models.PartnerNamespaceUpdateParameters(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(partner_namespace_update_parameters, 'PartnerNamespaceUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('PartnerNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, partner_namespace_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Update a partner namespace. - - Asynchronously updates a partner namespace with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param tags: Tags of the partner namespace. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns PartnerNamespace or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.PartnerNamespace] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.PartnerNamespace]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - partner_namespace_name=partner_namespace_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('PartnerNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner namespaces under an Azure subscription. - - List all the partner namespaces under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerNamespace - :rtype: - ~azure.mgmt.eventgrid.models.PartnerNamespacePaged[~azure.mgmt.eventgrid.models.PartnerNamespace] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerNamespaces'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner namespaces under a resource group. - - List all the partner namespaces under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerNamespace - :rtype: - ~azure.mgmt.eventgrid.models.PartnerNamespacePaged[~azure.mgmt.eventgrid.models.PartnerNamespace] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces'} - - def list_shared_access_keys( - self, resource_group_name, partner_namespace_name, custom_headers=None, raw=False, **operation_config): - """List keys for a partner namespace. - - List the two keys used to publish to a partner namespace. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :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: PartnerNamespaceSharedAccessKeys or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerNamespaceSharedAccessKeys - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_shared_access_keys.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerNamespaceSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/listKeys'} - - def regenerate_key( - self, resource_group_name, partner_namespace_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerate key for a partner namespace. - - Regenerate a shared access key for a partner namespace. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_namespace_name: Name of the partner namespace. - :type partner_namespace_name: str - :param key_name: Key name to regenerate (key1 or key2). - :type key_name: str - :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: PartnerNamespaceSharedAccessKeys or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerNamespaceSharedAccessKeys - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key_request = models.PartnerNamespaceRegenerateKeyRequest(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerNamespaceName': self._serialize.url("partner_namespace_name", partner_namespace_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(regenerate_key_request, 'PartnerNamespaceRegenerateKeyRequest') - - # 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]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerNamespaceSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_registrations_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_registrations_operations.py deleted file mode 100644 index 9bd6e57dfd2..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_registrations_operations.py +++ /dev/null @@ -1,545 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PartnerRegistrationsOperations(object): - """PartnerRegistrationsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, partner_registration_name, custom_headers=None, raw=False, **operation_config): - """Get a partner registration. - - Gets a partner registration with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_registration_name: Name of the partner registration. - :type partner_registration_name: str - :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: PartnerRegistration or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerRegistration or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerRegistrationName': self._serialize.url("partner_registration_name", partner_registration_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerRegistration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'} - - def create_or_update( - self, resource_group_name, partner_registration_name, partner_registration_info, custom_headers=None, raw=False, **operation_config): - """Create a partner registration. - - Creates a new partner registration with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_registration_name: Name of the partner registration. - :type partner_registration_name: str - :param partner_registration_info: PartnerRegistration information. - :type partner_registration_info: - ~azure.mgmt.eventgrid.models.PartnerRegistration - :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: PartnerRegistration or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerRegistration or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerRegistrationName': self._serialize.url("partner_registration_name", partner_registration_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(partner_registration_info, 'PartnerRegistration') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerRegistration', response) - if response.status_code == 202: - deserialized = self._deserialize('PartnerRegistration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'} - - def delete( - self, resource_group_name, partner_registration_name, custom_headers=None, raw=False, **operation_config): - """Delete a partner registration. - - Deletes a partner registration with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_registration_name: Name of the partner registration. - :type partner_registration_name: str - :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:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerRegistrationName': self._serialize.url("partner_registration_name", partner_registration_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'} - - def update( - self, resource_group_name, partner_registration_name, partner_registration_update_parameters, custom_headers=None, raw=False, **operation_config): - """Update a partner registration. - - Updates a partner registration with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_registration_name: Name of the partner registration. - :type partner_registration_name: str - :param partner_registration_update_parameters: Partner registration - update information. - :type partner_registration_update_parameters: - ~azure.mgmt.eventgrid.models.PartnerRegistrationUpdateParameters - :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: PartnerRegistration or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerRegistration or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerRegistrationName': self._serialize.url("partner_registration_name", partner_registration_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(partner_registration_update_parameters, 'PartnerRegistrationUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('PartnerRegistration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner registrations under an Azure subscription. - - List all the partner registrations under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerRegistration - :rtype: - ~azure.mgmt.eventgrid.models.PartnerRegistrationPaged[~azure.mgmt.eventgrid.models.PartnerRegistration] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerRegistrationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerRegistrations'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner registrations under a resource group. - - List all the partner registrations under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerRegistration - :rtype: - ~azure.mgmt.eventgrid.models.PartnerRegistrationPaged[~azure.mgmt.eventgrid.models.PartnerRegistration] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerRegistrationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all available partners registrations. - - List all partners registrations. - - :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: An iterator like instance of PartnerRegistration - :rtype: - ~azure.mgmt.eventgrid.models.PartnerRegistrationPaged[~azure.mgmt.eventgrid.models.PartnerRegistration] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerRegistrationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.EventGrid/partnerRegistrations'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topic_event_subscriptions_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topic_event_subscriptions_operations.py deleted file mode 100644 index 04110282b68..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topic_event_subscriptions_operations.py +++ /dev/null @@ -1,585 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class PartnerTopicEventSubscriptionsOperations(object): - """PartnerTopicEventSubscriptionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, partner_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get an event subscription of a partner topic. - - Get an event subscription of a partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param event_subscription_name: Name of the event subscription to be - found. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :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: EventSubscription or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _create_or_update_initial( - self, resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_info, 'EventSubscription') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an event subscription of a partner topic. - - Asynchronously creates or updates an event subscription of a partner - topic with the specified parameters. Existing event subscriptions will - be updated with this API. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param event_subscription_info: Event subscription properties - containing the destination and filter information. - :type event_subscription_info: - ~azure.mgmt.eventgrid.models.EventSubscription - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - partner_topic_name=partner_topic_name, - event_subscription_name=event_subscription_name, - event_subscription_info=event_subscription_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _delete_initial( - self, resource_group_name, partner_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, partner_topic_name, event_subscription_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete an event subscription of a partner topic. - - Delete an event subscription of a partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - partner_topic_name=partner_topic_name, - event_subscription_name=event_subscription_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _update_initial( - self, resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_update_parameters, 'EventSubscriptionUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Update event subscription of a partner topic. - - Update event subscription of a partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param event_subscription_update_parameters: Updated event - subscription information. - :type event_subscription_update_parameters: - ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - partner_topic_name=partner_topic_name, - event_subscription_name=event_subscription_name, - event_subscription_update_parameters=event_subscription_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - def get_full_url( - self, resource_group_name, partner_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get full URL of an event subscription of a partner topic. - - Get the full endpoint URL for an event subscription of a partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :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: EventSubscriptionFullUrl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_full_url.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscriptionFullUrl', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_full_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'} - - def list_by_partner_topic( - self, resource_group_name, partner_topic_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List event subscriptions of a partner topic. - - List event subscriptions that belong to a specific partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_partner_topic.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_partner_topic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topics_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topics_operations.py deleted file mode 100644 index 763b8d9bdce..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_partner_topics_operations.py +++ /dev/null @@ -1,564 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class PartnerTopicsOperations(object): - """PartnerTopicsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, partner_topic_name, custom_headers=None, raw=False, **operation_config): - """Get a partner topic. - - Get properties of a partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :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: PartnerTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'} - - - def _delete_initial( - self, resource_group_name, partner_topic_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, partner_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a partner topic. - - Delete existing partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - partner_topic_name=partner_topic_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'} - - def update( - self, resource_group_name, partner_topic_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Update a partner topic. - - Asynchronously updates a partner topic with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :param tags: Tags of the partner topic. - :type tags: dict[str, str] - :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: PartnerTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - partner_topic_update_parameters = models.PartnerTopicUpdateParameters(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(partner_topic_update_parameters, 'PartnerTopicUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('PartnerTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner topics under an Azure subscription. - - List all the partner topics under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerTopic - :rtype: - ~azure.mgmt.eventgrid.models.PartnerTopicPaged[~azure.mgmt.eventgrid.models.PartnerTopic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List partner topics under a resource group. - - List all the partner topics under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PartnerTopic - :rtype: - ~azure.mgmt.eventgrid.models.PartnerTopicPaged[~azure.mgmt.eventgrid.models.PartnerTopic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PartnerTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics'} - - def activate( - self, resource_group_name, partner_topic_name, custom_headers=None, raw=False, **operation_config): - """Activate a partner topic. - - Activate a newly created partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :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: PartnerTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.activate.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate'} - - def deactivate( - self, resource_group_name, partner_topic_name, custom_headers=None, raw=False, **operation_config): - """Deactivate a partner topic. - - Deactivate specific partner topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param partner_topic_name: Name of the partner topic. - :type partner_topic_name: str - :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: PartnerTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PartnerTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.deactivate.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'partnerTopicName': self._serialize.url("partner_topic_name", partner_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PartnerTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - deactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_endpoint_connections_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 253fc8db222..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,425 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): - """Get a specific private endpoint connection. - - Get a specific private endpoint connection under a topic or domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param private_endpoint_connection_name: The name of the private - endpoint connection connection. - :type private_endpoint_connection_name: str - :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: PrivateEndpointConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PrivateEndpointConnection or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'} - - - def _update_initial( - self, resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', response) - if response.status_code == 201: - deserialized = self._deserialize('PrivateEndpointConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers=None, raw=False, polling=True, **operation_config): - """Update a specific private endpoint connection. - - Update a specific private endpoint connection under a topic or domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param private_endpoint_connection_name: The name of the private - endpoint connection connection. - :type private_endpoint_connection_name: str - :param private_endpoint_connection: The private endpoint connection - object to update. - :type private_endpoint_connection: - ~azure.mgmt.eventgrid.models.PrivateEndpointConnection - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - PrivateEndpointConnection or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.PrivateEndpointConnection]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - parent_type=parent_type, - parent_name=parent_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection=private_endpoint_connection, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('PrivateEndpointConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'} - - - def _delete_initial( - self, resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a specific private endpoint connection. - - Delete a specific private endpoint connection under a topic or domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param private_endpoint_connection_name: The name of the private - endpoint connection connection. - :type private_endpoint_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - parent_type=parent_type, - parent_name=parent_name, - private_endpoint_connection_name=private_endpoint_connection_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'} - - def list_by_resource( - self, resource_group_name, parent_type, parent_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists all private endpoint connections under a resource. - - Get all private endpoint connections under a topic or domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PrivateEndpointConnection - :rtype: - ~azure.mgmt.eventgrid.models.PrivateEndpointConnectionPaged[~azure.mgmt.eventgrid.models.PrivateEndpointConnection] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_link_resources_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_link_resources_operations.py deleted file mode 100644 index 6500b3252ee..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,210 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers=None, raw=False, **operation_config): - """Get a private link resource. - - Get properties of a private link resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param private_link_resource_name: The name of private link resource. - :type private_link_resource_name: str - :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: PrivateLinkResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.PrivateLinkResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateLinkResource', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}'} - - def list_by_resource( - self, resource_group_name, parent_type, parent_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List private link resources under specific topic or domain. - - List all the private link resources under a topic or domain. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param parent_type: The type of the parent resource. This can be - either \\'topics\\' or \\'domains\\'. - :type parent_type: str - :param parent_name: The name of the parent resource (namely, either, - the topic name or domain name). - :type parent_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of PrivateLinkResource - :rtype: - ~azure.mgmt.eventgrid.models.PrivateLinkResourcePaged[~azure.mgmt.eventgrid.models.PrivateLinkResource] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'parentType': self._serialize.url("parent_type", parent_type, 'str'), - 'parentName': self._serialize.url("parent_name", parent_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topic_event_subscriptions_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topic_event_subscriptions_operations.py deleted file mode 100644 index bfa03f26013..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topic_event_subscriptions_operations.py +++ /dev/null @@ -1,585 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class SystemTopicEventSubscriptionsOperations(object): - """SystemTopicEventSubscriptionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, system_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get an event subscription of a system topic. - - Get an event subscription. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :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: EventSubscription or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _create_or_update_initial( - self, resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_info, 'EventSubscription') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an event subscription for a system topic. - - Asynchronously creates or updates an event subscription with the - specified parameters. Existing event subscriptions will be updated with - this API. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param event_subscription_info: Event subscription properties - containing the destination and filter information. - :type event_subscription_info: - ~azure.mgmt.eventgrid.models.EventSubscription - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - event_subscription_name=event_subscription_name, - event_subscription_info=event_subscription_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _delete_initial( - self, resource_group_name, system_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, system_topic_name, event_subscription_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete an event subscription of a system topic. - - Delete an event subscription of a system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - event_subscription_name=event_subscription_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - - def _update_initial( - self, resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(event_subscription_update_parameters, 'EventSubscriptionUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Update event subscription of a system topic. - - Update event subscription of a system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :param event_subscription_update_parameters: Updated event - subscription information. - :type event_subscription_update_parameters: - ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns EventSubscription or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - event_subscription_name=event_subscription_name, - event_subscription_update_parameters=event_subscription_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('EventSubscription', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'} - - def get_full_url( - self, resource_group_name, system_topic_name, event_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get full URL of an event subscription of a system topic. - - Get the full endpoint URL for an event subscription of a system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param event_subscription_name: Name of the event subscription to be - created. Event subscription names must be between 3 and 100 characters - in length and use alphanumeric letters only. - :type event_subscription_name: str - :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: EventSubscriptionFullUrl or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_full_url.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str'), - 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EventSubscriptionFullUrl', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_full_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'} - - def list_by_system_topic( - self, resource_group_name, system_topic_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List event subscriptions of a system topic. - - List event subscriptions that belong to a specific system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of EventSubscription - :rtype: - ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_system_topic.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_system_topic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topics_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topics_operations.py deleted file mode 100644 index 1d9b4643522..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_system_topics_operations.py +++ /dev/null @@ -1,577 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class SystemTopicsOperations(object): - """SystemTopicsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, system_topic_name, custom_headers=None, raw=False, **operation_config): - """Get a system topic. - - Get properties of a system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :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: SystemTopic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.SystemTopic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SystemTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'} - - - def _create_or_update_initial( - self, resource_group_name, system_topic_name, system_topic_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(system_topic_info, 'SystemTopic') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SystemTopic', response) - if response.status_code == 201: - deserialized = self._deserialize('SystemTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, system_topic_name, system_topic_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create a system topic. - - Asynchronously creates a new system topic with the specified - parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param system_topic_info: System Topic information. - :type system_topic_info: ~azure.mgmt.eventgrid.models.SystemTopic - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns SystemTopic or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.SystemTopic] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.SystemTopic]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - system_topic_info=system_topic_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('SystemTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'} - - - def _delete_initial( - self, resource_group_name, system_topic_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, system_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a system topic. - - Delete existing system topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'} - - - def _update_initial( - self, resource_group_name, system_topic_name, tags=None, custom_headers=None, raw=False, **operation_config): - system_topic_update_parameters = models.SystemTopicUpdateParameters(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'systemTopicName': self._serialize.url("system_topic_name", system_topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(system_topic_update_parameters, 'SystemTopicUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SystemTopic', response) - if response.status_code == 201: - deserialized = self._deserialize('SystemTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, system_topic_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Update a system topic. - - Asynchronously updates a system topic with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param system_topic_name: Name of the system topic. - :type system_topic_name: str - :param tags: Tags of the system topic. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns SystemTopic or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.SystemTopic] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.SystemTopic]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - system_topic_name=system_topic_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('SystemTopic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List system topics under an Azure subscription. - - List all the system topics under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of SystemTopic - :rtype: - ~azure.mgmt.eventgrid.models.SystemTopicPaged[~azure.mgmt.eventgrid.models.SystemTopic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SystemTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/systemTopics'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List system topics under a resource group. - - List all the system topics under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of SystemTopic - :rtype: - ~azure.mgmt.eventgrid.models.SystemTopicPaged[~azure.mgmt.eventgrid.models.SystemTopic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SystemTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topic_types_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topic_types_operations.py deleted file mode 100644 index c9222e00b38..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topic_types_operations.py +++ /dev/null @@ -1,233 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class TopicTypesOperations(object): - """TopicTypesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List topic types. - - List all registered topic types. - - :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: An iterator like instance of TopicTypeInfo - :rtype: - ~azure.mgmt.eventgrid.models.TopicTypeInfoPaged[~azure.mgmt.eventgrid.models.TopicTypeInfo] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.TopicTypeInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes'} - - def get( - self, topic_type_name, custom_headers=None, raw=False, **operation_config): - """Get a topic type. - - Get information about a topic type. - - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :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: TopicTypeInfo or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicTypeInfo or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('TopicTypeInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'} - - def list_event_types( - self, topic_type_name, custom_headers=None, raw=False, **operation_config): - """List event types. - - List event types for a topic type. - - :param topic_type_name: Name of the topic type. - :type topic_type_name: str - :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: An iterator like instance of EventType - :rtype: - ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_event_types.metadata['url'] - path_format_arguments = { - 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') - } - 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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_event_types.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topics_operations.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topics_operations.py deleted file mode 100644 index 636333df52a..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/operations/_topics_operations.py +++ /dev/null @@ -1,788 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class TopicsOperations(object): - """TopicsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-04-01-preview" - - self.config = config - - def get( - self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): - """Get a topic. - - Get properties of a topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :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: Topic or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.Topic or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Topic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} - - - def _create_or_update_initial( - self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(topic_info, 'Topic') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('Topic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, polling=True, **operation_config): - """Create a topic. - - Asynchronously creates a new topic with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :param topic_info: Topic information. - :type topic_info: ~azure.mgmt.eventgrid.models.Topic - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Topic or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Topic]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - topic_name=topic_name, - topic_info=topic_info, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Topic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} - - - def _delete_initial( - self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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 = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, topic_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete a topic. - - Delete existing topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - topic_name=topic_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} - - - def _update_initial( - self, resource_group_name, topic_name, topic_update_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(topic_update_parameters, 'TopicUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('Topic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, topic_name, topic_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Update a topic. - - Asynchronously updates a topic with the specified parameters. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :param topic_update_parameters: Topic update information. - :type topic_update_parameters: - ~azure.mgmt.eventgrid.models.TopicUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns Topic or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Topic]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - topic_name=topic_name, - topic_update_parameters=topic_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Topic', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} - - def list_by_subscription( - self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List topics under an Azure subscription. - - List all the topics under an Azure subscription. - - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of Topic - :rtype: - ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics'} - - def list_by_resource_group( - self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """List topics under a resource group. - - List all the topics under a resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param filter: The query used to filter the search results using OData - syntax. Filtering is permitted on the 'name' property only and with - limited number of OData operations. These operations are: the - 'contains' function as well as the following logical operations: not, - and, or, eq (for equal), and ne (for not equal). No arithmetic - operations are supported. The following is a valid filter example: - $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The - following is not a valid filter example: $filter=location eq 'westus'. - :type filter: str - :param top: The number of results to return per page for the list - operation. Valid range for top parameter is 1 to 100. If not - specified, the default number of results to be returned is 20 items - per page. - :type top: int - :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: An iterator like instance of Topic - :rtype: - ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - 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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics'} - - def list_shared_access_keys( - self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): - """List keys for a topic. - - List the two keys used to publish to a topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :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: TopicSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_shared_access_keys.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('TopicSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys'} - - def regenerate_key( - self, resource_group_name, topic_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerate key for a topic. - - Regenerate a shared access key for a topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param topic_name: Name of the topic. - :type topic_name: str - :param key_name: Key name to regenerate key1 or key2 - :type key_name: str - :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: TopicSharedAccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key_request = models.TopicRegenerateKeyRequest(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'topicName': self._serialize.url("topic_name", topic_name, 'str') - } - 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['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(regenerate_key_request, 'TopicRegenerateKeyRequest') - - # 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]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('TopicSharedAccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey'} - - def list_event_types( - self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): - """List topic event types. - - List event types for a topic. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param provider_namespace: Namespace of the provider of the topic. - :type provider_namespace: str - :param resource_type_name: Name of the topic type. - :type resource_type_name: str - :param resource_name: Name of the topic. - :type resource_name: str - :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: An iterator like instance of EventType - :rtype: - ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_event_types.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), - 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') - } - 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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_event_types.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes'} diff --git a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/version.py b/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/version.py deleted file mode 100644 index 29bcdffc352..00000000000 --- a/src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/version.py +++ /dev/null @@ -1,12 +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. -# -------------------------------------------------------------------------- - -VERSION = "3.0.0rc6" diff --git a/src/eventgrid/setup.py b/src/eventgrid/setup.py index d7d46020ffe..c355d8a41a0 100644 --- a/src/eventgrid/setup.py +++ b/src/eventgrid/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "1.0.0b1" +VERSION = "1.0.0b2" CLASSIFIERS = [ 'Development Status :: 4 - Beta',