azure_mgmt_event_grid 0.15.2 → 0.15.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +4 -1
  3. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +4 -4
  4. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/topics.rb +4 -4
  5. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +4 -1
  6. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +4 -4
  7. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +54 -0
  8. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/topics.rb +170 -4
  9. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid.rb +9 -8
  10. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +144 -0
  11. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb +1799 -0
  12. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +62 -0
  13. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription.rb +136 -0
  14. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +47 -0
  15. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +98 -0
  16. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  17. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +20 -0
  18. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +83 -0
  19. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +55 -0
  20. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_type.rb +95 -0
  21. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  22. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  23. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  24. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  25. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/resource.rb +71 -0
  26. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  27. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic.rb +112 -0
  28. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  29. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  30. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  31. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb +139 -0
  32. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  33. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  34. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +54 -0
  35. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb +55 -0
  36. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  37. data/lib/2018-01-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +75 -0
  38. data/lib/2018-01-01/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  39. data/lib/2018-01-01/generated/azure_mgmt_event_grid/operations.rb +115 -0
  40. data/lib/2018-01-01/generated/azure_mgmt_event_grid/topic_types.rb +296 -0
  41. data/lib/2018-01-01/generated/azure_mgmt_event_grid/topics.rb +1092 -0
  42. data/lib/2018-01-01/generated/azure_mgmt_event_grid.rb +57 -0
  43. data/lib/azure_mgmt_event_grid.rb +1 -0
  44. data/lib/profiles/latest/eventgrid_latest_profile_client.rb +28 -9
  45. data/lib/profiles/latest/eventgrid_module_definition.rb +0 -1
  46. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +125 -114
  47. data/lib/version.rb +1 -1
  48. metadata +37 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3236f28e100b4058463911fcd5f5dad3cf1657dc
4
- data.tar.gz: fa14cf05c6e215a38613dd934799e4e232450cde
3
+ metadata.gz: 85b434d4278fa557096a2672669dd9cabe086601
4
+ data.tar.gz: 3c3331b55c29ef58ef180fe4a55e135e18ed87ca
5
5
  SHA512:
6
- metadata.gz: 0089072f630566b1b18861f40af9cbc46727e451c33eb97ea19ca3e98ac20db9b20995bd16d84b6719e4528bffc0bc3ba8bdfcd5cb850a002f6a0e77ff2281cc
7
- data.tar.gz: f8535f30ae02dd746e4d7bf0cf8767b88e0ba53b72da0c532cebcae910f1617acddb6ac32d9b28ab660d6cfcf2f87c9b4faf0b5c88fbf5c835b518eaa66ad778
6
+ metadata.gz: a23d16a5b5c3b52ea8e1918bcc0dea747a4f0482724e9ee721f22eab3a9b56a85ee47d53fab0658790fb079fc15c8a7975b244e4a004bc2e6529f186ceccfa33
7
+ data.tar.gz: 7c51f93567ffb981e10dfaf6a0980ee78afc3992ed4434d7c57597a17c4c66b332dfa8e5f65ceeedbd89235c9187fd883fc3608e956b6c53fe77271d72ab5137
@@ -118,6 +118,9 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
118
118
  fail ArgumentError, 'path is nil' if path.nil?
119
119
 
120
120
  request_url = options[:base_url] || @base_url
121
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
122
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
123
+ end
121
124
 
122
125
  request_headers = @request_headers
123
126
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -134,7 +137,7 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
134
137
  #
135
138
  def add_telemetry
136
139
  sdk_information = 'azure_mgmt_event_grid'
137
- sdk_information = "#{sdk_information}/0.15.2"
140
+ sdk_information = "#{sdk_information}/0.15.3"
138
141
  add_user_agent_information(sdk_information)
139
142
  end
140
143
  end
@@ -1490,12 +1490,12 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
1490
1490
 
1491
1491
  request_headers = {}
1492
1492
 
1493
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1494
+
1493
1495
  # Set Headers
1494
1496
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1495
1497
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1496
1498
 
1497
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1498
-
1499
1499
  # Serialize Request
1500
1500
  request_mapper = Azure::EventGrid::Mgmt::V2017_06_15_preview::Models::EventSubscription.mapper()
1501
1501
  request_content = @client.serialize(request_mapper, event_subscription_info)
@@ -1746,12 +1746,12 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
1746
1746
 
1747
1747
  request_headers = {}
1748
1748
 
1749
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1750
+
1749
1751
  # Set Headers
1750
1752
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1751
1753
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1752
1754
 
1753
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1754
-
1755
1755
  # Serialize Request
1756
1756
  request_mapper = Azure::EventGrid::Mgmt::V2017_06_15_preview::Models::EventSubscriptionUpdateParameters.mapper()
