зеркало из
1
0
Форкнуть 0

Regen azure_mgmt_service_bus using AutoRest.Ruby v1.9.3

This commit is contained in:
Vishrut Shah 2017-09-09 11:38:30 -07:00
Родитель 41b73f9b62
Коммит 1295b80496
32 изменённых файлов: 1396 добавлений и 14 удалений

Просмотреть файл

@ -26,29 +26,37 @@ module Azure::ARM::ServiceBus
autoload :Topics, 'generated/azure_mgmt_service_bus/topics.rb'
autoload :Subscriptions, 'generated/azure_mgmt_service_bus/subscriptions.rb'
autoload :Rules, 'generated/azure_mgmt_service_bus/rules.rb'
autoload :Regions, 'generated/azure_mgmt_service_bus/regions.rb'
autoload :PremiumMessagingRegionsOperations, 'generated/azure_mgmt_service_bus/premium_messaging_regions_operations.rb'
autoload :EventHubs, 'generated/azure_mgmt_service_bus/event_hubs.rb'
autoload :ServiceBusManagementClient, 'generated/azure_mgmt_service_bus/service_bus_management_client.rb'
module Models
autoload :CorrelationFilter, 'generated/azure_mgmt_service_bus/models/correlation_filter.rb'
autoload :RegenerateAccessKeyParameters, 'generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
autoload :MessageCountDetails, 'generated/azure_mgmt_service_bus/models/message_count_details.rb'
autoload :SBSku, 'generated/azure_mgmt_service_bus/models/sbsku.rb'
autoload :Operation, 'generated/azure_mgmt_service_bus/models/operation.rb'
autoload :SBNamespaceListResult, 'generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
autoload :CheckNameAvailability, 'generated/azure_mgmt_service_bus/models/check_name_availability.rb'
autoload :PremiumMessagingRegionsListResult, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb'
autoload :SBQueueListResult, 'generated/azure_mgmt_service_bus/models/sbqueue_list_result.rb'
autoload :OperationListResult, 'generated/azure_mgmt_service_bus/models/operation_list_result.rb'
autoload :AuthorizationRuleProperties, 'generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
autoload :PremiumMessagingRegionsProperties, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb'
autoload :EventHubListResult, 'generated/azure_mgmt_service_bus/models/event_hub_list_result.rb'
autoload :SBTopicListResult, 'generated/azure_mgmt_service_bus/models/sbtopic_list_result.rb'
autoload :SqlFilter, 'generated/azure_mgmt_service_bus/models/sql_filter.rb'
autoload :CaptureDescription, 'generated/azure_mgmt_service_bus/models/capture_description.rb'
autoload :RuleListResult, 'generated/azure_mgmt_service_bus/models/rule_list_result.rb'
autoload :ErrorResponse, 'generated/azure_mgmt_service_bus/models/error_response.rb'
autoload :SBAuthorizationRuleListResult, 'generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
autoload :SBSubscriptionListResult, 'generated/azure_mgmt_service_bus/models/sbsubscription_list_result.rb'
autoload :AccessKeys, 'generated/azure_mgmt_service_bus/models/access_keys.rb'
autoload :CheckNameAvailability, 'generated/azure_mgmt_service_bus/models/check_name_availability.rb'
autoload :SBAuthorizationRuleListResult, 'generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
autoload :CorrelationFilter, 'generated/azure_mgmt_service_bus/models/correlation_filter.rb'
autoload :MessageCountDetails, 'generated/azure_mgmt_service_bus/models/message_count_details.rb'
autoload :CheckNameAvailabilityResult, 'generated/azure_mgmt_service_bus/models/check_name_availability_result.rb'
autoload :Action, 'generated/azure_mgmt_service_bus/models/action.rb'
autoload :SBSku, 'generated/azure_mgmt_service_bus/models/sbsku.rb'
autoload :OperationDisplay, 'generated/azure_mgmt_service_bus/models/operation_display.rb'
autoload :Destination, 'generated/azure_mgmt_service_bus/models/destination.rb'
autoload :Operation, 'generated/azure_mgmt_service_bus/models/operation.rb'
autoload :RegenerateAccessKeyParameters, 'generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
autoload :OperationListResult, 'generated/azure_mgmt_service_bus/models/operation_list_result.rb'
autoload :SBNamespaceListResult, 'generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
autoload :ErrorResponse, 'generated/azure_mgmt_service_bus/models/error_response.rb'
autoload :Action, 'generated/azure_mgmt_service_bus/models/action.rb'
autoload :AuthorizationRuleProperties, 'generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
autoload :SqlFilter, 'generated/azure_mgmt_service_bus/models/sql_filter.rb'
autoload :TrackedResource, 'generated/azure_mgmt_service_bus/models/tracked_resource.rb'
autoload :ResourceNamespacePatch, 'generated/azure_mgmt_service_bus/models/resource_namespace_patch.rb'
autoload :SBNamespace, 'generated/azure_mgmt_service_bus/models/sbnamespace.rb'
@ -59,6 +67,8 @@ module Azure::ARM::ServiceBus
autoload :SBSubscription, 'generated/azure_mgmt_service_bus/models/sbsubscription.rb'
autoload :Rule, 'generated/azure_mgmt_service_bus/models/rule.rb'
autoload :SqlRuleAction, 'generated/azure_mgmt_service_bus/models/sql_rule_action.rb'
autoload :PremiumMessagingRegions, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions.rb'
autoload :Eventhub, 'generated/azure_mgmt_service_bus/models/eventhub.rb'
autoload :SkuName, 'generated/azure_mgmt_service_bus/models/sku_name.rb'
autoload :SkuTier, 'generated/azure_mgmt_service_bus/models/sku_tier.rb'
autoload :AccessRights, 'generated/azure_mgmt_service_bus/models/access_rights.rb'
@ -66,5 +76,6 @@ module Azure::ARM::ServiceBus
autoload :EntityStatus, 'generated/azure_mgmt_service_bus/models/entity_status.rb'
autoload :UnavailableReason, 'generated/azure_mgmt_service_bus/models/unavailable_reason.rb'
autoload :FilterType, 'generated/azure_mgmt_service_bus/models/filter_type.rb'
autoload :EncodingCaptureDescription, 'generated/azure_mgmt_service_bus/models/encoding_capture_description.rb'
end
end

