azure_mgmt_service_bus 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-08-01/generated/azure_mgmt_service_bus.rb +67 -0
  3. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/access_rights.rb +1 -1
  4. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/check_name_availability.rb +1 -1
  5. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/check_name_availability_result.rb +70 -0
  6. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/entity_availability_status.rb +19 -0
  7. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/entity_status.rb +5 -5
  8. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/message_count_details.rb +8 -8
  9. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_create_or_update_parameters.rb +151 -0
  10. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_list_result.rb +96 -0
  11. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_resource.rb +169 -0
  12. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_state.rb +27 -0
  13. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_update_parameters.rb +62 -0
  14. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation.rb +1 -1
  15. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation_display.rb +1 -1
  16. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation_list_result.rb +1 -1
  17. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/policykey.rb +16 -0
  18. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_create_or_update_parameters.rb +307 -0
  19. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_list_result.rb +95 -0
  20. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_resource.rb +318 -0
  21. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/regenerate_keys_parameters.rb +46 -0
  22. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/resource.rb +77 -0
  23. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/resource_list_keys.rb +88 -0
  24. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_create_or_update_parameters.rb +74 -0
  25. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_list_result.rb +98 -0
  26. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_resource.rb +83 -0
  27. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/sku.rb +66 -0
  28. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/sku_name.rb +1 -1
  29. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/sku_tier.rb +1 -1
  30. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_create_or_update_parameters.rb +237 -0
  31. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_list_result.rb +96 -0
  32. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_resource.rb +248 -0
  33. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_create_or_update_parameters.rb +294 -0
  34. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_list_result.rb +95 -0
  35. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_resource.rb +305 -0
  36. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/tracked_resource.rb +82 -0
  37. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/unavailable_reason.rb +1 -1
  38. data/lib/2015-08-01/generated/azure_mgmt_service_bus/module_definition.rb +9 -0
  39. data/lib/2015-08-01/generated/azure_mgmt_service_bus/namespaces.rb +1751 -0
  40. data/lib/2015-08-01/generated/azure_mgmt_service_bus/operations.rb +213 -0
  41. data/lib/2015-08-01/generated/azure_mgmt_service_bus/queues.rb +1267 -0
  42. data/lib/2015-08-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +147 -0
  43. data/lib/2015-08-01/generated/azure_mgmt_service_bus/subscriptions.rb +545 -0
  44. data/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb +1267 -0
  45. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/version.rb +2 -2
  46. data/lib/2017-04-01/generated/azure_mgmt_service_bus.rb +87 -0
  47. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/disaster_recovery_configs.rb +6 -6
  48. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/event_hubs.rb +3 -3
  49. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/access_keys.rb +1 -1
  50. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/access_rights.rb +17 -0
  51. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/action.rb +1 -1
  52. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/arm_disaster_recovery.rb +1 -1
  53. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb +1 -1
  54. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/authorization_rule_properties.rb +1 -1
  55. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/capture_description.rb +1 -1
  56. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability.rb +47 -0
  57. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/check_name_availability_result.rb +1 -1
  58. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/correlation_filter.rb +1 -1
  59. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/destination.rb +1 -1
  60. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/encoding_capture_description.rb +1 -1
  61. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/entity_status.rb +23 -0
  62. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/error_response.rb +1 -1
  63. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/event_hub_list_result.rb +1 -1
  64. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/eventhub.rb +1 -1
  65. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/filter_type.rb +1 -1
  66. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/key_type.rb +1 -1
  67. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/message_count_details.rb +91 -0
  68. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation.rb +56 -0
  69. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation_display.rb +68 -0
  70. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation_list_result.rb +99 -0
  71. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions.rb +1 -1
  72. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb +1 -1
  73. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb +1 -1
  74. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/provisioning_state_dr.rb +1 -1
  75. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb +1 -1
  76. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/resource.rb +1 -1
  77. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/resource_namespace_patch.rb +1 -1
  78. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/role_disaster_recovery.rb +1 -1
  79. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/rule.rb +1 -1
  80. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/rule_list_result.rb +1 -1
  81. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbauthorization_rule.rb +1 -1
  82. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb +1 -1
  83. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace.rb +1 -1
  84. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace_list_result.rb +1 -1
  85. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace_update_parameters.rb +1 -1
  86. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbqueue.rb +1 -1
  87. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbqueue_list_result.rb +1 -1
  88. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsku.rb +1 -1
  89. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsubscription.rb +1 -1
  90. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsubscription_list_result.rb +1 -1
  91. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbtopic.rb +1 -1
  92. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbtopic_list_result.rb +1 -1
  93. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sku_name.rb +17 -0
  94. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sku_tier.rb +17 -0
  95. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sql_filter.rb +1 -1
  96. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sql_rule_action.rb +1 -1
  97. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/tracked_resource.rb +1 -1
  98. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/unavailable_reason.rb +20 -0
  99. data/lib/2017-04-01/generated/azure_mgmt_service_bus/module_definition.rb +9 -0
  100. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/namespaces.rb +23 -23
  101. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/operations.rb +3 -3
  102. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/premium_messaging_regions_operations.rb +3 -3
  103. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/queues.rb +14 -14
  104. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/regions.rb +3 -3
  105. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/rules.rb +6 -6
  106. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/service_bus_management_client.rb +3 -3
  107. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/subscriptions.rb +6 -6
  108. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/topics.rb +14 -14
  109. data/lib/{generated/azure_mgmt_service_bus/module_definition.rb → 2017-04-01/generated/azure_mgmt_service_bus/version.rb} +3 -3
  110. data/lib/azure_mgmt_service_bus.rb +3 -1
  111. data/lib/module_definition.rb +7 -0
  112. data/lib/profiles/common/configurable.rb +73 -0
  113. data/lib/profiles/common/default.rb +68 -0
  114. data/lib/profiles/latest/modules/servicebus_profile_module.rb +260 -0
  115. data/lib/profiles/latest/servicebus_latest_profile_client.rb +33 -0
  116. data/lib/profiles/latest/servicebus_module_definition.rb +9 -0
  117. data/lib/version.rb +7 -0
  118. metadata +117 -66
  119. data/lib/generated/azure_mgmt_service_bus.rb +0 -87