1757
1757
  request_content = @client.serialize(request_mapper, event_subscription_update_parameters)
@@ -560,12 +560,12 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
560
560
 
561
561
  request_headers = {}
562
562
 
563
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
564
+
563
565
  # Set Headers
564
566
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
567
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
568
 
567
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
568
-
569
569
  # Serialize Request
570
570
  request_mapper = Azure::EventGrid::Mgmt::V2017_06_15_preview::Models::TopicRegenerateKeyRequest.mapper()
571
571
  request_content = @client.serialize(request_mapper, regenerate_key_request)
@@ -781,12 +781,12 @@ module Azure::EventGrid::Mgmt::V2017_06_15_preview
781
781
 
782
782
  request_headers = {}
783
783
 
784
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
785
+
784
786
  # Set Headers
785
787
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
786
788
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
787
789
 
788
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
789
-
790
790
  # Serialize Request
791
791
  request_mapper = Azure::EventGrid::Mgmt::V2017_06_15_preview::Models::Topic.mapper()
792
792
  request_content = @client.serialize(request_mapper, topic_info)
@@ -118,6 +118,9 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
118
118
  fail ArgumentError, 'path is nil' if path.nil?
119
119
 
120
120
  request_url = options[:base_url] || @base_url
121
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
122
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
123
+ end
121
124
 
122
125
  request_headers = @request_headers
123
126
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -134,7 +137,7 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
134
137
  #
135
138
  def add_telemetry
136
139
  sdk_information = 'azure_mgmt_event_grid'
137
- sdk_information = "#{sdk_information}/0.15.2"
140
+ sdk_information = "#{sdk_information}/0.15.3"
138
141
  add_user_agent_information(sdk_information)
139
142
  end
140
143
  end
@@ -1490,12 +1490,12 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
1490
1490
 
1491
1491
  request_headers = {}
1492
1492
 
1493
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1494
+
1493
1495
  # Set Headers
1494
1496
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1495
1497
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1496
1498
 
1497
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1498
-
1499
1499
  # Serialize Request
1500
1500
  request_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::EventSubscription.mapper()
1501
1501
  request_content = @client.serialize(request_mapper, event_subscription_info)
@@ -1746,12 +1746,12 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
1746
1746
 
1747
1747
  request_headers = {}
1748
1748
 
1749
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1750
+
1749
1751
  # Set Headers
1750
1752
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1751
1753
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1752
1754
 
1753
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1754
-
1755
1755
  # Serialize Request
1756
1756
  request_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::EventSubscriptionUpdateParameters.mapper()
1757
1757
  request_content = @client.serialize(request_mapper, event_subscription_update_parameters)
