azure_mgmt_event_grid 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  3. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  4. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  5. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  6. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid.rb +91 -0
  7. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb +231 -0
  8. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/domains.rb +986 -0
  9. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +153 -0
  10. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +1917 -0
  11. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb +70 -0
  12. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb +69 -0
  13. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb +50 -0
  14. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain.rb +140 -0
  15. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb +20 -0
  16. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb +46 -0
  17. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb +57 -0
  18. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb +62 -0
  19. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb +55 -0
  20. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb +54 -0
  21. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb +55 -0
  22. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb +17 -0
  23. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +62 -0
  24. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb +189 -0
  25. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +49 -0
  26. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +120 -0
  27. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  28. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +21 -0
  29. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +137 -0
  30. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +55 -0
  31. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb +95 -0
  32. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  33. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb +64 -0
  34. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/input_schema.rb +17 -0
  35. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb +49 -0
  36. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb +50 -0
  37. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb +65 -0
  38. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb +130 -0
  39. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb +69 -0
  40. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb +69 -0
  41. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb +77 -0
  42. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb +69 -0
  43. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb +69 -0
  44. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb +77 -0
  45. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  46. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  47. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  48. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/resource.rb +80 -0
  49. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  50. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb +57 -0
  51. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb +74 -0
  52. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb +75 -0
  53. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb +77 -0
  54. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb +77 -0
  55. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb +77 -0
  56. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb +77 -0
  57. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb +77 -0
  58. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic.rb +144 -0
  59. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  60. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  61. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  62. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb +139 -0
  63. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  64. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  65. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +54 -0
  66. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb +55 -0
  67. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  68. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +75 -0
  69. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  70. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/operations.rb +116 -0
  71. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/topic_types.rb +299 -0
  72. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/topics.rb +1095 -0
  73. data/lib/azure_mgmt_event_grid.rb +1 -0
  74. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +187 -99
  75. data/lib/version.rb +1 -1
  76. metadata +69 -2
