From e5539e6d04206df58a73ce90b63571efc3d704c1 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 8 Mar 2019 02:51:24 +0000 Subject: [PATCH] Generated from db7ea9a7b7820f006cff16587f0199a6e4fc2c5c Add 2019-02-01-preview tags for readme files for GO and Ruby --- .../generated/azure_mgmt_event_grid.rb | 93 + .../azure_mgmt_event_grid/domain_topics.rb | 648 ++++ .../azure_mgmt_event_grid/domains.rb | 1232 ++++++ .../event_grid_management_client.rb | 151 + .../event_subscriptions.rb | 3297 +++++++++++++++++ .../models/advanced_filter.rb | 72 + .../models/bool_equals_advanced_filter.rb | 65 + .../models/dead_letter_destination.rb | 49 + .../azure_mgmt_event_grid/models/domain.rb | 131 + .../models/domain_provisioning_state.rb | 20 + .../models/domain_regenerate_key_request.rb | 44 + .../models/domain_shared_access_keys.rb | 54 + .../models/domain_topic.rb | 70 + .../models/domain_topic_provisioning_state.rb | 20 + .../models/domain_topics_list_result.rb | 94 + .../models/domain_update_parameters.rb | 51 + .../models/domains_list_result.rb | 94 + .../models/event_delivery_schema.rb | 17 + ...vent_hub_event_subscription_destination.rb | 59 + .../models/event_subscription.rb | 175 + .../models/event_subscription_destination.rb | 49 + .../models/event_subscription_filter.rb | 112 + .../models/event_subscription_full_url.rb | 45 + .../event_subscription_provisioning_state.rb | 21 + .../event_subscription_update_parameters.rb | 128 + .../models/event_subscriptions_list_result.rb | 94 + .../models/event_type.rb | 98 + .../models/event_types_list_result.rb | 52 + ...nnection_event_subscription_destination.rb | 61 + .../models/input_schema.rb | 17 + .../models/input_schema_mapping.rb | 48 + .../models/json_field.rb | 48 + .../models/json_field_with_default.rb | 64 + .../models/json_input_schema_mapping.rb | 122 + .../number_greater_than_advanced_filter.rb | 65 + ..._greater_than_or_equals_advanced_filter.rb | 65 + .../models/number_in_advanced_filter.rb | 72 + .../number_less_than_advanced_filter.rb | 65 + ...ber_less_than_or_equals_advanced_filter.rb | 65 + .../models/number_not_in_advanced_filter.rb | 72 + .../azure_mgmt_event_grid/models/operation.rb | 75 + .../models/operation_info.rb | 74 + .../models/operations_list_result.rb | 52 + .../azure_mgmt_event_grid/models/resource.rb | 67 + .../models/resource_region_type.rb | 16 + .../models/retry_policy.rb | 54 + ...us_queue_event_subscription_destination.rb | 60 + .../storage_blob_dead_letter_destination.rb | 70 + ...ge_queue_event_subscription_destination.rb | 71 + .../string_begins_with_advanced_filter.rb | 72 + .../models/string_contains_advanced_filter.rb | 72 + .../string_ends_with_advanced_filter.rb | 72 + .../models/string_in_advanced_filter.rb | 72 + .../models/string_not_in_advanced_filter.rb | 72 + .../azure_mgmt_event_grid/models/topic.rb | 133 + .../models/topic_provisioning_state.rb | 20 + .../models/topic_regenerate_key_request.rb | 44 + .../models/topic_shared_access_keys.rb | 54 + .../models/topic_type_info.rb | 128 + .../models/topic_type_provisioning_state.rb | 20 + .../models/topic_types_list_result.rb | 52 + .../models/topic_update_parameters.rb | 51 + .../models/topics_list_result.rb | 94 + .../models/tracked_resource.rb | 85 + ...web_hook_event_subscription_destination.rb | 71 + .../module_definition.rb | 9 + .../azure_mgmt_event_grid/operations.rb | 115 + .../azure_mgmt_event_grid/topic_types.rb | 296 ++ .../generated/azure_mgmt_event_grid/topics.rb | 1340 +++++++ .../azure_mgmt_event_grid/version.rb | 8 + .../lib/azure_mgmt_event_grid.rb | 1 + 71 files changed, 11219 insertions(+) create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/module_definition.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb create mode 100644 management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/version.rb diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid.rb new file mode 100644 index 0000000000..4585962124 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2019-02-01-preview/generated/azure_mgmt_event_grid/module_definition' +require 'ms_rest_azure' + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + autoload :Domains, '2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb' + autoload :DomainTopics, '2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb' + autoload :EventSubscriptions, '2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb' + autoload :Operations, '2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb' + autoload :Topics, '2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb' + autoload :TopicTypes, '2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb' + autoload :EventGridManagementClient, '2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb' + + module Models + autoload :EventSubscriptionFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb' + autoload :RetryPolicy, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb' + autoload :Resource, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource.rb' + autoload :DeadLetterDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb' + autoload :JsonFieldWithDefault, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb' + autoload :InputSchemaMapping, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb' + autoload :JsonField, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb' + autoload :TopicRegenerateKeyRequest, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb' + autoload :TopicTypesListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb' + autoload :DomainsListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb' + autoload :TopicsListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb' + autoload :DomainRegenerateKeyRequest, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb' + autoload :EventSubscriptionFullUrl, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb' + autoload :DomainTopicsListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb' + autoload :EventSubscriptionUpdateParameters, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb' + autoload :AdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb' + autoload :EventSubscriptionsListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb' + autoload :DomainUpdateParameters, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb' + autoload :OperationInfo, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb' + autoload :EventTypesListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb' + autoload :Operation, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation.rb' + autoload :TopicSharedAccessKeys, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb' + autoload :OperationsListResult, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb' + autoload :EventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb' + autoload :TopicUpdateParameters, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb' + autoload :DomainSharedAccessKeys, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb' + autoload :JsonInputSchemaMapping, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb' + autoload :TrackedResource, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb' + autoload :Domain, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain.rb' + autoload :DomainTopic, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb' + autoload :NumberInAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb' + autoload :StorageBlobDeadLetterDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb' + autoload :NumberNotInAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb' + autoload :NumberLessThanAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb' + autoload :NumberGreaterThanAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb' + autoload :NumberLessThanOrEqualsAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb' + autoload :NumberGreaterThanOrEqualsAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb' + autoload :BoolEqualsAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb' + autoload :StringInAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb' + autoload :StringNotInAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb' + autoload :StringBeginsWithAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb' + autoload :StringEndsWithAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb' + autoload :StringContainsAdvancedFilter, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb' + autoload :WebHookEventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb' + autoload :EventHubEventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb' + autoload :StorageQueueEventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb' + autoload :HybridConnectionEventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb' + autoload :ServiceBusQueueEventSubscriptionDestination, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb' + autoload :EventSubscription, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb' + autoload :Topic, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic.rb' + autoload :EventType, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb' + autoload :TopicTypeInfo, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb' + autoload :DomainProvisioningState, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb' + autoload :InputSchema, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb' + autoload :DomainTopicProvisioningState, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb' + autoload :EventSubscriptionProvisioningState, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb' + autoload :EventDeliverySchema, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb' + autoload :TopicProvisioningState, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb' + autoload :ResourceRegionType, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb' + autoload :TopicTypeProvisioningState, '2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb' + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb new file mode 100644 index 0000000000..5091160021 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb @@ -0,0 +1,648 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class DomainTopics + include MsRestAzure + + # + # Creates and initializes a new instance of the DomainTopics class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a domain topic + # + # Get properties of a domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def get(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + response = get_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a domain topic + # + # Get properties of a domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + get_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + end + + # + # Get a domain topic + # + # Get properties of a domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain topic + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def create_or_update(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + response = create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a domain topic + # + # Delete existing domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + response = delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_domain(resource_group_name, domain_name, filter = nil, top = nil, custom_headers = nil) + first_page = list_by_domain_as_lazy(resource_group_name, domain_name, filter, top, custom_headers) + first_page.get_all_items + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_with_http_info(resource_group_name, domain_name, filter = nil, top = nil, custom_headers = nil) + list_by_domain_async(resource_group_name, domain_name, filter, top, custom_headers).value! + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_async(resource_group_name, domain_name, filter = nil, top = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain topic + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopic] operation results. + # + def begin_create_or_update(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update a domain topic + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + end + + # + # Create or update a domain topic + # + # Asynchronously creates or updates a new domain topic with the specified + # parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a domain topic + # + # Delete existing domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + nil + end + + # + # Delete a domain topic + # + # Delete existing domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers).value! + end + + # + # Delete a domain topic + # + # Delete existing domain topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_topic_name [String] Name of the domain topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, domain_name, domain_topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_topic_name is nil' if domain_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'domainTopicName' => domain_topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopicsListResult] operation results. + # + def list_by_domain_next(next_page_link, custom_headers = nil) + response = list_by_domain_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_next_with_http_info(next_page_link, custom_headers = nil) + list_by_domain_next_async(next_page_link, custom_headers).value! + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domain topics. + # + # List all the topics in a domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Domain name. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainTopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_domain_as_lazy(resource_group_name, domain_name, filter = nil, top = nil, custom_headers = nil) + response = list_by_domain_async(resource_group_name, domain_name, filter, top, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_domain_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb new file mode 100644 index 0000000000..0667a785b7 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb @@ -0,0 +1,1232 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class Domains + include MsRestAzure + + # + # Creates and initializes a new instance of the Domains class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a domain + # + # Get properties of a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def get(resource_group_name, domain_name, custom_headers = nil) + response = get_async(resource_group_name, domain_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a domain + # + # Get properties of a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, domain_name, custom_headers = nil) + get_async(resource_group_name, domain_name, custom_headers).value! + end + + # + # Get a domain + # + # Get properties of a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, domain_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_info [Domain] Domain information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def create_or_update(resource_group_name, domain_name, domain_info, custom_headers = nil) + response = create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_info [Domain] Domain information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a domain + # + # Delete existing domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, domain_name, custom_headers = nil) + response = delete_async(resource_group_name, domain_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, domain_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, domain_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update a domain + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def update(resource_group_name, domain_name, domain_update_parameters, custom_headers = nil) + response = update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(filter = nil, top = nil, custom_headers = nil) + first_page = list_by_subscription_as_lazy(filter, top, custom_headers) + first_page.get_all_items + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(filter = nil, top = nil, custom_headers = nil) + list_by_subscription_async(filter, top, custom_headers).value! + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(filter = nil, top = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, filter = nil, top = nil, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, filter, top, custom_headers) + first_page.get_all_items + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, filter = nil, top = nil, custom_headers = nil) + list_by_resource_group_async(resource_group_name, filter, top, custom_headers).value! + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, filter = nil, top = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List keys for a domain + # + # List the two keys used to publish to a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainSharedAccessKeys] operation results. + # + def list_shared_access_keys(resource_group_name, domain_name, custom_headers = nil) + response = list_shared_access_keys_async(resource_group_name, domain_name, custom_headers).value! + response.body unless response.nil? + end + + # + # List keys for a domain + # + # List the two keys used to publish to a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_shared_access_keys_with_http_info(resource_group_name, domain_name, custom_headers = nil) + list_shared_access_keys_async(resource_group_name, domain_name, custom_headers).value! + end + + # + # List keys for a domain + # + # List the two keys used to publish to a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_shared_access_keys_async(resource_group_name, domain_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerate key for a domain + # + # Regenerate a shared access key for a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainSharedAccessKeys] operation results. + # + def regenerate_key(resource_group_name, domain_name, regenerate_key_request, custom_headers = nil) + response = regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerate key for a domain + # + # Regenerate a shared access key for a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def regenerate_key_with_http_info(resource_group_name, domain_name, regenerate_key_request, custom_headers = nil) + regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers).value! + end + + # + # Regenerate key for a domain + # + # Regenerate a shared access key for a domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param regenerate_key_request [DomainRegenerateKeyRequest] Request body to + # regenerate key + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def regenerate_key_async(resource_group_name, domain_name, regenerate_key_request, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'regenerate_key_request is nil' if regenerate_key_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainRegenerateKeyRequest.mapper() + request_content = @client.serialize(request_mapper, regenerate_key_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update a domain + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_info [Domain] Domain information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def begin_create_or_update(resource_group_name, domain_name, domain_info, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update a domain + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_info [Domain] Domain information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain_info, custom_headers = nil) + begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers).value! + end + + # + # Create or update a domain + # + # Asynchronously creates or updates a new domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_info [Domain] Domain information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, domain_name, domain_info, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_info is nil' if domain_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + request_content = @client.serialize(request_mapper, domain_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a domain + # + # Delete existing domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, domain_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, domain_name, custom_headers).value! + nil + end + + # + # Delete a domain + # + # Delete existing domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, domain_name, custom_headers = nil) + begin_delete_async(resource_group_name, domain_name, custom_headers).value! + end + + # + # Delete a domain + # + # Delete existing domain + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, domain_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a domain + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Domain] operation results. + # + def begin_update(resource_group_name, domain_name, domain_update_parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Update a domain + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, domain_name, domain_update_parameters, custom_headers = nil) + begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers).value! + end + + # + # Update a domain + # + # Asynchronously updates a domain with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the domain + # @param domain_update_parameters [DomainUpdateParameters] Domain update + # information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, domain_name, domain_update_parameters, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'domain_update_parameters is nil' if domain_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, domain_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers = nil) + response = list_by_subscription_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil) + list_by_subscription_next_async(next_page_link, custom_headers).value! + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List domains under an Azure subscription + # + # List all the domains under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] which provide lazy access to pages of the + # response. + # + def list_by_subscription_as_lazy(filter = nil, top = nil, custom_headers = nil) + response = list_by_subscription_async(filter, top, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # List domains under a resource group + # + # List all the domains under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DomainsListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, filter = nil, top = nil, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, filter, top, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb new file mode 100644 index 0000000000..705ec820f9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -0,0 +1,151 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # A service client - single point of access to the REST API. + # + class EventGridManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Subscription credentials that uniquely identify a + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Version of the API to be used with the client request. + attr_reader :api_version + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [Domains] domains + attr_reader :domains + + # @return [DomainTopics] domain_topics + attr_reader :domain_topics + + # @return [EventSubscriptions] event_subscriptions + attr_reader :event_subscriptions + + # @return [Operations] operations + attr_reader :operations + + # @return [Topics] topics + attr_reader :topics + + # @return [TopicTypes] topic_types + attr_reader :topic_types + + # + # Creates initializes a new instance of the EventGridManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @domains = Domains.new(self) + @domain_topics = DomainTopics.new(self) + @event_subscriptions = EventSubscriptions.new(self) + @operations = Operations.new(self) + @topics = Topics.new(self) + @topic_types = TopicTypes.new(self) + @api_version = '2019-02-01-preview' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_event_grid' + if defined? Azure::EventGrid::Mgmt::V2019_02_01_preview::VERSION + sdk_information = "#{sdk_information}/#{Azure::EventGrid::Mgmt::V2019_02_01_preview::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb new file mode 100644 index 0000000000..c56a5a29ba --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb @@ -0,0 +1,3297 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class EventSubscriptions + include MsRestAzure + + # + # Creates and initializes a new instance of the EventSubscriptions class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get an event subscription + # + # Get properties of an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def get(scope, event_subscription_name, custom_headers = nil) + response = get_async(scope, event_subscription_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get an event subscription + # + # Get properties of an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(scope, event_subscription_name, custom_headers = nil) + get_async(scope, event_subscription_name, custom_headers).value! + end + + # + # Get an event subscription + # + # Get properties of an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(scope, event_subscription_name, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] 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. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers = nil) + response = create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers).value! + response.body unless response.nil? + end + + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete an event subscription + # + # Delete an existing event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(scope, event_subscription_name, custom_headers = nil) + response = delete_async(scope, event_subscription_name, custom_headers).value! + nil + end + + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(scope, event_subscription_name, custom_headers = nil) + # Send request + promise = begin_delete_async(scope, event_subscription_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update an event subscription + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription to be + # updated + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers = nil) + response = update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription to be + # updated + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Get full URL of an event subscription + # + # Get the full endpoint URL for an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionFullUrl] operation results. + # + def get_full_url(scope, event_subscription_name, custom_headers = nil) + response = get_full_url_async(scope, event_subscription_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get full URL of an event subscription + # + # Get the full endpoint URL for an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_full_url_with_http_info(scope, event_subscription_name, custom_headers = nil) + get_full_url_async(scope, event_subscription_name, custom_headers).value! + end + + # + # Get full URL of an event subscription + # + # Get the full endpoint URL for an event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_full_url_async(scope, event_subscription_name, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionFullUrl.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_subscription(filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_global_by_subscription_as_lazy(filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_with_http_info(filter = nil, top = nil, label = nil, custom_headers = nil) + list_global_by_subscription_async(filter, top, label, custom_headers).value! + end + + # + # 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 [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_async(filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_subscription_for_topic_type(topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_for_topic_type_with_http_info(topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_global_by_subscription_for_topic_type_async(topic_type_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_for_topic_type_async(topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_resource_group(resource_group_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_global_by_resource_group_as_lazy(resource_group_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_with_http_info(resource_group_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_global_by_resource_group_async(resource_group_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_async(resource_group_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_global_by_resource_group_for_topic_type(resource_group_name, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_for_topic_type_with_http_info(resource_group_name, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_subscription(location, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_regional_by_subscription_as_lazy(location, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_with_http_info(location, filter = nil, top = nil, label = nil, custom_headers = nil) + list_regional_by_subscription_async(location, filter, top, label, custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_async(location, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_resource_group(resource_group_name, location, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_regional_by_resource_group_as_lazy(resource_group_name, location, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_with_http_info(resource_group_name, location, filter = nil, top = nil, label = nil, custom_headers = nil) + list_regional_by_resource_group_async(resource_group_name, location, filter, top, label, custom_headers).value! + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_async(resource_group_name, location, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_subscription_for_topic_type(location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_for_topic_type_with_http_info(location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_regional_by_resource_group_for_topic_type(resource_group_name, location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_for_topic_type_with_http_info(resource_group_name, location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location,'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the resource type + # @param resource_name [String] Name of the resource + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource(resource_group_name, provider_namespace, resource_type_name, resource_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the resource type + # @param resource_name [String] Name of the resource + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter, top, label, custom_headers).value! + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the resource type + # @param resource_name [String] Name of the resource + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil? + fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain + # @param topic_name [String] Name of the domain topic + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_domain_topic(resource_group_name, domain_name, topic_name, filter = nil, top = nil, label = nil, custom_headers = nil) + first_page = list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter, top, label, custom_headers) + first_page.get_all_items + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain + # @param topic_name [String] Name of the domain topic + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_topic_with_http_info(resource_group_name, domain_name, topic_name, filter = nil, top = nil, label = nil, custom_headers = nil) + list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter, top, label, custom_headers).value! + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain + # @param topic_name [String] Name of the domain topic + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter = nil, top = nil, label = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'domain_name is nil' if domain_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'label' => label}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] 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. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers = nil) + response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 [String] 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. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(scope, event_subscription_name, event_subscription_info, custom_headers = nil) + begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers).value! + end + + # + # 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 [String] 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. + # @param event_subscription_name [String] Name of the event subscription. Event + # subscription names must be between 3 and 64 characters in length and should + # use alphanumeric letters only. + # @param event_subscription_info [EventSubscription] Event subscription + # properties containing the destination and filter information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, 'event_subscription_info is nil' if event_subscription_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + request_content = @client.serialize(request_mapper, event_subscription_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete an event subscription + # + # Delete an existing event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(scope, event_subscription_name, custom_headers = nil) + response = begin_delete_async(scope, event_subscription_name, custom_headers).value! + nil + end + + # + # Delete an event subscription + # + # Delete an existing event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(scope, event_subscription_name, custom_headers = nil) + begin_delete_async(scope, event_subscription_name, custom_headers).value! + end + + # + # Delete an event subscription + # + # Delete an existing event subscription + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(scope, event_subscription_name, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update an event subscription + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription to be + # updated + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscription] operation results. + # + def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers = nil) + response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Update an event subscription + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription to be + # updated + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers = nil) + begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers).value! + end + + # + # Update an event subscription + # + # Asynchronously updates an existing event subscription. + # + # @param scope [String] 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. + # @param event_subscription_name [String] Name of the event subscription to be + # updated + # @param event_subscription_update_parameters + # [EventSubscriptionUpdateParameters] Updated event subscription information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers = nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil? + fail ArgumentError, 'event_subscription_update_parameters is nil' if event_subscription_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, event_subscription_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'eventSubscriptionName' => event_subscription_name}, + skip_encoding_path_params: {'scope' => scope}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_subscription_next(next_page_link, custom_headers = nil) + response = list_global_by_subscription_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_next_with_http_info(next_page_link, custom_headers = nil) + list_global_by_subscription_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all global event subscriptions for a topic type + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_subscription_for_topic_type_next(next_page_link, custom_headers = nil) + response = list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List all global event subscriptions for a topic type + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers = nil) + list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers).value! + end + + # + # List all global event subscriptions for a topic type + # + # List all global event subscriptions under an Azure subscription for a topic + # type. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_global_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_global_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_global_by_resource_group_for_topic_type_next(next_page_link, custom_headers = nil) + response = list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_global_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers = nil) + list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_subscription_next(next_page_link, custom_headers = nil) + response = list_regional_by_subscription_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_next_with_http_info(next_page_link, custom_headers = nil) + list_regional_by_subscription_next_async(next_page_link, custom_headers).value! + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_regional_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_regional_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_subscription_for_topic_type_next(next_page_link, custom_headers = nil) + response = list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers = nil) + list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_regional_by_resource_group_for_topic_type_next(next_page_link, custom_headers = nil) + response = list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_regional_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers = nil) + list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers).value! + end + + # + # 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 next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers = nil) + response = list_by_resource_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_next_async(next_page_link, custom_headers).value! + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List all event subscriptions for a specific domain topic + # + # List all event subscriptions that have been created for a specific domain + # topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] operation results. + # + def list_by_domain_topic_next(next_page_link, custom_headers = nil) + response = list_by_domain_topic_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List all event subscriptions for a specific domain topic + # + # List all event subscriptions that have been created for a specific domain + # topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_domain_topic_next_with_http_info(next_page_link, custom_headers = nil) + list_by_domain_topic_next_async(next_page_link, custom_headers).value! + end + + # + # List all event subscriptions for a specific domain topic + # + # List all event subscriptions that have been created for a specific domain + # topic + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_domain_topic_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # 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 [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_subscription_as_lazy(filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_global_by_subscription_async(filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_subscription_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_global_by_subscription_for_topic_type_async(topic_type_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_resource_group_as_lazy(resource_group_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_global_by_resource_group_async(resource_group_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # List all regional event subscriptions under an Azure subscription + # + # List all event subscriptions from the given location under a specific Azure + # subscription + # + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_subscription_as_lazy(location, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_regional_by_subscription_async(location, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_subscription_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_resource_group_as_lazy(resource_group_name, location, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_regional_by_resource_group_async(resource_group_name, location, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param location [String] Name of the location + # @param topic_type_name [String] Name of the topic type + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # List all event subscriptions for a specific topic + # + # List all event subscriptions that have been created for a specific topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the resource type + # @param resource_name [String] Name of the resource + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # 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 [String] The name of the resource group within the + # user's subscription. + # @param domain_name [String] Name of the top level domain + # @param topic_name [String] Name of the domain topic + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param label [String] The label used to filter the results for event + # subscriptions list. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventSubscriptionsListResult] which provide lazy access to pages of + # the response. + # + def list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter = nil, top = nil, label = nil, custom_headers = nil) + response = list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter, top, label, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_domain_topic_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb new file mode 100644 index 0000000000..5fea87bbba --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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. + # + class AdvancedFilter + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["NumberIn"] = "NumberInAdvancedFilter" + @@discriminatorMap["NumberNotIn"] = "NumberNotInAdvancedFilter" + @@discriminatorMap["NumberLessThan"] = "NumberLessThanAdvancedFilter" + @@discriminatorMap["NumberGreaterThan"] = "NumberGreaterThanAdvancedFilter" + @@discriminatorMap["NumberLessThanOrEquals"] = "NumberLessThanOrEqualsAdvancedFilter" + @@discriminatorMap["NumberGreaterThanOrEquals"] = "NumberGreaterThanOrEqualsAdvancedFilter" + @@discriminatorMap["BoolEquals"] = "BoolEqualsAdvancedFilter" + @@discriminatorMap["StringIn"] = "StringInAdvancedFilter" + @@discriminatorMap["StringNotIn"] = "StringNotInAdvancedFilter" + @@discriminatorMap["StringBeginsWith"] = "StringBeginsWithAdvancedFilter" + @@discriminatorMap["StringEndsWith"] = "StringEndsWithAdvancedFilter" + @@discriminatorMap["StringContains"] = "StringContainsAdvancedFilter" + + def initialize + @operatorType = "AdvancedFilter" + end + + attr_accessor :operatorType + + # @return [String] The field/property in the event based on which you + # want to filter. + attr_accessor :key + + + # + # Mapper for AdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AdvancedFilter', + type: { + name: 'Composite', + polymorphic_discriminator: 'operatorType', + uber_parent: 'AdvancedFilter', + class_name: 'AdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb new file mode 100644 index 0000000000..41819307e5 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # BoolEquals Advanced Filter. + # + class BoolEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "BoolEquals" + end + + attr_accessor :operatorType + + # @return [Boolean] The boolean filter value. + attr_accessor :value + + + # + # Mapper for BoolEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'BoolEquals', + type: { + name: 'Composite', + class_name: 'BoolEqualsAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb new file mode 100644 index 0000000000..2e42edf709 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb @@ -0,0 +1,49 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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. + # + class DeadLetterDestination + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["StorageBlob"] = "StorageBlobDeadLetterDestination" + + def initialize + @endpointType = "DeadLetterDestination" + end + + attr_accessor :endpointType + + + # + # Mapper for DeadLetterDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DeadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain.rb new file mode 100644 index 0000000000..3d0fba9715 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain.rb @@ -0,0 +1,131 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # EventGrid Domain + # + class Domain < TrackedResource + + include MsRestAzure + + # @return [DomainProvisioningState] Provisioning state of the domain. + # Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Endpoint for the domain. + attr_accessor :endpoint + + # @return [InputSchema] This determines the format that Event Grid should + # expect for incoming events published to the domain. Possible values + # include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + # Default value: 'EventGridSchema' . + attr_accessor :input_schema + + # @return [InputSchemaMapping] Information about the InputSchemaMapping + # which specified the info about mapping event payload. + attr_accessor :input_schema_mapping + + + # + # Mapper for Domain class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Domain', + type: { + name: 'Composite', + class_name: 'Domain', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb new file mode 100644 index 0000000000..53da73b5f3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for DomainProvisioningState + # + module DomainProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb new file mode 100644 index 0000000000..95b18c9751 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Domain regenerate share access key request + # + class DomainRegenerateKeyRequest + + include MsRestAzure + + # @return [String] Key name to regenerate key1 or key2 + attr_accessor :key_name + + + # + # Mapper for DomainRegenerateKeyRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'DomainRegenerateKeyRequest', + model_properties: { + key_name: { + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb new file mode 100644 index 0000000000..57aa7130df --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Shared access keys of the Domain + # + class DomainSharedAccessKeys + + include MsRestAzure + + # @return [String] Shared access key1 for the domain. + attr_accessor :key1 + + # @return [String] Shared access key2 for the domain. + attr_accessor :key2 + + + # + # Mapper for DomainSharedAccessKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'DomainSharedAccessKeys', + model_properties: { + key1: { + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb new file mode 100644 index 0000000000..13f916b203 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Domain Topic + # + class DomainTopic < Resource + + include MsRestAzure + + # @return [DomainTopicProvisioningState] Provisioning state of the domain + # topic. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + + # + # Mapper for DomainTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainTopic', + type: { + name: 'Composite', + class_name: 'DomainTopic', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb new file mode 100644 index 0000000000..e31ba1fbc3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for DomainTopicProvisioningState + # + module DomainTopicProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb new file mode 100644 index 0000000000..bfc80c6277 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Domain Topics operation + # + class DomainTopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Domain Topics + attr_accessor :value + + # @return [String] A link for the next page of domain topics + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DomainTopicsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DomainTopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainTopicsListResult', + type: { + name: 'Composite', + class_name: 'DomainTopicsListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'DomainTopicElementType', + type: { + name: 'Composite', + class_name: 'DomainTopic' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb new file mode 100644 index 0000000000..75d77813a7 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Properties of the Domain update + # + class DomainUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the domains resource + attr_accessor :tags + + + # + # Mapper for DomainUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainUpdateParameters', + type: { + name: 'Composite', + class_name: 'DomainUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb new file mode 100644 index 0000000000..6f2c4f645f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Domains operation + # + class DomainsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Domains + attr_accessor :value + + # @return [String] A link for the next page of domains + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [DomainsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for DomainsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DomainsListResult', + type: { + name: 'Composite', + class_name: 'DomainsListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'DomainElementType', + type: { + name: 'Composite', + class_name: 'Domain' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb new file mode 100644 index 0000000000..22dfd50a3d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for EventDeliverySchema + # + module EventDeliverySchema + EventGridSchema = "EventGridSchema" + CloudEventV01Schema = "CloudEventV01Schema" + CustomInputSchema = "CustomInputSchema" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb new file mode 100644 index 0000000000..791056bd73 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the event hub destination for an event subscription + # + class EventHubEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "EventHub" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # an Event Hub destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for EventHubEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventHub', + type: { + name: 'Composite', + class_name: 'EventHubEventSubscriptionDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb new file mode 100644 index 0000000000..d073aab1b1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb @@ -0,0 +1,175 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Event Subscription + # + class EventSubscription < Resource + + include MsRestAzure + + # @return [String] Name of the topic of the event subscription. + attr_accessor :topic + + # @return [EventSubscriptionProvisioningState] Provisioning state of the + # event subscription. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed', 'AwaitingManualAction' + attr_accessor :provisioning_state + + # @return [EventSubscriptionDestination] Information about the + # destination where events have to be delivered for the event + # subscription. + attr_accessor :destination + + # @return [EventSubscriptionFilter] Information about the filter for the + # event subscription. + attr_accessor :filter + + # @return [Array] List of user defined labels. + attr_accessor :labels + + # @return [DateTime] Expiration time of the event subscription. + attr_accessor :expiration_time_utc + + # @return [EventDeliverySchema] The event delivery schema for the event + # subscription. Possible values include: 'EventGridSchema', + # 'CloudEventV01Schema', 'CustomInputSchema' + attr_accessor :event_delivery_schema + + # @return [RetryPolicy] The retry policy for events. This can be used to + # configure maximum number of delivery attempts and time to live for + # events. + attr_accessor :retry_policy + + # @return [DeadLetterDestination] The DeadLetter destination of the event + # subscription. + attr_accessor :dead_letter_destination + + + # + # Mapper for EventSubscription class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscription', + type: { + name: 'Composite', + class_name: 'EventSubscription', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + topic: { + required: false, + read_only: true, + serialized_name: 'properties.topic', + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + destination: { + required: false, + serialized_name: 'properties.destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + filter: { + required: false, + serialized_name: 'properties.filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + required: false, + serialized_name: 'properties.labels', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + required: false, + serialized_name: 'properties.expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + required: false, + serialized_name: 'properties.eventDeliverySchema', + type: { + name: 'String' + } + }, + retry_policy: { + required: false, + serialized_name: 'properties.retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + required: false, + serialized_name: 'properties.deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb new file mode 100644 index 0000000000..c5e6cb3e7d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb @@ -0,0 +1,49 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the destination for an event subscription + # + class EventSubscriptionDestination + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["WebHook"] = "WebHookEventSubscriptionDestination" + @@discriminatorMap["EventHub"] = "EventHubEventSubscriptionDestination" + @@discriminatorMap["StorageQueue"] = "StorageQueueEventSubscriptionDestination" + @@discriminatorMap["HybridConnection"] = "HybridConnectionEventSubscriptionDestination" + @@discriminatorMap["ServiceBusQueue"] = "ServiceBusQueueEventSubscriptionDestination" + + def initialize + @endpointType = "EventSubscriptionDestination" + end + + attr_accessor :endpointType + + + # + # Mapper for EventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscriptionDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb new file mode 100644 index 0000000000..73e2a181d3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Filter for the Event Subscription + # + class EventSubscriptionFilter + + include MsRestAzure + + # @return [String] 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. + attr_accessor :subject_begins_with + + # @return [String] An optional string to filter events for an event + # subscription based on a resource path suffix. + # Wildcard characters are not supported in this path. + attr_accessor :subject_ends_with + + # @return [Array] 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. + attr_accessor :included_event_types + + # @return [Boolean] Specifies if the SubjectBeginsWith and + # SubjectEndsWith properties of the filter + # should be compared in a case sensitive manner. Default value: false . + attr_accessor :is_subject_case_sensitive + + # @return [Array] An array of advanced filters that are + # used for filtering event subscriptions. + attr_accessor :advanced_filters + + + # + # Mapper for EventSubscriptionFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscriptionFilter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter', + model_properties: { + subject_begins_with: { + required: false, + serialized_name: 'subjectBeginsWith', + type: { + name: 'String' + } + }, + subject_ends_with: { + required: false, + serialized_name: 'subjectEndsWith', + type: { + name: 'String' + } + }, + included_event_types: { + required: false, + serialized_name: 'includedEventTypes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_subject_case_sensitive: { + required: false, + serialized_name: 'isSubjectCaseSensitive', + default_value: false, + type: { + name: 'Boolean' + } + }, + advanced_filters: { + required: false, + serialized_name: 'advancedFilters', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'AdvancedFilterElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'operatorType', + uber_parent: 'AdvancedFilter', + class_name: 'AdvancedFilter' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb new file mode 100644 index 0000000000..05ee4e11f3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Full endpoint url of an event subscription + # + class EventSubscriptionFullUrl + + include MsRestAzure + + # @return [String] The URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_url + + + # + # Mapper for EventSubscriptionFullUrl class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscriptionFullUrl', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFullUrl', + model_properties: { + endpoint_url: { + required: false, + serialized_name: 'endpointUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb new file mode 100644 index 0000000000..2fbeb60b4e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb @@ -0,0 +1,21 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for EventSubscriptionProvisioningState + # + module EventSubscriptionProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + AwaitingManualAction = "AwaitingManualAction" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb new file mode 100644 index 0000000000..8c4af443ef --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb @@ -0,0 +1,128 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Properties of the Event Subscription update + # + class EventSubscriptionUpdateParameters + + include MsRestAzure + + # @return [EventSubscriptionDestination] Information about the + # destination where events have to be delivered for the event + # subscription. + attr_accessor :destination + + # @return [EventSubscriptionFilter] Information about the filter for the + # event subscription. + attr_accessor :filter + + # @return [Array] List of user defined labels. + attr_accessor :labels + + # @return [DateTime] Information about the expiration time for the event + # subscription. + attr_accessor :expiration_time_utc + + # @return [EventDeliverySchema] The event delivery schema for the event + # subscription. Possible values include: 'EventGridSchema', + # 'CloudEventV01Schema', 'CustomInputSchema' + attr_accessor :event_delivery_schema + + # @return [RetryPolicy] The retry policy for events. This can be used to + # configure maximum number of delivery attempts and time to live for + # events. + attr_accessor :retry_policy + + # @return [DeadLetterDestination] The DeadLetter destination of the event + # subscription. + attr_accessor :dead_letter_destination + + + # + # Mapper for EventSubscriptionUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscriptionUpdateParameters', + type: { + name: 'Composite', + class_name: 'EventSubscriptionUpdateParameters', + model_properties: { + destination: { + required: false, + serialized_name: 'destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + filter: { + required: false, + serialized_name: 'filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + required: false, + serialized_name: 'labels', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + required: false, + serialized_name: 'expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + required: false, + serialized_name: 'eventDeliverySchema', + type: { + name: 'String' + } + }, + retry_policy: { + required: false, + serialized_name: 'retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + required: false, + serialized_name: 'deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb new file mode 100644 index 0000000000..9d8fd43789 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List EventSubscriptions operation + # + class EventSubscriptionsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of EventSubscriptions + attr_accessor :value + + # @return [String] A link for the next page of event subscriptions + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [EventSubscriptionsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for EventSubscriptionsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventSubscriptionsListResult', + type: { + name: 'Composite', + class_name: 'EventSubscriptionsListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventSubscriptionElementType', + type: { + name: 'Composite', + class_name: 'EventSubscription' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb new file mode 100644 index 0000000000..dbd8cb69a3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb @@ -0,0 +1,98 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Event Type for a subject under a topic + # + class EventType < Resource + + include MsRestAzure + + # @return [String] Display name of the event type. + attr_accessor :display_name + + # @return [String] Description of the event type. + attr_accessor :description + + # @return [String] Url of the schema for this event type. + attr_accessor :schema_url + + # @return [Boolean] IsInDefaultSet flag of the event type. + attr_accessor :is_in_default_set + + + # + # Mapper for EventType class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventType', + type: { + name: 'Composite', + class_name: 'EventType', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + schema_url: { + required: false, + serialized_name: 'properties.schemaUrl', + type: { + name: 'String' + } + }, + is_in_default_set: { + required: false, + serialized_name: 'properties.isInDefaultSet', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb new file mode 100644 index 0000000000..80cbe63722 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Event Types operation + # + class EventTypesListResult + + include MsRestAzure + + # @return [Array] A collection of event types + attr_accessor :value + + + # + # Mapper for EventTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventTypesListResult', + type: { + name: 'Composite', + class_name: 'EventTypesListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventTypeElementType', + type: { + name: 'Composite', + class_name: 'EventType' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb new file mode 100644 index 0000000000..9a44381b20 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb @@ -0,0 +1,61 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the HybridConnection destination for an event + # subscription. + # + class HybridConnectionEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "HybridConnection" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of an hybrid connection that is + # the destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for HybridConnectionEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'HybridConnection', + type: { + name: 'Composite', + class_name: 'HybridConnectionEventSubscriptionDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb new file mode 100644 index 0000000000..b7dcabea2b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for InputSchema + # + module InputSchema + EventGridSchema = "EventGridSchema" + CustomEventSchema = "CustomEventSchema" + CloudEventV01Schema = "CloudEventV01Schema" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb new file mode 100644 index 0000000000..ac0cba882f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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'. + # + class InputSchemaMapping + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["Json"] = "JsonInputSchemaMapping" + + def initialize + @inputSchemaMappingType = "InputSchemaMapping" + end + + attr_accessor :inputSchemaMappingType + + + # + # Mapper for InputSchemaMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'InputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping', + model_properties: { + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb new file mode 100644 index 0000000000..40a2e17feb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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. + # + class JsonField + + include MsRestAzure + + # @return [String] Name of a field in the input event schema that's to be + # used as the source of a mapping. + attr_accessor :source_field + + + # + # Mapper for JsonField class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'JsonField', + type: { + name: 'Composite', + class_name: 'JsonField', + model_properties: { + source_field: { + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb new file mode 100644 index 0000000000..c2aecff8a3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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. + # + class JsonFieldWithDefault + + include MsRestAzure + + # @return [String] Name of a field in the input event schema that's to be + # used as the source of a mapping. + attr_accessor :source_field + + # @return [String] 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. + attr_accessor :default_value + + + # + # Mapper for JsonFieldWithDefault class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'JsonFieldWithDefault', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault', + model_properties: { + source_field: { + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + }, + default_value: { + required: false, + serialized_name: 'defaultValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb new file mode 100644 index 0000000000..54dfbc138c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # 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. + # + class JsonInputSchemaMapping < InputSchemaMapping + + include MsRestAzure + + + def initialize + @inputSchemaMappingType = "Json" + end + + attr_accessor :inputSchemaMappingType + + # @return [JsonField] The mapping information for the Id property of the + # Event Grid Event. + attr_accessor :id + + # @return [JsonField] The mapping information for the Topic property of + # the Event Grid Event. + attr_accessor :topic + + # @return [JsonField] The mapping information for the EventTime property + # of the Event Grid Event. + attr_accessor :event_time + + # @return [JsonFieldWithDefault] The mapping information for the + # EventType property of the Event Grid Event. + attr_accessor :event_type + + # @return [JsonFieldWithDefault] The mapping information for the Subject + # property of the Event Grid Event. + attr_accessor :subject + + # @return [JsonFieldWithDefault] The mapping information for the + # DataVersion property of the Event Grid Event. + attr_accessor :data_version + + + # + # Mapper for JsonInputSchemaMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Json', + type: { + name: 'Composite', + class_name: 'JsonInputSchemaMapping', + model_properties: { + inputSchemaMappingType: { + required: true, + serialized_name: 'inputSchemaMappingType', + type: { + name: 'String' + } + }, + id: { + required: false, + serialized_name: 'properties.id', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + topic: { + required: false, + serialized_name: 'properties.topic', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_time: { + required: false, + serialized_name: 'properties.eventTime', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_type: { + required: false, + serialized_name: 'properties.eventType', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + subject: { + required: false, + serialized_name: 'properties.subject', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + data_version: { + required: false, + serialized_name: 'properties.dataVersion', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb new file mode 100644 index 0000000000..41076c4429 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberGreaterThan Advanced Filter. + # + class NumberGreaterThanAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberGreaterThan" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberGreaterThanAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberGreaterThan', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb new file mode 100644 index 0000000000..7cdf39dda8 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberGreaterThanOrEquals Advanced Filter. + # + class NumberGreaterThanOrEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberGreaterThanOrEquals" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberGreaterThanOrEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberGreaterThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanOrEqualsAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb new file mode 100644 index 0000000000..840f0956d2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberIn Advanced Filter. + # + class NumberInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberIn', + type: { + name: 'Composite', + class_name: 'NumberInAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb new file mode 100644 index 0000000000..41d37cb6b8 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberLessThan Advanced Filter. + # + class NumberLessThanAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberLessThan" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberLessThanAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberLessThan', + type: { + name: 'Composite', + class_name: 'NumberLessThanAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb new file mode 100644 index 0000000000..2c3412957d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberLessThanOrEquals Advanced Filter. + # + class NumberLessThanOrEqualsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberLessThanOrEquals" + end + + attr_accessor :operatorType + + # @return [Float] The filter value. + attr_accessor :value + + + # + # Mapper for NumberLessThanOrEqualsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberLessThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberLessThanOrEqualsAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb new file mode 100644 index 0000000000..6a7aa7d89d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # NumberNotIn Advanced Filter. + # + class NumberNotInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberNotIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberNotInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'NumberNotIn', + type: { + name: 'Composite', + class_name: 'NumberNotInAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation.rb new file mode 100644 index 0000000000..55728a064b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation.rb @@ -0,0 +1,75 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Represents an operation returned by the GetOperations request + # + class Operation + + include MsRestAzure + + # @return [String] Name of the operation + attr_accessor :name + + # @return [OperationInfo] Display name of the operation + attr_accessor :display + + # @return [String] Origin of the operation + attr_accessor :origin + + # @return Properties of the operation + attr_accessor :properties + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationInfo' + } + }, + origin: { + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + }, + properties: { + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb new file mode 100644 index 0000000000..7c9b875a3d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about an operation + # + class OperationInfo + + include MsRestAzure + + # @return [String] Name of the provider + attr_accessor :provider + + # @return [String] Name of the resource type + attr_accessor :resource + + # @return [String] Name of the operation + attr_accessor :operation + + # @return [String] Description of the operation + attr_accessor :description + + + # + # Mapper for OperationInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationInfo', + type: { + name: 'Composite', + class_name: 'OperationInfo', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb new file mode 100644 index 0000000000..5fe3832ab8 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Operations operation + # + class OperationsListResult + + include MsRestAzure + + # @return [Array] A collection of operations + attr_accessor :value + + + # + # Mapper for OperationsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationsListResult', + type: { + name: 'Composite', + class_name: 'OperationsListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource.rb new file mode 100644 index 0000000000..64a9df4929 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Definition of a Resource + # + class Resource + + include MsRestAzure + + # @return [String] Fully qualified identifier of the resource + attr_accessor :id + + # @return [String] Name of the resource + attr_accessor :name + + # @return [String] Type of the resource + attr_accessor :type + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb new file mode 100644 index 0000000000..2b00ff289e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for ResourceRegionType + # + module ResourceRegionType + RegionalResource = "RegionalResource" + GlobalResource = "GlobalResource" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb new file mode 100644 index 0000000000..cb7409b717 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the retry policy for an event subscription + # + class RetryPolicy + + include MsRestAzure + + # @return [Integer] Maximum number of delivery retry attempts for events. + attr_accessor :max_delivery_attempts + + # @return [Integer] Time To Live (in minutes) for events. + attr_accessor :event_time_to_live_in_minutes + + + # + # Mapper for RetryPolicy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RetryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy', + model_properties: { + max_delivery_attempts: { + required: false, + serialized_name: 'maxDeliveryAttempts', + type: { + name: 'Number' + } + }, + event_time_to_live_in_minutes: { + required: false, + serialized_name: 'eventTimeToLiveInMinutes', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb new file mode 100644 index 0000000000..5709f58d14 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb @@ -0,0 +1,60 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the service bus destination for an event subscription + # + class ServiceBusQueueEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "ServiceBusQueue" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Service Bus destination of an event subscription. + attr_accessor :resource_id + + + # + # Mapper for ServiceBusQueueEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ServiceBusQueue', + type: { + name: 'Composite', + class_name: 'ServiceBusQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb new file mode 100644 index 0000000000..4d186e5939 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the storage blob based dead letter destination. + # + class StorageBlobDeadLetterDestination < DeadLetterDestination + + include MsRestAzure + + + def initialize + @endpointType = "StorageBlob" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of the storage account that is + # the destination of the deadletter events + attr_accessor :resource_id + + # @return [String] The name of the Storage blob container that is the + # destination of the deadletter events + attr_accessor :blob_container_name + + + # + # Mapper for StorageBlobDeadLetterDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StorageBlob', + type: { + name: 'Composite', + class_name: 'StorageBlobDeadLetterDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + blob_container_name: { + required: false, + serialized_name: 'properties.blobContainerName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb new file mode 100644 index 0000000000..a15b00f854 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the storage queue destination for an event + # subscription. + # + class StorageQueueEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "StorageQueue" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource ID of the storage account that + # contains the queue that is the destination of an event subscription. + attr_accessor :resource_id + + # @return [String] The name of the Storage queue under a storage account + # that is the destination of an event subscription. + attr_accessor :queue_name + + + # + # Mapper for StorageQueueEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StorageQueue', + type: { + name: 'Composite', + class_name: 'StorageQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + queue_name: { + required: false, + serialized_name: 'properties.queueName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb new file mode 100644 index 0000000000..9e0d491c94 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # StringBeginsWith Advanced Filter. + # + class StringBeginsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringBeginsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringBeginsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StringBeginsWith', + type: { + name: 'Composite', + class_name: 'StringBeginsWithAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb new file mode 100644 index 0000000000..c5d7891b1c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # StringContains Advanced Filter. + # + class StringContainsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringContains" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringContainsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StringContains', + type: { + name: 'Composite', + class_name: 'StringContainsAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb new file mode 100644 index 0000000000..73b4e2e803 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # StringEndsWith Advanced Filter. + # + class StringEndsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringEndsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringEndsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StringEndsWith', + type: { + name: 'Composite', + class_name: 'StringEndsWithAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb new file mode 100644 index 0000000000..848793d984 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # StringIn Advanced Filter. + # + class StringInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StringIn', + type: { + name: 'Composite', + class_name: 'StringInAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb new file mode 100644 index 0000000000..2e376cfe0a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # StringNotIn Advanced Filter. + # + class StringNotInAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringNotIn" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringNotInAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StringNotIn', + type: { + name: 'Composite', + class_name: 'StringNotInAdvancedFilter', + model_properties: { + key: { + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic.rb new file mode 100644 index 0000000000..311b2f09a0 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic.rb @@ -0,0 +1,133 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # EventGrid Topic + # + class Topic < TrackedResource + + include MsRestAzure + + # @return [TopicProvisioningState] Provisioning state of the topic. + # Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Endpoint for the topic. + attr_accessor :endpoint + + # @return [InputSchema] This determines the format that Event Grid should + # expect for incoming events published to the topic. Possible values + # include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + # Default value: 'EventGridSchema' . + attr_accessor :input_schema + + # @return [InputSchemaMapping] 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. + attr_accessor :input_schema_mapping + + + # + # Mapper for Topic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Topic', + type: { + name: 'Composite', + class_name: 'Topic', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb new file mode 100644 index 0000000000..484784e0f0 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for TopicProvisioningState + # + module TopicProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb new file mode 100644 index 0000000000..3a78859e70 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Topic regenerate share access key request + # + class TopicRegenerateKeyRequest + + include MsRestAzure + + # @return [String] Key name to regenerate key1 or key2 + attr_accessor :key_name + + + # + # Mapper for TopicRegenerateKeyRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'TopicRegenerateKeyRequest', + model_properties: { + key_name: { + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb new file mode 100644 index 0000000000..c1a6604d37 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Shared access keys of the Topic + # + class TopicSharedAccessKeys + + include MsRestAzure + + # @return [String] Shared access key1 for the topic. + attr_accessor :key1 + + # @return [String] Shared access key2 for the topic. + attr_accessor :key2 + + + # + # Mapper for TopicSharedAccessKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'TopicSharedAccessKeys', + model_properties: { + key1: { + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb new file mode 100644 index 0000000000..0e16637072 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb @@ -0,0 +1,128 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Properties of a topic type info. + # + class TopicTypeInfo < Resource + + include MsRestAzure + + # @return [String] Namespace of the provider of the topic type. + attr_accessor :provider + + # @return [String] Display Name for the topic type. + attr_accessor :display_name + + # @return [String] Description of the topic type. + attr_accessor :description + + # @return [ResourceRegionType] Region type of the resource. Possible + # values include: 'RegionalResource', 'GlobalResource' + attr_accessor :resource_region_type + + # @return [TopicTypeProvisioningState] Provisioning state of the topic + # type. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [Array] List of locations supported by this topic type. + attr_accessor :supported_locations + + + # + # Mapper for TopicTypeInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicTypeInfo', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provider: { + required: false, + serialized_name: 'properties.provider', + type: { + name: 'String' + } + }, + display_name: { + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + resource_region_type: { + required: false, + serialized_name: 'properties.resourceRegionType', + type: { + name: 'String' + } + }, + provisioning_state: { + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + supported_locations: { + required: false, + serialized_name: 'properties.supportedLocations', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb new file mode 100644 index 0000000000..5fa2bb9451 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Defines values for TopicTypeProvisioningState + # + module TopicTypeProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb new file mode 100644 index 0000000000..4aa7792202 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Topic Types operation + # + class TopicTypesListResult + + include MsRestAzure + + # @return [Array] A collection of topic types + attr_accessor :value + + + # + # Mapper for TopicTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicTypesListResult', + type: { + name: 'Composite', + class_name: 'TopicTypesListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TopicTypeInfoElementType', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb new file mode 100644 index 0000000000..6300bb2992 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Properties of the Topic update + # + class TopicUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the resource + attr_accessor :tags + + + # + # Mapper for TopicUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicUpdateParameters', + type: { + name: 'Composite', + class_name: 'TopicUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb new file mode 100644 index 0000000000..b4d7e68c69 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Result of the List Topics operation + # + class TopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Topics + attr_accessor :value + + # @return [String] A link for the next page of topics + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [TopicsListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for TopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TopicsListResult', + type: { + name: 'Composite', + class_name: 'TopicsListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'TopicElementType', + type: { + name: 'Composite', + class_name: 'Topic' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb new file mode 100644 index 0000000000..a8840cf1f6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb @@ -0,0 +1,85 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Definition of a Tracked Resource + # + class TrackedResource < Resource + + include MsRestAzure + + # @return [String] Location of the resource + attr_accessor :location + + # @return [Hash{String => String}] Tags of the resource + attr_accessor :tags + + + # + # Mapper for TrackedResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb new file mode 100644 index 0000000000..e1b819b11e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + module Models + # + # Information about the webhook destination for an event subscription + # + class WebHookEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "WebHook" + end + + attr_accessor :endpointType + + # @return [String] The URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_url + + # @return [String] The base URL that represents the endpoint of the + # destination of an event subscription. + attr_accessor :endpoint_base_url + + + # + # Mapper for WebHookEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'WebHook', + type: { + name: 'Composite', + class_name: 'WebHookEventSubscriptionDestination', + model_properties: { + endpointType: { + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + endpoint_url: { + required: false, + serialized_name: 'properties.endpointUrl', + type: { + name: 'String' + } + }, + endpoint_base_url: { + required: false, + read_only: true, + serialized_name: 'properties.endpointBaseUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/module_definition.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/module_definition.rb new file mode 100644 index 0000000000..73c9e1492b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::EventGrid end +module Azure::EventGrid::Mgmt end +module Azure::EventGrid::Mgmt::V2019_02_01_preview end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb new file mode 100644 index 0000000000..8a7003e3e6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb @@ -0,0 +1,115 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # List available operations + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationsListResult] operation results. + # + def list(custom_headers = nil) + response = list_async(custom_headers).value! + response.body unless response.nil? + end + + # + # List available operations + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # List available operations + # + # List the available operations supported by the Microsoft.EventGrid resource + # provider + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::OperationsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb new file mode 100644 index 0000000000..ee860f143f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb @@ -0,0 +1,296 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class TopicTypes + include MsRestAzure + + # + # Creates and initializes a new instance of the TopicTypes class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # List topic types + # + # List all registered topic types + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicTypesListResult] operation results. + # + def list(custom_headers = nil) + response = list_async(custom_headers).value! + response.body unless response.nil? + end + + # + # List topic types + # + # List all registered topic types + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # List topic types + # + # List all registered topic types + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a topic type + # + # Get information about a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicTypeInfo] operation results. + # + def get(topic_type_name, custom_headers = nil) + response = get_async(topic_type_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a topic type + # + # Get information about a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(topic_type_name, custom_headers = nil) + get_async(topic_type_name, custom_headers).value! + end + + # + # Get a topic type + # + # Get information about a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(topic_type_name, custom_headers = nil) + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypeInfo.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List event types + # + # List event types for a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventTypesListResult] operation results. + # + def list_event_types(topic_type_name, custom_headers = nil) + response = list_event_types_async(topic_type_name, custom_headers).value! + response.body unless response.nil? + end + + # + # List event types + # + # List event types for a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_event_types_with_http_info(topic_type_name, custom_headers = nil) + list_event_types_async(topic_type_name, custom_headers).value! + end + + # + # List event types + # + # List event types for a topic type + # + # @param topic_type_name [String] Name of the topic type + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_event_types_async(topic_type_name, custom_headers = nil) + fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'topicTypeName' => topic_type_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb new file mode 100644 index 0000000000..0ed368f008 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb @@ -0,0 +1,1340 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + # + # Azure EventGrid Management Client + # + class Topics + include MsRestAzure + + # + # Creates and initializes a new instance of the Topics class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [EventGridManagementClient] reference to the EventGridManagementClient + attr_reader :client + + # + # Get a topic + # + # Get properties of a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def get(resource_group_name, topic_name, custom_headers = nil) + response = get_async(resource_group_name, topic_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a topic + # + # Get properties of a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, topic_name, custom_headers = nil) + get_async(resource_group_name, topic_name, custom_headers).value! + end + + # + # Get a topic + # + # Get properties of a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a topic + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_info [Topic] Topic information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def create_or_update(resource_group_name, topic_name, topic_info, custom_headers = nil) + response = create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_info [Topic] Topic information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Delete a topic + # + # Delete existing topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, topic_name, custom_headers = nil) + response = delete_async(resource_group_name, topic_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, topic_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, topic_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update a topic + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def update(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil) + response = update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_subscription(filter = nil, top = nil, custom_headers = nil) + first_page = list_by_subscription_as_lazy(filter, top, custom_headers) + first_page.get_all_items + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_with_http_info(filter = nil, top = nil, custom_headers = nil) + list_by_subscription_async(filter, top, custom_headers).value! + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_async(filter = nil, top = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, filter = nil, top = nil, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, filter, top, custom_headers) + first_page.get_all_items + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, filter = nil, top = nil, custom_headers = nil) + list_by_resource_group_async(resource_group_name, filter, top, custom_headers).value! + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, filter = nil, top = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List keys for a topic + # + # List the two keys used to publish to a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicSharedAccessKeys] operation results. + # + def list_shared_access_keys(resource_group_name, topic_name, custom_headers = nil) + response = list_shared_access_keys_async(resource_group_name, topic_name, custom_headers).value! + response.body unless response.nil? + end + + # + # List keys for a topic + # + # List the two keys used to publish to a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_shared_access_keys_with_http_info(resource_group_name, topic_name, custom_headers = nil) + list_shared_access_keys_async(resource_group_name, topic_name, custom_headers).value! + end + + # + # List keys for a topic + # + # List the two keys used to publish to a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_shared_access_keys_async(resource_group_name, topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerate key for a topic + # + # Regenerate a shared access key for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicSharedAccessKeys] operation results. + # + def regenerate_key(resource_group_name, topic_name, regenerate_key_request, custom_headers = nil) + response = regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerate key for a topic + # + # Regenerate a shared access key for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def regenerate_key_with_http_info(resource_group_name, topic_name, regenerate_key_request, custom_headers = nil) + regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers).value! + end + + # + # Regenerate key for a topic + # + # Regenerate a shared access key for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to + # regenerate key + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'regenerate_key_request is nil' if regenerate_key_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicRegenerateKeyRequest.mapper() + request_content = @client.serialize(request_mapper, regenerate_key_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicSharedAccessKeys.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topic event types + # + # List event types for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the topic type + # @param resource_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventTypesListResult] operation results. + # + def list_event_types(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers = nil) + response = list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers).value! + response.body unless response.nil? + end + + # + # List topic event types + # + # List event types for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the topic type + # @param resource_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_event_types_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers = nil) + list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers).value! + end + + # + # List topic event types + # + # List event types for a topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param provider_namespace [String] Namespace of the provider of the topic + # @param resource_type_name [String] Name of the topic type + # @param resource_name [String] Name of the topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil? + fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil? + fail ArgumentError, 'resource_name is nil' if resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create a topic + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_info [Topic] Topic information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def begin_create_or_update(resource_group_name, topic_name, topic_info, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers).value! + response.body unless response.nil? + end + + # + # Create a topic + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_info [Topic] Topic information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, topic_name, topic_info, custom_headers = nil) + begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers).value! + end + + # + # Create a topic + # + # Asynchronously creates a new topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_info [Topic] Topic information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'topic_info is nil' if topic_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + request_content = @client.serialize(request_mapper, topic_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete a topic + # + # Delete existing topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, topic_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, topic_name, custom_headers).value! + nil + end + + # + # Delete a topic + # + # Delete existing topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, topic_name, custom_headers = nil) + begin_delete_async(resource_group_name, topic_name, custom_headers).value! + end + + # + # Delete a topic + # + # Delete existing topic + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, topic_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a topic + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Topic] operation results. + # + def begin_update(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Update a topic + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil) + begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value! + end + + # + # Update a topic + # + # Asynchronously updates a topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param topic_name [String] Name of the topic + # @param topic_update_parameters [TopicUpdateParameters] Topic update + # information + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'topic_name is nil' if topic_name.nil? + fail ArgumentError, 'topic_update_parameters is nil' if topic_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, topic_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers = nil) + response = list_by_subscription_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil) + list_by_subscription_next_async(next_page_link, custom_headers).value! + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_subscription_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # List topics under an Azure subscription + # + # List all the topics under an Azure subscription + # + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_subscription_as_lazy(filter = nil, top = nil, custom_headers = nil) + response = list_by_subscription_async(filter, top, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # List topics under a resource group + # + # List all the topics under a resource group + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] Filter the results using OData syntax. + # @param top [Integer] The number of results to return. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [TopicsListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, filter = nil, top = nil, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, filter, top, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/version.rb b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/version.rb new file mode 100644 index 0000000000..7255e77870 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::EventGrid::Mgmt::V2019_02_01_preview + VERSION = '0.16.1' +end diff --git a/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb b/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb index 56d4abfe83..0e5b6c337e 100644 --- a/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb +++ b/management/azure_mgmt_event_grid/lib/azure_mgmt_event_grid.rb @@ -7,5 +7,6 @@ require '2018-09-15-preview/generated/azure_mgmt_event_grid' require '2019-01-01/generated/azure_mgmt_event_grid' require '2017-09-15-preview/generated/azure_mgmt_event_grid' +require '2019-02-01-preview/generated/azure_mgmt_event_grid' require '2017-06-15-preview/generated/azure_mgmt_event_grid' require 'profiles/latest/eventgrid_latest_profile_client'