@@ -0,0 +1,147 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ServiceBus::Mgmt::V2015_08_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ServiceBusManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials that uniquely identify a
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client API version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] Gets or sets the preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
+ # Running Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
+ # is generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [Operations] operations
40
+ attr_reader :operations
41
+
42
+ # @return [Namespaces] namespaces
43
+ attr_reader :namespaces
44
+
45
+ # @return [Queues] queues
46
+ attr_reader :queues
47
+
48
+ # @return [Topics] topics
49
+ attr_reader :topics
50
+
51
+ # @return [Subscriptions] subscriptions
52
+ attr_reader :subscriptions
53
+
54
+ #
55
+ # Creates initializes a new instance of the ServiceBusManagementClient class.
56
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
57
+ # @param base_url [String] the base URI of the service.
58
+ # @param options [Array] filters to be applied to the HTTP requests.
59
+ #
60
+ def initialize(credentials = nil, base_url = nil, options = nil)
61
+ super(credentials, options)
62
+ @base_url = base_url || 'https://management.azure.com'
63
+
64
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
65
+ @credentials = credentials
66
+
67
+ @operations = Operations.new(self)
68
+ @namespaces = Namespaces.new(self)
69
+ @queues = Queues.new(self)
70
+ @topics = Topics.new(self)
71
+ @subscriptions = Subscriptions.new(self)
72
+ @api_version = '2015-08-01'
73
+ @accept_language = 'en-US'
74
+ @long_running_operation_retry_timeout = 30
75
+ @generate_client_request_id = true
76
+ add_telemetry
77
+ end
78
+
79
+ #
80
+ # Makes a request and returns the body of the response.
81
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
82
+ # @param path [String] the path, relative to {base_url}.
83
+ # @param options [Hash{String=>String}] specifying any request options like :body.
84
+ # @return [Hash{String=>String}] containing the body of the response.
85
+ # Example:
86
+ #
87
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
88
+ # path = "/path"
89
+ # options = {
90
+ # body: request_content,
91
+ # query_params: {'api-version' => '2016-02-01'}
92
+ # }
93
+ # result = @client.make_request(:put, path, options)
94
+ #
95
+ def make_request(method, path, options = {})
96
+ result = make_request_with_http_info(method, path, options)
97
+ result.body unless result.nil?
98
+ end
99
+
100
+ #
101
+ # Makes a request and returns the operation response.
102
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
103
+ # @param path [String] the path, relative to {base_url}.
104
+ # @param options [Hash{String=>String}] specifying any request options like :body.
105
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
106
+ #
107
+ def make_request_with_http_info(method, path, options = {})
108
+ result = make_request_async(method, path, options).value!
109
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
110
+ result
111
+ end
112
+
113
+ #
114
+ # Makes a request asynchronously.
115
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
116
+ # @param path [String] the path, relative to {base_url}.
117
+ # @param options [Hash{String=>String}] specifying any request options like :body.
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def make_request_async(method, path, options = {})
121
+ fail ArgumentError, 'method is nil' if method.nil?
122
+ fail ArgumentError, 'path is nil' if path.nil?
123
+
124
+ request_url = options[:base_url] || @base_url
125
+
126
+ request_headers = @request_headers
127
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
128
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
129
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
130
+
131
+ super(request_url, method, path, options)
132
+ end
133
+
134
+
135
+ private
136
+ #
137
+ # Adds telemetry information.
138
+ #
139
+ def add_telemetry
140
+ sdk_information = 'azure_mgmt_service_bus'
141
+ if defined? Azure::ServiceBus::Mgmt::V2015_08_01::VERSION
142
+ sdk_information = "#{sdk_information}/#{Azure::ServiceBus::Mgmt::V2015_08_01::VERSION}"
143
+ end
144
+ add_user_agent_information(sdk_information)
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,545 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ServiceBus::Mgmt::V2015_08_01
7
+ #
8
+ # Azure Service Bus client
9
+ #
10
+ class Subscriptions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Subscriptions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List all the subscriptions under a specified topic.
26
+ #
27
+ # @param resource_group_name [String] Name of the Resource group within the
28
+ # Azure subscription.
29
+ # @param namespace_name [String] The namespace name
30
+ # @param topic_name [String] The topic name.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<SubscriptionResource>] operation results.
35
+ #
36
+ def list_all(resource_group_name, namespace_name, topic_name, custom_headers = nil)
37
+ first_page = list_all_as_lazy(resource_group_name, namespace_name, topic_name, custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # List all the subscriptions under a specified topic.
43
+ #
44
+ # @param resource_group_name [String] Name of the Resource group within the
45
+ # Azure subscription.
46
+ # @param namespace_name [String] The namespace name
47
+ # @param topic_name [String] The topic name.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_all_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers = nil)
54
+ list_all_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # List all the subscriptions under a specified topic.
59
+ #
60
+ # @param resource_group_name [String] Name of the Resource group within the
61
+ # Azure subscription.
62
+ # @param namespace_name [String] The namespace name
63
+ # @param topic_name [String] The topic name.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_all_async(resource_group_name, namespace_name, topic_name, custom_headers = nil)
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
72
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+
76
+
77
+ request_headers = {}
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionId' => @client.subscription_id},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SubscriptionListResult.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Creates a topic subscription.
124
+ #
125
+ # @param resource_group_name [String] Name of the Resource group within the
126
+ # Azure subscription.
127
+ # @param namespace_name [String] The namespace name
128
+ # @param topic_name [String] The topic name.
129
+ # @param subscription_name [String] The subscription name.
130
+ # @param parameters [SubscriptionCreateOrUpdateParameters] Parameters supplied
131
+ # to create a subscription resource.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [SubscriptionResource] operation results.
136
+ #
137
+ def create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers = nil)
138
+ response = create_or_update_async(resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Creates a topic subscription.
144
+ #
145
+ # @param resource_group_name [String] Name of the Resource group within the
146
+ # Azure subscription.
147
+ # @param namespace_name [String] The namespace name
148
+ # @param topic_name [String] The topic name.
149
+ # @param subscription_name [String] The subscription name.
150
+ # @param parameters [SubscriptionCreateOrUpdateParameters] Parameters supplied
151
+ # to create a subscription resource.
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
156
+ #
157
+ def create_or_update_with_http_info(resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers = nil)
158
+ create_or_update_async(resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers).value!
159
+ end
160
+
161
+ #
162
+ # Creates a topic subscription.
163
+ #
164
+ # @param resource_group_name [String] Name of the Resource group within the
165
+ # Azure subscription.
166
+ # @param namespace_name [String] The namespace name
167
+ # @param topic_name [String] The topic name.
168
+ # @param subscription_name [String] The subscription name.
169
+ # @param parameters [SubscriptionCreateOrUpdateParameters] Parameters supplied
170
+ # to create a subscription resource.
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def create_or_update_async(resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers = nil)
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
179
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
180
+ fail ArgumentError, 'subscription_name is nil' if subscription_name.nil?
181
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
182
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
183
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+
185
+
186
+ request_headers = {}
187
+
188
+ # Set Headers
189
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
190
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
191
+
192
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
193
+
194
+ # Serialize Request
195
+ request_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SubscriptionCreateOrUpdateParameters.mapper()
196
+ request_content = @client.serialize(request_mapper, parameters)
197
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
198
+
199
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
200
+
201
+ request_url = @base_url || @client.base_url
202
+
203
+ options = {
204
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
205
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionName' => subscription_name,'subscriptionId' => @client.subscription_id},
206
+ query_params: {'api-version' => @client.api_version},
207
+ body: request_content,
208
+ headers: request_headers.merge(custom_headers || {}),
209
+ base_url: request_url
210
+ }
211
+ promise = @client.make_request_async(:put, path_template, options)
212
+
213
+ promise = promise.then do |result|
214
+ http_response = result.response
215
+ status_code = http_response.status
216
+ response_content = http_response.body
217
+ unless status_code == 200
218
+ error_model = JSON.load(response_content)
219
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
220
+ end
221
+
222
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
223
+ # Deserialize Response
224
+ if status_code == 200
225
+ begin
226
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
227
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SubscriptionResource.mapper()
228
+ result.body = @client.deserialize(result_mapper, parsed_response)
229
+ rescue Exception => e
230
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
231
+ end
232
+ end
233
+
234
+ result
235
+ end
236
+
237
+ promise.execute
238
+ end
239
+
240
+ #
241
+ # Deletes a subscription from the specified topic.
242
+ #
243
+ # @param resource_group_name [String] Name of the Resource group within the
244
+ # Azure subscription.
245
+ # @param namespace_name [String] The namespace name
246
+ # @param topic_name [String] The topic name.
247
+ # @param subscription_name [String] The subscription name.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ #
252
+ def delete(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
253
+ response = delete_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers).value!
254
+ nil
255
+ end
256
+
257
+ #
258
+ # Deletes a subscription from the specified topic.
259
+ #
260
+ # @param resource_group_name [String] Name of the Resource group within the
261
+ # Azure subscription.
262
+ # @param namespace_name [String] The namespace name
263
+ # @param topic_name [String] The topic name.
264
+ # @param subscription_name [String] The subscription name.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
269
+ #
270
+ def delete_with_http_info(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
271
+ delete_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers).value!
272
+ end
273
+
274
+ #
275
+ # Deletes a subscription from the specified topic.
276
+ #
277
+ # @param resource_group_name [String] Name of the Resource group within the
278
+ # Azure subscription.
279
+ # @param namespace_name [String] The namespace name
280
+ # @param topic_name [String] The topic name.
281
+ # @param subscription_name [String] The subscription name.
282
+ # @param [Hash{String => String}] A hash of custom headers that will be added
283
+ # to the HTTP request.
284
+ #
285
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
286
+ #
287
+ def delete_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
288
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
289
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
290
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
291
+ fail ArgumentError, 'subscription_name is nil' if subscription_name.nil?
292
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
293
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
294
+
295
+
296
+ request_headers = {}
297
+
298
+ # Set Headers
299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
301
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
302
+
303
+ request_url = @base_url || @client.base_url
304
+
305
+ options = {
306
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
307
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionName' => subscription_name,'subscriptionId' => @client.subscription_id},
308
+ query_params: {'api-version' => @client.api_version},
309
+ headers: request_headers.merge(custom_headers || {}),
310
+ base_url: request_url
311
+ }
312
+ promise = @client.make_request_async(:delete, path_template, options)
313
+
314
+ promise = promise.then do |result|
315
+ http_response = result.response
316
+ status_code = http_response.status
317
+ response_content = http_response.body
318
+ unless status_code == 204 || status_code == 200
319
+ error_model = JSON.load(response_content)
320
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
321
+ end
322
+
323
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
324
+
325
+ result
326
+ end
327
+
328
+ promise.execute
329
+ end
330
+
331
+ #
332
+ # Returns a subscription description for the specified topic.
333
+ #
334
+ # @param resource_group_name [String] Name of the Resource group within the
335
+ # Azure subscription.
336
+ # @param namespace_name [String] The namespace name
337
+ # @param topic_name [String] The topic name.
338
+ # @param subscription_name [String] The subscription name.
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [SubscriptionResource] operation results.
343
+ #
344
+ def get(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
345
+ response = get_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # Returns a subscription description for the specified topic.
351
+ #
352
+ # @param resource_group_name [String] Name of the Resource group within the
353
+ # Azure subscription.
354
+ # @param namespace_name [String] The namespace name
355
+ # @param topic_name [String] The topic name.
356
+ # @param subscription_name [String] The subscription name.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
361
+ #
362
+ def get_with_http_info(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
363
+ get_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers).value!
364
+ end
365
+
366
+ #
367
+ # Returns a subscription description for the specified topic.
368
+ #
369
+ # @param resource_group_name [String] Name of the Resource group within the
370
+ # Azure subscription.
371
+ # @param namespace_name [String] The namespace name
372
+ # @param topic_name [String] The topic name.
373
+ # @param subscription_name [String] The subscription name.
374
+ # @param [Hash{String => String}] A hash of custom headers that will be added
375
+ # to the HTTP request.
376
+ #
377
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
378
+ #
379
+ def get_async(resource_group_name, namespace_name, topic_name, subscription_name, custom_headers = nil)
380
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
381
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
382
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
383
+ fail ArgumentError, 'subscription_name is nil' if subscription_name.nil?
384
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
385
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
386
+
387
+
388
+ request_headers = {}
389
+
390
+ # Set Headers
391
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
392
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
393
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
394
+
395
+ request_url = @base_url || @client.base_url
396
+
397
+ options = {
398
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
399
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionName' => subscription_name,'subscriptionId' => @client.subscription_id},
400
+ query_params: {'api-version' => @client.api_version},
401
+ headers: request_headers.merge(custom_headers || {}),
402
+ base_url: request_url
403
+ }
404
+ promise = @client.make_request_async(:get, path_template, options)
405
+
406
+ promise = promise.then do |result|
407
+ http_response = result.response
408
+ status_code = http_response.status
409
+ response_content = http_response.body
410
+ unless status_code == 200
411
+ error_model = JSON.load(response_content)
412
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
413
+ end
414
+
415
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
416
+ # Deserialize Response
417
+ if status_code == 200
418
+ begin
419
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
420
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SubscriptionResource.mapper()
421
+ result.body = @client.deserialize(result_mapper, parsed_response)
422
+ rescue Exception => e
423
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
424
+ end
425
+ end
426
+
427
+ result
428
+ end
429
+
430
+ promise.execute
431
+ end
432
+
433
+ #
434
+ # List all the subscriptions under a specified topic.
435
+ #
436
+ # @param next_page_link [String] The NextLink from the previous successful call
437
+ # to List operation.
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [SubscriptionListResult] operation results.
442
+ #
443
+ def list_all_next(next_page_link, custom_headers = nil)
444
+ response = list_all_next_async(next_page_link, custom_headers).value!
445
+ response.body unless response.nil?
446
+ end
447
+
448
+ #
449
+ # List all the subscriptions under a specified topic.
450
+ #
451
+ # @param next_page_link [String] The NextLink from the previous successful call
452
+ # to List operation.
453
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
454
+ # will be added to the HTTP request.
455
+ #
456
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
457
+ #
458
+ def list_all_next_with_http_info(next_page_link, custom_headers = nil)
459
+ list_all_next_async(next_page_link, custom_headers).value!
460
+ end
461
+
462
+ #
463
+ # List all the subscriptions under a specified topic.
464
+ #
465
+ # @param next_page_link [String] The NextLink from the previous successful call
466
+ # to List operation.
467
+ # @param [Hash{String => String}] A hash of custom headers that will be added
468
+ # to the HTTP request.
469
+ #
470
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
471
+ #
472
+ def list_all_next_async(next_page_link, custom_headers = nil)
473
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
474
+
475
+
476
+ request_headers = {}
477
+
478
+ # Set Headers
479
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
480
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
481
+ path_template = '{nextLink}'
482
+
483
+ request_url = @base_url || @client.base_url
484
+
485
+ options = {
486
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
487
+ skip_encoding_path_params: {'nextLink' => next_page_link},
488
+ headers: request_headers.merge(custom_headers || {}),
489
+ base_url: request_url
490
+ }
491
+ promise = @client.make_request_async(:get, path_template, options)
492
+
493
+ promise = promise.then do |result|
494
+ http_response = result.response
495
+ status_code = http_response.status
496
+ response_content = http_response.body
497
+ unless status_code == 200
498
+ error_model = JSON.load(response_content)
499
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
500
+ end
501
+
502
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
503
+ # Deserialize Response
504
+ if status_code == 200
505
+ begin
506
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
507
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SubscriptionListResult.mapper()
508
+ result.body = @client.deserialize(result_mapper, parsed_response)
509
+ rescue Exception => e
510
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
511
+ end
512
+ end
513
+
514
+ result
515
+ end
516
+
517
+ promise.execute
518
+ end
519
+
520
+ #
521
+ # List all the subscriptions under a specified topic.
522
+ #
523
+ # @param resource_group_name [String] Name of the Resource group within the
524
+ # Azure subscription.
525
+ # @param namespace_name [String] The namespace name
526
+ # @param topic_name [String] The topic name.
527
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
528
+ # will be added to the HTTP request.
529
+ #
530
+ # @return [SubscriptionListResult] which provide lazy access to pages of the
531
+ # response.
532
+ #
533
+ def list_all_as_lazy(resource_group_name, namespace_name, topic_name, custom_headers = nil)
534
+ response = list_all_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
535
+ unless response.nil?
536
+ page = response.body
537
+ page.next_method = Proc.new do |next_page_link|
538
+ list_all_next_async(next_page_link, custom_headers)
539
+ end
540
+ page
541
+ end
542
+ end
543
+
544
+ end
545
+ end