@@ -0,0 +1,54 @@
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::EventGrid::Mgmt::V2017_09_15_preview
7
+ module Models
8
+ #
9
+ # Properties of the Topic update
10
+ #
11
+ class TopicUpdateParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Tags of the resource
16
+ attr_accessor :tags
17
+
18
+
19
+ #
20
+ # Mapper for TopicUpdateParameters class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'TopicUpdateParameters',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'TopicUpdateParameters',
31
+ model_properties: {
32
+ tags: {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'tags',
36
+ type: {
37
+ name: 'Dictionary',
38
+ value: {
39
+ client_side_validation: true,
40
+ required: false,
41
+ serialized_name: 'StringElementType',
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end
@@ -211,6 +211,56 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
211
211
  promise
212
212
  end
213
213
 
214
+ #
215
+ # Update a topic
216
+ #
217
+ # Asynchronously updates a topic with the specified parameters.
218
+ #
219
+ # @param resource_group_name [String] The name of the resource group within the
220
+ # user's subscription.
221
+ # @param topic_name [String] Name of the topic
222
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
223
+ # information
224
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
225
+ # will be added to the HTTP request.
226
+ #
227
+ # @return [Topic] operation results.
228
+ #
229
+ def update(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil)
230
+ response = update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value!
231
+ response.body unless response.nil?
232
+ end
233
+
234
+ #
235
+ # @param resource_group_name [String] The name of the resource group within the
236
+ # user's subscription.
237
+ # @param topic_name [String] Name of the topic
238
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
239
+ # information
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [Concurrent::Promise] promise which provides async access to http
244
+ # response.
245
+ #
246
+ def update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil)
247
+ # Send request
248
+ promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers)
249
+
250
+ promise = promise.then do |response|
251
+ # Defining deserialization method.
252
+ deserialize_method = lambda do |parsed_response|
253
+ result_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::Topic.mapper()
254
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
255
+ end
256
+
257
+ # Waiting for response.
258
+ @client.get_long_running_operation_result(response, deserialize_method)
259
+ end
260
+
261
+ promise
262
+ end
263
+
214
264
  #
215
265
  # List topics under an Azure subscription
216
266
  #
@@ -560,12 +610,12 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
560
610
 
561
611
  request_headers = {}
562
612
 
613
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
614
+
563
615
  # Set Headers
564
616
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
617
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
618
 
567
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
568
-
569
619
  # Serialize Request
570
620
  request_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::TopicRegenerateKeyRequest.mapper()
571
621
  request_content = @client.serialize(request_mapper, regenerate_key_request)
@@ -781,12 +831,12 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
781
831
 
782
832
  request_headers = {}
783
833
 
834
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
835
+
784
836
  # Set Headers
785
837
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
786
838
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
787
839
 
788
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
789
-
790
840
  # Serialize Request
791
841
  request_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::Topic.mapper()
792
842
  request_content = @client.serialize(request_mapper, topic_info)
@@ -922,5 +972,121 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
922
972
  promise.execute
923
973
  end
924
974
 
975
+ #
976
+ # Update a topic
977
+ #
978
+ # Asynchronously updates a topic with the specified parameters.
979
+ #
980
+ # @param resource_group_name [String] The name of the resource group within the
981
+ # user's subscription.
982
+ # @param topic_name [String] Name of the topic
983
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
984
+ # information
985
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
986
+ # will be added to the HTTP request.
987
+ #
988
+ # @return [Topic] operation results.
989
+ #
990
+ def begin_update(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil)
991
+ response = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value!
992
+ response.body unless response.nil?
993
+ end
994
+
995
+ #
996
+ # Update a topic
997
+ #
998
+ # Asynchronously updates a topic with the specified parameters.
999
+ #
1000
+ # @param resource_group_name [String] The name of the resource group within the
1001
+ # user's subscription.
1002
+ # @param topic_name [String] Name of the topic
1003
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
1004
+ # information
1005
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1006
+ # will be added to the HTTP request.
1007
+ #
1008
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1009
+ #
1010
+ def begin_update_with_http_info(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil)
1011
+ begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers).value!
1012
+ end
1013
+
1014
+ #
1015
+ # Update a topic
1016
+ #
1017
+ # Asynchronously updates a topic with the specified parameters.
1018
+ #
1019
+ # @param resource_group_name [String] The name of the resource group within the
1020
+ # user's subscription.
1021
+ # @param topic_name [String] Name of the topic
1022
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
1023
+ # information
1024
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1025
+ # to the HTTP request.
1026
+ #
1027
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1028
+ #
1029
+ def begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers = nil)
1030
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1031
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1032
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
1033
+ fail ArgumentError, 'topic_update_parameters is nil' if topic_update_parameters.nil?
1034
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1035
+
1036
+
1037
+ request_headers = {}
1038
+
1039
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1040
+
1041
+ # Set Headers
1042
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1043
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1044
+
1045
+ # Serialize Request
1046
+ request_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::TopicUpdateParameters.mapper()
1047
+ request_content = @client.serialize(request_mapper, topic_update_parameters)
1048
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1049
+
1050
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1051
+
1052
+ request_url = @base_url || @client.base_url
1053
+
1054
+ options = {
1055
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1056
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
1057
+ query_params: {'api-version' => @client.api_version},
1058
+ body: request_content,
1059
+ headers: request_headers.merge(custom_headers || {}),
1060
+ base_url: request_url
1061
+ }
1062
+ promise = @client.make_request_async(:patch, path_template, options)
1063
+
1064
+ promise = promise.then do |result|
1065
+ http_response = result.response
1066
+ status_code = http_response.status
1067
+ response_content = http_response.body
1068
+ unless status_code == 201
1069
+ error_model = JSON.load(response_content)
1070
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1071
+ end
1072
+
1073
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1074
+ # Deserialize Response
1075
+ if status_code == 201
1076
+ begin
1077
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1078
+ result_mapper = Azure::EventGrid::Mgmt::V2017_09_15_preview::Models::Topic.mapper()
1079
+ result.body = @client.deserialize(result_mapper, parsed_response)
1080
+ rescue Exception => e
1081
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1082
+ end
1083
+ end
1084
+
1085
+ result
1086
+ end
1087
+
1088
+ promise.execute
1089
+ end
1090
+
925
1091
  end
926
1092
  end
@@ -27,19 +27,20 @@ module Azure::EventGrid::Mgmt::V2017_09_15_preview
27
27
  autoload :EventGridManagementClient, '2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb'
28
28
 
29
29
  module Models
30
- autoload :Operation, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/operation.rb'
31
30
  autoload :OperationsListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb'
32
- autoload :EventSubscriptionFilter, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb'
33
31
  autoload :EventSubscriptionDestination, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb'
