diff --git a/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 276efa763..852d572d8 100644 --- a/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 610cb7a72..e7b37902c 100644 --- a/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 2fd06de5b..8db8129c3 100644 --- a/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2018_01_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index cb2006bfe..969066773 100644 --- a/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2018_05_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 71a2fd66a..eff1aaa81 100644 --- a/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2018_09_15_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 440dfc92b..794454f92 100644 --- a/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -138,7 +138,7 @@ module Azure::EventGrid::Mgmt::V2019_01_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) 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 index 315b88153..573ca9044 100644 --- 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 @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2019_02_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 4d44d02c7..b6be0d87c 100644 --- a/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2019_06_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index b9746afca..0d16f7bab 100644 --- a/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -146,7 +146,7 @@ module Azure::EventGrid::Mgmt::V2020_01_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 9b54b1ab4..4441cf2ad 100644 --- a/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -187,7 +187,7 @@ module Azure::EventGrid::Mgmt::V2020_04_01_preview # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb index 69959eec5..8877fbccf 100644 --- a/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +++ b/management/azure_mgmt_event_grid/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -154,7 +154,7 @@ module Azure::EventGrid::Mgmt::V2020_06_01 # def add_telemetry sdk_information = 'azure_mgmt_event_grid' - sdk_information = "#{sdk_information}/0.20.2" + sdk_information = "#{sdk_information}/0.21.0" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid.rb new file mode 100644 index 000000000..0e1826bc9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid.rb @@ -0,0 +1,171 @@ +# 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 '2020-10-15-preview/generated/azure_mgmt_event_grid/module_definition' +require 'ms_rest_azure' + +module Azure::EventGrid::Mgmt::V2020_10_15_preview + autoload :Domains, '2020-10-15-preview/generated/azure_mgmt_event_grid/domains.rb' + autoload :DomainTopics, '2020-10-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb' + autoload :EventChannels, '2020-10-15-preview/generated/azure_mgmt_event_grid/event_channels.rb' + autoload :EventSubscriptions, '2020-10-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb' + autoload :SystemTopicEventSubscriptions, '2020-10-15-preview/generated/azure_mgmt_event_grid/system_topic_event_subscriptions.rb' + autoload :PartnerTopicEventSubscriptions, '2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topic_event_subscriptions.rb' + autoload :Operations, '2020-10-15-preview/generated/azure_mgmt_event_grid/operations.rb' + autoload :PartnerNamespaces, '2020-10-15-preview/generated/azure_mgmt_event_grid/partner_namespaces.rb' + autoload :PartnerRegistrations, '2020-10-15-preview/generated/azure_mgmt_event_grid/partner_registrations.rb' + autoload :PartnerTopics, '2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topics.rb' + autoload :PrivateEndpointConnections, '2020-10-15-preview/generated/azure_mgmt_event_grid/private_endpoint_connections.rb' + autoload :PrivateLinkResources, '2020-10-15-preview/generated/azure_mgmt_event_grid/private_link_resources.rb' + autoload :SystemTopics, '2020-10-15-preview/generated/azure_mgmt_event_grid/system_topics.rb' + autoload :Topics, '2020-10-15-preview/generated/azure_mgmt_event_grid/topics.rb' + autoload :ExtensionTopics, '2020-10-15-preview/generated/azure_mgmt_event_grid/extension_topics.rb' + autoload :TopicTypes, '2020-10-15-preview/generated/azure_mgmt_event_grid/topic_types.rb' + autoload :EventGridManagementClient, '2020-10-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb' + + module Models + autoload :DeadLetterDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb' + autoload :DeadLetterWithResourceIdentity, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_with_resource_identity.rb' + autoload :ConnectionState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/connection_state.rb' + autoload :DeliveryAttributeMapping, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_mapping.rb' + autoload :InputSchemaMapping, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb' + autoload :PartnerTopicUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_update_parameters.rb' + autoload :ResourceSku, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_sku.rb' + autoload :PartnerTopicsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topics_list_result.rb' + autoload :IdentityInfo, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_info.rb' + autoload :EventChannelsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channels_list_result.rb' + autoload :JsonField, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb' + autoload :EventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb' + autoload :DeliveryAttributeListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_list_result.rb' + autoload :EventSubscriptionsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb' + autoload :SystemData, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_data.rb' + autoload :EventSubscriptionFullUrl, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb' + autoload :DomainUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb' + autoload :EventSubscriptionUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb' + autoload :DomainSharedAccessKeys, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb' + autoload :PrivateLinkResource, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resource.rb' + autoload :PartnerRegistrationsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registrations_list_result.rb' + autoload :PrivateLinkResourcesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb' + autoload :EventChannelSource, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_source.rb' + autoload :SystemTopicUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic_update_parameters.rb' + autoload :AdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb' + autoload :SystemTopicsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topics_list_result.rb' + autoload :PartnerRegistrationUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_update_parameters.rb' + autoload :UserIdentityProperties, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/user_identity_properties.rb' + autoload :PartnerNamespaceRegenerateKeyRequest, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_regenerate_key_request.rb' + autoload :Resource, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource.rb' + autoload :PartnerNamespacesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespaces_list_result.rb' + autoload :JsonFieldWithDefault, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb' + autoload :PrivateEndpointConnectionListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb' + autoload :ExtendedLocation, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/extended_location.rb' + autoload :Operation, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation.rb' + autoload :EventSubscriptionIdentity, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity.rb' + autoload :PartnerRegistrationEventTypesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_event_types_list_result.rb' + autoload :DeliveryWithResourceIdentity, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_with_resource_identity.rb' + autoload :DomainsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb' + autoload :EventSubscriptionFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb' + autoload :DomainTopicsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb' + autoload :RetryPolicy, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb' + autoload :EventChannelFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_filter.rb' + autoload :PrivateEndpoint, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint.rb' + autoload :PartnerNamespaceSharedAccessKeys, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_shared_access_keys.rb' + autoload :PartnerNamespaceUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_update_parameters.rb' + autoload :TopicUpdateParameters, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb' + autoload :OperationInfo, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb' + autoload :InboundIpRule, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb' + autoload :DomainRegenerateKeyRequest, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb' + autoload :EventTypesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb' + autoload :TopicTypesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb' + autoload :PartnerTopicTypesListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_types_list_result.rb' + autoload :TopicRegenerateKeyRequest, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb' + autoload :OperationsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb' + autoload :TopicSharedAccessKeys, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb' + autoload :EventChannelDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_destination.rb' + autoload :TopicsListResult, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb' + autoload :PrivateEndpointConnection, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb' + autoload :JsonInputSchemaMapping, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb' + autoload :TrackedResource, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb' + autoload :Domain, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain.rb' + autoload :DomainTopic, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb' + autoload :NumberInAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb' + autoload :NumberNotInAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb' + autoload :NumberLessThanAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb' + autoload :NumberGreaterThanAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb' + autoload :NumberLessThanOrEqualsAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb' + autoload :NumberGreaterThanOrEqualsAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb' + autoload :BoolEqualsAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb' + autoload :StringInAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb' + autoload :StringNotInAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb' + autoload :StringBeginsWithAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb' + autoload :StringEndsWithAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb' + autoload :StringContainsAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb' + autoload :NumberInRangeAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_range_advanced_filter.rb' + autoload :NumberNotInRangeAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_range_advanced_filter.rb' + autoload :StringNotBeginsWithAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_begins_with_advanced_filter.rb' + autoload :StringNotEndsWithAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_ends_with_advanced_filter.rb' + autoload :StringNotContainsAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_contains_advanced_filter.rb' + autoload :IsNullOrUndefinedAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_null_or_undefined_advanced_filter.rb' + autoload :IsNotNullAdvancedFilter, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_not_null_advanced_filter.rb' + autoload :EventChannel, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel.rb' + autoload :StaticDeliveryAttributeMapping, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/static_delivery_attribute_mapping.rb' + autoload :DynamicDeliveryAttributeMapping, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/dynamic_delivery_attribute_mapping.rb' + autoload :StorageBlobDeadLetterDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb' + autoload :WebHookEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb' + autoload :EventHubEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb' + autoload :StorageQueueEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb' + autoload :HybridConnectionEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb' + autoload :ServiceBusQueueEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb' + autoload :ServiceBusTopicEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb' + autoload :AzureFunctionEventSubscriptionDestination, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb' + autoload :EventSubscription, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb' + autoload :PartnerNamespace, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace.rb' + autoload :PartnerRegistration, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration.rb' + autoload :EventType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb' + autoload :PartnerTopic, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic.rb' + autoload :PartnerTopicType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type.rb' + autoload :SystemTopic, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic.rb' + autoload :Topic, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic.rb' + autoload :ExtensionTopic, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/extension_topic.rb' + autoload :TopicTypeInfo, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb' + autoload :PersistedConnectionStatus, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb' + autoload :ResourceProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb' + autoload :DomainProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb' + autoload :InputSchema, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema.rb' + autoload :PublicNetworkAccess, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/public_network_access.rb' + autoload :IpActionType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb' + autoload :Sku, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/sku.rb' + autoload :IdentityType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_type.rb' + autoload :CreatedByType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/created_by_type.rb' + autoload :DomainTopicProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb' + autoload :EventChannelProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_provisioning_state.rb' + autoload :PartnerTopicReadinessState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_readiness_state.rb' + autoload :EventSubscriptionProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb' + autoload :EventSubscriptionIdentityType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity_type.rb' + autoload :EventDeliverySchema, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb' + autoload :PartnerNamespaceProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_provisioning_state.rb' + autoload :PartnerRegistrationProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_provisioning_state.rb' + autoload :PartnerRegistrationVisibilityState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_visibility_state.rb' + autoload :PartnerTopicProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_provisioning_state.rb' + autoload :PartnerTopicActivationState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_activation_state.rb' + autoload :PartnerTopicTypeAuthorizationState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type_authorization_state.rb' + autoload :TopicProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb' + autoload :ResourceKind, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_kind.rb' + autoload :ResourceRegionType, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb' + autoload :TopicTypeProvisioningState, '2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb' + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb new file mode 100644 index 000000000..86e3fe989 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb @@ -0,0 +1,699 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domains.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domains.rb new file mode 100644 index 000000000..26e2d25a1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domains.rb @@ -0,0 +1,1328 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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: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: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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List domains under an Azure subscription. + # + # List all the domains under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_channels.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_channels.rb new file mode 100644 index 000000000..cdf97104a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_channels.rb @@ -0,0 +1,658 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class EventChannels + include MsRestAzure + + # + # Creates and initializes a new instance of the EventChannels 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 channel. + # + # Get properties of an event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventChannel] operation results. + # + def get(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:nil) + response = get_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get an event channel. + # + # Get properties of an event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_name, custom_headers:nil) + get_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:custom_headers).value! + end + + # + # Get an event channel. + # + # Get properties of an event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, 'event_channel_name is nil' if event_channel_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}' + + 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,'partnerNamespaceName' => partner_namespace_name,'eventChannelName' => event_channel_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::EventChannel.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 an event channel. + # + # Asynchronously creates a new event channel with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @param event_channel_info [EventChannel] EventChannel information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventChannel] operation results. + # + def create_or_update(resource_group_name, partner_namespace_name, event_channel_name, event_channel_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, partner_namespace_name, event_channel_name, event_channel_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create an event channel. + # + # Asynchronously creates a new event channel with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @param event_channel_info [EventChannel] EventChannel 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 create_or_update_with_http_info(resource_group_name, partner_namespace_name, event_channel_name, event_channel_info, custom_headers:nil) + create_or_update_async(resource_group_name, partner_namespace_name, event_channel_name, event_channel_info, custom_headers:custom_headers).value! + end + + # + # Create an event channel. + # + # Asynchronously creates a new event channel with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @param event_channel_info [EventChannel] EventChannel 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 create_or_update_async(resource_group_name, partner_namespace_name, event_channel_name, event_channel_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, 'event_channel_name is nil' if event_channel_name.nil? + fail ArgumentError, 'event_channel_info is nil' if event_channel_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannel.mapper() + request_content = @client.serialize(request_mapper, event_channel_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}' + + 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,'partnerNamespaceName' => partner_namespace_name,'eventChannelName' => event_channel_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 == 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::EventChannel.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 channel. + # + # Delete existing event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:nil) + response = delete_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers: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 event channels. + # + # List all the event channels in a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_namespace(resource_group_name, partner_namespace_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_partner_namespace_as_lazy(resource_group_name, partner_namespace_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List event channels. + # + # List all the event channels in a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_namespace_with_http_info(resource_group_name, partner_namespace_name, filter:nil, top:nil, custom_headers:nil) + list_by_partner_namespace_async(resource_group_name, partner_namespace_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List event channels. + # + # List all the event channels in a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_namespace_async(resource_group_name, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}/eventChannels' + + 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,'partnerNamespaceName' => partner_namespace_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::EventChannelsListResult.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 channel. + # + # Delete existing event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete an event channel. + # + # Delete existing event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_name, custom_headers:nil) + begin_delete_async(resource_group_name, partner_namespace_name, event_channel_name, custom_headers:custom_headers).value! + end + + # + # Delete an event channel. + # + # Delete existing event channel. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param event_channel_name [String] Name of the event channel. + # @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, partner_namespace_name, event_channel_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, 'event_channel_name is nil' if event_channel_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}' + + 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,'partnerNamespaceName' => partner_namespace_name,'eventChannelName' => event_channel_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # List event channels. + # + # List all the event channels in a partner namespace. + # + # @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 [EventChannelsListResult] operation results. + # + def list_by_partner_namespace_next(next_page_link, custom_headers:nil) + response = list_by_partner_namespace_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List event channels. + # + # List all the event channels in a partner namespace. + # + # @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_partner_namespace_next_with_http_info(next_page_link, custom_headers:nil) + list_by_partner_namespace_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List event channels. + # + # List all the event channels in a partner namespace. + # + # @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_partner_namespace_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::EventChannelsListResult.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 channels. + # + # List all the event channels in a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventChannelsListResult] which provide lazy access to pages of the + # response. + # + def list_by_partner_namespace_as_lazy(resource_group_name, partner_namespace_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_partner_namespace_async(resource_group_name, partner_namespace_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_partner_namespace_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb new file mode 100644 index 000000000..11bf84632 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb @@ -0,0 +1,194 @@ +# 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::V2020_10_15_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] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. 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 [EventChannels] event_channels + attr_reader :event_channels + + # @return [EventSubscriptions] event_subscriptions + attr_reader :event_subscriptions + + # @return [SystemTopicEventSubscriptions] system_topic_event_subscriptions + attr_reader :system_topic_event_subscriptions + + # @return [PartnerTopicEventSubscriptions] + # partner_topic_event_subscriptions + attr_reader :partner_topic_event_subscriptions + + # @return [Operations] operations + attr_reader :operations + + # @return [PartnerNamespaces] partner_namespaces + attr_reader :partner_namespaces + + # @return [PartnerRegistrations] partner_registrations + attr_reader :partner_registrations + + # @return [PartnerTopics] partner_topics + attr_reader :partner_topics + + # @return [PrivateEndpointConnections] private_endpoint_connections + attr_reader :private_endpoint_connections + + # @return [PrivateLinkResources] private_link_resources + attr_reader :private_link_resources + + # @return [SystemTopics] system_topics + attr_reader :system_topics + + # @return [Topics] topics + attr_reader :topics + + # @return [ExtensionTopics] extension_topics + attr_reader :extension_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_channels = EventChannels.new(self) + @event_subscriptions = EventSubscriptions.new(self) + @system_topic_event_subscriptions = SystemTopicEventSubscriptions.new(self) + @partner_topic_event_subscriptions = PartnerTopicEventSubscriptions.new(self) + @operations = Operations.new(self) + @partner_namespaces = PartnerNamespaces.new(self) + @partner_registrations = PartnerRegistrations.new(self) + @partner_topics = PartnerTopics.new(self) + @private_endpoint_connections = PrivateEndpointConnections.new(self) + @private_link_resources = PrivateLinkResources.new(self) + @system_topics = SystemTopics.new(self) + @topics = Topics.new(self) + @extension_topics = ExtensionTopics.new(self) + @topic_types = TopicTypes.new(self) + @api_version = '2020-10-15-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 + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + 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' + sdk_information = "#{sdk_information}/0.21.0" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb new file mode 100644 index 000000000..185d53a7f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb @@ -0,0 +1,3775 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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: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: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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_global_by_subscription_as_lazy(filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_global_by_subscription_async(filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_global_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_regional_by_subscription_as_lazy(location, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + first_page = list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}, + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 delivery attributes for an event subscription. + # + # Get all delivery attributes 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 [DeliveryAttributeListResult] operation results. + # + def get_delivery_attributes(scope, event_subscription_name, custom_headers:nil) + response = get_delivery_attributes_async(scope, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get delivery attributes for an event subscription. + # + # Get all delivery attributes 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_delivery_attributes_with_http_info(scope, event_subscription_name, custom_headers:nil) + get_delivery_attributes_async(scope, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get delivery attributes for an event subscription. + # + # Get all delivery attributes 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_delivery_attributes_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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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}/getDeliveryAttributes' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::DeliveryAttributeListResult.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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_global_by_subscription_async(filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, custom_headers:nil) + response = list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/extension_topics.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/extension_topics.rb new file mode 100644 index 000000000..d03e9e02b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/extension_topics.rb @@ -0,0 +1,141 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class ExtensionTopics + include MsRestAzure + + # + # Creates and initializes a new instance of the ExtensionTopics 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 properties of an extension topic. + # + # Get the properties of an extension topic. + # + # @param scope [String] The identifier of the resource to which extension topic + # is queried. The scope can be a subscription, or a resource group, or a top + # level resource belonging to a resource provider namespace. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for Azure resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ExtensionTopic] operation results. + # + def get(scope, custom_headers:nil) + response = get_async(scope, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get properties of an extension topic. + # + # Get the properties of an extension topic. + # + # @param scope [String] The identifier of the resource to which extension topic + # is queried. The scope can be a subscription, or a resource group, or a top + # level resource belonging to a resource provider namespace. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for Azure resource. + # @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, custom_headers:nil) + get_async(scope, custom_headers:custom_headers).value! + end + + # + # Get properties of an extension topic. + # + # Get the properties of an extension topic. + # + # @param scope [String] The identifier of the resource to which extension topic + # is queried. The scope can be a subscription, or a resource group, or a top + # level resource belonging to a resource provider namespace. For example, use + # '/subscriptions/{subscriptionId}/' for a subscription, + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a + # resource group, and + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + # for Azure resource. + # @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, custom_headers:nil) + fail ArgumentError, 'scope is nil' if scope.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/extensionTopics/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::ExtensionTopic.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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb new file mode 100644 index 000000000..cbfcbcb78 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb @@ -0,0 +1,81 @@ +# 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::V2020_10_15_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" + @@discriminatorMap["NumberInRange"] = "NumberInRangeAdvancedFilter" + @@discriminatorMap["NumberNotInRange"] = "NumberNotInRangeAdvancedFilter" + @@discriminatorMap["StringNotBeginsWith"] = "StringNotBeginsWithAdvancedFilter" + @@discriminatorMap["StringNotEndsWith"] = "StringNotEndsWithAdvancedFilter" + @@discriminatorMap["StringNotContains"] = "StringNotContainsAdvancedFilter" + @@discriminatorMap["IsNullOrUndefined"] = "IsNullOrUndefinedAdvancedFilter" + @@discriminatorMap["IsNotNull"] = "IsNotNullAdvancedFilter" + + 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() + { + client_side_validation: true, + required: false, + serialized_name: 'AdvancedFilter', + type: { + name: 'Composite', + polymorphic_discriminator: 'operatorType', + uber_parent: 'AdvancedFilter', + class_name: 'AdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb new file mode 100644 index 000000000..99d80a596 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.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::V2020_10_15_preview + module Models + # + # Information about the azure function destination for an event + # subscription. + # + class AzureFunctionEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "AzureFunction" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Azure Function destination of an event subscription. + attr_accessor :resource_id + + # @return [Integer] Maximum number of events per batch. Default value: 1 + # . + attr_accessor :max_events_per_batch + + # @return [Integer] Preferred batch size in Kilobytes. Default value: 64 + # . + attr_accessor :preferred_batch_size_in_kilobytes + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for AzureFunctionEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AzureFunction', + type: { + name: 'Composite', + class_name: 'AzureFunctionEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + max_events_per_batch: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxEventsPerBatch', + default_value: 1, + type: { + name: 'Number' + } + }, + preferred_batch_size_in_kilobytes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.preferredBatchSizeInKilobytes', + default_value: 64, + type: { + name: 'Number' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb new file mode 100644 index 000000000..cfc01df23 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'BoolEquals', + type: { + name: 'Composite', + class_name: 'BoolEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/connection_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/connection_state.rb new file mode 100644 index 000000000..f92e660fa --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/connection_state.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_preview + module Models + # + # ConnectionState information. + # + class ConnectionState + + include MsRestAzure + + # @return [PersistedConnectionStatus] Status of the connection. Possible + # values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + attr_accessor :status + + # @return [String] Description of the connection state. + attr_accessor :description + + # @return [String] Actions required (if any). + attr_accessor :actions_required + + + # + # Mapper for ConnectionState class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ConnectionState', + type: { + name: 'Composite', + class_name: 'ConnectionState', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + }, + actions_required: { + client_side_validation: true, + required: false, + serialized_name: 'actionsRequired', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/created_by_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/created_by_type.rb new file mode 100644 index 000000000..771365e66 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/created_by_type.rb @@ -0,0 +1,18 @@ +# 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::V2020_10_15_preview + module Models + # + # Defines values for CreatedByType + # + module CreatedByType + User = "User" + Application = "Application" + ManagedIdentity = "ManagedIdentity" + Key = "Key" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb new file mode 100644 index 000000000..7f62cf7ab --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb @@ -0,0 +1,50 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_with_resource_identity.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_with_resource_identity.rb new file mode 100644 index 000000000..b4fca3c33 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_with_resource_identity.rb @@ -0,0 +1,66 @@ +# 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::V2020_10_15_preview + module Models + # + # Information about the deadletter destination with resource identity. + # + class DeadLetterWithResourceIdentity + + include MsRestAzure + + # @return [EventSubscriptionIdentity] The identity to use when + # dead-lettering events. + attr_accessor :identity + + # @return [DeadLetterDestination] Information about the destination where + # events have to be delivered for the event subscription. + # Uses the managed identity setup on the parent resource (namely, topic + # or domain) to acquire the authentication tokens being used during + # delivery / dead-lettering. + attr_accessor :dead_letter_destination + + + # + # Mapper for DeadLetterWithResourceIdentity class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DeadLetterWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeadLetterWithResourceIdentity', + model_properties: { + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'EventSubscriptionIdentity' + } + }, + dead_letter_destination: { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_list_result.rb new file mode 100644 index 000000000..2cf66bb48 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_list_result.rb @@ -0,0 +1,58 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the Get delivery attributes operation. + # + class DeliveryAttributeListResult + + include MsRestAzure + + # @return [Array] A collection of + # DeliveryAttributeMapping + attr_accessor :value + + + # + # Mapper for DeliveryAttributeListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeListResult', + type: { + name: 'Composite', + class_name: 'DeliveryAttributeListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_mapping.rb new file mode 100644 index 000000000..5f504fb18 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_mapping.rb @@ -0,0 +1,58 @@ +# 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::V2020_10_15_preview + module Models + # + # Delivery attribute mapping details. + # + class DeliveryAttributeMapping + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["Static"] = "StaticDeliveryAttributeMapping" + @@discriminatorMap["Dynamic"] = "DynamicDeliveryAttributeMapping" + + def initialize + @type = "DeliveryAttributeMapping" + end + + attr_accessor :type + + # @return [String] Name of the delivery attribute or header. + attr_accessor :name + + + # + # Mapper for DeliveryAttributeMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_with_resource_identity.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_with_resource_identity.rb new file mode 100644 index 000000000..1dc2575fc --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_with_resource_identity.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::V2020_10_15_preview + module Models + # + # Information about the delivery for an event subscription with resource + # identity. + # + class DeliveryWithResourceIdentity + + include MsRestAzure + + # @return [EventSubscriptionIdentity] The identity to use when delivering + # events. + attr_accessor :identity + + # @return [EventSubscriptionDestination] Information about the + # destination where events have to be delivered for the event + # subscription. + # Uses Azure Event Grid's identity to acquire the authentication tokens + # being used during delivery / dead-lettering. + attr_accessor :destination + + + # + # Mapper for DeliveryWithResourceIdentity class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeliveryWithResourceIdentity', + model_properties: { + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'EventSubscriptionIdentity' + } + }, + destination: { + client_side_validation: true, + required: false, + serialized_name: 'destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain.rb new file mode 100644 index 000000000..479081830 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain.rb @@ -0,0 +1,253 @@ +# 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::V2020_10_15_preview + module Models + # + # EventGrid Domain. + # + class Domain < TrackedResource + + include MsRestAzure + + # @return [Array] List of private endpoint + # connections. + attr_accessor :private_endpoint_connections + + # @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', + # 'CloudEventSchemaV1_0'. 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 + + # @return [String] Metric resource id for the domain. + attr_accessor :metric_resource_id + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled'. Default value: + # 'Enabled' . + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + # @return [ResourceSku] The Sku pricing tier for the domain. Default + # value: Basic . + attr_accessor :sku + + # @return [IdentityInfo] Identity information for the resource. + attr_accessor :identity + + # @return [SystemData] The system metadata relating to Domain resource. + attr_accessor :system_data + + + # + # Mapper for Domain class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Domain', + type: { + name: 'Composite', + class_name: 'Domain', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + }, + metric_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.metricResourceId', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + default_value: 'Enabled', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + default_value: Basic, + type: { + name: 'Composite', + class_name: 'ResourceSku' + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb new file mode 100644 index 000000000..d4460daa3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb new file mode 100644 index 000000000..320bfd8e2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb @@ -0,0 +1,46 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'DomainRegenerateKeyRequest', + model_properties: { + key_name: { + client_side_validation: true, + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb new file mode 100644 index 000000000..a7b5e221f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb @@ -0,0 +1,57 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'DomainSharedAccessKeys', + model_properties: { + key1: { + client_side_validation: true, + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + client_side_validation: true, + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb new file mode 100644 index 000000000..fa6fc1fb4 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb @@ -0,0 +1,89 @@ +# 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::V2020_10_15_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 + + # @return [SystemData] The system metadata relating to Domain Topic + # resource. + attr_accessor :system_data + + + # + # Mapper for DomainTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopic', + type: { + name: 'Composite', + class_name: 'DomainTopic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb new file mode 100644 index 000000000..db81f0743 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb new file mode 100644 index 000000000..3c1c27513 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.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::V2020_10_15_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 && !page.next_link.strip.empty? 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() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopicsListResult', + type: { + name: 'Composite', + class_name: 'DomainTopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DomainTopicElementType', + type: { + name: 'Composite', + class_name: 'DomainTopic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb new file mode 100644 index 000000000..d1d3e5f84 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb @@ -0,0 +1,117 @@ +# 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::V2020_10_15_preview + module Models + # + # Properties of the Domain update. + # + class DomainUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the domains resource. + attr_accessor :tags + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled'. Default value: + # 'Enabled' . + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + # @return [IdentityInfo] Identity information for the resource. + attr_accessor :identity + + # @return [ResourceSku] The Sku pricing tier for the domain. + attr_accessor :sku + + + # + # Mapper for DomainUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainUpdateParameters', + type: { + name: 'Composite', + class_name: 'DomainUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + default_value: 'Enabled', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'ResourceSku' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb new file mode 100644 index 000000000..032d2c3f4 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.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::V2020_10_15_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 && !page.next_link.strip.empty? 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() + { + client_side_validation: true, + required: false, + serialized_name: 'DomainsListResult', + type: { + name: 'Composite', + class_name: 'DomainsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DomainElementType', + type: { + name: 'Composite', + class_name: 'Domain' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dynamic_delivery_attribute_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dynamic_delivery_attribute_mapping.rb new file mode 100644 index 000000000..61d2178ab --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dynamic_delivery_attribute_mapping.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_preview + module Models + # + # Dynamic delivery attribute mapping details. + # + class DynamicDeliveryAttributeMapping < DeliveryAttributeMapping + + include MsRestAzure + + + def initialize + @type = "Dynamic" + end + + attr_accessor :type + + # @return [String] JSON path in the event which contains attribute value. + attr_accessor :source_field + + + # + # Mapper for DynamicDeliveryAttributeMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Dynamic', + type: { + name: 'Composite', + class_name: 'DynamicDeliveryAttributeMapping', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + source_field: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sourceField', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel.rb new file mode 100644 index 000000000..5ef914c7f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel.rb @@ -0,0 +1,172 @@ +# 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::V2020_10_15_preview + module Models + # + # Event Channel. + # + class EventChannel < Resource + + include MsRestAzure + + # @return [EventChannelSource] Source of the event channel. This + # represents a unique resource in the partner's resource model. + attr_accessor :source + + # @return [EventChannelDestination] Represents the destination of an + # event channel. + attr_accessor :destination + + # @return [EventChannelProvisioningState] Provisioning state of the event + # channel. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [PartnerTopicReadinessState] The readiness state of the + # corresponding partner topic. Possible values include: + # 'NotActivatedByUserYet', 'ActivatedByUser', 'DeactivatedByUser', + # 'DeletedByUser' + attr_accessor :partner_topic_readiness_state + + # @return [DateTime] Expiration time of the event channel. If this timer + # expires while the corresponding partner topic is never activated, + # the event channel and corresponding partner topic are deleted. + attr_accessor :expiration_time_if_not_activated_utc + + # @return [EventChannelFilter] Information about the filter for the event + # channel. + attr_accessor :filter + + # @return [String] Friendly description about the topic. This can be set + # by the publisher/partner to show custom description for the customer + # partner topic. + # This will be helpful to remove any ambiguity of the origin of creation + # of the partner topic for the customer. + attr_accessor :partner_topic_friendly_description + + # @return [SystemData] The system metadata relating to Event Channel + # resource. + attr_accessor :system_data + + + # + # Mapper for EventChannel class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventChannel', + type: { + name: 'Composite', + class_name: 'EventChannel', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.source', + type: { + name: 'Composite', + class_name: 'EventChannelSource' + } + }, + destination: { + client_side_validation: true, + required: false, + serialized_name: 'properties.destination', + type: { + name: 'Composite', + class_name: 'EventChannelDestination' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + partner_topic_readiness_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.partnerTopicReadinessState', + type: { + name: 'String' + } + }, + expiration_time_if_not_activated_utc: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationTimeIfNotActivatedUtc', + type: { + name: 'DateTime' + } + }, + filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.filter', + type: { + name: 'Composite', + class_name: 'EventChannelFilter' + } + }, + partner_topic_friendly_description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerTopicFriendlyDescription', + type: { + name: 'String' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_destination.rb new file mode 100644 index 000000000..2c7d1a9c9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_destination.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::V2020_10_15_preview + module Models + # + # Properties of the destination of an event channel. + # + class EventChannelDestination + + include MsRestAzure + + # @return [String] Azure subscription ID of the customer creating the + # event channel. The partner topic + # associated with the event channel will be created under this Azure + # subscription. + attr_accessor :azure_subscription_id + + # @return [String] Azure Resource Group of the customer creating the + # event channel. The partner topic + # associated with the event channel will be created under this resource + # group. + attr_accessor :resource_group + + # @return [String] Name of the partner topic associated with the event + # channel. + attr_accessor :partner_topic_name + + + # + # Mapper for EventChannelDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventChannelDestination', + type: { + name: 'Composite', + class_name: 'EventChannelDestination', + model_properties: { + azure_subscription_id: { + client_side_validation: true, + required: false, + serialized_name: 'azureSubscriptionId', + type: { + name: 'String' + } + }, + resource_group: { + client_side_validation: true, + required: false, + serialized_name: 'resourceGroup', + type: { + name: 'String' + } + }, + partner_topic_name: { + client_side_validation: true, + required: false, + serialized_name: 'partnerTopicName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_filter.rb new file mode 100644 index 000000000..ee1dfd880 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_filter.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::V2020_10_15_preview + module Models + # + # Filter for the Event Channel. + # + class EventChannelFilter + + include MsRestAzure + + # @return [Boolean] Allows advanced filters to be evaluated against an + # array of values instead of expecting a singular value. + attr_accessor :enable_advanced_filtering_on_arrays + + # @return [Array] An array of advanced filters that are + # used for filtering event channels. + attr_accessor :advanced_filters + + + # + # Mapper for EventChannelFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventChannelFilter', + type: { + name: 'Composite', + class_name: 'EventChannelFilter', + model_properties: { + enable_advanced_filtering_on_arrays: { + client_side_validation: true, + required: false, + serialized_name: 'enableAdvancedFilteringOnArrays', + type: { + name: 'Boolean' + } + }, + advanced_filters: { + client_side_validation: true, + required: false, + serialized_name: 'advancedFilters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_provisioning_state.rb new file mode 100644 index 000000000..3fea12711 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_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::V2020_10_15_preview + module Models + # + # Defines values for EventChannelProvisioningState + # + module EventChannelProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_source.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_source.rb new file mode 100644 index 000000000..7928f697f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_source.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::V2020_10_15_preview + module Models + # + # Properties of the source of an event channel. + # + class EventChannelSource + + include MsRestAzure + + # @return [String] The identifier of the resource that's the source of + # the events. + # This represents a unique resource in the partner's resource model. + attr_accessor :source + + + # + # Mapper for EventChannelSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventChannelSource', + type: { + name: 'Composite', + class_name: 'EventChannelSource', + model_properties: { + source: { + client_side_validation: true, + required: false, + serialized_name: 'source', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channels_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channels_list_result.rb new file mode 100644 index 000000000..74cbb1b73 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channels_list_result.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::V2020_10_15_preview + module Models + # + # Result of the List Event Channels operation + # + class EventChannelsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of Event Channels + attr_accessor :value + + # @return [String] A link for the next page of event channels + 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [EventChannelsListResult] 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 EventChannelsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventChannelsListResult', + type: { + name: 'Composite', + class_name: 'EventChannelsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventChannelElementType', + type: { + name: 'Composite', + class_name: 'EventChannel' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb new file mode 100644 index 000000000..efc436760 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_preview + module Models + # + # Defines values for EventDeliverySchema + # + module EventDeliverySchema + EventGridSchema = "EventGridSchema" + CustomInputSchema = "CustomInputSchema" + CloudEventSchemaV10 = "CloudEventSchemaV1_0" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb new file mode 100644 index 000000000..c96b6a08a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb @@ -0,0 +1,84 @@ +# 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::V2020_10_15_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 + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for EventHubEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventHub', + type: { + name: 'Composite', + class_name: 'EventHubEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb new file mode 100644 index 000000000..facc09028 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb @@ -0,0 +1,244 @@ +# 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::V2020_10_15_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. + # Uses Azure Event Grid's identity to acquire the authentication tokens + # being used during delivery / dead-lettering. + attr_accessor :destination + + # @return [DeliveryWithResourceIdentity] Information about the + # destination where events have to be delivered for the event + # subscription. + # Uses the managed identity setup on the parent resource (namely, topic + # or domain) to acquire the authentication tokens being used during + # delivery / dead-lettering. + attr_accessor :delivery_with_resource_identity + + # @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', + # 'CustomInputSchema', 'CloudEventSchemaV1_0'. Default value: + # 'EventGridSchema' . + 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 dead letter destination of the + # event subscription. Any event that cannot be delivered to its' + # destination is sent to the dead letter destination. + # Uses Azure Event Grid's identity to acquire the authentication tokens + # being used during delivery / dead-lettering. + attr_accessor :dead_letter_destination + + # @return [DeadLetterWithResourceIdentity] The dead letter destination of + # the event subscription. Any event that cannot be delivered to its' + # destination is sent to the dead letter destination. + # Uses the managed identity setup on the parent resource (namely, topic + # or domain) to acquire the authentication tokens being used during + # delivery / dead-lettering. + attr_accessor :dead_letter_with_resource_identity + + # @return [SystemData] The system metadata relating to Event Subscription + # resource. + attr_accessor :system_data + + + # + # Mapper for EventSubscription class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscription', + type: { + name: 'Composite', + class_name: 'EventSubscription', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + topic: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.topic', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + destination: { + client_side_validation: true, + required: false, + serialized_name: 'properties.destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + delivery_with_resource_identity: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeliveryWithResourceIdentity' + } + }, + filter: { + client_side_validation: true, + required: false, + serialized_name: 'properties.filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labels', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventDeliverySchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + retry_policy: { + client_side_validation: true, + required: false, + serialized_name: 'properties.retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + }, + dead_letter_with_resource_identity: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deadLetterWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeadLetterWithResourceIdentity' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb new file mode 100644 index 000000000..acc149b85 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.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::V2020_10_15_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" + @@discriminatorMap["ServiceBusTopic"] = "ServiceBusTopicEventSubscriptionDestination" + @@discriminatorMap["AzureFunction"] = "AzureFunctionEventSubscriptionDestination" + + 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() + { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb new file mode 100644 index 000000000..2fb079618 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb @@ -0,0 +1,132 @@ +# 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::V2020_10_15_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 [Boolean] Allows advanced filters to be evaluated against an + # array of values instead of expecting a singular value. + attr_accessor :enable_advanced_filtering_on_arrays + + # @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() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionFilter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter', + model_properties: { + subject_begins_with: { + client_side_validation: true, + required: false, + serialized_name: 'subjectBeginsWith', + type: { + name: 'String' + } + }, + subject_ends_with: { + client_side_validation: true, + required: false, + serialized_name: 'subjectEndsWith', + type: { + name: 'String' + } + }, + included_event_types: { + client_side_validation: true, + required: false, + serialized_name: 'includedEventTypes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_subject_case_sensitive: { + client_side_validation: true, + required: false, + serialized_name: 'isSubjectCaseSensitive', + default_value: false, + type: { + name: 'Boolean' + } + }, + enable_advanced_filtering_on_arrays: { + client_side_validation: true, + required: false, + serialized_name: 'enableAdvancedFilteringOnArrays', + type: { + name: 'Boolean' + } + }, + advanced_filters: { + client_side_validation: true, + required: false, + serialized_name: 'advancedFilters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb new file mode 100644 index 000000000..604fc81a0 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb @@ -0,0 +1,47 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionFullUrl', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFullUrl', + model_properties: { + endpoint_url: { + client_side_validation: true, + required: false, + serialized_name: 'endpointUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity.rb new file mode 100644 index 000000000..7e2704f31 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity.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::V2020_10_15_preview + module Models + # + # The identity information with the event subscription. + # + class EventSubscriptionIdentity + + include MsRestAzure + + # @return [EventSubscriptionIdentityType] The type of managed identity + # used. The type 'SystemAssigned, UserAssigned' includes both an + # implicitly created identity and a set of user-assigned identities. The + # type 'None' will remove any identity. Possible values include: + # 'SystemAssigned', 'UserAssigned' + attr_accessor :type + + # @return [String] The user identity associated with the resource. + attr_accessor :user_assigned_identity + + + # + # Mapper for EventSubscriptionIdentity class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionIdentity', + type: { + name: 'Composite', + class_name: 'EventSubscriptionIdentity', + model_properties: { + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + user_assigned_identity: { + client_side_validation: true, + required: false, + serialized_name: 'userAssignedIdentity', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity_type.rb new file mode 100644 index 000000000..daed01c4a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity_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::V2020_10_15_preview + module Models + # + # Defines values for EventSubscriptionIdentityType + # + module EventSubscriptionIdentityType + SystemAssigned = "SystemAssigned" + UserAssigned = "UserAssigned" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb new file mode 100644 index 000000000..5642db857 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb new file mode 100644 index 000000000..41ecf5389 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb @@ -0,0 +1,176 @@ +# 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::V2020_10_15_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. + # Uses Azure Event Grid's identity to acquire the authentication tokens + # being used during delivery / dead-lettering. + attr_accessor :destination + + # @return [DeliveryWithResourceIdentity] Information about the + # destination where events have to be delivered for the event + # subscription. + # Uses the managed identity setup on the parent resource (topic / domain) + # to acquire the authentication tokens being used during delivery / + # dead-lettering. + attr_accessor :delivery_with_resource_identity + + # @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', + # 'CustomInputSchema', 'CloudEventSchemaV1_0' + 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 dead letter destination of the + # event subscription. Any event that cannot be delivered to its' + # destination is sent to the dead letter destination. + # Uses Azure Event Grid's identity to acquire the authentication tokens + # being used during delivery / dead-lettering. + attr_accessor :dead_letter_destination + + # @return [DeadLetterWithResourceIdentity] The dead letter destination of + # the event subscription. Any event that cannot be delivered to its' + # destination is sent to the dead letter destination. + # Uses the managed identity setup on the parent resource (topic / domain) + # to acquire the authentication tokens being used during delivery / + # dead-lettering. + attr_accessor :dead_letter_with_resource_identity + + + # + # Mapper for EventSubscriptionUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionUpdateParameters', + type: { + name: 'Composite', + class_name: 'EventSubscriptionUpdateParameters', + model_properties: { + destination: { + client_side_validation: true, + required: false, + serialized_name: 'destination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'EventSubscriptionDestination', + class_name: 'EventSubscriptionDestination' + } + }, + delivery_with_resource_identity: { + client_side_validation: true, + required: false, + serialized_name: 'deliveryWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeliveryWithResourceIdentity' + } + }, + filter: { + client_side_validation: true, + required: false, + serialized_name: 'filter', + type: { + name: 'Composite', + class_name: 'EventSubscriptionFilter' + } + }, + labels: { + client_side_validation: true, + required: false, + serialized_name: 'labels', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + expiration_time_utc: { + client_side_validation: true, + required: false, + serialized_name: 'expirationTimeUtc', + type: { + name: 'DateTime' + } + }, + event_delivery_schema: { + client_side_validation: true, + required: false, + serialized_name: 'eventDeliverySchema', + type: { + name: 'String' + } + }, + retry_policy: { + client_side_validation: true, + required: false, + serialized_name: 'retryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy' + } + }, + dead_letter_destination: { + client_side_validation: true, + required: false, + serialized_name: 'deadLetterDestination', + type: { + name: 'Composite', + polymorphic_discriminator: 'endpointType', + uber_parent: 'DeadLetterDestination', + class_name: 'DeadLetterDestination' + } + }, + dead_letter_with_resource_identity: { + client_side_validation: true, + required: false, + serialized_name: 'deadLetterWithResourceIdentity', + type: { + name: 'Composite', + class_name: 'DeadLetterWithResourceIdentity' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb new file mode 100644 index 000000000..b170b19d2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.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::V2020_10_15_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 && !page.next_link.strip.empty? 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() + { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionsListResult', + type: { + name: 'Composite', + class_name: 'EventSubscriptionsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventSubscriptionElementType', + type: { + name: 'Composite', + class_name: 'EventSubscription' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb new file mode 100644 index 000000000..986834e1e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb @@ -0,0 +1,106 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'EventType', + type: { + name: 'Composite', + class_name: 'EventType', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + schema_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.schemaUrl', + type: { + name: 'String' + } + }, + is_in_default_set: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isInDefaultSet', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb new file mode 100644 index 000000000..6ceb6d600 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb @@ -0,0 +1,55 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'EventTypesListResult', + type: { + name: 'Composite', + class_name: 'EventTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventTypeElementType', + type: { + name: 'Composite', + class_name: 'EventType' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extended_location.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extended_location.rb new file mode 100644 index 000000000..4e2f4004b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extended_location.rb @@ -0,0 +1,57 @@ +# 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::V2020_10_15_preview + module Models + # + # Definition of an Extended Location + # + class ExtendedLocation + + include MsRestAzure + + # @return [String] Fully qualified name of the extended location. + attr_accessor :name + + # @return [String] Type of the extended location. + attr_accessor :type + + + # + # Mapper for ExtendedLocation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExtendedLocation', + type: { + name: 'Composite', + class_name: 'ExtendedLocation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extension_topic.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extension_topic.rb new file mode 100644 index 000000000..2eee3c443 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extension_topic.rb @@ -0,0 +1,86 @@ +# 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::V2020_10_15_preview + module Models + # + # Event grid Extension Topic. This is used for getting Event Grid related + # metrics for Azure resources. + # + class ExtensionTopic < Resource + + include MsRestAzure + + # @return [String] Description of the extension topic. + attr_accessor :description + + # @return [String] System topic resource id which is mapped to the + # source. + attr_accessor :system_topic + + + # + # Mapper for ExtensionTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExtensionTopic', + type: { + name: 'Composite', + class_name: 'ExtensionTopic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + system_topic: { + client_side_validation: true, + required: false, + serialized_name: 'properties.systemTopic', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb new file mode 100644 index 000000000..cb2ac893a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb @@ -0,0 +1,86 @@ +# 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::V2020_10_15_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 + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for HybridConnectionEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'HybridConnection', + type: { + name: 'Composite', + class_name: 'HybridConnectionEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_info.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_info.rb new file mode 100644 index 000000000..8e0dadcab --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_info.rb @@ -0,0 +1,96 @@ +# 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::V2020_10_15_preview + module Models + # + # The identity information for the resource. + # + class IdentityInfo + + include MsRestAzure + + # @return [IdentityType] The type of managed identity used. The type + # 'SystemAssigned, UserAssigned' includes both an implicitly created + # identity and a set of user-assigned identities. The type 'None' will + # remove any identity. Possible values include: 'None', 'SystemAssigned', + # 'UserAssigned', 'SystemAssigned, UserAssigned' + attr_accessor :type + + # @return [String] The principal ID of resource identity. + attr_accessor :principal_id + + # @return [String] The tenant ID of resource. + attr_accessor :tenant_id + + # @return [Hash{String => UserIdentityProperties}] The list of user + # identities associated with the resource. The user identity dictionary + # key references will be ARM resource ids in the form: + # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + # This property is currently not used and reserved for future usage. + attr_accessor :user_assigned_identities + + + # + # Mapper for IdentityInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IdentityInfo', + type: { + name: 'Composite', + class_name: 'IdentityInfo', + model_properties: { + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + principal_id: { + client_side_validation: true, + required: false, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'tenantId', + type: { + name: 'String' + } + }, + user_assigned_identities: { + client_side_validation: true, + required: false, + serialized_name: 'userAssignedIdentities', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'UserIdentityPropertiesElementType', + type: { + name: 'Composite', + class_name: 'UserIdentityProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_type.rb new file mode 100644 index 000000000..ccf809d12 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_type.rb @@ -0,0 +1,18 @@ +# 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::V2020_10_15_preview + module Models + # + # Defines values for IdentityType + # + module IdentityType + None = "None" + SystemAssigned = "SystemAssigned" + UserAssigned = "UserAssigned" + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb new file mode 100644 index 000000000..ef339f90d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.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::V2020_10_15_preview + module Models + # + # Model object. + # + # + class InboundIpRule + + include MsRestAzure + + # @return [String] IP Address in CIDR notation e.g., 10.0.0.0/8. + attr_accessor :ip_mask + + # @return [IpActionType] Action to perform based on the match or no match + # of the IpMask. Possible values include: 'Allow' + attr_accessor :action + + + # + # Mapper for InboundIpRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRule', + type: { + name: 'Composite', + class_name: 'InboundIpRule', + model_properties: { + ip_mask: { + client_side_validation: true, + required: false, + serialized_name: 'ipMask', + type: { + name: 'String' + } + }, + action: { + client_side_validation: true, + required: false, + serialized_name: 'action', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema.rb new file mode 100644 index 000000000..776d65289 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_preview + module Models + # + # Defines values for InputSchema + # + module InputSchema + EventGridSchema = "EventGridSchema" + CustomEventSchema = "CustomEventSchema" + CloudEventSchemaV10 = "CloudEventSchemaV1_0" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb new file mode 100644 index 000000000..a5bee0196 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.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::V2020_10_15_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() + { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb new file mode 100644 index 000000000..784a0df83 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb @@ -0,0 +1,15 @@ +# 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::V2020_10_15_preview + module Models + # + # Defines values for IpActionType + # + module IpActionType + Allow = "Allow" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_not_null_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_not_null_advanced_filter.rb new file mode 100644 index 000000000..ec430fd6d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_not_null_advanced_filter.rb @@ -0,0 +1,58 @@ +# 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::V2020_10_15_preview + module Models + # + # IsNotNull Advanced Filter. + # + class IsNotNullAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "IsNotNull" + end + + attr_accessor :operatorType + + + # + # Mapper for IsNotNullAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IsNotNull', + type: { + name: 'Composite', + class_name: 'IsNotNullAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_null_or_undefined_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_null_or_undefined_advanced_filter.rb new file mode 100644 index 000000000..553b54f6a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_null_or_undefined_advanced_filter.rb @@ -0,0 +1,58 @@ +# 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::V2020_10_15_preview + module Models + # + # IsNullOrUndefined Advanced Filter. + # + class IsNullOrUndefinedAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "IsNullOrUndefined" + end + + attr_accessor :operatorType + + + # + # Mapper for IsNullOrUndefinedAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IsNullOrUndefined', + type: { + name: 'Composite', + class_name: 'IsNullOrUndefinedAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb new file mode 100644 index 000000000..19f003501 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb @@ -0,0 +1,50 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'JsonField', + type: { + name: 'Composite', + class_name: 'JsonField', + model_properties: { + source_field: { + client_side_validation: true, + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb new file mode 100644 index 000000000..714c58121 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'JsonFieldWithDefault', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault', + model_properties: { + source_field: { + client_side_validation: true, + required: false, + serialized_name: 'sourceField', + type: { + name: 'String' + } + }, + default_value: { + client_side_validation: true, + required: false, + serialized_name: 'defaultValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb new file mode 100644 index 000000000..ce8c6dc9c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb @@ -0,0 +1,130 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'Json', + type: { + name: 'Composite', + class_name: 'JsonInputSchemaMapping', + model_properties: { + inputSchemaMappingType: { + client_side_validation: true, + required: true, + serialized_name: 'inputSchemaMappingType', + type: { + name: 'String' + } + }, + id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.id', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + topic: { + client_side_validation: true, + required: false, + serialized_name: 'properties.topic', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_time: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventTime', + type: { + name: 'Composite', + class_name: 'JsonField' + } + }, + event_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.eventType', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + subject: { + client_side_validation: true, + required: false, + serialized_name: 'properties.subject', + type: { + name: 'Composite', + class_name: 'JsonFieldWithDefault' + } + }, + data_version: { + client_side_validation: true, + 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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb new file mode 100644 index 000000000..a6d135a13 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberGreaterThan', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb new file mode 100644 index 000000000..cef1a1561 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberGreaterThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberGreaterThanOrEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb new file mode 100644 index 000000000..d75186d52 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberIn', + type: { + name: 'Composite', + class_name: 'NumberInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_range_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_range_advanced_filter.rb new file mode 100644 index 000000000..76f764a2b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_range_advanced_filter.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::V2020_10_15_preview + module Models + # + # NumberInRange Advanced Filter. + # + class NumberInRangeAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberInRange" + end + + attr_accessor :operatorType + + # @return [Array>] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberInRangeAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberInRange', + type: { + name: 'Composite', + class_name: 'NumberInRangeAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb new file mode 100644 index 000000000..9edf0233e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberLessThan', + type: { + name: 'Composite', + class_name: 'NumberLessThanAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb new file mode 100644 index 000000000..e890cd37e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb @@ -0,0 +1,69 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberLessThanOrEquals', + type: { + name: 'Composite', + class_name: 'NumberLessThanOrEqualsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb new file mode 100644 index 000000000..b5b9d5e52 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberNotIn', + type: { + name: 'Composite', + class_name: 'NumberNotInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_range_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_range_advanced_filter.rb new file mode 100644 index 000000000..c19c02390 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_range_advanced_filter.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::V2020_10_15_preview + module Models + # + # NumberNotInRange Advanced Filter. + # + class NumberNotInRangeAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "NumberNotInRange" + end + + attr_accessor :operatorType + + # @return [Array>] The set of filter values. + attr_accessor :values + + + # + # Mapper for NumberNotInRangeAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NumberNotInRange', + type: { + name: 'Composite', + class_name: 'NumberNotInRangeAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FloatElementType', + type: { + name: 'Double' + } + } + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation.rb new file mode 100644 index 000000000..bf2d59b82 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation.rb @@ -0,0 +1,80 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationInfo' + } + }, + origin: { + client_side_validation: true, + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + }, + properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb new file mode 100644 index 000000000..0fffb3222 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb @@ -0,0 +1,79 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationInfo', + type: { + name: 'Composite', + class_name: 'OperationInfo', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb new file mode 100644 index 000000000..895cd837b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb @@ -0,0 +1,55 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationsListResult', + type: { + name: 'Composite', + class_name: 'OperationsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace.rb new file mode 100644 index 000000000..a57dd7ec8 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace.rb @@ -0,0 +1,140 @@ +# 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::V2020_10_15_preview + module Models + # + # EventGrid Partner Namespace. + # + class PartnerNamespace < TrackedResource + + include MsRestAzure + + # @return [PartnerNamespaceProvisioningState] Provisioning state of the + # partner namespace. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] The fully qualified ARM Id of the partner registration + # that should be associated with this partner namespace. This takes the + # following format: + # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + attr_accessor :partner_registration_fully_qualified_id + + # @return [String] Endpoint for the partner namespace. + attr_accessor :endpoint + + # @return [SystemData] The system metadata relating to Partner Namespace + # resource. + attr_accessor :system_data + + + # + # Mapper for PartnerNamespace class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespace', + type: { + name: 'Composite', + class_name: 'PartnerNamespace', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + partner_registration_fully_qualified_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerRegistrationFullyQualifiedId', + type: { + name: 'String' + } + }, + endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_provisioning_state.rb new file mode 100644 index 000000000..1a65d1d20 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_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::V2020_10_15_preview + module Models + # + # Defines values for PartnerNamespaceProvisioningState + # + module PartnerNamespaceProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_regenerate_key_request.rb new file mode 100644 index 000000000..ea21f47e9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_regenerate_key_request.rb @@ -0,0 +1,46 @@ +# 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::V2020_10_15_preview + module Models + # + # PartnerNamespace regenerate shared access key request. + # + class PartnerNamespaceRegenerateKeyRequest + + include MsRestAzure + + # @return [String] Key name to regenerate (key1 or key2). + attr_accessor :key_name + + + # + # Mapper for PartnerNamespaceRegenerateKeyRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespaceRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'PartnerNamespaceRegenerateKeyRequest', + model_properties: { + key_name: { + client_side_validation: true, + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_shared_access_keys.rb new file mode 100644 index 000000000..14f5ad246 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_shared_access_keys.rb @@ -0,0 +1,57 @@ +# 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::V2020_10_15_preview + module Models + # + # Shared access keys of the partner namespace. + # + class PartnerNamespaceSharedAccessKeys + + include MsRestAzure + + # @return [String] Shared access key1 for the partner namespace. + attr_accessor :key1 + + # @return [String] Shared access key2 for the partner namespace. + attr_accessor :key2 + + + # + # Mapper for PartnerNamespaceSharedAccessKeys class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespaceSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'PartnerNamespaceSharedAccessKeys', + model_properties: { + key1: { + client_side_validation: true, + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + client_side_validation: true, + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_update_parameters.rb new file mode 100644 index 000000000..b3cded74e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_update_parameters.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::V2020_10_15_preview + module Models + # + # Properties of the PartnerNamespace update. + # + class PartnerNamespaceUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the partner namespace. + attr_accessor :tags + + + # + # Mapper for PartnerNamespaceUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespaceUpdateParameters', + type: { + name: 'Composite', + class_name: 'PartnerNamespaceUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespaces_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespaces_list_result.rb new file mode 100644 index 000000000..88efb8a86 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespaces_list_result.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::V2020_10_15_preview + module Models + # + # Result of the List Partner Namespaces operation + # + class PartnerNamespacesListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of partner namespaces. + attr_accessor :value + + # @return [String] A link for the next page of partner namespaces. + 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PartnerNamespacesListResult] 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 PartnerNamespacesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespacesListResult', + type: { + name: 'Composite', + class_name: 'PartnerNamespacesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartnerNamespaceElementType', + type: { + name: 'Composite', + class_name: 'PartnerNamespace' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration.rb new file mode 100644 index 000000000..356fd22b3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration.rb @@ -0,0 +1,278 @@ +# 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::V2020_10_15_preview + module Models + # + # Information about a partner registration. + # + class PartnerRegistration < TrackedResource + + include MsRestAzure + + # @return [PartnerRegistrationProvisioningState] Provisioning state of + # the partner registration. Possible values include: 'Creating', + # 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Official name of the partner name. For example: + # "Contoso". + attr_accessor :partner_name + + # @return [String] Name of the partner resource type. + attr_accessor :partner_resource_type_name + + # @return [String] Display name of the partner resource type. + attr_accessor :partner_resource_type_display_name + + # @return [String] Short description of the partner resource type. The + # length of this description should not exceed 256 characters. + attr_accessor :partner_resource_type_description + + # @return [String] Long description for the custom scenarios and + # integration to be displayed in the portal if needed. + # Length of this description should not exceed 2048 characters. + attr_accessor :long_description + + # @return [String] The customer service number of the publisher. The + # expected phone format should start with a '+' sign + # followed by the country code. The remaining digits are then followed. + # Only digits and spaces are allowed and its + # length cannot exceed 16 digits including country code. Examples of + # valid phone numbers are: +1 515 123 4567 and + # +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + # 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + attr_accessor :partner_customer_service_number + + # @return [String] The extension of the customer service number of the + # publisher. Only digits are allowed and number of digits should not + # exceed 10. + attr_accessor :partner_customer_service_extension + + # @return [String] The extension of the customer service URI of the + # publisher. + attr_accessor :customer_service_uri + + # @return [String] URI of the partner website that can be used by Azure + # customers to setup Event Grid + # integration on an event source. + attr_accessor :setup_uri + + # @return [String] URI of the logo. + attr_accessor :logo_uri + + # @return [PartnerRegistrationVisibilityState] Visibility state of the + # partner registration. Possible values include: 'Hidden', + # 'PublicPreview', 'GenerallyAvailable' + attr_accessor :visibility_state + + # @return [Array] List of Azure subscription Ids that are + # authorized to create a partner namespace + # associated with this partner registration. This is an optional + # property. Creating + # partner namespaces is always permitted under the same Azure + # subscription as the one used + # for creating the partner registration. + attr_accessor :authorized_azure_subscription_ids + + # @return [SystemData] The system metadata relating to Partner + # Registration resource. + attr_accessor :system_data + + + # + # Mapper for PartnerRegistration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerRegistration', + type: { + name: 'Composite', + class_name: 'PartnerRegistration', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + partner_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerName', + type: { + name: 'String' + } + }, + partner_resource_type_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerResourceTypeName', + type: { + name: 'String' + } + }, + partner_resource_type_display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerResourceTypeDisplayName', + type: { + name: 'String' + } + }, + partner_resource_type_description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerResourceTypeDescription', + type: { + name: 'String' + } + }, + long_description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.longDescription', + type: { + name: 'String' + } + }, + partner_customer_service_number: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerCustomerServiceNumber', + type: { + name: 'String' + } + }, + partner_customer_service_extension: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerCustomerServiceExtension', + type: { + name: 'String' + } + }, + customer_service_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customerServiceUri', + type: { + name: 'String' + } + }, + setup_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.setupUri', + type: { + name: 'String' + } + }, + logo_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.logoUri', + type: { + name: 'String' + } + }, + visibility_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.visibilityState', + type: { + name: 'String' + } + }, + authorized_azure_subscription_ids: { + client_side_validation: true, + required: false, + serialized_name: 'properties.authorizedAzureSubscriptionIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_event_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_event_types_list_result.rb new file mode 100644 index 000000000..40498bd4e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_event_types_list_result.rb @@ -0,0 +1,68 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the List Partner Registration Event Types operation. + # + class PartnerRegistrationEventTypesListResult + + include MsRestAzure + + # @return [Array] A collection of partner registration event + # types. + attr_accessor :value + + # @return [String] A link for the next page of partner registration event + # types. + attr_accessor :next_link + + + # + # Mapper for PartnerRegistrationEventTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerRegistrationEventTypesListResult', + type: { + name: 'Composite', + class_name: 'PartnerRegistrationEventTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventTypeElementType', + type: { + name: 'Composite', + class_name: 'EventType' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_provisioning_state.rb new file mode 100644 index 000000000..c4e36b9c1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_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::V2020_10_15_preview + module Models + # + # Defines values for PartnerRegistrationProvisioningState + # + module PartnerRegistrationProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_update_parameters.rb new file mode 100644 index 000000000..20fa39665 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_update_parameters.rb @@ -0,0 +1,137 @@ +# 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::V2020_10_15_preview + module Models + # + # Properties of the Partner Registration update. + # + class PartnerRegistrationUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the partner registration + # resource. + attr_accessor :tags + + # @return [String] Name of the partner topic type. + attr_accessor :partner_topic_type_name + + # @return [String] Display name of the partner topic type. + attr_accessor :partner_topic_type_display_name + + # @return [String] Description of the partner topic type. + attr_accessor :partner_topic_type_description + + # @return [String] URI of the partner website that can be used by Azure + # customers to setup Event Grid + # integration on an event source. + attr_accessor :setup_uri + + # @return [String] URI of the partner logo. + attr_accessor :logo_uri + + # @return [Array] List of IDs of Azure AD applications that are + # authorized to create a partner namespace + # associated with this partner registration. This is an optional + # property. Creating + # partner namespaces is always permitted under the same Azure + # subscription as the one used + # for creating the partner registration. + attr_accessor :authorized_azure_subscription_ids + + + # + # Mapper for PartnerRegistrationUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerRegistrationUpdateParameters', + type: { + name: 'Composite', + class_name: 'PartnerRegistrationUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + partner_topic_type_name: { + client_side_validation: true, + required: false, + serialized_name: 'partnerTopicTypeName', + type: { + name: 'String' + } + }, + partner_topic_type_display_name: { + client_side_validation: true, + required: false, + serialized_name: 'partnerTopicTypeDisplayName', + type: { + name: 'String' + } + }, + partner_topic_type_description: { + client_side_validation: true, + required: false, + serialized_name: 'partnerTopicTypeDescription', + type: { + name: 'String' + } + }, + setup_uri: { + client_side_validation: true, + required: false, + serialized_name: 'setupUri', + type: { + name: 'String' + } + }, + logo_uri: { + client_side_validation: true, + required: false, + serialized_name: 'logoUri', + type: { + name: 'String' + } + }, + authorized_azure_subscription_ids: { + client_side_validation: true, + required: false, + serialized_name: 'authorizedAzureSubscriptionIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_visibility_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_visibility_state.rb new file mode 100644 index 000000000..5fecc791b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_visibility_state.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::V2020_10_15_preview + module Models + # + # Defines values for PartnerRegistrationVisibilityState + # + module PartnerRegistrationVisibilityState + Hidden = "Hidden" + PublicPreview = "PublicPreview" + GenerallyAvailable = "GenerallyAvailable" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registrations_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registrations_list_result.rb new file mode 100644 index 000000000..86982f686 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registrations_list_result.rb @@ -0,0 +1,99 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the List Partner Registrations operation. + # + class PartnerRegistrationsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of partner + # registrations. + attr_accessor :value + + # @return [String] A link for the next page of partner registrations. + 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PartnerRegistrationsListResult] 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 PartnerRegistrationsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerRegistrationsListResult', + type: { + name: 'Composite', + class_name: 'PartnerRegistrationsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartnerRegistrationElementType', + type: { + name: 'Composite', + class_name: 'PartnerRegistration' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic.rb new file mode 100644 index 000000000..8d31516e6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic.rb @@ -0,0 +1,179 @@ +# 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::V2020_10_15_preview + module Models + # + # EventGrid Partner Topic. + # + class PartnerTopic < TrackedResource + + include MsRestAzure + + # @return [String] Source associated with this partner topic. This + # represents a unique partner resource. + attr_accessor :source + + # @return [DateTime] Expiration time of the partner topic. If this timer + # expires while the partner topic is still never activated, + # the partner topic and corresponding event channel are deleted. + attr_accessor :expiration_time_if_not_activated_utc + + # @return [PartnerTopicProvisioningState] Provisioning state of the + # partner topic. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [PartnerTopicActivationState] Activation state of the partner + # topic. Possible values include: 'NeverActivated', 'Activated', + # 'Deactivated' + attr_accessor :activation_state + + # @return [String] Friendly description about the topic. This can be set + # by the publisher/partner to show custom description for the customer + # partner topic. + # This will be helpful to remove any ambiguity of the origin of creation + # of the partner topic for the customer. + attr_accessor :partner_topic_friendly_description + + # @return [IdentityInfo] Identity information for the resource. + attr_accessor :identity + + # @return [SystemData] The system metadata relating to Partner Topic + # resource. + attr_accessor :system_data + + + # + # Mapper for PartnerTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopic', + type: { + name: 'Composite', + class_name: 'PartnerTopic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.source', + type: { + name: 'String' + } + }, + expiration_time_if_not_activated_utc: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationTimeIfNotActivatedUtc', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + activation_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.activationState', + type: { + name: 'String' + } + }, + partner_topic_friendly_description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerTopicFriendlyDescription', + type: { + name: 'String' + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_activation_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_activation_state.rb new file mode 100644 index 000000000..daa330adf --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_activation_state.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::V2020_10_15_preview + module Models + # + # Defines values for PartnerTopicActivationState + # + module PartnerTopicActivationState + NeverActivated = "NeverActivated" + Activated = "Activated" + Deactivated = "Deactivated" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_provisioning_state.rb new file mode 100644 index 000000000..8b0a18117 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_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::V2020_10_15_preview + module Models + # + # Defines values for PartnerTopicProvisioningState + # + module PartnerTopicProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_readiness_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_readiness_state.rb new file mode 100644 index 000000000..53b509789 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_readiness_state.rb @@ -0,0 +1,18 @@ +# 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::V2020_10_15_preview + module Models + # + # Defines values for PartnerTopicReadinessState + # + module PartnerTopicReadinessState + NotActivatedByUserYet = "NotActivatedByUserYet" + ActivatedByUser = "ActivatedByUser" + DeactivatedByUser = "DeactivatedByUser" + DeletedByUser = "DeletedByUser" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type.rb new file mode 100644 index 000000000..5b23d6c5f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type.rb @@ -0,0 +1,134 @@ +# 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::V2020_10_15_preview + module Models + # + # Properties of a partner topic type. + # + class PartnerTopicType < Resource + + include MsRestAzure + + # @return [String] Official name of the partner. + attr_accessor :partner_name + + # @return [String] Name of the partner topic type. This name should be + # unique among all partner topic types names. + attr_accessor :topic_type_name + + # @return [String] Display Name for the partner topic type. + attr_accessor :display_name + + # @return [String] Description of the partner topic type. + attr_accessor :description + + # @return [String] URI of the partner website that can be used by Azure + # customers to setup Event Grid + # integration on an event source. + attr_accessor :setup_uri + + # @return [PartnerTopicTypeAuthorizationState] Status of whether the + # customer has authorized a partner to create partner topics + # in the customer's subscription. Possible values include: + # 'NotApplicable', 'NotAuthorized', 'Authorized' + attr_accessor :authorization_state + + + # + # Mapper for PartnerTopicType class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicType', + type: { + name: 'Composite', + class_name: 'PartnerTopicType', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + partner_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.partnerName', + type: { + name: 'String' + } + }, + topic_type_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.topicTypeName', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + setup_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.setupUri', + type: { + name: 'String' + } + }, + authorization_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.authorizationState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type_authorization_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type_authorization_state.rb new file mode 100644 index 000000000..1adb5006d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type_authorization_state.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::V2020_10_15_preview + module Models + # + # Defines values for PartnerTopicTypeAuthorizationState + # + module PartnerTopicTypeAuthorizationState + NotApplicable = "NotApplicable" + NotAuthorized = "NotAuthorized" + Authorized = "Authorized" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_types_list_result.rb new file mode 100644 index 000000000..b0a11df52 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_types_list_result.rb @@ -0,0 +1,55 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the List Partner Topic Types operation. + # + class PartnerTopicTypesListResult + + include MsRestAzure + + # @return [Array] A collection of partner topic types. + attr_accessor :value + + + # + # Mapper for PartnerTopicTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicTypesListResult', + type: { + name: 'Composite', + class_name: 'PartnerTopicTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicTypeElementType', + type: { + name: 'Composite', + class_name: 'PartnerTopicType' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_update_parameters.rb new file mode 100644 index 000000000..0dd604e8e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_update_parameters.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::V2020_10_15_preview + module Models + # + # Properties of the Partner Topic update. + # + class PartnerTopicUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the partner topic. + attr_accessor :tags + + + # + # Mapper for PartnerTopicUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicUpdateParameters', + type: { + name: 'Composite', + class_name: 'PartnerTopicUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topics_list_result.rb new file mode 100644 index 000000000..c4fd58eb1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topics_list_result.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::V2020_10_15_preview + module Models + # + # Result of the List Partner Topics operation. + # + class PartnerTopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of partner topics. + attr_accessor :value + + # @return [String] A link for the next page of partner 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PartnerTopicsListResult] 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 PartnerTopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicsListResult', + type: { + name: 'Composite', + class_name: 'PartnerTopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PartnerTopicElementType', + type: { + name: 'Composite', + class_name: 'PartnerTopic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb new file mode 100644 index 000000000..ebedfb594 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb @@ -0,0 +1,18 @@ +# 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::V2020_10_15_preview + module Models + # + # Defines values for PersistedConnectionStatus + # + module PersistedConnectionStatus + Pending = "Pending" + Approved = "Approved" + Rejected = "Rejected" + Disconnected = "Disconnected" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint.rb new file mode 100644 index 000000000..ad131b153 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint.rb @@ -0,0 +1,46 @@ +# 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::V2020_10_15_preview + module Models + # + # PrivateEndpoint information. + # + class PrivateEndpoint + + include MsRestAzure + + # @return [String] The ARM identifier for Private Endpoint. + attr_accessor :id + + + # + # Mapper for PrivateEndpoint class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpoint', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb new file mode 100644 index 000000000..1dccbb2c2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb @@ -0,0 +1,121 @@ +# 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::V2020_10_15_preview + module Models + # + # Model object. + # + # + class PrivateEndpointConnection < Resource + + include MsRestAzure + + # @return [PrivateEndpoint] The Private Endpoint resource for this + # Connection. + attr_accessor :private_endpoint + + # @return [Array] GroupIds from the private link service + # resource. + attr_accessor :group_ids + + # @return [ConnectionState] Details about the state of the connection. + attr_accessor :private_link_service_connection_state + + # @return [ResourceProvisioningState] Provisioning state of the Private + # Endpoint Connection. Possible values include: 'Creating', 'Updating', + # 'Deleting', 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + + # + # Mapper for PrivateEndpointConnection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnection', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + private_endpoint: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpoint', + type: { + name: 'Composite', + class_name: 'PrivateEndpoint' + } + }, + group_ids: { + client_side_validation: true, + required: false, + serialized_name: 'properties.groupIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_link_service_connection_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateLinkServiceConnectionState', + type: { + name: 'Composite', + class_name: 'ConnectionState' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb new file mode 100644 index 000000000..ed08e7966 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb @@ -0,0 +1,100 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the list of all private endpoint connections operation. + # + class PrivateEndpointConnectionListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of private + # endpoint connection resources. + attr_accessor :value + + # @return [String] A link for the next page of private endpoint + # connection resources. + 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PrivateEndpointConnectionListResult] 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 PrivateEndpointConnectionListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionListResult', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnectionListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resource.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resource.rb new file mode 100644 index 000000000..81503490a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resource.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::V2020_10_15_preview + module Models + # + # Information of the private link resource. + # + class PrivateLinkResource + + include MsRestAzure + + # @return [String] + attr_accessor :group_id + + # @return [String] + attr_accessor :display_name + + # @return [Array] + attr_accessor :required_members + + # @return [Array] + attr_accessor :required_zone_names + + # @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 PrivateLinkResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResource', + type: { + name: 'Composite', + class_name: 'PrivateLinkResource', + model_properties: { + group_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.groupId', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + required_members: { + client_side_validation: true, + required: false, + serialized_name: 'properties.requiredMembers', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + required_zone_names: { + client_side_validation: true, + required: false, + serialized_name: 'properties.requiredZoneNames', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb new file mode 100644 index 000000000..3aec3b52e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb @@ -0,0 +1,99 @@ +# 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::V2020_10_15_preview + module Models + # + # Result of the List private link resources operation. + # + class PrivateLinkResourcesListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of private link + # resources + attr_accessor :value + + # @return [String] A link for the next page of private link resources. + 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [PrivateLinkResourcesListResult] 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 PrivateLinkResourcesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResourcesListResult', + type: { + name: 'Composite', + class_name: 'PrivateLinkResourcesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateLinkResourceElementType', + type: { + name: 'Composite', + class_name: 'PrivateLinkResource' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/public_network_access.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/public_network_access.rb new file mode 100644 index 000000000..8550286a4 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/public_network_access.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::V2020_10_15_preview + module Models + # + # Defines values for PublicNetworkAccess + # + module PublicNetworkAccess + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource.rb new file mode 100644 index 000000000..84a92cacc --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource.rb @@ -0,0 +1,80 @@ +# 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::V2020_10_15_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 + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_kind.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_kind.rb new file mode 100644 index 000000000..6e5f686ac --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_kind.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::V2020_10_15_preview + module Models + # + # Defines values for ResourceKind + # + module ResourceKind + Azure = "Azure" + AzureArc = "AzureArc" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb new file mode 100644 index 000000000..49d1b147a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_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::V2020_10_15_preview + module Models + # + # Defines values for ResourceProvisioningState + # + module ResourceProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Canceled = "Canceled" + Failed = "Failed" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb new file mode 100644 index 000000000..3639441e9 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_sku.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_sku.rb new file mode 100644 index 000000000..f078eaeb2 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_sku.rb @@ -0,0 +1,47 @@ +# 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::V2020_10_15_preview + module Models + # + # Describes an EventGrid Resource Sku. + # + class ResourceSku + + include MsRestAzure + + # @return [Sku] The Sku name of the resource. The possible values are: + # Basic or Premium. Possible values include: 'Basic', 'Premium' + attr_accessor :name + + + # + # Mapper for ResourceSku class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSku', + type: { + name: 'Composite', + class_name: 'ResourceSku', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb new file mode 100644 index 000000000..0da01000b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.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::V2020_10_15_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. + # Default value: 30 . + attr_accessor :max_delivery_attempts + + # @return [Integer] Time To Live (in minutes) for events. Default value: + # 1440 . + 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() + { + client_side_validation: true, + required: false, + serialized_name: 'RetryPolicy', + type: { + name: 'Composite', + class_name: 'RetryPolicy', + model_properties: { + max_delivery_attempts: { + client_side_validation: true, + required: false, + serialized_name: 'maxDeliveryAttempts', + default_value: 30, + type: { + name: 'Number' + } + }, + event_time_to_live_in_minutes: { + client_side_validation: true, + required: false, + serialized_name: 'eventTimeToLiveInMinutes', + default_value: 1440, + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb new file mode 100644 index 000000000..6faddd258 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.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::V2020_10_15_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 + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for ServiceBusQueueEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceBusQueue', + type: { + name: 'Composite', + class_name: 'ServiceBusQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb new file mode 100644 index 000000000..fd968a81a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb @@ -0,0 +1,86 @@ +# 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::V2020_10_15_preview + module Models + # + # Information about the service bus topic destination for an event + # subscription. + # + class ServiceBusTopicEventSubscriptionDestination < EventSubscriptionDestination + + include MsRestAzure + + + def initialize + @endpointType = "ServiceBusTopic" + end + + attr_accessor :endpointType + + # @return [String] The Azure Resource Id that represents the endpoint of + # the Service Bus Topic destination of an event subscription. + attr_accessor :resource_id + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for ServiceBusTopicEventSubscriptionDestination class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceBusTopic', + type: { + name: 'Composite', + class_name: 'ServiceBusTopicEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/sku.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/sku.rb new file mode 100644 index 000000000..b8c9e2f1e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/sku.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::V2020_10_15_preview + module Models + # + # Defines values for Sku + # + module Sku + Basic = "Basic" + Premium = "Premium" + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/static_delivery_attribute_mapping.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/static_delivery_attribute_mapping.rb new file mode 100644 index 000000000..21b5a7c27 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/static_delivery_attribute_mapping.rb @@ -0,0 +1,81 @@ +# 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::V2020_10_15_preview + module Models + # + # Static delivery attribute mapping details. + # + class StaticDeliveryAttributeMapping < DeliveryAttributeMapping + + include MsRestAzure + + + def initialize + @type = "Static" + end + + attr_accessor :type + + # @return [String] Value of the delivery attribute. + attr_accessor :value + + # @return [Boolean] Boolean flag to tell if the attribute contains + # sensitive information . + attr_accessor :is_secret + + + # + # Mapper for StaticDeliveryAttributeMapping class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Static', + type: { + name: 'Composite', + class_name: 'StaticDeliveryAttributeMapping', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'properties.value', + type: { + name: 'String' + } + }, + is_secret: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isSecret', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb new file mode 100644 index 000000000..9a74c4f69 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StorageBlob', + type: { + name: 'Composite', + class_name: 'StorageBlobDeadLetterDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + blob_container_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.blobContainerName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb new file mode 100644 index 000000000..c7f38b8d6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb @@ -0,0 +1,86 @@ +# 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::V2020_10_15_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 + + # @return [Integer] Storage queue message time to live in seconds. + attr_accessor :queue_message_time_to_live_in_seconds + + + # + # Mapper for StorageQueueEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StorageQueue', + type: { + name: 'Composite', + class_name: 'StorageQueueEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceId', + type: { + name: 'String' + } + }, + queue_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.queueName', + type: { + name: 'String' + } + }, + queue_message_time_to_live_in_seconds: { + client_side_validation: true, + required: false, + serialized_name: 'properties.queueMessageTimeToLiveInSeconds', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb new file mode 100644 index 000000000..0dd1c8dad --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StringBeginsWith', + type: { + name: 'Composite', + class_name: 'StringBeginsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb new file mode 100644 index 000000000..39a6ee9ff --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StringContains', + type: { + name: 'Composite', + class_name: 'StringContainsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb new file mode 100644 index 000000000..7d1b69661 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StringEndsWith', + type: { + name: 'Composite', + class_name: 'StringEndsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb new file mode 100644 index 000000000..c4029c2c1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StringIn', + type: { + name: 'Composite', + class_name: 'StringInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_begins_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_begins_with_advanced_filter.rb new file mode 100644 index 000000000..6b885a8e1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_begins_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_preview + module Models + # + # StringNotBeginsWith Advanced Filter. + # + class StringNotBeginsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringNotBeginsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringNotBeginsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringNotBeginsWith', + type: { + name: 'Composite', + class_name: 'StringNotBeginsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_contains_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_contains_advanced_filter.rb new file mode 100644 index 000000000..bc1af1c83 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_contains_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_preview + module Models + # + # StringNotContains Advanced Filter. + # + class StringNotContainsAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringNotContains" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringNotContainsAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringNotContains', + type: { + name: 'Composite', + class_name: 'StringNotContainsAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_ends_with_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_ends_with_advanced_filter.rb new file mode 100644 index 000000000..d76eec393 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_ends_with_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_preview + module Models + # + # StringNotEndsWith Advanced Filter. + # + class StringNotEndsWithAdvancedFilter < AdvancedFilter + + include MsRestAzure + + + def initialize + @operatorType = "StringNotEndsWith" + end + + attr_accessor :operatorType + + # @return [Array] The set of filter values. + attr_accessor :values + + + # + # Mapper for StringNotEndsWithAdvancedFilter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'StringNotEndsWith', + type: { + name: 'Composite', + class_name: 'StringNotEndsWithAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb new file mode 100644 index 000000000..02d69967a --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb @@ -0,0 +1,77 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'StringNotIn', + type: { + name: 'Composite', + class_name: 'StringNotInAdvancedFilter', + model_properties: { + key: { + client_side_validation: true, + required: false, + serialized_name: 'key', + type: { + name: 'String' + } + }, + operatorType: { + client_side_validation: true, + required: true, + serialized_name: 'operatorType', + type: { + name: 'String' + } + }, + values: { + client_side_validation: true, + required: false, + serialized_name: 'values', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_data.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_data.rb new file mode 100644 index 000000000..c8435d1ef --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_data.rb @@ -0,0 +1,105 @@ +# 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::V2020_10_15_preview + module Models + # + # Metadata pertaining to creation and last modification of the resource. + # + class SystemData + + include MsRestAzure + + # @return [String] The identity that created the resource. + attr_accessor :created_by + + # @return [CreatedByType] The type of identity that created the resource. + # Possible values include: 'User', 'Application', 'ManagedIdentity', + # 'Key' + attr_accessor :created_by_type + + # @return [DateTime] The timestamp of resource creation (UTC). + attr_accessor :created_at + + # @return [String] The identity that last modified the resource. + attr_accessor :last_modified_by + + # @return [CreatedByType] The type of identity that last modified the + # resource. Possible values include: 'User', 'Application', + # 'ManagedIdentity', 'Key' + attr_accessor :last_modified_by_type + + # @return [DateTime] The timestamp of resource last modification (UTC) + attr_accessor :last_modified_at + + + # + # Mapper for SystemData class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData', + model_properties: { + created_by: { + client_side_validation: true, + required: false, + serialized_name: 'createdBy', + type: { + name: 'String' + } + }, + created_by_type: { + client_side_validation: true, + required: false, + serialized_name: 'createdByType', + type: { + name: 'String' + } + }, + created_at: { + client_side_validation: true, + required: false, + serialized_name: 'createdAt', + type: { + name: 'DateTime' + } + }, + last_modified_by: { + client_side_validation: true, + required: false, + serialized_name: 'lastModifiedBy', + type: { + name: 'String' + } + }, + last_modified_by_type: { + client_side_validation: true, + required: false, + serialized_name: 'lastModifiedByType', + type: { + name: 'String' + } + }, + last_modified_at: { + client_side_validation: true, + required: false, + serialized_name: 'lastModifiedAt', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic.rb new file mode 100644 index 000000000..fc82a7ab4 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic.rb @@ -0,0 +1,159 @@ +# 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::V2020_10_15_preview + module Models + # + # EventGrid System Topic. + # + class SystemTopic < TrackedResource + + include MsRestAzure + + # @return [ResourceProvisioningState] Provisioning state of the system + # topic. Possible values include: 'Creating', 'Updating', 'Deleting', + # 'Succeeded', 'Canceled', 'Failed' + attr_accessor :provisioning_state + + # @return [String] Source for the system topic. + attr_accessor :source + + # @return [String] TopicType for the system topic. + attr_accessor :topic_type + + # @return [String] Metric resource id for the system topic. + attr_accessor :metric_resource_id + + # @return [IdentityInfo] Identity information for the resource. + attr_accessor :identity + + # @return [SystemData] The system metadata relating to this resource. + attr_accessor :system_data + + + # + # Mapper for SystemTopic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SystemTopic', + type: { + name: 'Composite', + class_name: 'SystemTopic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.source', + type: { + name: 'String' + } + }, + topic_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.topicType', + type: { + name: 'String' + } + }, + metric_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.metricResourceId', + type: { + name: 'String' + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic_update_parameters.rb new file mode 100644 index 000000000..ba814ce33 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic_update_parameters.rb @@ -0,0 +1,66 @@ +# 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::V2020_10_15_preview + module Models + # + # Properties of the System Topic update. + # + class SystemTopicUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the system topic. + attr_accessor :tags + + # @return [IdentityInfo] Resource identity information. + attr_accessor :identity + + + # + # Mapper for SystemTopicUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SystemTopicUpdateParameters', + type: { + name: 'Composite', + class_name: 'SystemTopicUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topics_list_result.rb new file mode 100644 index 000000000..6bff77105 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topics_list_result.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::V2020_10_15_preview + module Models + # + # Result of the List System topics operation. + # + class SystemTopicsListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] A collection of system 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 && !page.next_link.strip.empty? do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [SystemTopicsListResult] 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 SystemTopicsListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SystemTopicsListResult', + type: { + name: 'Composite', + class_name: 'SystemTopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SystemTopicElementType', + type: { + name: 'Composite', + class_name: 'SystemTopic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic.rb new file mode 100644 index 000000000..f86683fa6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic.rb @@ -0,0 +1,278 @@ +# 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::V2020_10_15_preview + module Models + # + # EventGrid Topic + # + class Topic < TrackedResource + + include MsRestAzure + + # @return [Array] + attr_accessor :private_endpoint_connections + + # @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', + # 'CloudEventSchemaV1_0'. 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 + + # @return [String] Metric resource id for the topic. + attr_accessor :metric_resource_id + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled'. Default value: + # 'Enabled' . + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + # @return [ResourceSku] The Sku pricing tier for the topic. Default + # value: Basic . + attr_accessor :sku + + # @return [IdentityInfo] Identity information for the resource. + attr_accessor :identity + + # @return [ResourceKind] Kind of the resource. Possible values include: + # 'Azure', 'AzureArc' + attr_accessor :kind + + # @return [ExtendedLocation] Extended location of the resource. + attr_accessor :extended_location + + # @return [SystemData] The system metadata relating to Topic resource. + attr_accessor :system_data + + + # + # Mapper for Topic class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Topic', + type: { + name: 'Composite', + class_name: 'Topic', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + private_endpoint_connections: { + client_side_validation: true, + required: false, + serialized_name: 'properties.privateEndpointConnections', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PrivateEndpointConnectionElementType', + type: { + name: 'Composite', + class_name: 'PrivateEndpointConnection' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + endpoint: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpoint', + type: { + name: 'String' + } + }, + input_schema: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchema', + default_value: 'EventGridSchema', + type: { + name: 'String' + } + }, + input_schema_mapping: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inputSchemaMapping', + type: { + name: 'Composite', + polymorphic_discriminator: 'inputSchemaMappingType', + uber_parent: 'InputSchemaMapping', + class_name: 'InputSchemaMapping' + } + }, + metric_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.metricResourceId', + type: { + name: 'String' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + default_value: 'Enabled', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + default_value: Basic, + type: { + name: 'Composite', + class_name: 'ResourceSku' + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + kind: { + client_side_validation: true, + required: false, + serialized_name: 'kind', + type: { + name: 'String' + } + }, + extended_location: { + client_side_validation: true, + required: false, + serialized_name: 'extendedLocation', + type: { + name: 'Composite', + class_name: 'ExtendedLocation' + } + }, + system_data: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'systemData', + type: { + name: 'Composite', + class_name: 'SystemData' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb new file mode 100644 index 000000000..57351ec1d --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb new file mode 100644 index 000000000..4df75d924 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb @@ -0,0 +1,46 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicRegenerateKeyRequest', + type: { + name: 'Composite', + class_name: 'TopicRegenerateKeyRequest', + model_properties: { + key_name: { + client_side_validation: true, + required: true, + serialized_name: 'keyName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb new file mode 100644 index 000000000..e2af5dbcb --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb @@ -0,0 +1,57 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicSharedAccessKeys', + type: { + name: 'Composite', + class_name: 'TopicSharedAccessKeys', + model_properties: { + key1: { + client_side_validation: true, + required: false, + serialized_name: 'key1', + type: { + name: 'String' + } + }, + key2: { + client_side_validation: true, + required: false, + serialized_name: 'key2', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb new file mode 100644 index 000000000..333964f29 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb @@ -0,0 +1,169 @@ +# 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::V2020_10_15_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 + + # @return [String] Source resource format. + attr_accessor :source_resource_format + + # @return [Array] Supported source scopes. + attr_accessor :supported_scopes_for_source + + + # + # Mapper for TopicTypeInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypeInfo', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + provider: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provider', + type: { + name: 'String' + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + resource_region_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceRegionType', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + supported_locations: { + client_side_validation: true, + required: false, + serialized_name: 'properties.supportedLocations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + source_resource_format: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sourceResourceFormat', + type: { + name: 'String' + } + }, + supported_scopes_for_source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.supportedScopesForSource', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'enumElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb new file mode 100644 index 000000000..cd730521c --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb new file mode 100644 index 000000000..1094ca1b3 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb @@ -0,0 +1,55 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypesListResult', + type: { + name: 'Composite', + class_name: 'TopicTypesListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopicTypeInfoElementType', + type: { + name: 'Composite', + class_name: 'TopicTypeInfo' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb new file mode 100644 index 000000000..295e5885e --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb @@ -0,0 +1,117 @@ +# 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::V2020_10_15_preview + module Models + # + # Properties of the Topic update + # + class TopicUpdateParameters + + include MsRestAzure + + # @return [Hash{String => String}] Tags of the resource. + attr_accessor :tags + + # @return [IdentityInfo] Resource identity information. + attr_accessor :identity + + # @return [PublicNetworkAccess] This determines if traffic is allowed + # over public network. By default it is enabled. + # You can further restrict to specific IPs by configuring . Possible values include: 'Enabled', 'Disabled'. Default value: + # 'Enabled' . + attr_accessor :public_network_access + + # @return [Array] This can be used to restrict traffic + # from specific IPs instead of all IPs. Note: These are considered only + # if PublicNetworkAccess is enabled. + attr_accessor :inbound_ip_rules + + # @return [ResourceSku] The Sku pricing tier for the topic. + attr_accessor :sku + + + # + # Mapper for TopicUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicUpdateParameters', + type: { + name: 'Composite', + class_name: 'TopicUpdateParameters', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityInfo' + } + }, + public_network_access: { + client_side_validation: true, + required: false, + serialized_name: 'properties.publicNetworkAccess', + default_value: 'Enabled', + type: { + name: 'String' + } + }, + inbound_ip_rules: { + client_side_validation: true, + required: false, + serialized_name: 'properties.inboundIpRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundIpRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundIpRule' + } + } + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'ResourceSku' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb new file mode 100644 index 000000000..bc8fe9584 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.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::V2020_10_15_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 && !page.next_link.strip.empty? 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() + { + client_side_validation: true, + required: false, + serialized_name: 'TopicsListResult', + type: { + name: 'Composite', + class_name: 'TopicsListResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'TopicElementType', + type: { + name: 'Composite', + class_name: 'Topic' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb new file mode 100644 index 000000000..9af1d14cc --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb @@ -0,0 +1,92 @@ +# 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::V2020_10_15_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() + { + client_side_validation: true, + required: false, + serialized_name: 'TrackedResource', + type: { + name: 'Composite', + class_name: 'TrackedResource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/user_identity_properties.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/user_identity_properties.rb new file mode 100644 index 000000000..b3fd4ef77 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/user_identity_properties.rb @@ -0,0 +1,57 @@ +# 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::V2020_10_15_preview + module Models + # + # The information about the user identity. + # + class UserIdentityProperties + + include MsRestAzure + + # @return [String] The principal id of user assigned identity. + attr_accessor :principal_id + + # @return [String] The client id of user assigned identity. + attr_accessor :client_id + + + # + # Mapper for UserIdentityProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserIdentityProperties', + type: { + name: 'Composite', + class_name: 'UserIdentityProperties', + model_properties: { + principal_id: { + client_side_validation: true, + required: false, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + client_id: { + client_side_validation: true, + required: false, + serialized_name: 'clientId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb new file mode 100644 index 000000000..e96d1d062 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb @@ -0,0 +1,148 @@ +# 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::V2020_10_15_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 + + # @return [Integer] Maximum number of events per batch. Default value: 1 + # . + attr_accessor :max_events_per_batch + + # @return [Integer] Preferred batch size in Kilobytes. Default value: 64 + # . + attr_accessor :preferred_batch_size_in_kilobytes + + # @return [String] The Azure Active Directory Tenant ID to get the access + # token that will be included as the bearer token in delivery requests. + attr_accessor :azure_active_directory_tenant_id + + # @return [String] The Azure Active Directory Application ID or URI to + # get the access token that will be included as the bearer token in + # delivery requests. + attr_accessor :azure_active_directory_application_id_or_uri + + # @return [Array] Delivery attribute details. + attr_accessor :delivery_attribute_mappings + + + # + # Mapper for WebHookEventSubscriptionDestination class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WebHook', + type: { + name: 'Composite', + class_name: 'WebHookEventSubscriptionDestination', + model_properties: { + endpointType: { + client_side_validation: true, + required: true, + serialized_name: 'endpointType', + type: { + name: 'String' + } + }, + endpoint_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.endpointUrl', + type: { + name: 'String' + } + }, + endpoint_base_url: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.endpointBaseUrl', + type: { + name: 'String' + } + }, + max_events_per_batch: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxEventsPerBatch', + default_value: 1, + type: { + name: 'Number' + } + }, + preferred_batch_size_in_kilobytes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.preferredBatchSizeInKilobytes', + default_value: 64, + type: { + name: 'Number' + } + }, + azure_active_directory_tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.azureActiveDirectoryTenantId', + type: { + name: 'String' + } + }, + azure_active_directory_application_id_or_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.azureActiveDirectoryApplicationIdOrUri', + type: { + name: 'String' + } + }, + delivery_attribute_mappings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deliveryAttributeMappings', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DeliveryAttributeMappingElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'type', + uber_parent: 'DeliveryAttributeMapping', + class_name: 'DeliveryAttributeMapping' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/module_definition.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/module_definition.rb new file mode 100644 index 000000000..7ee24a804 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-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::V2020_10_15_preview end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/operations.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/operations.rb new file mode 100644 index 000000000..94c55603f --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/operations.rb @@ -0,0 +1,118 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_namespaces.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_namespaces.rb new file mode 100644 index 000000000..2fb02a8f1 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_namespaces.rb @@ -0,0 +1,1333 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PartnerNamespaces + include MsRestAzure + + # + # Creates and initializes a new instance of the PartnerNamespaces 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 partner namespace. + # + # Get properties of a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespace] operation results. + # + def get(resource_group_name, partner_namespace_name, custom_headers:nil) + response = get_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a partner namespace. + # + # Get properties of a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_name, custom_headers:nil) + get_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + end + + # + # Get a partner namespace. + # + # Get properties of a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}' + + 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,'partnerNamespaceName' => partner_namespace_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespace.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 partner namespace. + # + # Asynchronously creates a new partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_info [PartnerNamespace] PartnerNamespace + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespace] operation results. + # + def create_or_update(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers: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 partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_info [PartnerNamespace] PartnerNamespace + # 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, partner_namespace_name, partner_namespace_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespace.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 partner namespace. + # + # Delete existing partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, partner_namespace_name, custom_headers:nil) + response = delete_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, partner_namespace_name, custom_headers: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 partner namespace. + # + # Asynchronously updates a partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_update_parameters [PartnerNamespaceUpdateParameters] + # Partner namespace update information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespace] operation results. + # + def update(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers: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 partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_update_parameters [PartnerNamespaceUpdateParameters] + # Partner namespace 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, partner_namespace_name, partner_namespace_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespace.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 partner namespaces under an Azure subscription. + # + # List all the partner namespaces under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner namespaces under an Azure subscription. + # + # List all the partner namespaces under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner namespaces under an Azure subscription. + # + # List all the partner namespaces under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespacesListResult.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 partner namespaces under a resource group. + # + # List all the partner namespaces under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner namespaces under a resource group. + # + # List all the partner namespaces under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner namespaces under a resource group. + # + # List all the partner namespaces under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespacesListResult.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 partner namespace. + # + # List the two keys used to publish to a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespaceSharedAccessKeys] operation results. + # + def list_shared_access_keys(resource_group_name, partner_namespace_name, custom_headers:nil) + response = list_shared_access_keys_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List keys for a partner namespace. + # + # List the two keys used to publish to a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_name, custom_headers:nil) + list_shared_access_keys_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + end + + # + # List keys for a partner namespace. + # + # List the two keys used to publish to a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}/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,'partnerNamespaceName' => partner_namespace_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespaceSharedAccessKeys.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 partner namespace. + # + # Regenerate a shared access key for a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param regenerate_key_request [PartnerNamespaceRegenerateKeyRequest] 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 [PartnerNamespaceSharedAccessKeys] operation results. + # + def regenerate_key(resource_group_name, partner_namespace_name, regenerate_key_request, custom_headers:nil) + response = regenerate_key_async(resource_group_name, partner_namespace_name, regenerate_key_request, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerate key for a partner namespace. + # + # Regenerate a shared access key for a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param regenerate_key_request [PartnerNamespaceRegenerateKeyRequest] 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, partner_namespace_name, regenerate_key_request, custom_headers:nil) + regenerate_key_async(resource_group_name, partner_namespace_name, regenerate_key_request, custom_headers:custom_headers).value! + end + + # + # Regenerate key for a partner namespace. + # + # Regenerate a shared access key for a partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param regenerate_key_request [PartnerNamespaceRegenerateKeyRequest] 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, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceRegenerateKeyRequest.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/partnerNamespaces/{partnerNamespaceName}/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,'partnerNamespaceName' => partner_namespace_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespaceSharedAccessKeys.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 partner namespace. + # + # Asynchronously creates a new partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_info [PartnerNamespace] PartnerNamespace + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespace] operation results. + # + def begin_create_or_update(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a partner namespace. + # + # Asynchronously creates a new partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_info [PartnerNamespace] PartnerNamespace + # 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, partner_namespace_name, partner_namespace_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, partner_namespace_name, partner_namespace_info, custom_headers:custom_headers).value! + end + + # + # Create a partner namespace. + # + # Asynchronously creates a new partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_info [PartnerNamespace] PartnerNamespace + # 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, partner_namespace_name, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, 'partner_namespace_info is nil' if partner_namespace_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespace.mapper() + request_content = @client.serialize(request_mapper, partner_namespace_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}' + + 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,'partnerNamespaceName' => partner_namespace_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespace.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 partner namespace. + # + # Delete existing partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a partner namespace. + # + # Delete existing partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_name, custom_headers:nil) + begin_delete_async(resource_group_name, partner_namespace_name, custom_headers:custom_headers).value! + end + + # + # Delete a partner namespace. + # + # Delete existing partner namespace. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @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, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerNamespaces/{partnerNamespaceName}' + + 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,'partnerNamespaceName' => partner_namespace_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a partner namespace. + # + # Asynchronously updates a partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_update_parameters [PartnerNamespaceUpdateParameters] + # Partner namespace update information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespace] operation results. + # + def begin_update(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a partner namespace. + # + # Asynchronously updates a partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_update_parameters [PartnerNamespaceUpdateParameters] + # Partner namespace 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, partner_namespace_name, partner_namespace_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, partner_namespace_name, partner_namespace_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a partner namespace. + # + # Asynchronously updates a partner namespace with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_namespace_name [String] Name of the partner namespace. + # @param partner_namespace_update_parameters [PartnerNamespaceUpdateParameters] + # Partner namespace 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, partner_namespace_name, partner_namespace_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, 'partner_namespace_name is nil' if partner_namespace_name.nil? + fail ArgumentError, 'partner_namespace_update_parameters is nil' if partner_namespace_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, partner_namespace_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}' + + 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,'partnerNamespaceName' => partner_namespace_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespace.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 partner namespaces under an Azure subscription. + # + # List all the partner namespaces 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 [PartnerNamespacesListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner namespaces under an Azure subscription. + # + # List all the partner namespaces 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:custom_headers).value! + end + + # + # List partner namespaces under an Azure subscription. + # + # List all the partner namespaces 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespacesListResult.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 partner namespaces under a resource group. + # + # List all the partner namespaces 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 [PartnerNamespacesListResult] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner namespaces under a resource group. + # + # List all the partner namespaces 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:custom_headers).value! + end + + # + # List partner namespaces under a resource group. + # + # List all the partner namespaces 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerNamespacesListResult.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 partner namespaces under an Azure subscription. + # + # List all the partner namespaces under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespacesListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + # + # List partner namespaces under a resource group. + # + # List all the partner namespaces under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerNamespacesListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_registrations.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_registrations.rb new file mode 100644 index 000000000..78a04f5d4 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_registrations.rb @@ -0,0 +1,1074 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PartnerRegistrations + include MsRestAzure + + # + # Creates and initializes a new instance of the PartnerRegistrations 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 partner registration. + # + # Gets a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistration] operation results. + # + def get(resource_group_name, partner_registration_name, custom_headers:nil) + response = get_async(resource_group_name, partner_registration_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a partner registration. + # + # Gets a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @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, partner_registration_name, custom_headers:nil) + get_async(resource_group_name, partner_registration_name, custom_headers:custom_headers).value! + end + + # + # Get a partner registration. + # + # Gets a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @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, partner_registration_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, 'partner_registration_name is nil' if partner_registration_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerRegistrations/{partnerRegistrationName}' + + 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,'partnerRegistrationName' => partner_registration_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistration.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 partner registration. + # + # Creates a new partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_info [PartnerRegistration] PartnerRegistration + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistration] operation results. + # + def create_or_update(resource_group_name, partner_registration_name, partner_registration_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, partner_registration_name, partner_registration_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a partner registration. + # + # Creates a new partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_info [PartnerRegistration] PartnerRegistration + # 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 create_or_update_with_http_info(resource_group_name, partner_registration_name, partner_registration_info, custom_headers:nil) + create_or_update_async(resource_group_name, partner_registration_name, partner_registration_info, custom_headers:custom_headers).value! + end + + # + # Create a partner registration. + # + # Creates a new partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_info [PartnerRegistration] PartnerRegistration + # 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 create_or_update_async(resource_group_name, partner_registration_name, partner_registration_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, 'partner_registration_name is nil' if partner_registration_name.nil? + fail ArgumentError, 'partner_registration_info is nil' if partner_registration_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistration.mapper() + request_content = @client.serialize(request_mapper, partner_registration_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}' + + 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,'partnerRegistrationName' => partner_registration_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 == 200 || status_code == 202 + 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistration.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 + # Deserialize Response + if status_code == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistration.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 partner registration. + # + # Deletes a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, partner_registration_name, custom_headers:nil) + response = delete_async(resource_group_name, partner_registration_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a partner registration. + # + # Deletes a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @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 delete_with_http_info(resource_group_name, partner_registration_name, custom_headers:nil) + delete_async(resource_group_name, partner_registration_name, custom_headers:custom_headers).value! + end + + # + # Delete a partner registration. + # + # Deletes a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @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 delete_async(resource_group_name, partner_registration_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, 'partner_registration_name is nil' if partner_registration_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerRegistrations/{partnerRegistrationName}' + + 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,'partnerRegistrationName' => partner_registration_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a partner registration. + # + # Updates a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_update_parameters + # [PartnerRegistrationUpdateParameters] Partner registration update + # information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistration] operation results. + # + def update(resource_group_name, partner_registration_name, partner_registration_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, partner_registration_name, partner_registration_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a partner registration. + # + # Updates a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_update_parameters + # [PartnerRegistrationUpdateParameters] Partner registration 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 update_with_http_info(resource_group_name, partner_registration_name, partner_registration_update_parameters, custom_headers:nil) + update_async(resource_group_name, partner_registration_name, partner_registration_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a partner registration. + # + # Updates a partner registration with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_registration_name [String] Name of the partner registration. + # @param partner_registration_update_parameters + # [PartnerRegistrationUpdateParameters] Partner registration 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 update_async(resource_group_name, partner_registration_name, partner_registration_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, 'partner_registration_name is nil' if partner_registration_name.nil? + fail ArgumentError, 'partner_registration_update_parameters is nil' if partner_registration_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, partner_registration_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}' + + 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,'partnerRegistrationName' => partner_registration_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistration.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 partner registrations under an Azure subscription. + # + # List all the partner registrations under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner registrations under an Azure subscription. + # + # List all the partner registrations under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner registrations under an Azure subscription. + # + # List all the partner registrations under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerRegistrations' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistrationsListResult.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 partner registrations under a resource group. + # + # List all the partner registrations under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner registrations under a resource group. + # + # List all the partner registrations under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner registrations under a resource group. + # + # List all the partner registrations under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerRegistrations' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistrationsListResult.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 available partners registrations. + # + # List all partners registrations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistrationsListResult] operation results. + # + def list(custom_headers:nil) + response = list_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List all available partners registrations. + # + # List all partners registrations. + # + # @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:custom_headers).value! + end + + # + # List all available partners registrations. + # + # List all partners registrations. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerRegistrations' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistrationsListResult.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 partner registrations under an Azure subscription. + # + # List all the partner registrations 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 [PartnerRegistrationsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner registrations under an Azure subscription. + # + # List all the partner registrations 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:custom_headers).value! + end + + # + # List partner registrations under an Azure subscription. + # + # List all the partner registrations 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistrationsListResult.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 partner registrations under a resource group. + # + # List all the partner registrations 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 [PartnerRegistrationsListResult] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner registrations under a resource group. + # + # List all the partner registrations 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:custom_headers).value! + end + + # + # List partner registrations under a resource group. + # + # List all the partner registrations 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerRegistrationsListResult.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 partner registrations under an Azure subscription. + # + # List all the partner registrations under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistrationsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + # + # List partner registrations under a resource group. + # + # List all the partner registrations under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerRegistrationsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topic_event_subscriptions.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topic_event_subscriptions.rb new file mode 100644 index 000000000..32c4aea99 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topic_event_subscriptions.rb @@ -0,0 +1,1156 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PartnerTopicEventSubscriptions + include MsRestAzure + + # + # Creates and initializes a new instance of the PartnerTopicEventSubscriptions 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 of a partner topic. + # + # Get an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # found. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + response = get_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get an event subscription of a partner topic. + # + # Get an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # found. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_name, custom_headers:nil) + get_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get an event subscription of a partner topic. + # + # Get an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # found. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 of a partner topic. + # + # Asynchronously creates or updates an event subscription of a partner topic + # with the specified parameters. Existing event subscriptions will be updated + # with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers: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 partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 of a partner topic. + # + # Delete an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + response = delete_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers: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 event subscription of a partner topic. + # + # Update event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers: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 partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 of a partner topic. + # + # Get the full endpoint URL for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + response = get_full_url_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get full URL of an event subscription of a partner topic. + # + # Get the full endpoint URL for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + get_full_url_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get full URL of an event subscription of a partner topic. + # + # Get the full endpoint URL for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_topic(resource_group_name, partner_topic_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_partner_topic_as_lazy(resource_group_name, partner_topic_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_topic_with_http_info(resource_group_name, partner_topic_name, filter:nil, top:nil, custom_headers:nil) + list_by_partner_topic_async(resource_group_name, partner_topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_topic_async(resource_group_name, partner_topic_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/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,'partnerTopicName' => partner_topic_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 delivery attributes for an event subscription of a partner topic. + # + # Get all delivery attributes for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DeliveryAttributeListResult] operation results. + # + def get_delivery_attributes(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + response = get_delivery_attributes_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get delivery attributes for an event subscription of a partner topic. + # + # Get all delivery attributes for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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_delivery_attributes_with_http_info(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:nil) + get_delivery_attributes_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get delivery attributes for an event subscription of a partner topic. + # + # Get all delivery attributes for an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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_delivery_attributes_async(resource_group_name, partner_topic_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::DeliveryAttributeListResult.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 of a partner topic. + # + # Asynchronously creates or updates an event subscription of a partner topic + # with the specified parameters. Existing event subscriptions will be updated + # with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an event subscription of a partner topic. + # + # Asynchronously creates or updates an event subscription of a partner topic + # with the specified parameters. Existing event subscriptions will be updated + # with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + end + + # + # Create or update an event subscription of a partner topic. + # + # Asynchronously creates or updates an event subscription of a partner topic + # with the specified parameters. Existing event subscriptions will be updated + # with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 of a partner topic. + # + # Delete an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete an event subscription of a partner topic. + # + # Delete an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_name, custom_headers:nil) + begin_delete_async(resource_group_name, partner_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Delete an event subscription of a partner topic. + # + # Delete an event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, partner_topic_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update event subscription of a partner topic. + # + # Update event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update event subscription of a partner topic. + # + # Update event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update event subscription of a partner topic. + # + # Update event subscription of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, partner_topic_name, event_subscription_name, event_subscription_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, 'partner_topic_name is nil' if partner_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'partnerTopicName' => partner_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner 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_partner_topic_next(next_page_link, custom_headers:nil) + response = list_by_partner_topic_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner 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_partner_topic_next_with_http_info(next_page_link, custom_headers:nil) + list_by_partner_topic_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner 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_partner_topic_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 event subscriptions of a partner topic. + # + # List event subscriptions that belong to a specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_partner_topic_as_lazy(resource_group_name, partner_topic_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_partner_topic_async(resource_group_name, partner_topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_partner_topic_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topics.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topics.rb new file mode 100644 index 000000000..1cde02aa6 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topics.rb @@ -0,0 +1,1102 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PartnerTopics + include MsRestAzure + + # + # Creates and initializes a new instance of the PartnerTopics 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 partner topic. + # + # Get properties of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopic] operation results. + # + def get(resource_group_name, partner_topic_name, custom_headers:nil) + response = get_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a partner topic. + # + # Get properties of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_topic_name, custom_headers:nil) + get_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + end + + # + # Get a partner topic. + # + # Get properties of a partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}' + + 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,'partnerTopicName' => partner_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopic.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 partner topic. + # + # Delete existing partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_topic_name, custom_headers:nil) + response = delete_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_topic_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, partner_topic_name, custom_headers: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 partner topic. + # + # Asynchronously updates a partner topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param partner_topic_update_parameters [PartnerTopicUpdateParameters] + # PartnerTopic update information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopic] operation results. + # + def update(resource_group_name, partner_topic_name, partner_topic_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, partner_topic_name, partner_topic_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a partner topic. + # + # Asynchronously updates a partner topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param partner_topic_update_parameters [PartnerTopicUpdateParameters] + # PartnerTopic 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 update_with_http_info(resource_group_name, partner_topic_name, partner_topic_update_parameters, custom_headers:nil) + update_async(resource_group_name, partner_topic_name, partner_topic_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a partner topic. + # + # Asynchronously updates a partner topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param partner_topic_update_parameters [PartnerTopicUpdateParameters] + # PartnerTopic 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 update_async(resource_group_name, partner_topic_name, partner_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, 'partner_topic_update_parameters is nil' if partner_topic_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, partner_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/partnerTopics/{partnerTopicName}' + + 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,'partnerTopicName' => partner_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopic.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 partner topics under an Azure subscription. + # + # List all the partner topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner topics under an Azure subscription. + # + # List all the partner topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner topics under an Azure subscription. + # + # List all the partner topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopicsListResult.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 partner topics under a resource group. + # + # List all the partner topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List partner topics under a resource group. + # + # List all the partner topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List partner topics under a resource group. + # + # List all the partner topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopicsListResult.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 + + # + # Activate a partner topic. + # + # Activate a newly created partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopic] operation results. + # + def activate(resource_group_name, partner_topic_name, custom_headers:nil) + response = activate_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Activate a partner topic. + # + # Activate a newly created partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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 activate_with_http_info(resource_group_name, partner_topic_name, custom_headers:nil) + activate_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + end + + # + # Activate a partner topic. + # + # Activate a newly created partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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 activate_async(resource_group_name, partner_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/activate' + + 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,'partnerTopicName' => partner_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopic.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 + + # + # Deactivate a partner topic. + # + # Deactivate specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopic] operation results. + # + def deactivate(resource_group_name, partner_topic_name, custom_headers:nil) + response = deactivate_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Deactivate a partner topic. + # + # Deactivate specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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 deactivate_with_http_info(resource_group_name, partner_topic_name, custom_headers:nil) + deactivate_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + end + + # + # Deactivate a partner topic. + # + # Deactivate specific partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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 deactivate_async(resource_group_name, partner_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}/deactivate' + + 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,'partnerTopicName' => partner_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopic.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 partner topic. + # + # Delete existing partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_topic_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a partner topic. + # + # Delete existing partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_topic_name, custom_headers:nil) + begin_delete_async(resource_group_name, partner_topic_name, custom_headers:custom_headers).value! + end + + # + # Delete a partner topic. + # + # Delete existing partner topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param partner_topic_name [String] Name of the partner 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, partner_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, 'partner_topic_name is nil' if partner_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/partnerTopics/{partnerTopicName}' + + 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,'partnerTopicName' => partner_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # List partner topics under an Azure subscription. + # + # List all the partner 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 [PartnerTopicsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner topics under an Azure subscription. + # + # List all the partner 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:custom_headers).value! + end + + # + # List partner topics under an Azure subscription. + # + # List all the partner 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopicsListResult.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 partner topics under a resource group. + # + # List all the partner 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 [PartnerTopicsListResult] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List partner topics under a resource group. + # + # List all the partner 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:custom_headers).value! + end + + # + # List partner topics under a resource group. + # + # List all the partner 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PartnerTopicsListResult.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 partner topics under an Azure subscription. + # + # List all the partner topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopicsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + # + # List partner topics under a resource group. + # + # List all the partner topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PartnerTopicsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_endpoint_connections.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_endpoint_connections.rb new file mode 100644 index 000000000..dd4bb1fd7 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_endpoint_connections.rb @@ -0,0 +1,791 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PrivateEndpointConnections + include MsRestAzure + + # + # Creates and initializes a new instance of the PrivateEndpointConnections 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 specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def get(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = get_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + get_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + end + + # + # Get a specific private endpoint connection. + # + # Get a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + 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,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateEndpointConnection.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 + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def update(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + response = update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: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 parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @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, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnection.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 specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers: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 + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/{parentType}/{parentName}/privateEndpointConnections' + + 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,'parentType' => parent_type,'parentName' => parent_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateEndpointConnectionListResult.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 + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnection] operation results. + # + def begin_update(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + response = begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @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, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil) + begin_update_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value! + end + + # + # Update a specific private endpoint connection. + # + # Update a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @param private_endpoint_connection [PrivateEndpointConnection] The private + # endpoint connection object to update. + # @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, parent_type, parent_name, private_endpoint_connection_name, private_endpoint_connection, 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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, 'private_endpoint_connection is nil' if private_endpoint_connection.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnection.mapper() + request_content = @client.serialize(request_mapper, private_endpoint_connection) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + 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,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateEndpointConnection.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 + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnection.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 specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_name, custom_headers:nil) + begin_delete_async(resource_group_name, parent_type, parent_name, private_endpoint_connection_name, custom_headers:custom_headers).value! + end + + # + # Delete a specific private endpoint connection. + # + # Delete a specific private endpoint connection under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_endpoint_connection_name [String] The name of the private + # endpoint connection connection. + # @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, parent_type, parent_name, private_endpoint_connection_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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}' + + 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,'parentType' => parent_type,'parentName' => parent_name,'privateEndpointConnectionName' => private_endpoint_connection_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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or 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 [PrivateEndpointConnectionListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers:nil) + response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or 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_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or 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_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateEndpointConnectionListResult.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 + + # + # Lists all private endpoint connections under a resource. + # + # Get all private endpoint connections under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [Enum] The type of the parent resource. This can be either + # \'topics\' or \'domains\'. Possible values include: 'topics', 'domains' + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateEndpointConnectionListResult] which provide lazy access to + # pages of the response. + # + def list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_link_resources.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_link_resources.rb new file mode 100644 index 000000000..8a2d30f9b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_link_resources.rb @@ -0,0 +1,423 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class PrivateLinkResources + include MsRestAzure + + # + # Creates and initializes a new instance of the PrivateLinkResources 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 private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateLinkResource] operation results. + # + def get(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil) + response = get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @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, parent_type, parent_name, private_link_resource_name, custom_headers:nil) + get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value! + end + + # + # Get a private link resource. + # + # Get properties of a private link resource. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param private_link_resource_name [String] The name of private link resource. + # @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, parent_type, parent_name, private_link_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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, 'private_link_resource_name is nil' if private_link_resource_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}' + + 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,'parentType' => parent_type,'parentName' => parent_name,'privateLinkResourceName' => private_link_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateLinkResource.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 private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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, parent_type, parent_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, 'parent_type is nil' if parent_type.nil? + fail ArgumentError, 'parent_name is nil' if parent_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/{parentType}/{parentName}/privateLinkResources' + + 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,'parentType' => parent_type,'parentName' => parent_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateLinkResourcesListResult.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 private link resources under specific topic or domain. + # + # List all the private link resources under a topic or 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 [PrivateLinkResourcesListResult] operation results. + # + def list_by_resource_next(next_page_link, custom_headers:nil) + response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or 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_resource_next_with_http_info(next_page_link, custom_headers:nil) + list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List private link resources under specific topic or domain. + # + # List all the private link resources under a topic or 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_resource_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::PrivateLinkResourcesListResult.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 private link resources under specific topic or domain. + # + # List all the private link resources under a topic or domain. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param parent_type [String] The type of the parent resource. This can be + # either \'topics\' or \'domains\'. + # @param parent_name [String] The name of the parent resource (namely, either, + # the topic name or domain name). + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PrivateLinkResourcesListResult] which provide lazy access to pages + # of the response. + # + def list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topic_event_subscriptions.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topic_event_subscriptions.rb new file mode 100644 index 000000000..0e99c9a0b --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topic_event_subscriptions.rb @@ -0,0 +1,1152 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class SystemTopicEventSubscriptions + include MsRestAzure + + # + # Creates and initializes a new instance of the SystemTopicEventSubscriptions 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 of a system topic. + # + # Get an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + response = get_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get an event subscription of a system topic. + # + # Get an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_name, custom_headers:nil) + get_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get an event subscription of a system topic. + # + # Get an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 for a system topic. + # + # Asynchronously creates or updates an event subscription with the specified + # parameters. Existing event subscriptions will be updated with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers: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 system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 of a system topic. + # + # Delete an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + response = delete_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers: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 event subscription of a system topic. + # + # Update event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers: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 system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 of a system topic + # + # Get the full endpoint URL for an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + response = get_full_url_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get full URL of an event subscription of a system topic + # + # Get the full endpoint URL for an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + get_full_url_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get full URL of an event subscription of a system topic + # + # Get the full endpoint URL for an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_system_topic(resource_group_name, system_topic_name, filter:nil, top:nil, custom_headers:nil) + first_page = list_by_system_topic_as_lazy(resource_group_name, system_topic_name, filter:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_system_topic_with_http_info(resource_group_name, system_topic_name, filter:nil, top:nil, custom_headers:nil) + list_by_system_topic_async(resource_group_name, system_topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_system_topic_async(resource_group_name, system_topic_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, 'system_topic_name is nil' if system_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}/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,'systemTopicName' => system_topic_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 delivery attributes for an event subscription. + # + # Get all delivery attributes for an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DeliveryAttributeListResult] operation results. + # + def get_delivery_attributes(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + response = get_delivery_attributes_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get delivery attributes for an event subscription. + # + # Get all delivery attributes for an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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_delivery_attributes_with_http_info(resource_group_name, system_topic_name, event_subscription_name, custom_headers:nil) + get_delivery_attributes_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Get delivery attributes for an event subscription. + # + # Get all delivery attributes for an event subscription. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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_delivery_attributes_async(resource_group_name, system_topic_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::DeliveryAttributeListResult.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 for a system topic. + # + # Asynchronously creates or updates an event subscription with the specified + # parameters. Existing event subscriptions will be updated with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update an event subscription for a system topic. + # + # Asynchronously creates or updates an event subscription with the specified + # parameters. Existing event subscriptions will be updated with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value! + end + + # + # Create or update an event subscription for a system topic. + # + # Asynchronously creates or updates an event subscription with the specified + # parameters. Existing event subscriptions will be updated with this API. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 of a system topic. + # + # Delete an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete an event subscription of a system topic. + # + # Delete an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_name, custom_headers:nil) + begin_delete_async(resource_group_name, system_topic_name, event_subscription_name, custom_headers:custom_headers).value! + end + + # + # Delete an event subscription of a system topic. + # + # Delete an event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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, system_topic_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update event subscription of a system topic. + # + # Update event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update event subscription of a system topic. + # + # Update event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, system_topic_name, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update event subscription of a system topic. + # + # Update event subscription of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param event_subscription_name [String] Name of the event subscription to be + # created. Event subscription names must be between 3 and 100 characters in + # length and use alphanumeric letters only. + # @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(resource_group_name, system_topic_name, event_subscription_name, event_subscription_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, 'system_topic_name is nil' if system_topic_name.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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}' + + 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,'systemTopicName' => system_topic_name,'eventSubscriptionName' => event_subscription_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system 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_system_topic_next(next_page_link, custom_headers:nil) + response = list_by_system_topic_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system 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_system_topic_next_with_http_info(next_page_link, custom_headers:nil) + list_by_system_topic_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system 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_system_topic_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 event subscriptions of a system topic. + # + # List event subscriptions that belong to a specific system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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_system_topic_as_lazy(resource_group_name, system_topic_name, filter:nil, top:nil, custom_headers:nil) + response = list_by_system_topic_async(resource_group_name, system_topic_name, filter:filter, top:top, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_system_topic_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topics.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topics.rb new file mode 100644 index 000000000..e27ff1077 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topics.rb @@ -0,0 +1,1128 @@ +# 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::V2020_10_15_preview + # + # Azure EventGrid Management Client + # + class SystemTopics + include MsRestAzure + + # + # Creates and initializes a new instance of the SystemTopics 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 system topic. + # + # Get properties of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopic] operation results. + # + def get(resource_group_name, system_topic_name, custom_headers:nil) + response = get_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get a system topic. + # + # Get properties of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_topic_name, custom_headers:nil) + get_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value! + end + + # + # Get a system topic. + # + # Get properties of a system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_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, 'system_topic_name is nil' if system_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}' + + 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,'systemTopicName' => system_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopic.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 system topic. + # + # Asynchronously creates a new system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_info [SystemTopic] System Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopic] operation results. + # + def create_or_update(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil) + response = create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers: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 system_topic_name [String] Name of the system topic. + # @param system_topic_info [SystemTopic] System 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, system_topic_name, system_topic_info, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.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 system topic. + # + # Delete existing system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_topic_name, custom_headers:nil) + response = delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_topic_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, system_topic_name, custom_headers: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 system topic. + # + # Asynchronously updates a system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_update_parameters [SystemTopicUpdateParameters] + # SystemTopic update information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopic] operation results. + # + def update(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil) + response = update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers: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 system_topic_name [String] Name of the system topic. + # @param system_topic_update_parameters [SystemTopicUpdateParameters] + # SystemTopic 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, system_topic_name, system_topic_update_parameters, custom_headers:nil) + # Send request + promise = begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.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 system topics under an Azure subscription. + # + # List all the system topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List system topics under an Azure subscription. + # + # List all the system topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List system topics under an Azure subscription. + # + # List all the system topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopicsListResult.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 system topics under a resource group. + # + # List all the system topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List system topics under a resource group. + # + # List all the system topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List system topics under a resource group. + # + # List all the system topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics' + + 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopicsListResult.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 system topic. + # + # Asynchronously creates a new system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_info [SystemTopic] System Topic information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopic] operation results. + # + def begin_create_or_update(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create a system topic. + # + # Asynchronously creates a new system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_info [SystemTopic] System 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, system_topic_name, system_topic_info, custom_headers:nil) + begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers).value! + end + + # + # Create a system topic. + # + # Asynchronously creates a new system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_info [SystemTopic] System 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, system_topic_name, system_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, 'system_topic_name is nil' if system_topic_name.nil? + fail ArgumentError, 'system_topic_info is nil' if system_topic_info.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper() + request_content = @client.serialize(request_mapper, system_topic_info) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}' + + 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,'systemTopicName' => system_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopic.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 + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.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 system topic. + # + # Delete existing system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_topic_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete a system topic. + # + # Delete existing system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_topic_name, custom_headers:nil) + begin_delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value! + end + + # + # Delete a system topic. + # + # Delete existing system topic. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system 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, system_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, 'system_topic_name is nil' if system_topic_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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/systemTopics/{systemTopicName}' + + 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,'systemTopicName' => system_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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? + + result + end + + promise.execute + end + + # + # Update a system topic. + # + # Asynchronously updates a system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_update_parameters [SystemTopicUpdateParameters] + # SystemTopic update information. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopic] operation results. + # + def begin_update(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil) + response = begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Update a system topic. + # + # Asynchronously updates a system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_update_parameters [SystemTopicUpdateParameters] + # SystemTopic 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, system_topic_name, system_topic_update_parameters, custom_headers:nil) + begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers).value! + end + + # + # Update a system topic. + # + # Asynchronously updates a system topic with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param system_topic_name [String] Name of the system topic. + # @param system_topic_update_parameters [SystemTopicUpdateParameters] + # SystemTopic 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, system_topic_name, system_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, 'system_topic_name is nil' if system_topic_name.nil? + fail ArgumentError, 'system_topic_update_parameters is nil' if system_topic_update_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, system_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/systemTopics/{systemTopicName}' + + 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,'systemTopicName' => system_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopic.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 + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.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 system topics under an Azure subscription. + # + # List all the system 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 [SystemTopicsListResult] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List system topics under an Azure subscription. + # + # List all the system 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:custom_headers).value! + end + + # + # List system topics under an Azure subscription. + # + # List all the system 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopicsListResult.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 system topics under a resource group. + # + # List all the system 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 [SystemTopicsListResult] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List system topics under a resource group. + # + # List all the system 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:custom_headers).value! + end + + # + # List system topics under a resource group. + # + # List all the system 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_preview::Models::SystemTopicsListResult.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 system topics under an Azure subscription. + # + # List all the system topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopicsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + # + # List system topics under a resource group. + # + # List all the system topics under a resource group. + # + # @param resource_group_name [String] The name of the resource group within the + # user's subscription. + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SystemTopicsListResult] 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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topic_types.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topic_types.rb new file mode 100644 index 000000000..ee222dc25 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topic_types.rb @@ -0,0 +1,305 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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/2020-10-15-preview/generated/azure_mgmt_event_grid/topics.rb b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topics.rb new file mode 100644 index 000000000..7d2b268e8 --- /dev/null +++ b/management/azure_mgmt_event_grid/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topics.rb @@ -0,0 +1,1489 @@ +# 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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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: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: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: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:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers:custom_headers).value! + end + + # + # List topics under an Azure subscription. + # + # List all the topics under an Azure subscription. + # + # @param filter [String] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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 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 [Concurrent::Promise] promise which provides async access to http + # response. + # + def regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + # Send request + promise = begin_regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicSharedAccessKeys.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 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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 == 200 || 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 + + # + # 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 begin_regenerate_key(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + response = begin_regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers: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 begin_regenerate_key_with_http_info(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil) + begin_regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers: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 begin_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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_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 || status_code == 202 + 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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 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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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: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: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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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? + result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? + result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_10_15_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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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: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] The query used to filter the search results using + # OData syntax. Filtering is permitted on the 'name' property only and with + # limited number of OData operations. These operations are: the 'contains' + # function as well as the following logical operations: not, and, or, eq (for + # equal), and ne (for not equal). No arithmetic operations are supported. The + # following is a valid filter example: $filter=contains(namE, 'PATTERN') and + # name ne 'PATTERN-1'. The following is not a valid filter example: + # $filter=location eq 'westus'. + # @param top [Integer] The number of results to return per page for the list + # operation. Valid range for top parameter is 1 to 100. If not specified, the + # default number of results to be returned is 20 items per page. + # @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:filter, top:top, custom_headers: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:custom_headers) + end + page + end + end + + end +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 d1dbe89f0..5cbb782b4 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 @@ -2,15 +2,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -require '2020-01-01-preview/generated/azure_mgmt_event_grid' +require '2017-09-15-preview/generated/azure_mgmt_event_grid' +require '2020-06-01/generated/azure_mgmt_event_grid' +require '2017-06-15-preview/generated/azure_mgmt_event_grid' require '2018-05-01-preview/generated/azure_mgmt_event_grid' require '2018-09-15-preview/generated/azure_mgmt_event_grid' -require '2017-09-15-preview/generated/azure_mgmt_event_grid' -require '2019-01-01/generated/azure_mgmt_event_grid' -require '2017-06-15-preview/generated/azure_mgmt_event_grid' -require '2020-06-01/generated/azure_mgmt_event_grid' -require '2018-01-01/generated/azure_mgmt_event_grid' require '2019-06-01/generated/azure_mgmt_event_grid' -require '2019-02-01-preview/generated/azure_mgmt_event_grid' +require '2020-10-15-preview/generated/azure_mgmt_event_grid' require '2020-04-01-preview/generated/azure_mgmt_event_grid' +require '2020-01-01-preview/generated/azure_mgmt_event_grid' +require '2019-02-01-preview/generated/azure_mgmt_event_grid' +require '2018-01-01/generated/azure_mgmt_event_grid' +require '2019-01-01/generated/azure_mgmt_event_grid' require 'profiles/latest/eventgrid_latest_profile_client' diff --git a/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb b/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb index c7964d62e..96c9329d9 100644 --- a/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb +++ b/management/azure_mgmt_event_grid/lib/profiles/latest/modules/eventgrid_profile_module.rb @@ -6,96 +6,159 @@ require 'azure_mgmt_event_grid' module Azure::EventGrid::Profiles::Latest module Mgmt - Domains = Azure::EventGrid::Mgmt::V2020_06_01::Domains - DomainTopics = Azure::EventGrid::Mgmt::V2020_06_01::DomainTopics - EventSubscriptions = Azure::EventGrid::Mgmt::V2020_06_01::EventSubscriptions - Operations = Azure::EventGrid::Mgmt::V2020_06_01::Operations - Topics = Azure::EventGrid::Mgmt::V2020_06_01::Topics - PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_06_01::PrivateEndpointConnections - PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_06_01::PrivateLinkResources - TopicTypes = Azure::EventGrid::Mgmt::V2020_06_01::TopicTypes + Domains = Azure::EventGrid::Mgmt::V2020_10_15_preview::Domains + DomainTopics = Azure::EventGrid::Mgmt::V2020_10_15_preview::DomainTopics + EventChannels = Azure::EventGrid::Mgmt::V2020_10_15_preview::EventChannels + EventSubscriptions = Azure::EventGrid::Mgmt::V2020_10_15_preview::EventSubscriptions + SystemTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_10_15_preview::SystemTopicEventSubscriptions + PartnerTopicEventSubscriptions = Azure::EventGrid::Mgmt::V2020_10_15_preview::PartnerTopicEventSubscriptions + Operations = Azure::EventGrid::Mgmt::V2020_10_15_preview::Operations + PartnerNamespaces = Azure::EventGrid::Mgmt::V2020_10_15_preview::PartnerNamespaces + PartnerRegistrations = Azure::EventGrid::Mgmt::V2020_10_15_preview::PartnerRegistrations + PartnerTopics = Azure::EventGrid::Mgmt::V2020_10_15_preview::PartnerTopics + PrivateEndpointConnections = Azure::EventGrid::Mgmt::V2020_10_15_preview::PrivateEndpointConnections + PrivateLinkResources = Azure::EventGrid::Mgmt::V2020_10_15_preview::PrivateLinkResources + SystemTopics = Azure::EventGrid::Mgmt::V2020_10_15_preview::SystemTopics + Topics = Azure::EventGrid::Mgmt::V2020_10_15_preview::Topics + ExtensionTopics = Azure::EventGrid::Mgmt::V2020_10_15_preview::ExtensionTopics + TopicTypes = Azure::EventGrid::Mgmt::V2020_10_15_preview::TopicTypes module Models - AdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter - EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter - ConnectionState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState - RetryPolicy = Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy - InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping - DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination - Resource = Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource - EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult - JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault - EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl - JsonField = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField - TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys - DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters - TopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult - DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys - EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters - TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters - OperationInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo - EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination - Operation = Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation - TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest - InboundIpRule = Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule - OperationsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult - DomainsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult - PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult - DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult - PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource - PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult - PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint - TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult - DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest - EventTypesListResult = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult - PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection - JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping - TrackedResource = Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource - Domain = Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain - DomainTopic = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic - NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter - StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination - NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter - NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter - NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter - NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter - NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter - BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter - StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter - StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter - StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter - StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter - StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter - WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination - EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination - StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination - HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination - ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination - ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination - AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination - EventSubscription = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription - Topic = Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic - EventType = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType - TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo - PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus - ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState - DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState - InputSchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema - PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess - IpActionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType - DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState - EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState - EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema - TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState - ResourceRegionType = Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType - TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState + DeadLetterDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeadLetterDestination + DeadLetterWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeadLetterWithResourceIdentity + ConnectionState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ConnectionState + DeliveryAttributeMapping = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryAttributeMapping + InputSchemaMapping = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InputSchemaMapping + PartnerTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicUpdateParameters + ResourceSku = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceSku + PartnerTopicsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicsListResult + IdentityInfo = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IdentityInfo + EventChannelsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelsListResult + JsonField = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonField + EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionDestination + DeliveryAttributeListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryAttributeListResult + EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult + SystemData = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemData + EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionFullUrl + DomainUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainUpdateParameters + EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionUpdateParameters + DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainSharedAccessKeys + PrivateLinkResource = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateLinkResource + PartnerRegistrationsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationsListResult + PrivateLinkResourcesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateLinkResourcesListResult + EventChannelSource = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelSource + SystemTopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicUpdateParameters + AdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::AdvancedFilter + SystemTopicsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult + PartnerRegistrationUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationUpdateParameters + UserIdentityProperties = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::UserIdentityProperties + PartnerNamespaceRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceRegenerateKeyRequest + Resource = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Resource + PartnerNamespacesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespacesListResult + JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonFieldWithDefault + PrivateEndpointConnectionListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnectionListResult + ExtendedLocation = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ExtendedLocation + Operation = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Operation + EventSubscriptionIdentity = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionIdentity + PartnerRegistrationEventTypesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationEventTypesListResult + DeliveryWithResourceIdentity = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryWithResourceIdentity + DomainsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainsListResult + EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionFilter + DomainTopicsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopicsListResult + RetryPolicy = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::RetryPolicy + EventChannelFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelFilter + PrivateEndpoint = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpoint + PartnerNamespaceSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceSharedAccessKeys + PartnerNamespaceUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceUpdateParameters + TopicUpdateParameters = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicUpdateParameters + OperationInfo = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::OperationInfo + InboundIpRule = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InboundIpRule + DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainRegenerateKeyRequest + EventTypesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventTypesListResult + TopicTypesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypesListResult + PartnerTopicTypesListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicTypesListResult + TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicRegenerateKeyRequest + OperationsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::OperationsListResult + TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicSharedAccessKeys + EventChannelDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelDestination + TopicsListResult = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicsListResult + PrivateEndpointConnection = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnection + JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonInputSchemaMapping + TrackedResource = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TrackedResource + Domain = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Domain + DomainTopic = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopic + NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberInAdvancedFilter + NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberNotInAdvancedFilter + NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberLessThanAdvancedFilter + NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberGreaterThanAdvancedFilter + NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberLessThanOrEqualsAdvancedFilter + NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter + BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::BoolEqualsAdvancedFilter + StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringInAdvancedFilter + StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotInAdvancedFilter + StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringBeginsWithAdvancedFilter + StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringEndsWithAdvancedFilter + StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringContainsAdvancedFilter + NumberInRangeAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberInRangeAdvancedFilter + NumberNotInRangeAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberNotInRangeAdvancedFilter + StringNotBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotBeginsWithAdvancedFilter + StringNotEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotEndsWithAdvancedFilter + StringNotContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotContainsAdvancedFilter + IsNullOrUndefinedAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IsNullOrUndefinedAdvancedFilter + IsNotNullAdvancedFilter = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IsNotNullAdvancedFilter + EventChannel = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannel + StaticDeliveryAttributeMapping = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StaticDeliveryAttributeMapping + DynamicDeliveryAttributeMapping = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DynamicDeliveryAttributeMapping + StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StorageBlobDeadLetterDestination + WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::WebHookEventSubscriptionDestination + EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventHubEventSubscriptionDestination + StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StorageQueueEventSubscriptionDestination + HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::HybridConnectionEventSubscriptionDestination + ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ServiceBusQueueEventSubscriptionDestination + ServiceBusTopicEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ServiceBusTopicEventSubscriptionDestination + AzureFunctionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::AzureFunctionEventSubscriptionDestination + EventSubscription = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscription + PartnerNamespace = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespace + PartnerRegistration = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistration + EventType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventType + PartnerTopic = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopic + PartnerTopicType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicType + SystemTopic = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic + Topic = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Topic + ExtensionTopic = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ExtensionTopic + TopicTypeInfo = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypeInfo + PersistedConnectionStatus = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PersistedConnectionStatus + ResourceProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceProvisioningState + DomainProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainProvisioningState + InputSchema = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InputSchema + PublicNetworkAccess = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PublicNetworkAccess + IpActionType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IpActionType + Sku = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Sku + IdentityType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IdentityType + CreatedByType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::CreatedByType + DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopicProvisioningState + EventChannelProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelProvisioningState + PartnerTopicReadinessState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicReadinessState + EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionProvisioningState + EventSubscriptionIdentityType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionIdentityType + EventDeliverySchema = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventDeliverySchema + PartnerNamespaceProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceProvisioningState + PartnerRegistrationProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationProvisioningState + PartnerRegistrationVisibilityState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationVisibilityState + PartnerTopicProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicProvisioningState + PartnerTopicActivationState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicActivationState + PartnerTopicTypeAuthorizationState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicTypeAuthorizationState + TopicProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicProvisioningState + ResourceKind = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceKind + ResourceRegionType = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceRegionType + TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypeProvisioningState end # # EventGridManagementClass # class EventGridManagementClass - attr_reader :domains, :domain_topics, :event_subscriptions, :operations, :topics, :private_endpoint_connections, :private_link_resources, :topic_types, :configurable, :base_url, :options, :model_classes + attr_reader :domains, :domain_topics, :event_channels, :event_subscriptions, :system_topic_event_subscriptions, :partner_topic_event_subscriptions, :operations, :partner_namespaces, :partner_registrations, :partner_topics, :private_endpoint_connections, :private_link_resources, :system_topics, :topics, :extension_topics, :topic_types, :configurable, :base_url, :options, :model_classes def initialize(options = {}) if options.is_a?(Hash) && options.length == 0 @@ -110,18 +173,26 @@ module Azure::EventGrid::Profiles::Latest @base_url = options[:base_url].nil? ? nil:options[:base_url] @options = options[:options].nil? ? nil:options[:options] - @client_0 = Azure::EventGrid::Mgmt::V2020_06_01::EventGridManagementClient.new(configurable.credentials, base_url, options) + @client_0 = Azure::EventGrid::Mgmt::V2020_10_15_preview::EventGridManagementClient.new(configurable.credentials, base_url, options) if(@client_0.respond_to?(:subscription_id)) @client_0.subscription_id = configurable.subscription_id end add_telemetry(@client_0) @domains = @client_0.domains @domain_topics = @client_0.domain_topics + @event_channels = @client_0.event_channels @event_subscriptions = @client_0.event_subscriptions + @system_topic_event_subscriptions = @client_0.system_topic_event_subscriptions + @partner_topic_event_subscriptions = @client_0.partner_topic_event_subscriptions @operations = @client_0.operations - @topics = @client_0.topics + @partner_namespaces = @client_0.partner_namespaces + @partner_registrations = @client_0.partner_registrations + @partner_topics = @client_0.partner_topics @private_endpoint_connections = @client_0.private_endpoint_connections @private_link_resources = @client_0.private_link_resources + @system_topics = @client_0.system_topics + @topics = @client_0.topics + @extension_topics = @client_0.extension_topics @topic_types = @client_0.topic_types @model_classes = ModelClasses.new @@ -143,224 +214,389 @@ module Azure::EventGrid::Profiles::Latest end class ModelClasses - def advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::AdvancedFilter + def dead_letter_destination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeadLetterDestination end - def event_subscription_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFilter + def dead_letter_with_resource_identity + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeadLetterWithResourceIdentity end def connection_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::ConnectionState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ConnectionState end - def retry_policy - Azure::EventGrid::Mgmt::V2020_06_01::Models::RetryPolicy + def delivery_attribute_mapping + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryAttributeMapping end def input_schema_mapping - Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchemaMapping + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InputSchemaMapping end - def dead_letter_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::DeadLetterDestination + def partner_topic_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicUpdateParameters end - def resource - Azure::EventGrid::Mgmt::V2020_06_01::Models::Resource + def resource_sku + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceSku end - def event_subscriptions_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionsListResult + def partner_topics_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicsListResult end - def json_field_with_default - Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonFieldWithDefault + def identity_info + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IdentityInfo end - def event_subscription_full_url - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionFullUrl + def event_channels_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelsListResult end def json_field - Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonField - end - def topic_shared_access_keys - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicSharedAccessKeys - end - def domain_update_parameters - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainUpdateParameters - end - def topics_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicsListResult - end - def domain_shared_access_keys - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainSharedAccessKeys - end - def event_subscription_update_parameters - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionUpdateParameters - end - def topic_update_parameters - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicUpdateParameters - end - def operation_info - Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationInfo + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonField end def event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionDestination end - def operation - Azure::EventGrid::Mgmt::V2020_06_01::Models::Operation + def delivery_attribute_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryAttributeListResult end - def topic_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicRegenerateKeyRequest + def event_subscriptions_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult end - def inbound_ip_rule - Azure::EventGrid::Mgmt::V2020_06_01::Models::InboundIpRule + def system_data + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemData end - def operations_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::OperationsListResult + def event_subscription_full_url + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionFullUrl end - def domains_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainsListResult + def domain_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainUpdateParameters end - def private_endpoint_connection_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnectionListResult + def event_subscription_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionUpdateParameters end - def domain_topics_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicsListResult + def domain_shared_access_keys + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainSharedAccessKeys end def private_link_resource - Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateLinkResource + end + def partner_registrations_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationsListResult end def private_link_resources_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateLinkResourcesListResult + end + def event_channel_source + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelSource + end + def system_topic_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicUpdateParameters + end + def advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::AdvancedFilter + end + def system_topics_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult + end + def partner_registration_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationUpdateParameters + end + def user_identity_properties + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::UserIdentityProperties + end + def partner_namespace_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceRegenerateKeyRequest + end + def resource + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Resource + end + def partner_namespaces_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespacesListResult + end + def json_field_with_default + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonFieldWithDefault + end + def private_endpoint_connection_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnectionListResult + end + def extended_location + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ExtendedLocation + end + def operation + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Operation + end + def event_subscription_identity + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionIdentity + end + def partner_registration_event_types_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationEventTypesListResult + end + def delivery_with_resource_identity + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryWithResourceIdentity + end + def domains_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainsListResult + end + def event_subscription_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionFilter + end + def domain_topics_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopicsListResult + end + def retry_policy + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::RetryPolicy + end + def event_channel_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelFilter end def private_endpoint - Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpoint + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpoint end - def topic_types_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult + def partner_namespace_shared_access_keys + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceSharedAccessKeys + end + def partner_namespace_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceUpdateParameters + end + def topic_update_parameters + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicUpdateParameters + end + def operation_info + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::OperationInfo + end + def inbound_ip_rule + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InboundIpRule end def domain_regenerate_key_request - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainRegenerateKeyRequest + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainRegenerateKeyRequest end def event_types_list_result - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventTypesListResult + end + def topic_types_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypesListResult + end + def partner_topic_types_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicTypesListResult + end + def topic_regenerate_key_request + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicRegenerateKeyRequest + end + def operations_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::OperationsListResult + end + def topic_shared_access_keys + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicSharedAccessKeys + end + def event_channel_destination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelDestination + end + def topics_list_result + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicsListResult end def private_endpoint_connection - Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateEndpointConnection + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PrivateEndpointConnection end def json_input_schema_mapping - Azure::EventGrid::Mgmt::V2020_06_01::Models::JsonInputSchemaMapping + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::JsonInputSchemaMapping end def tracked_resource - Azure::EventGrid::Mgmt::V2020_06_01::Models::TrackedResource + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TrackedResource end def domain - Azure::EventGrid::Mgmt::V2020_06_01::Models::Domain + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Domain end def domain_topic - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopic + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopic end def number_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberInAdvancedFilter - end - def storage_blob_dead_letter_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageBlobDeadLetterDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberInAdvancedFilter end def number_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberNotInAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberNotInAdvancedFilter end def number_less_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberLessThanAdvancedFilter end def number_greater_than_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberGreaterThanAdvancedFilter end def number_less_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberLessThanOrEqualsAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberLessThanOrEqualsAdvancedFilter end def number_greater_than_or_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::NumberGreaterThanOrEqualsAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter end def bool_equals_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::BoolEqualsAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::BoolEqualsAdvancedFilter end def string_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::StringInAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringInAdvancedFilter end def string_not_in_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::StringNotInAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotInAdvancedFilter end def string_begins_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::StringBeginsWithAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringBeginsWithAdvancedFilter end def string_ends_with_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::StringEndsWithAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringEndsWithAdvancedFilter end def string_contains_advanced_filter - Azure::EventGrid::Mgmt::V2020_06_01::Models::StringContainsAdvancedFilter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringContainsAdvancedFilter + end + def number_in_range_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberInRangeAdvancedFilter + end + def number_not_in_range_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::NumberNotInRangeAdvancedFilter + end + def string_not_begins_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotBeginsWithAdvancedFilter + end + def string_not_ends_with_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotEndsWithAdvancedFilter + end + def string_not_contains_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StringNotContainsAdvancedFilter + end + def is_null_or_undefined_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IsNullOrUndefinedAdvancedFilter + end + def is_not_null_advanced_filter + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IsNotNullAdvancedFilter + end + def event_channel + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannel + end + def static_delivery_attribute_mapping + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StaticDeliveryAttributeMapping + end + def dynamic_delivery_attribute_mapping + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DynamicDeliveryAttributeMapping + end + def storage_blob_dead_letter_destination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StorageBlobDeadLetterDestination end def web_hook_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::WebHookEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::WebHookEventSubscriptionDestination end def event_hub_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventHubEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventHubEventSubscriptionDestination end def storage_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::StorageQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::StorageQueueEventSubscriptionDestination end def hybrid_connection_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::HybridConnectionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::HybridConnectionEventSubscriptionDestination end def service_bus_queue_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusQueueEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ServiceBusQueueEventSubscriptionDestination end def service_bus_topic_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::ServiceBusTopicEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ServiceBusTopicEventSubscriptionDestination end def azure_function_event_subscription_destination - Azure::EventGrid::Mgmt::V2020_06_01::Models::AzureFunctionEventSubscriptionDestination + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::AzureFunctionEventSubscriptionDestination end def event_subscription - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscription + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscription end - def topic - Azure::EventGrid::Mgmt::V2020_06_01::Models::Topic + def partner_namespace + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespace + end + def partner_registration + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistration end def event_type - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventType + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventType + end + def partner_topic + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopic + end + def partner_topic_type + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicType + end + def system_topic + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic + end + def topic + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Topic + end + def extension_topic + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ExtensionTopic end def topic_type_info - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypeInfo end def persisted_connection_status - Azure::EventGrid::Mgmt::V2020_06_01::Models::PersistedConnectionStatus + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PersistedConnectionStatus end def resource_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceProvisioningState end def domain_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainProvisioningState end def input_schema - Azure::EventGrid::Mgmt::V2020_06_01::Models::InputSchema + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::InputSchema end def public_network_access - Azure::EventGrid::Mgmt::V2020_06_01::Models::PublicNetworkAccess + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PublicNetworkAccess end def ip_action_type - Azure::EventGrid::Mgmt::V2020_06_01::Models::IpActionType + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IpActionType + end + def sku + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::Sku + end + def identity_type + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::IdentityType + end + def created_by_type + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::CreatedByType end def domain_topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::DomainTopicProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DomainTopicProvisioningState + end + def event_channel_provisioning_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventChannelProvisioningState + end + def partner_topic_readiness_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicReadinessState end def event_subscription_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventSubscriptionProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionProvisioningState + end + def event_subscription_identity_type + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionIdentityType end def event_delivery_schema - Azure::EventGrid::Mgmt::V2020_06_01::Models::EventDeliverySchema + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventDeliverySchema + end + def partner_namespace_provisioning_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerNamespaceProvisioningState + end + def partner_registration_provisioning_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationProvisioningState + end + def partner_registration_visibility_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerRegistrationVisibilityState + end + def partner_topic_provisioning_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicProvisioningState + end + def partner_topic_activation_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicActivationState + end + def partner_topic_type_authorization_state + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::PartnerTopicTypeAuthorizationState end def topic_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicProvisioningState + end + def resource_kind + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceKind end def resource_region_type - Azure::EventGrid::Mgmt::V2020_06_01::Models::ResourceRegionType + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::ResourceRegionType end def topic_type_provisioning_state - Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeProvisioningState + Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::TopicTypeProvisioningState end end end diff --git a/management/azure_mgmt_event_grid/lib/version.rb b/management/azure_mgmt_event_grid/lib/version.rb index 66f07e0b0..43740f177 100644 --- a/management/azure_mgmt_event_grid/lib/version.rb +++ b/management/azure_mgmt_event_grid/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::EventGrid::Mgmt - VERSION = '0.20.2' + VERSION = '0.21.0' end