Просмотреть файл

@ -0,0 +1,229 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
#
# Azure Service Bus client
#
class EventHubs
include MsRestAzure
#
# Creates and initializes a new instance of the EventHubs class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
attr_reader :client
#
# Gets all the Event Hubs in a service bus Namespace.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param namespace_name [String] The namespace name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Eventhub>] operation results.
#
def list_by_namespace(resource_group_name, namespace_name, custom_headers = nil)
first_page = list_by_namespace_as_lazy(resource_group_name, namespace_name, custom_headers)
first_page.get_all_items
end
#
# Gets all the Event Hubs in a service bus Namespace.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param namespace_name [String] The namespace name
# @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_namespace_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
list_by_namespace_async(resource_group_name, namespace_name, custom_headers).value!
end
#
# Gets all the Event Hubs in a service bus Namespace.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param namespace_name [String] The namespace name
# @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_namespace_async(resource_group_name, namespace_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::EventHubListResult.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
#
# Gets all the Event Hubs in a service bus 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 [EventHubListResult] operation results.
#
def list_by_namespace_next(next_page_link, custom_headers = nil)
response = list_by_namespace_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Gets all the Event Hubs in a service bus 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_namespace_next_with_http_info(next_page_link, custom_headers = nil)
list_by_namespace_next_async(next_page_link, custom_headers).value!
end
#
# Gets all the Event Hubs in a service bus 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_namespace_next_async(next_page_link, custom_headers = nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::EventHubListResult.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
#
# Gets all the Event Hubs in a service bus Namespace.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param namespace_name [String] The namespace name
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [EventHubListResult] which provide lazy access to pages of the
# response.
#
def list_by_namespace_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
response = list_by_namespace_async(resource_group_name, namespace_name, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_namespace_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

Просмотреть файл

Просмотреть файл

@ -0,0 +1,103 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Properties to configure capture description for eventhub
#
class CaptureDescription
include MsRestAzure
include MsRest::JSONable
# @return [Boolean] A value that indicates whether capture description is
# enabled.
attr_accessor :enabled
# @return [EncodingCaptureDescription] Enumerates the possible values for
# the encoding format of capture description. Possible values include:
# 'Avro', 'AvroDeflate'
attr_accessor :encoding
# @return [Integer] The time window allows you to set the frequency with
# which the capture to Azure Blobs will happen, value should between 60
# to 900 seconds
attr_accessor :interval_in_seconds
# @return [Integer] The size window defines the amount of data built up
# in your Event Hub before an capture operation, value should be between
# 10485760 and 524288000 bytes
attr_accessor :size_limit_in_bytes
# @return [Destination] Properties of Destination where capture will be
# stored. (Storage Account, Blob Names)
attr_accessor :destination
#
# Mapper for CaptureDescription class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CaptureDescription',
type: {
name: 'Composite',
class_name: 'CaptureDescription',
model_properties: {
enabled: {
required: false,
serialized_name: 'enabled',
type: {
name: 'Boolean'
}
},
encoding: {
required: false,
serialized_name: 'encoding',
type: {
name: 'Enum',
module: 'EncodingCaptureDescription'
}
},
interval_in_seconds: {
required: false,
serialized_name: 'intervalInSeconds',
constraints: {
InclusiveMaximum: 900,
InclusiveMinimum: 60
},
type: {
name: 'Number'
}
},
size_limit_in_bytes: {
required: false,
serialized_name: 'sizeLimitInBytes',
constraints: {
InclusiveMaximum: 524288000,
InclusiveMinimum: 10485760
},
type: {
name: 'Number'
}
},
destination: {
required: false,
serialized_name: 'destination',
type: {
name: 'Composite',
class_name: 'Destination'
}
}
}
}
}
end
end
end
end

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,79 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Capture storage details for capture description
#
class Destination
include MsRestAzure
include MsRest::JSONable
# @return [String] Name for capture destination
attr_accessor :name
# @return [String] Resource id of the storage account to be used to
# create the blobs
attr_accessor :storage_account_resource_id
# @return [String] Blob container Name
attr_accessor :blob_container
# @return [String] Blob naming convention for archive, e.g.
# {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}.
# Here all the parameters (Namespace,EventHub .. etc) are mandatory
# irrespective of order
attr_accessor :archive_name_format
#
# Mapper for Destination class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Destination',
type: {
name: 'Composite',
class_name: 'Destination',
model_properties: {
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
storage_account_resource_id: {
required: false,
serialized_name: 'properties.storageAccountResourceId',
type: {
name: 'String'
}
},
blob_container: {
required: false,
serialized_name: 'properties.blobContainer',
type: {
name: 'String'
}
},
archive_name_format: {
required: false,
serialized_name: 'properties.archiveNameFormat',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,16 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Defines values for EncodingCaptureDescription
#
module EncodingCaptureDescription
Avro = "Avro"
AvroDeflate = "AvroDeflate"
end
end
end

Просмотреть файл

Просмотреть файл

@ -0,0 +1,96 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# The result of the List EventHubs operation.
#
class EventHubListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Eventhub>] Result of the List EventHubs operation.
attr_accessor :value
# @return [String] Link to the next set of results. Not empty if Value
# contains incomplete list of EventHubs.
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<Eventhub>] operation results.
#
def get_all_items
items = @value
page = self
while page.next_link != nil do
page = page.get_next_page
items.concat(page.value)
end
items
end
#
# Gets the next page of results.
#
# @return [EventHubListResult] 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 EventHubListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'EventHubListResult',
type: {
name: 'Composite',
class_name: 'EventHubListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'EventhubElementType',
type: {
name: 'Composite',
class_name: 'Eventhub'
}
}
}
},
next_link: {
required: false,
read_only: true,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,154 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Single item in List or Get Event Hub operation
#
class Eventhub < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [Array<String>] Current number of shards on the Event Hub.
attr_accessor :partition_ids
# @return [DateTime] Exact time the Event Hub was created.
attr_accessor :created_at
# @return [DateTime] The exact time the message was updated.
attr_accessor :updated_at
# @return [Integer] Number of days to retain the events for this Event
# Hub, value should be 1 to 7 days
attr_accessor :message_retention_in_days
# @return [Integer] Number of partitions created for the Event Hub,
# allowed values are from 1 to 32 partitions.
attr_accessor :partition_count
# @return [EntityStatus] Enumerates the possible values for the status of
# the Event Hub. Possible values include: 'Active', 'Disabled',
# 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
# 'Renaming', 'Unknown'
attr_accessor :status
# @return [CaptureDescription] Properties of capture description
attr_accessor :capture_description
#
# Mapper for Eventhub class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Eventhub',
type: {
name: 'Composite',
class_name: 'Eventhub',
model_properties: {
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
},
partition_ids: {
required: false,
read_only: true,
serialized_name: 'properties.partitionIds',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
created_at: {
required: false,
read_only: true,
serialized_name: 'properties.createdAt',
type: {
name: 'DateTime'
}
},
updated_at: {
required: false,
read_only: true,
serialized_name: 'properties.updatedAt',
type: {
name: 'DateTime'
}
},
message_retention_in_days: {
required: false,
serialized_name: 'properties.messageRetentionInDays',
constraints: {
InclusiveMaximum: 7,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
partition_count: {
required: false,
serialized_name: 'properties.partitionCount',
constraints: {
InclusiveMaximum: 32,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
status: {
required: false,
serialized_name: 'properties.status',
type: {
name: 'Enum',
module: 'EntityStatus'
}
},
capture_description: {
required: false,
serialized_name: 'properties.captureDescription',
type: {
name: 'Composite',
class_name: 'CaptureDescription'
}
}
}
}
}
end
end
end
end

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,91 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Premium Messaging Region
#
class PremiumMessagingRegions < ResourceNamespacePatch
include MsRestAzure
include MsRest::JSONable
# @return [PremiumMessagingRegionsProperties]
attr_accessor :properties
#
# Mapper for PremiumMessagingRegions class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'PremiumMessagingRegions',
type: {
name: 'Composite',
class_name: 'PremiumMessagingRegions',
model_properties: {
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
},
location: {
required: false,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'PremiumMessagingRegionsProperties'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,97 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# The response of the List PremiumMessagingRegions operation.
#
class PremiumMessagingRegionsListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<PremiumMessagingRegions>] Result of the List
# PremiumMessagingRegions type.
attr_accessor :value
# @return [String] Link to the next set of results. Not empty if Value
# contains incomplete list of PremiumMessagingRegions.
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<PremiumMessagingRegions>] operation results.
#
def get_all_items
items = @value
page = self
while page.next_link != nil do
page = page.get_next_page
items.concat(page.value)
end
items
end
#
# Gets the next page of results.
#
# @return [PremiumMessagingRegionsListResult] 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 PremiumMessagingRegionsListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'PremiumMessagingRegionsListResult',
type: {
name: 'Composite',
class_name: 'PremiumMessagingRegionsListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'PremiumMessagingRegionsElementType',
type: {
name: 'Composite',
class_name: 'PremiumMessagingRegions'
}
}
}
},
next_link: {
required: false,
read_only: true,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,58 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
module Models
#
# Model object.
#
#
class PremiumMessagingRegionsProperties
include MsRestAzure
include MsRest::JSONable
# @return [String] Region code
attr_accessor :code
# @return [String] Full name of the region
attr_accessor :full_name
#
# Mapper for PremiumMessagingRegionsProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'PremiumMessagingRegions_properties',
type: {
name: 'Composite',
class_name: 'PremiumMessagingRegionsProperties',
model_properties: {
code: {
required: false,
read_only: true,
serialized_name: 'code',
type: {
name: 'String'
}
},
full_name: {
required: false,
read_only: true,
serialized_name: 'fullName',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -13,7 +13,7 @@ module Azure::ARM::ServiceBus
include MsRestAzure
include MsRest::JSONable
# @return [String] The Geo-location where the resource live
# @return [String] The Geo-location where the resource lives
attr_accessor :location
# @return [Hash{String => String}] Resource tags

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,215 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
#
# Azure Service Bus client
#
class PremiumMessagingRegionsOperations
include MsRestAzure
#
# Creates and initializes a new instance of the PremiumMessagingRegionsOperations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
attr_reader :client
#
# Gets the available premium messaging regions for servicebus
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<PremiumMessagingRegions>] operation results.
#
def list(custom_headers = nil)
first_page = list_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Gets the available premium messaging regions for servicebus
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_with_http_info(custom_headers = nil)
list_async(custom_headers).value!
end
#
# Gets the available premium messaging regions for servicebus
#
# @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?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions'
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},
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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::PremiumMessagingRegionsListResult.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
#
# Gets the available premium messaging regions for servicebus
#
# @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 [PremiumMessagingRegionsListResult] operation results.
#
def list_next(next_page_link, custom_headers = nil)
response = list_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Gets the available premium messaging regions for servicebus
#
# @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_next_with_http_info(next_page_link, custom_headers = nil)
list_next_async(next_page_link, custom_headers).value!
end
#
# Gets the available premium messaging regions for servicebus
#
# @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_next_async(next_page_link, custom_headers = nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::PremiumMessagingRegionsListResult.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
#
# Gets the available premium messaging regions for servicebus
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [PremiumMessagingRegionsListResult] which provide lazy access to
# pages of the response.
#
def list_as_lazy(custom_headers = nil)
response = list_async(custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

Просмотреть файл

Просмотреть файл

@ -0,0 +1,220 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::ServiceBus
#
# Azure Service Bus client
#
class Regions
include MsRestAzure
#
# Creates and initializes a new instance of the Regions class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
attr_reader :client
#
# Gets the available Regions for a given sku
#
# @param sku [String] The sku type.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<PremiumMessagingRegions>] operation results.
#
def list_by_sku(sku, custom_headers = nil)
first_page = list_by_sku_as_lazy(sku, custom_headers)
first_page.get_all_items
end
#
# Gets the available Regions for a given sku
#
# @param sku [String] The sku 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_by_sku_with_http_info(sku, custom_headers = nil)
list_by_sku_async(sku, custom_headers).value!
end
#
# Gets the available Regions for a given sku
#
# @param sku [String] The sku 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_by_sku_async(sku, custom_headers = nil)
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'sku is nil' if sku.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'sku' => sku},
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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::PremiumMessagingRegionsListResult.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
#
# Gets the available Regions for a given sku
#
# @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 [PremiumMessagingRegionsListResult] operation results.
#
def list_by_sku_next(next_page_link, custom_headers = nil)
response = list_by_sku_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Gets the available Regions for a given sku
#
# @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_sku_next_with_http_info(next_page_link, custom_headers = nil)
list_by_sku_next_async(next_page_link, custom_headers).value!
end
#
# Gets the available Regions for a given sku
#
# @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_sku_next_async(next_page_link, custom_headers = nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::ServiceBus::Models::PremiumMessagingRegionsListResult.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
#
# Gets the available Regions for a given sku
#
# @param sku [String] The sku type.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [PremiumMessagingRegionsListResult] which provide lazy access to
# pages of the response.
#
def list_by_sku_as_lazy(sku, custom_headers = nil)
response = list_by_sku_async(sku, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_sku_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

Просмотреть файл

@ -54,6 +54,16 @@ module Azure::ARM::ServiceBus
# @return [Rules] rules
attr_reader :rules
# @return [Regions] regions
attr_reader :regions
# @return [PremiumMessagingRegionsOperations]
# premium_messaging_regions_operations
attr_reader :premium_messaging_regions_operations
# @return [EventHubs] event_hubs
attr_reader :event_hubs
#
# Creates initializes a new instance of the ServiceBusManagementClient class.
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
@ -73,6 +83,9 @@ module Azure::ARM::ServiceBus
@topics = Topics.new(self)
@subscriptions = Subscriptions.new(self)
@rules = Rules.new(self)
@regions = Regions.new(self)
@premium_messaging_regions_operations = PremiumMessagingRegionsOperations.new(self)
@event_hubs = EventHubs.new(self)
@api_version = '2017-04-01'
@accept_language = 'en-US'
@long_running_operation_retry_timeout = 30

Просмотреть файл

Просмотреть файл

Просмотреть файл