34
- autoload :OperationInfo, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb'
35
- autoload :EventTypesListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb'
36
- autoload :TopicSharedAccessKeys, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb'
37
- autoload :EventSubscriptionUpdateParameters, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb'
32
+ autoload :Operation, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/operation.rb'
38
33
  autoload :Resource, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/resource.rb'
39
- autoload :EventSubscriptionsListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb'
34
+ autoload :EventSubscriptionFilter, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb'
35
+ autoload :TopicSharedAccessKeys, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb'
36
+ autoload :EventTypesListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb'
37
+ autoload :TopicRegenerateKeyRequest, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb'
40
38
  autoload :EventSubscriptionFullUrl, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb'
39
+ autoload :OperationInfo, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb'
41
40
  autoload :TopicTypesListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb'
42
- autoload :TopicRegenerateKeyRequest, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb'
41
+ autoload :EventSubscriptionsListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb'
42
+ autoload :TopicUpdateParameters, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb'
43
+ autoload :EventSubscriptionUpdateParameters, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb'
43
44
  autoload :TopicsListResult, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb'
44
45
  autoload :WebHookEventSubscriptionDestination, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb'
45
46
  autoload :EventHubEventSubscriptionDestination, '2017-09-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb'
@@ -0,0 +1,144 @@
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::EventGrid::Mgmt::V2018_01_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class EventGridManagementClient < 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] Version of the API to be used with the client request.
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 [EventSubscriptions] event_subscriptions
40
+ attr_reader :event_subscriptions
41
+
42
+ # @return [Operations] operations
43
+ attr_reader :operations
44
+
45
+ # @return [Topics] topics
46
+ attr_reader :topics
47
+
48
+ # @return [TopicTypes] topic_types
49
+ attr_reader :topic_types
50
+
51
+ #
52
+ # Creates initializes a new instance of the EventGridManagementClient class.
53
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
54
+ # @param base_url [String] the base URI of the service.
55
+ # @param options [Array] filters to be applied to the HTTP requests.
56
+ #
57
+ def initialize(credentials = nil, base_url = nil, options = nil)
58
+ super(credentials, options)
59
+ @base_url = base_url || 'https://management.azure.com'
60
+
61
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
62
+ @credentials = credentials
63
+
64
+ @event_subscriptions = EventSubscriptions.new(self)
65
+ @operations = Operations.new(self)
66
+ @topics = Topics.new(self)
67
+ @topic_types = TopicTypes.new(self)
68
+ @api_version = '2018-01-01'
69
+ @accept_language = 'en-US'
70
+ @long_running_operation_retry_timeout = 30
71
+ @generate_client_request_id = true
72
+ add_telemetry
73
+ end
74
+
75
+ #
76
+ # Makes a request and returns the body of the response.
77
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
78
+ # @param path [String] the path, relative to {base_url}.
79
+ # @param options [Hash{String=>String}] specifying any request options like :body.
80
+ # @return [Hash{String=>String}] containing the body of the response.
81
+ # Example:
82
+ #
83
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
84
+ # path = "/path"
85
+ # options = {
86
+ # body: request_content,
87
+ # query_params: {'api-version' => '2016-02-01'}
88
+ # }
89
+ # result = @client.make_request(:put, path, options)
90
+ #
91
+ def make_request(method, path, options = {})
92
+ result = make_request_with_http_info(method, path, options)
93
+ result.body unless result.nil?
94
+ end
95
+
96
+ #
97
+ # Makes a request and returns the operation response.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
102
+ #
103
+ def make_request_with_http_info(method, path, options = {})
104
+ result = make_request_async(method, path, options).value!
105
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
106
+ result
107
+ end
108
+
109
+ #
110
+ # Makes a request asynchronously.
111
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
112
+ # @param path [String] the path, relative to {base_url}.
113
+ # @param options [Hash{String=>String}] specifying any request options like :body.
114
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
115
+ #
116
+ def make_request_async(method, path, options = {})
117
+ fail ArgumentError, 'method is nil' if method.nil?
118
+ fail ArgumentError, 'path is nil' if path.nil?
119
+
120
+ request_url = options[:base_url] || @base_url
121
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
122
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
123
+ end
124
+
125
+ request_headers = @request_headers
126
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
127
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
128
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
129
+
130
+ super(request_url, method, path, options)
131
+ end
132
+
133
+
134
+ private
135
+ #
136
+ # Adds telemetry information.
137
+ #
138
+ def add_telemetry
139
+ sdk_information = 'azure_mgmt_event_grid'
140
+ sdk_information = "#{sdk_information}/0.15.3"
141
+ add_user_agent_information(sdk_information)
142
+ end
143
+ end
144
+ end