@@ -0,0 +1,92 @@
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_09_15_preview
7
+ module Models
8
+ #
9
+ # Definition of a Tracked Resource
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Location of the resource
16
+ attr_accessor :location
17
+
18
+ # @return [Hash{String => String}] Tags of the resource
19
+ attr_accessor :tags
20
+
21
+
22
+ #
23
+ # Mapper for TrackedResource class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'TrackedResource',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'TrackedResource',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'id',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'name',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ type: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ location: {
63
+ client_side_validation: true,
64
+ required: true,
65
+ serialized_name: 'location',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ tags: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ serialized_name: 'tags',
74
+ type: {
75
+ name: 'Dictionary',
76
+ value: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'StringElementType',
80
+ type: {
81
+ name: 'String'
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,75 @@
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_09_15_preview
7
+ module Models
8
+ #
9
+ # Information about the webhook destination for an event subscription
10
+ #
11
+ class WebHookEventSubscriptionDestination < EventSubscriptionDestination
12
+
13
+ include MsRestAzure
14
+
15
+
16
+ def initialize
17
+ @endpointType = "WebHook"
18
+ end
19
+
20
+ attr_accessor :endpointType
21
+
22
+ # @return [String] The URL that represents the endpoint of the
23
+ # destination of an event subscription.
24
+ attr_accessor :endpoint_url
25
+
26
+ # @return [String] The base URL that represents the endpoint of the
27
+ # destination of an event subscription.
28
+ attr_accessor :endpoint_base_url
29
+
30
+
31
+ #
32
+ # Mapper for WebHookEventSubscriptionDestination class as Ruby Hash.
33
+ # This will be used for serialization/deserialization.
34
+ #
35
+ def self.mapper()
36
+ {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'WebHook',
40
+ type: {
41
+ name: 'Composite',
42
+ class_name: 'WebHookEventSubscriptionDestination',
43
+ model_properties: {
44
+ endpointType: {
45
+ client_side_validation: true,
46
+ required: true,
47
+ serialized_name: 'endpointType',
48
+ type: {
49
+ name: 'String'
50
+ }
51
+ },
52
+ endpoint_url: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'properties.endpointUrl',
56
+ type: {
57
+ name: 'String'
58
+ }
59
+ },
60
+ endpoint_base_url: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ read_only: true,
64
+ serialized_name: 'properties.endpointBaseUrl',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::EventGrid end
8
+ module Azure::EventGrid::Mgmt end
9
+ module Azure::EventGrid::Mgmt::V2018_09_15_preview end
@@ -0,0 +1,116 @@
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_09_15_preview
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventGridManagementClient] reference to the EventGridManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List available operations
26
+ #
27
+ # List the available operations supported by the Microsoft.EventGrid resource
28
+ # provider
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [OperationsListResult] operation results.
34
+ #
35
+ def list(custom_headers:nil)
36
+ response = list_async(custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # List available operations
42
+ #
43
+ # List the available operations supported by the Microsoft.EventGrid resource
44
+ # provider
45
+ #
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(custom_headers:nil)
52
+ list_async(custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # List available operations
57
+ #
58
+ # List the available operations supported by the Microsoft.EventGrid resource
59
+ # provider
60
+ #
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'providers/Microsoft.EventGrid/operations'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::EventGrid::Mgmt::V2018_09_15_preview::Models::OperationsListResult.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ end
116
+ end
@@ -0,0 +1,299 @@
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_09_15_preview
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class TopicTypes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the TopicTypes class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventGridManagementClient] reference to the EventGridManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List topic types
26
+ #
27
+ # List all registered topic types
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [TopicTypesListResult] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ response = list_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # List topic types
41
+ #
42
+ # List all registered topic types
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # List topic types
55
+ #
56
+ # List all registered topic types
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'providers/Microsoft.EventGrid/topicTypes'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::EventGrid::Mgmt::V2018_09_15_preview::Models::TopicTypesListResult.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
112
+ #
113
+ # Get a topic type
114
+ #
115
+ # Get information about a topic type
116
+ #
117
+ # @param topic_type_name [String] Name of the topic type
118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
119
+ # will be added to the HTTP request.
120
+ #
121
+ # @return [TopicTypeInfo] operation results.
122
+ #
123
+ def get(topic_type_name, custom_headers:nil)
124
+ response = get_async(topic_type_name, custom_headers:custom_headers).value!
125
+ response.body unless response.nil?
126
+ end
127
+
128
+ #
129
+ # Get a topic type
130
+ #
131
+ # Get information about a topic type
132
+ #
133
+ # @param topic_type_name [String] Name of the topic type
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
138
+ #
139
+ def get_with_http_info(topic_type_name, custom_headers:nil)
140
+ get_async(topic_type_name, custom_headers:custom_headers).value!
141
+ end
142
+
143
+ #
144
+ # Get a topic type
145
+ #
146
+ # Get information about a topic type
147
+ #
148
+ # @param topic_type_name [String] Name of the topic type
149
+ # @param [Hash{String => String}] A hash of custom headers that will be added
150
+ # to the HTTP request.
151
+ #
152
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
+ #
154
+ def get_async(topic_type_name, custom_headers:nil)
155
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
156
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
157
+
158
+
159
+ request_headers = {}
160
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
161
+
162
+ # Set Headers
163
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
164
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
165
+ path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'
166
+
167
+ request_url = @base_url || @client.base_url
168
+
169
+ options = {
170
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
171
+ path_params: {'topicTypeName' => topic_type_name},
172
+ query_params: {'api-version' => @client.api_version},
173
+ headers: request_headers.merge(custom_headers || {}),
174
+ base_url: request_url
175
+ }
176
+ promise = @client.make_request_async(:get, path_template, options)
177
+
178
+ promise = promise.then do |result|
179
+ http_response = result.response
180
+ status_code = http_response.status
181
+ response_content = http_response.body
182
+ unless status_code == 200
183
+ error_model = JSON.load(response_content)
184
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
185
+ end
186
+
187
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
188
+ # Deserialize Response
189
+ if status_code == 200
190
+ begin
191
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
192
+ result_mapper = Azure::EventGrid::Mgmt::V2018_09_15_preview::Models::TopicTypeInfo.mapper()
193
+ result.body = @client.deserialize(result_mapper, parsed_response)
194
+ rescue Exception => e
195
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
196
+ end
197
+ end
198
+
199
+ result
200
+ end
201
+
202
+ promise.execute
203
+ end
204
+
205
+ #
206
+ # List event types
207
+ #
208
+ # List event types for a topic type
209
+ #
210
+ # @param topic_type_name [String] Name of the topic type
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ # @return [EventTypesListResult] operation results.
215
+ #
216
+ def list_event_types(topic_type_name, custom_headers:nil)
217
+ response = list_event_types_async(topic_type_name, custom_headers:custom_headers).value!
218
+ response.body unless response.nil?
219
+ end
220
+
221
+ #
222
+ # List event types
223
+ #
224
+ # List event types for a topic type
225
+ #
226
+ # @param topic_type_name [String] Name of the topic type
227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
228
+ # will be added to the HTTP request.
229
+ #
230
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
231
+ #
232
+ def list_event_types_with_http_info(topic_type_name, custom_headers:nil)
233
+ list_event_types_async(topic_type_name, custom_headers:custom_headers).value!
234
+ end
235
+
236
+ #
237
+ # List event types
238
+ #
239
+ # List event types for a topic type
240
+ #
241
+ # @param topic_type_name [String] Name of the topic type
242
+ # @param [Hash{String => String}] A hash of custom headers that will be added
243
+ # to the HTTP request.
244
+ #
245
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
246
+ #
247
+ def list_event_types_async(topic_type_name, custom_headers:nil)
248
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
249
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
250
+
251
+
252
+ request_headers = {}
253
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
254
+
255
+ # Set Headers
256
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
257
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
258
+ path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'
259
+
260
+ request_url = @base_url || @client.base_url
261
+
262
+ options = {
263
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
264
+ path_params: {'topicTypeName' => topic_type_name},
265
+ query_params: {'api-version' => @client.api_version},
266
+ headers: request_headers.merge(custom_headers || {}),
267
+ base_url: request_url
268
+ }
269
+ promise = @client.make_request_async(:get, path_template, options)
270
+
271
+ promise = promise.then do |result|
272
+ http_response = result.response
273
+ status_code = http_response.status
274
+ response_content = http_response.body
275
+ unless status_code == 200
276
+ error_model = JSON.load(response_content)
277
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
278
+ end
279
+
280
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
281
+ # Deserialize Response
282
+ if status_code == 200
283
+ begin
284
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
285
+ result_mapper = Azure::EventGrid::Mgmt::V2018_09_15_preview::Models::EventTypesListResult.mapper()
286
+ result.body = @client.deserialize(result_mapper, parsed_response)
287
+ rescue Exception => e
288
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
289
+ end
290
+ end
291
+
292
+ result
293
+ end
294
+
295
+ promise.execute
296
+ end
297
+
298
+ end
299
+ end