azure_mgmt_stream_analytics 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_stream_analytics.rb +5 -0
  4. data/lib/generated/azure_mgmt_stream_analytics.rb +102 -0
  5. data/lib/generated/azure_mgmt_stream_analytics/functions.rb +1055 -0
  6. data/lib/generated/azure_mgmt_stream_analytics/inputs.rb +923 -0
  7. data/lib/generated/azure_mgmt_stream_analytics/models/avro_serialization.rb +61 -0
  8. data/lib/generated/azure_mgmt_stream_analytics/models/azure_machine_learning_web_service_function_binding.rb +115 -0
  9. data/lib/generated/azure_mgmt_stream_analytics/models/azure_machine_learning_web_service_function_retrieve_default_definition_parameters.rb +75 -0
  10. data/lib/generated/azure_mgmt_stream_analytics/models/azure_machine_learning_web_service_input_column.rb +71 -0
  11. data/lib/generated/azure_mgmt_stream_analytics/models/azure_machine_learning_web_service_inputs.rb +65 -0
  12. data/lib/generated/azure_mgmt_stream_analytics/models/azure_machine_learning_web_service_output_column.rb +60 -0
  13. data/lib/generated/azure_mgmt_stream_analytics/models/azure_sql_database_data_source_properties.rb +91 -0
  14. data/lib/generated/azure_mgmt_stream_analytics/models/azure_sql_database_output_data_source.rb +104 -0
  15. data/lib/generated/azure_mgmt_stream_analytics/models/azure_table_output_data_source.rb +135 -0
  16. data/lib/generated/azure_mgmt_stream_analytics/models/blob_data_source_properties.rb +107 -0
  17. data/lib/generated/azure_mgmt_stream_analytics/models/blob_output_data_source.rb +121 -0
  18. data/lib/generated/azure_mgmt_stream_analytics/models/blob_reference_input_data_source.rb +121 -0
  19. data/lib/generated/azure_mgmt_stream_analytics/models/blob_stream_input_data_source.rb +132 -0
  20. data/lib/generated/azure_mgmt_stream_analytics/models/compatibility_level.rb +15 -0
  21. data/lib/generated/azure_mgmt_stream_analytics/models/csv_serialization.rb +79 -0
  22. data/lib/generated/azure_mgmt_stream_analytics/models/diagnostic_condition.rb +72 -0
  23. data/lib/generated/azure_mgmt_stream_analytics/models/diagnostics.rb +57 -0
  24. data/lib/generated/azure_mgmt_stream_analytics/models/document_db_output_data_source.rb +121 -0
  25. data/lib/generated/azure_mgmt_stream_analytics/models/encoding.rb +15 -0
  26. data/lib/generated/azure_mgmt_stream_analytics/models/error_response.rb +57 -0
  27. data/lib/generated/azure_mgmt_stream_analytics/models/event_hub_data_source_properties.rb +67 -0
  28. data/lib/generated/azure_mgmt_stream_analytics/models/event_hub_output_data_source.rb +106 -0
  29. data/lib/generated/azure_mgmt_stream_analytics/models/event_hub_stream_input_data_source.rb +109 -0
  30. data/lib/generated/azure_mgmt_stream_analytics/models/events_out_of_order_policy.rb +16 -0
  31. data/lib/generated/azure_mgmt_stream_analytics/models/function.rb +73 -0
  32. data/lib/generated/azure_mgmt_stream_analytics/models/function_binding.rb +48 -0
  33. data/lib/generated/azure_mgmt_stream_analytics/models/function_input.rb +60 -0
  34. data/lib/generated/azure_mgmt_stream_analytics/models/function_list_result.rb +97 -0
  35. data/lib/generated/azure_mgmt_stream_analytics/models/function_output.rb +48 -0
  36. data/lib/generated/azure_mgmt_stream_analytics/models/function_properties.rb +60 -0
  37. data/lib/generated/azure_mgmt_stream_analytics/models/function_retrieve_default_definition_parameters.rb +49 -0
  38. data/lib/generated/azure_mgmt_stream_analytics/models/input.rb +73 -0
  39. data/lib/generated/azure_mgmt_stream_analytics/models/input_list_result.rb +97 -0
  40. data/lib/generated/azure_mgmt_stream_analytics/models/input_properties.rb +89 -0
  41. data/lib/generated/azure_mgmt_stream_analytics/models/io_thub_stream_input_data_source.rb +106 -0
  42. data/lib/generated/azure_mgmt_stream_analytics/models/java_script_function_binding.rb +60 -0
  43. data/lib/generated/azure_mgmt_stream_analytics/models/java_script_function_retrieve_default_definition_parameters.rb +73 -0
  44. data/lib/generated/azure_mgmt_stream_analytics/models/json_output_serialization_format.rb +16 -0
  45. data/lib/generated/azure_mgmt_stream_analytics/models/json_serialization.rb +80 -0
  46. data/lib/generated/azure_mgmt_stream_analytics/models/operation.rb +60 -0
  47. data/lib/generated/azure_mgmt_stream_analytics/models/operation_display.rb +82 -0
  48. data/lib/generated/azure_mgmt_stream_analytics/models/operation_list_result.rb +99 -0
  49. data/lib/generated/azure_mgmt_stream_analytics/models/output.rb +115 -0
  50. data/lib/generated/azure_mgmt_stream_analytics/models/output_data_source.rb +52 -0
  51. data/lib/generated/azure_mgmt_stream_analytics/models/output_error_policy.rb +16 -0
  52. data/lib/generated/azure_mgmt_stream_analytics/models/output_list_result.rb +97 -0
  53. data/lib/generated/azure_mgmt_stream_analytics/models/output_start_mode.rb +17 -0
  54. data/lib/generated/azure_mgmt_stream_analytics/models/reference_input_data_source.rb +46 -0
  55. data/lib/generated/azure_mgmt_stream_analytics/models/reference_input_properties.rb +91 -0
  56. data/lib/generated/azure_mgmt_stream_analytics/models/resource_test_status.rb +59 -0
  57. data/lib/generated/azure_mgmt_stream_analytics/models/scalar_function_properties.rb +102 -0
  58. data/lib/generated/azure_mgmt_stream_analytics/models/serialization.rb +49 -0
  59. data/lib/generated/azure_mgmt_stream_analytics/models/service_bus_data_source_properties.rb +71 -0
  60. data/lib/generated/azure_mgmt_stream_analytics/models/service_bus_queue_output_data_source.rb +113 -0
  61. data/lib/generated/azure_mgmt_stream_analytics/models/service_bus_topic_output_data_source.rb +113 -0
  62. data/lib/generated/azure_mgmt_stream_analytics/models/sku.rb +46 -0
  63. data/lib/generated/azure_mgmt_stream_analytics/models/sku_name.rb +15 -0
  64. data/lib/generated/azure_mgmt_stream_analytics/models/start_streaming_job_parameters.rb +64 -0
  65. data/lib/generated/azure_mgmt_stream_analytics/models/storage_account.rb +57 -0
  66. data/lib/generated/azure_mgmt_stream_analytics/models/stream_input_data_source.rb +48 -0
  67. data/lib/generated/azure_mgmt_stream_analytics/models/stream_input_properties.rb +90 -0
  68. data/lib/generated/azure_mgmt_stream_analytics/models/streaming_job.rb +353 -0
  69. data/lib/generated/azure_mgmt_stream_analytics/models/streaming_job_list_result.rb +97 -0
  70. data/lib/generated/azure_mgmt_stream_analytics/models/sub_resource.rb +64 -0
  71. data/lib/generated/azure_mgmt_stream_analytics/models/subscription_quota.rb +80 -0
  72. data/lib/generated/azure_mgmt_stream_analytics/models/subscription_quotas_list_result.rb +56 -0
  73. data/lib/generated/azure_mgmt_stream_analytics/models/transformation.rb +98 -0
  74. data/lib/generated/azure_mgmt_stream_analytics/models/udf_type.rb +15 -0
  75. data/lib/generated/azure_mgmt_stream_analytics/module_definition.rb +8 -0
  76. data/lib/generated/azure_mgmt_stream_analytics/operations.rb +213 -0
  77. data/lib/generated/azure_mgmt_stream_analytics/outputs.rb +924 -0
  78. data/lib/generated/azure_mgmt_stream_analytics/stream_analytics_management_client.rb +155 -0
  79. data/lib/generated/azure_mgmt_stream_analytics/streaming_jobs.rb +1327 -0
  80. data/lib/generated/azure_mgmt_stream_analytics/subscriptions.rb +121 -0
  81. data/lib/generated/azure_mgmt_stream_analytics/transformations.rb +427 -0
  82. data/lib/generated/azure_mgmt_stream_analytics/version.rb +8 -0
  83. metadata +195 -0
@@ -0,0 +1,155 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::StreamAnalytics
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class StreamAnalyticsManagementClient < 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] GUID which uniquely identify Microsoft Azure
21
+ # subscription. The subscription ID forms part of the URI for every service
22
+ # 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 [StreamingJobs] streaming_jobs
43
+ attr_reader :streaming_jobs
44
+
45
+ # @return [Inputs] inputs
46
+ attr_reader :inputs
47
+
48
+ # @return [Outputs] outputs
49
+ attr_reader :outputs
50
+
51
+ # @return [Transformations] transformations
52
+ attr_reader :transformations
53
+
54
+ # @return [Functions] functions
55
+ attr_reader :functions
56
+
57
+ # @return [Subscriptions] subscriptions
58
+ attr_reader :subscriptions
59
+
60
+ #
61
+ # Creates initializes a new instance of the StreamAnalyticsManagementClient class.
62
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
63
+ # @param base_url [String] the base URI of the service.
64
+ # @param options [Array] filters to be applied to the HTTP requests.
65
+ #
66
+ def initialize(credentials = nil, base_url = nil, options = nil)
67
+ super(credentials, options)
68
+ @base_url = base_url || 'https://management.azure.com'
69
+
70
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
71
+ @credentials = credentials
72
+
73
+ @operations = Operations.new(self)
74
+ @streaming_jobs = StreamingJobs.new(self)
75
+ @inputs = Inputs.new(self)
76
+ @outputs = Outputs.new(self)
77
+ @transformations = Transformations.new(self)
78
+ @functions = Functions.new(self)
79
+ @subscriptions = Subscriptions.new(self)
80
+ @api_version = '2016-03-01'
81
+ @accept_language = 'en-US'
82
+ @long_running_operation_retry_timeout = 30
83
+ @generate_client_request_id = true
84
+ add_telemetry
85
+ end
86
+
87
+ #
88
+ # Makes a request and returns the body of the response.
89
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
90
+ # @param path [String] the path, relative to {base_url}.
91
+ # @param options [Hash{String=>String}] specifying any request options like :body.
92
+ # @return [Hash{String=>String}] containing the body of the response.
93
+ # Example:
94
+ #
95
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
96
+ # path = "/path"
97
+ # options = {
98
+ # body: request_content,
99
+ # query_params: {'api-version' => '2016-02-01'}
100
+ # }
101
+ # result = @client.make_request(:put, path, options)
102
+ #
103
+ def make_request(method, path, options = {})
104
+ result = make_request_with_http_info(method, path, options)
105
+ result.body unless result.nil?
106
+ end
107
+
108
+ #
109
+ # Makes a request and returns the operation response.
110
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
111
+ # @param path [String] the path, relative to {base_url}.
112
+ # @param options [Hash{String=>String}] specifying any request options like :body.
113
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
114
+ #
115
+ def make_request_with_http_info(method, path, options = {})
116
+ result = make_request_async(method, path, options).value!
117
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
118
+ result
119
+ end
120
+
121
+ #
122
+ # Makes a request asynchronously.
123
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
124
+ # @param path [String] the path, relative to {base_url}.
125
+ # @param options [Hash{String=>String}] specifying any request options like :body.
126
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
127
+ #
128
+ def make_request_async(method, path, options = {})
129
+ fail ArgumentError, 'method is nil' if method.nil?
130
+ fail ArgumentError, 'path is nil' if path.nil?
131
+
132
+ request_url = options[:base_url] || @base_url
133
+
134
+ request_headers = @request_headers
135
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
136
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
137
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
138
+
139
+ super(request_url, method, path, options)
140
+ end
141
+
142
+
143
+ private
144
+ #
145
+ # Adds telemetry information.
146
+ #
147
+ def add_telemetry
148
+ sdk_information = 'azure_mgmt_stream_analytics'
149
+ if defined? Azure::ARM::StreamAnalytics::VERSION
150
+ sdk_information = "#{sdk_information}/#{Azure::ARM::StreamAnalytics::VERSION}"
151
+ end
152
+ add_user_agent_information(sdk_information)
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,1327 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::StreamAnalytics
7
+ #
8
+ # Stream Analytics Client
9
+ #
10
+ class StreamingJobs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the StreamingJobs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StreamAnalyticsManagementClient] reference to the StreamAnalyticsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates a streaming job or replaces an already existing streaming job.
26
+ #
27
+ # @param streaming_job [StreamingJob] The definition of the streaming job that
28
+ # will be used to create a new streaming job or replace the existing one.
29
+ # @param resource_group_name [String] The name of the resource group that
30
+ # contains the resource. You can obtain this value from the Azure Resource
31
+ # Manager API or the portal.
32
+ # @param job_name [String] The name of the streaming job.
33
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
34
+ # always overwrite the current record set. Specify the last-seen ETag value to
35
+ # prevent accidentally overwritting concurrent changes.
36
+ # @param if_none_match [String] Set to '*' to allow a new streaming job to be
37
+ # created, but to prevent updating an existing record set. Other values will
38
+ # result in a 412 Pre-condition Failed response.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [StreamingJob] operation results.
43
+ #
44
+ def create_or_replace(streaming_job, resource_group_name, job_name, if_match = nil, if_none_match = nil, custom_headers = nil)
45
+ response = create_or_replace_async(streaming_job, resource_group_name, job_name, if_match, if_none_match, custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # @param streaming_job [StreamingJob] The definition of the streaming job that
51
+ # will be used to create a new streaming job or replace the existing one.
52
+ # @param resource_group_name [String] The name of the resource group that
53
+ # contains the resource. You can obtain this value from the Azure Resource
54
+ # Manager API or the portal.
55
+ # @param job_name [String] The name of the streaming job.
56
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
57
+ # always overwrite the current record set. Specify the last-seen ETag value to
58
+ # prevent accidentally overwritting concurrent changes.
59
+ # @param if_none_match [String] Set to '*' to allow a new streaming job to be
60
+ # created, but to prevent updating an existing record set. Other values will
61
+ # result in a 412 Pre-condition Failed response.
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [Concurrent::Promise] promise which provides async access to http
66
+ # response.
67
+ #
68
+ def create_or_replace_async(streaming_job, resource_group_name, job_name, if_match = nil, if_none_match = nil, custom_headers = nil)
69
+ # Send request
70
+ promise = begin_create_or_replace_async(streaming_job, resource_group_name, job_name, if_match, if_none_match, custom_headers)
71
+
72
+ promise = promise.then do |response|
73
+ # Defining deserialization method.
74
+ deserialize_method = lambda do |parsed_response|
75
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
76
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
77
+ end
78
+
79
+ # Waiting for response.
80
+ @client.get_long_running_operation_result(response, deserialize_method)
81
+ end
82
+
83
+ promise
84
+ end
85
+
86
+ #
87
+ # Updates an existing streaming job. This can be used to partially update (ie.
88
+ # update one or two properties) a streaming job without affecting the rest the
89
+ # job definition.
90
+ #
91
+ # @param streaming_job [StreamingJob] A streaming job object. The properties
92
+ # specified here will overwrite the corresponding properties in the existing
93
+ # streaming job (ie. Those properties will be updated). Any properties that are
94
+ # set to null here will mean that the corresponding property in the existing
95
+ # input will remain the same and not change as a result of this PATCH
96
+ # operation.
97
+ # @param resource_group_name [String] The name of the resource group that
98
+ # contains the resource. You can obtain this value from the Azure Resource
99
+ # Manager API or the portal.
100
+ # @param job_name [String] The name of the streaming job.
101
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
102
+ # always overwrite the current record set. Specify the last-seen ETag value to
103
+ # prevent accidentally overwritting concurrent changes.
104
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
105
+ # will be added to the HTTP request.
106
+ #
107
+ # @return [StreamingJob] operation results.
108
+ #
109
+ def update(streaming_job, resource_group_name, job_name, if_match = nil, custom_headers = nil)
110
+ response = update_async(streaming_job, resource_group_name, job_name, if_match, custom_headers).value!
111
+ response.body unless response.nil?
112
+ end
113
+
114
+ #
115
+ # Updates an existing streaming job. This can be used to partially update (ie.
116
+ # update one or two properties) a streaming job without affecting the rest the
117
+ # job definition.
118
+ #
119
+ # @param streaming_job [StreamingJob] A streaming job object. The properties
120
+ # specified here will overwrite the corresponding properties in the existing
121
+ # streaming job (ie. Those properties will be updated). Any properties that are
122
+ # set to null here will mean that the corresponding property in the existing
123
+ # input will remain the same and not change as a result of this PATCH
124
+ # operation.
125
+ # @param resource_group_name [String] The name of the resource group that
126
+ # contains the resource. You can obtain this value from the Azure Resource
127
+ # Manager API or the portal.
128
+ # @param job_name [String] The name of the streaming job.
129
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
130
+ # always overwrite the current record set. Specify the last-seen ETag value to
131
+ # prevent accidentally overwritting concurrent changes.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
136
+ #
137
+ def update_with_http_info(streaming_job, resource_group_name, job_name, if_match = nil, custom_headers = nil)
138
+ update_async(streaming_job, resource_group_name, job_name, if_match, custom_headers).value!
139
+ end
140
+
141
+ #
142
+ # Updates an existing streaming job. This can be used to partially update (ie.
143
+ # update one or two properties) a streaming job without affecting the rest the
144
+ # job definition.
145
+ #
146
+ # @param streaming_job [StreamingJob] A streaming job object. The properties
147
+ # specified here will overwrite the corresponding properties in the existing
148
+ # streaming job (ie. Those properties will be updated). Any properties that are
149
+ # set to null here will mean that the corresponding property in the existing
150
+ # input will remain the same and not change as a result of this PATCH
151
+ # operation.
152
+ # @param resource_group_name [String] The name of the resource group that
153
+ # contains the resource. You can obtain this value from the Azure Resource
154
+ # Manager API or the portal.
155
+ # @param job_name [String] The name of the streaming job.
156
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
157
+ # always overwrite the current record set. Specify the last-seen ETag value to
158
+ # prevent accidentally overwritting concurrent changes.
159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
160
+ # to the HTTP request.
161
+ #
162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
163
+ #
164
+ def update_async(streaming_job, resource_group_name, job_name, if_match = nil, custom_headers = nil)
165
+ fail ArgumentError, 'streaming_job is nil' if streaming_job.nil?
166
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
167
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
168
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
169
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
170
+
171
+
172
+ request_headers = {}
173
+
174
+ # Set Headers
175
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
176
+ request_headers['If-Match'] = if_match unless if_match.nil?
177
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
178
+
179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
180
+
181
+ # Serialize Request
182
+ request_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
183
+ request_content = @client.serialize(request_mapper, streaming_job)
184
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
185
+
186
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ body: request_content,
195
+ headers: request_headers.merge(custom_headers || {}),
196
+ base_url: request_url
197
+ }
198
+ promise = @client.make_request_async(:patch, path_template, options)
199
+
200
+ promise = promise.then do |result|
201
+ http_response = result.response
202
+ status_code = http_response.status
203
+ response_content = http_response.body
204
+ unless status_code == 200
205
+ error_model = JSON.load(response_content)
206
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
207
+ end
208
+
209
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
210
+ # Deserialize Response
211
+ if status_code == 200
212
+ begin
213
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
214
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
215
+ result.body = @client.deserialize(result_mapper, parsed_response)
216
+ rescue Exception => e
217
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
218
+ end
219
+ end
220
+
221
+ result
222
+ end
223
+
224
+ promise.execute
225
+ end
226
+
227
+ #
228
+ # Deletes a streaming job.
229
+ #
230
+ # @param resource_group_name [String] The name of the resource group that
231
+ # contains the resource. You can obtain this value from the Azure Resource
232
+ # Manager API or the portal.
233
+ # @param job_name [String] The name of the streaming job.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ def delete(resource_group_name, job_name, custom_headers = nil)
238
+ response = delete_async(resource_group_name, job_name, custom_headers).value!
239
+ nil
240
+ end
241
+
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group that
244
+ # contains the resource. You can obtain this value from the Azure Resource
245
+ # Manager API or the portal.
246
+ # @param job_name [String] The name of the streaming job.
247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
248
+ # will be added to the HTTP request.
249
+ #
250
+ # @return [Concurrent::Promise] promise which provides async access to http
251
+ # response.
252
+ #
253
+ def delete_async(resource_group_name, job_name, custom_headers = nil)
254
+ # Send request
255
+ promise = begin_delete_async(resource_group_name, job_name, custom_headers)
256
+
257
+ promise = promise.then do |response|
258
+ # Defining deserialization method.
259
+ deserialize_method = lambda do |parsed_response|
260
+ end
261
+
262
+ # Waiting for response.
263
+ @client.get_long_running_operation_result(response, deserialize_method)
264
+ end
265
+
266
+ promise
267
+ end
268
+
269
+ #
270
+ # Gets details about the specified streaming job.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group that
273
+ # contains the resource. You can obtain this value from the Azure Resource
274
+ # Manager API or the portal.
275
+ # @param job_name [String] The name of the streaming job.
276
+ # @param expand [String] The $expand OData query parameter. This is a
277
+ # comma-separated list of additional streaming job properties to include in the
278
+ # response, beyond the default set returned when this parameter is absent. The
279
+ # default set is all streaming job properties other than 'inputs',
280
+ # 'transformation', 'outputs', and 'functions'.
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ # @return [StreamingJob] operation results.
285
+ #
286
+ def get(resource_group_name, job_name, expand = nil, custom_headers = nil)
287
+ response = get_async(resource_group_name, job_name, expand, custom_headers).value!
288
+ response.body unless response.nil?
289
+ end
290
+
291
+ #
292
+ # Gets details about the specified streaming job.
293
+ #
294
+ # @param resource_group_name [String] The name of the resource group that
295
+ # contains the resource. You can obtain this value from the Azure Resource
296
+ # Manager API or the portal.
297
+ # @param job_name [String] The name of the streaming job.
298
+ # @param expand [String] The $expand OData query parameter. This is a
299
+ # comma-separated list of additional streaming job properties to include in the
300
+ # response, beyond the default set returned when this parameter is absent. The
301
+ # default set is all streaming job properties other than 'inputs',
302
+ # 'transformation', 'outputs', and 'functions'.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
307
+ #
308
+ def get_with_http_info(resource_group_name, job_name, expand = nil, custom_headers = nil)
309
+ get_async(resource_group_name, job_name, expand, custom_headers).value!
310
+ end
311
+
312
+ #
313
+ # Gets details about the specified streaming job.
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group that
316
+ # contains the resource. You can obtain this value from the Azure Resource
317
+ # Manager API or the portal.
318
+ # @param job_name [String] The name of the streaming job.
319
+ # @param expand [String] The $expand OData query parameter. This is a
320
+ # comma-separated list of additional streaming job properties to include in the
321
+ # response, beyond the default set returned when this parameter is absent. The
322
+ # default set is all streaming job properties other than 'inputs',
323
+ # 'transformation', 'outputs', and 'functions'.
324
+ # @param [Hash{String => String}] A hash of custom headers that will be added
325
+ # to the HTTP request.
326
+ #
327
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
328
+ #
329
+ def get_async(resource_group_name, job_name, expand = nil, custom_headers = nil)
330
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
331
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
332
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
333
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
334
+
335
+
336
+ request_headers = {}
337
+
338
+ # Set Headers
339
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
340
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
341
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}'
342
+
343
+ request_url = @base_url || @client.base_url
344
+
345
+ options = {
346
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
347
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
348
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
349
+ headers: request_headers.merge(custom_headers || {}),
350
+ base_url: request_url
351
+ }
352
+ promise = @client.make_request_async(:get, path_template, options)
353
+
354
+ promise = promise.then do |result|
355
+ http_response = result.response
356
+ status_code = http_response.status
357
+ response_content = http_response.body
358
+ unless status_code == 200
359
+ error_model = JSON.load(response_content)
360
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
361
+ end
362
+
363
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
364
+ # Deserialize Response
365
+ if status_code == 200
366
+ begin
367
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
368
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
369
+ result.body = @client.deserialize(result_mapper, parsed_response)
370
+ rescue Exception => e
371
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
372
+ end
373
+ end
374
+
375
+ result
376
+ end
377
+
378
+ promise.execute
379
+ end
380
+
381
+ #
382
+ # Lists all of the streaming jobs in the specified resource group.
383
+ #
384
+ # @param resource_group_name [String] The name of the resource group that
385
+ # contains the resource. You can obtain this value from the Azure Resource
386
+ # Manager API or the portal.
387
+ # @param expand [String] The $expand OData query parameter. This is a
388
+ # comma-separated list of additional streaming job properties to include in the
389
+ # response, beyond the default set returned when this parameter is absent. The
390
+ # default set is all streaming job properties other than 'inputs',
391
+ # 'transformation', 'outputs', and 'functions'.
392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
+ # will be added to the HTTP request.
394
+ #
395
+ # @return [Array<StreamingJob>] operation results.
396
+ #
397
+ def list_by_resource_group(resource_group_name, expand = nil, custom_headers = nil)
398
+ first_page = list_by_resource_group_as_lazy(resource_group_name, expand, custom_headers)
399
+ first_page.get_all_items
400
+ end
401
+
402
+ #
403
+ # Lists all of the streaming jobs in the specified resource group.
404
+ #
405
+ # @param resource_group_name [String] The name of the resource group that
406
+ # contains the resource. You can obtain this value from the Azure Resource
407
+ # Manager API or the portal.
408
+ # @param expand [String] The $expand OData query parameter. This is a
409
+ # comma-separated list of additional streaming job properties to include in the
410
+ # response, beyond the default set returned when this parameter is absent. The
411
+ # default set is all streaming job properties other than 'inputs',
412
+ # 'transformation', 'outputs', and 'functions'.
413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
+ # will be added to the HTTP request.
415
+ #
416
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
417
+ #
418
+ def list_by_resource_group_with_http_info(resource_group_name, expand = nil, custom_headers = nil)
419
+ list_by_resource_group_async(resource_group_name, expand, custom_headers).value!
420
+ end
421
+
422
+ #
423
+ # Lists all of the streaming jobs in the specified resource group.
424
+ #
425
+ # @param resource_group_name [String] The name of the resource group that
426
+ # contains the resource. You can obtain this value from the Azure Resource
427
+ # Manager API or the portal.
428
+ # @param expand [String] The $expand OData query parameter. This is a
429
+ # comma-separated list of additional streaming job properties to include in the
430
+ # response, beyond the default set returned when this parameter is absent. The
431
+ # default set is all streaming job properties other than 'inputs',
432
+ # 'transformation', 'outputs', and 'functions'.
433
+ # @param [Hash{String => String}] A hash of custom headers that will be added
434
+ # to the HTTP request.
435
+ #
436
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
437
+ #
438
+ def list_by_resource_group_async(resource_group_name, expand = nil, custom_headers = nil)
439
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
440
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
441
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
442
+
443
+
444
+ request_headers = {}
445
+
446
+ # Set Headers
447
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
448
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
449
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs'
450
+
451
+ request_url = @base_url || @client.base_url
452
+
453
+ options = {
454
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
455
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
456
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
457
+ headers: request_headers.merge(custom_headers || {}),
458
+ base_url: request_url
459
+ }
460
+ promise = @client.make_request_async(:get, path_template, options)
461
+
462
+ promise = promise.then do |result|
463
+ http_response = result.response
464
+ status_code = http_response.status
465
+ response_content = http_response.body
466
+ unless status_code == 200
467
+ error_model = JSON.load(response_content)
468
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
469
+ end
470
+
471
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
472
+ # Deserialize Response
473
+ if status_code == 200
474
+ begin
475
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
476
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJobListResult.mapper()
477
+ result.body = @client.deserialize(result_mapper, parsed_response)
478
+ rescue Exception => e
479
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
480
+ end
481
+ end
482
+
483
+ result
484
+ end
485
+
486
+ promise.execute
487
+ end
488
+
489
+ #
490
+ # Lists all of the streaming jobs in the given subscription.
491
+ #
492
+ # @param expand [String] The $expand OData query parameter. This is a
493
+ # comma-separated list of additional streaming job properties to include in the
494
+ # response, beyond the default set returned when this parameter is absent. The
495
+ # default set is all streaming job properties other than 'inputs',
496
+ # 'transformation', 'outputs', and 'functions'.
497
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
+ # will be added to the HTTP request.
499
+ #
500
+ # @return [Array<StreamingJob>] operation results.
501
+ #
502
+ def list(expand = nil, custom_headers = nil)
503
+ first_page = list_as_lazy(expand, custom_headers)
504
+ first_page.get_all_items
505
+ end
506
+
507
+ #
508
+ # Lists all of the streaming jobs in the given subscription.
509
+ #
510
+ # @param expand [String] The $expand OData query parameter. This is a
511
+ # comma-separated list of additional streaming job properties to include in the
512
+ # response, beyond the default set returned when this parameter is absent. The
513
+ # default set is all streaming job properties other than 'inputs',
514
+ # 'transformation', 'outputs', and 'functions'.
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
519
+ #
520
+ def list_with_http_info(expand = nil, custom_headers = nil)
521
+ list_async(expand, custom_headers).value!
522
+ end
523
+
524
+ #
525
+ # Lists all of the streaming jobs in the given subscription.
526
+ #
527
+ # @param expand [String] The $expand OData query parameter. This is a
528
+ # comma-separated list of additional streaming job properties to include in the
529
+ # response, beyond the default set returned when this parameter is absent. The
530
+ # default set is all streaming job properties other than 'inputs',
531
+ # 'transformation', 'outputs', and 'functions'.
532
+ # @param [Hash{String => String}] A hash of custom headers that will be added
533
+ # to the HTTP request.
534
+ #
535
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
536
+ #
537
+ def list_async(expand = nil, custom_headers = nil)
538
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
539
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
540
+
541
+
542
+ request_headers = {}
543
+
544
+ # Set Headers
545
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
546
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
547
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/streamingjobs'
548
+
549
+ request_url = @base_url || @client.base_url
550
+
551
+ options = {
552
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
553
+ path_params: {'subscriptionId' => @client.subscription_id},
554
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
555
+ headers: request_headers.merge(custom_headers || {}),
556
+ base_url: request_url
557
+ }
558
+ promise = @client.make_request_async(:get, path_template, options)
559
+
560
+ promise = promise.then do |result|
561
+ http_response = result.response
562
+ status_code = http_response.status
563
+ response_content = http_response.body
564
+ unless status_code == 200
565
+ error_model = JSON.load(response_content)
566
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
567
+ end
568
+
569
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
570
+ # Deserialize Response
571
+ if status_code == 200
572
+ begin
573
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
574
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJobListResult.mapper()
575
+ result.body = @client.deserialize(result_mapper, parsed_response)
576
+ rescue Exception => e
577
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
578
+ end
579
+ end
580
+
581
+ result
582
+ end
583
+
584
+ promise.execute
585
+ end
586
+
587
+ #
588
+ # Starts a streaming job. Once a job is started it will start processing input
589
+ # events and produce output.
590
+ #
591
+ # @param resource_group_name [String] The name of the resource group that
592
+ # contains the resource. You can obtain this value from the Azure Resource
593
+ # Manager API or the portal.
594
+ # @param job_name [String] The name of the streaming job.
595
+ # @param start_job_parameters [StartStreamingJobParameters] Parameters
596
+ # applicable to a start streaming job operation.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ def start(resource_group_name, job_name, start_job_parameters = nil, custom_headers = nil)
601
+ response = start_async(resource_group_name, job_name, start_job_parameters, custom_headers).value!
602
+ nil
603
+ end
604
+
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group that
607
+ # contains the resource. You can obtain this value from the Azure Resource
608
+ # Manager API or the portal.
609
+ # @param job_name [String] The name of the streaming job.
610
+ # @param start_job_parameters [StartStreamingJobParameters] Parameters
611
+ # applicable to a start streaming job operation.
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [Concurrent::Promise] promise which provides async access to http
616
+ # response.
617
+ #
618
+ def start_async(resource_group_name, job_name, start_job_parameters = nil, custom_headers = nil)
619
+ # Send request
620
+ promise = begin_start_async(resource_group_name, job_name, start_job_parameters, custom_headers)
621
+
622
+ promise = promise.then do |response|
623
+ # Defining deserialization method.
624
+ deserialize_method = lambda do |parsed_response|
625
+ end
626
+
627
+ # Waiting for response.
628
+ @client.get_long_running_operation_result(response, deserialize_method)
629
+ end
630
+
631
+ promise
632
+ end
633
+
634
+ #
635
+ # Stops a running streaming job. This will cause a running streaming job to
636
+ # stop processing input events and producing output.
637
+ #
638
+ # @param resource_group_name [String] The name of the resource group that
639
+ # contains the resource. You can obtain this value from the Azure Resource
640
+ # Manager API or the portal.
641
+ # @param job_name [String] The name of the streaming job.
642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
643
+ # will be added to the HTTP request.
644
+ #
645
+ def stop(resource_group_name, job_name, custom_headers = nil)
646
+ response = stop_async(resource_group_name, job_name, custom_headers).value!
647
+ nil
648
+ end
649
+
650
+ #
651
+ # @param resource_group_name [String] The name of the resource group that
652
+ # contains the resource. You can obtain this value from the Azure Resource
653
+ # Manager API or the portal.
654
+ # @param job_name [String] The name of the streaming job.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ # @return [Concurrent::Promise] promise which provides async access to http
659
+ # response.
660
+ #
661
+ def stop_async(resource_group_name, job_name, custom_headers = nil)
662
+ # Send request
663
+ promise = begin_stop_async(resource_group_name, job_name, custom_headers)
664
+
665
+ promise = promise.then do |response|
666
+ # Defining deserialization method.
667
+ deserialize_method = lambda do |parsed_response|
668
+ end
669
+
670
+ # Waiting for response.
671
+ @client.get_long_running_operation_result(response, deserialize_method)
672
+ end
673
+
674
+ promise
675
+ end
676
+
677
+ #
678
+ # Creates a streaming job or replaces an already existing streaming job.
679
+ #
680
+ # @param streaming_job [StreamingJob] The definition of the streaming job that
681
+ # will be used to create a new streaming job or replace the existing one.
682
+ # @param resource_group_name [String] The name of the resource group that
683
+ # contains the resource. You can obtain this value from the Azure Resource
684
+ # Manager API or the portal.
685
+ # @param job_name [String] The name of the streaming job.
686
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
687
+ # always overwrite the current record set. Specify the last-seen ETag value to
688
+ # prevent accidentally overwritting concurrent changes.
689
+ # @param if_none_match [String] Set to '*' to allow a new streaming job to be
690
+ # created, but to prevent updating an existing record set. Other values will
691
+ # result in a 412 Pre-condition Failed response.
692
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
693
+ # will be added to the HTTP request.
694
+ #
695
+ # @return [StreamingJob] operation results.
696
+ #
697
+ def begin_create_or_replace(streaming_job, resource_group_name, job_name, if_match = nil, if_none_match = nil, custom_headers = nil)
698
+ response = begin_create_or_replace_async(streaming_job, resource_group_name, job_name, if_match, if_none_match, custom_headers).value!
699
+ response.body unless response.nil?
700
+ end
701
+
702
+ #
703
+ # Creates a streaming job or replaces an already existing streaming job.
704
+ #
705
+ # @param streaming_job [StreamingJob] The definition of the streaming job that
706
+ # will be used to create a new streaming job or replace the existing one.
707
+ # @param resource_group_name [String] The name of the resource group that
708
+ # contains the resource. You can obtain this value from the Azure Resource
709
+ # Manager API or the portal.
710
+ # @param job_name [String] The name of the streaming job.
711
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
712
+ # always overwrite the current record set. Specify the last-seen ETag value to
713
+ # prevent accidentally overwritting concurrent changes.
714
+ # @param if_none_match [String] Set to '*' to allow a new streaming job to be
715
+ # created, but to prevent updating an existing record set. Other values will
716
+ # result in a 412 Pre-condition Failed response.
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
721
+ #
722
+ def begin_create_or_replace_with_http_info(streaming_job, resource_group_name, job_name, if_match = nil, if_none_match = nil, custom_headers = nil)
723
+ begin_create_or_replace_async(streaming_job, resource_group_name, job_name, if_match, if_none_match, custom_headers).value!
724
+ end
725
+
726
+ #
727
+ # Creates a streaming job or replaces an already existing streaming job.
728
+ #
729
+ # @param streaming_job [StreamingJob] The definition of the streaming job that
730
+ # will be used to create a new streaming job or replace the existing one.
731
+ # @param resource_group_name [String] The name of the resource group that
732
+ # contains the resource. You can obtain this value from the Azure Resource
733
+ # Manager API or the portal.
734
+ # @param job_name [String] The name of the streaming job.
735
+ # @param if_match [String] The ETag of the streaming job. Omit this value to
736
+ # always overwrite the current record set. Specify the last-seen ETag value to
737
+ # prevent accidentally overwritting concurrent changes.
738
+ # @param if_none_match [String] Set to '*' to allow a new streaming job to be
739
+ # created, but to prevent updating an existing record set. Other values will
740
+ # result in a 412 Pre-condition Failed response.
741
+ # @param [Hash{String => String}] A hash of custom headers that will be added
742
+ # to the HTTP request.
743
+ #
744
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
745
+ #
746
+ def begin_create_or_replace_async(streaming_job, resource_group_name, job_name, if_match = nil, if_none_match = nil, custom_headers = nil)
747
+ fail ArgumentError, 'streaming_job is nil' if streaming_job.nil?
748
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
749
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
750
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
751
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
752
+
753
+
754
+ request_headers = {}
755
+
756
+ # Set Headers
757
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
758
+ request_headers['If-Match'] = if_match unless if_match.nil?
759
+ request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
760
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
761
+
762
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
763
+
764
+ # Serialize Request
765
+ request_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
766
+ request_content = @client.serialize(request_mapper, streaming_job)
767
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
768
+
769
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}'
770
+
771
+ request_url = @base_url || @client.base_url
772
+
773
+ options = {
774
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
775
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
776
+ query_params: {'api-version' => @client.api_version},
777
+ body: request_content,
778
+ headers: request_headers.merge(custom_headers || {}),
779
+ base_url: request_url
780
+ }
781
+ promise = @client.make_request_async(:put, path_template, options)
782
+
783
+ promise = promise.then do |result|
784
+ http_response = result.response
785
+ status_code = http_response.status
786
+ response_content = http_response.body
787
+ unless status_code == 200 || status_code == 201
788
+ error_model = JSON.load(response_content)
789
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
790
+ end
791
+
792
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
793
+ # Deserialize Response
794
+ if status_code == 200
795
+ begin
796
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
797
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
798
+ result.body = @client.deserialize(result_mapper, parsed_response)
799
+ rescue Exception => e
800
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
801
+ end
802
+ end
803
+ # Deserialize Response
804
+ if status_code == 201
805
+ begin
806
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
807
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJob.mapper()
808
+ result.body = @client.deserialize(result_mapper, parsed_response)
809
+ rescue Exception => e
810
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
811
+ end
812
+ end
813
+
814
+ result
815
+ end
816
+
817
+ promise.execute
818
+ end
819
+
820
+ #
821
+ # Deletes a streaming job.
822
+ #
823
+ # @param resource_group_name [String] The name of the resource group that
824
+ # contains the resource. You can obtain this value from the Azure Resource
825
+ # Manager API or the portal.
826
+ # @param job_name [String] The name of the streaming job.
827
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
828
+ # will be added to the HTTP request.
829
+ #
830
+ #
831
+ def begin_delete(resource_group_name, job_name, custom_headers = nil)
832
+ response = begin_delete_async(resource_group_name, job_name, custom_headers).value!
833
+ nil
834
+ end
835
+
836
+ #
837
+ # Deletes a streaming job.
838
+ #
839
+ # @param resource_group_name [String] The name of the resource group that
840
+ # contains the resource. You can obtain this value from the Azure Resource
841
+ # Manager API or the portal.
842
+ # @param job_name [String] The name of the streaming job.
843
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
844
+ # will be added to the HTTP request.
845
+ #
846
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
847
+ #
848
+ def begin_delete_with_http_info(resource_group_name, job_name, custom_headers = nil)
849
+ begin_delete_async(resource_group_name, job_name, custom_headers).value!
850
+ end
851
+
852
+ #
853
+ # Deletes a streaming job.
854
+ #
855
+ # @param resource_group_name [String] The name of the resource group that
856
+ # contains the resource. You can obtain this value from the Azure Resource
857
+ # Manager API or the portal.
858
+ # @param job_name [String] The name of the streaming job.
859
+ # @param [Hash{String => String}] A hash of custom headers that will be added
860
+ # to the HTTP request.
861
+ #
862
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
863
+ #
864
+ def begin_delete_async(resource_group_name, job_name, custom_headers = nil)
865
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
866
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
867
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
868
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
869
+
870
+
871
+ request_headers = {}
872
+
873
+ # Set Headers
874
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
875
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
876
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}'
877
+
878
+ request_url = @base_url || @client.base_url
879
+
880
+ options = {
881
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
882
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
883
+ query_params: {'api-version' => @client.api_version},
884
+ headers: request_headers.merge(custom_headers || {}),
885
+ base_url: request_url
886
+ }
887
+ promise = @client.make_request_async(:delete, path_template, options)
888
+
889
+ promise = promise.then do |result|
890
+ http_response = result.response
891
+ status_code = http_response.status
892
+ response_content = http_response.body
893
+ unless status_code == 200 || status_code == 202 || status_code == 204
894
+ error_model = JSON.load(response_content)
895
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
896
+ end
897
+
898
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
899
+
900
+ result
901
+ end
902
+
903
+ promise.execute
904
+ end
905
+
906
+ #
907
+ # Starts a streaming job. Once a job is started it will start processing input
908
+ # events and produce output.
909
+ #
910
+ # @param resource_group_name [String] The name of the resource group that
911
+ # contains the resource. You can obtain this value from the Azure Resource
912
+ # Manager API or the portal.
913
+ # @param job_name [String] The name of the streaming job.
914
+ # @param start_job_parameters [StartStreamingJobParameters] Parameters
915
+ # applicable to a start streaming job operation.
916
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
917
+ # will be added to the HTTP request.
918
+ #
919
+ #
920
+ def begin_start(resource_group_name, job_name, start_job_parameters = nil, custom_headers = nil)
921
+ response = begin_start_async(resource_group_name, job_name, start_job_parameters, custom_headers).value!
922
+ nil
923
+ end
924
+
925
+ #
926
+ # Starts a streaming job. Once a job is started it will start processing input
927
+ # events and produce output.
928
+ #
929
+ # @param resource_group_name [String] The name of the resource group that
930
+ # contains the resource. You can obtain this value from the Azure Resource
931
+ # Manager API or the portal.
932
+ # @param job_name [String] The name of the streaming job.
933
+ # @param start_job_parameters [StartStreamingJobParameters] Parameters
934
+ # applicable to a start streaming job operation.
935
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
936
+ # will be added to the HTTP request.
937
+ #
938
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
939
+ #
940
+ def begin_start_with_http_info(resource_group_name, job_name, start_job_parameters = nil, custom_headers = nil)
941
+ begin_start_async(resource_group_name, job_name, start_job_parameters, custom_headers).value!
942
+ end
943
+
944
+ #
945
+ # Starts a streaming job. Once a job is started it will start processing input
946
+ # events and produce output.
947
+ #
948
+ # @param resource_group_name [String] The name of the resource group that
949
+ # contains the resource. You can obtain this value from the Azure Resource
950
+ # Manager API or the portal.
951
+ # @param job_name [String] The name of the streaming job.
952
+ # @param start_job_parameters [StartStreamingJobParameters] Parameters
953
+ # applicable to a start streaming job operation.
954
+ # @param [Hash{String => String}] A hash of custom headers that will be added
955
+ # to the HTTP request.
956
+ #
957
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
958
+ #
959
+ def begin_start_async(resource_group_name, job_name, start_job_parameters = nil, custom_headers = nil)
960
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
961
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
962
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
963
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
964
+
965
+
966
+ request_headers = {}
967
+
968
+ # Set Headers
969
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
970
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
971
+
972
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
973
+
974
+ # Serialize Request
975
+ request_mapper = Azure::ARM::StreamAnalytics::Models::StartStreamingJobParameters.mapper()
976
+ request_content = @client.serialize(request_mapper, start_job_parameters)
977
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
978
+
979
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/start'
980
+
981
+ request_url = @base_url || @client.base_url
982
+
983
+ options = {
984
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
985
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
986
+ query_params: {'api-version' => @client.api_version},
987
+ body: request_content,
988
+ headers: request_headers.merge(custom_headers || {}),
989
+ base_url: request_url
990
+ }
991
+ promise = @client.make_request_async(:post, path_template, options)
992
+
993
+ promise = promise.then do |result|
994
+ http_response = result.response
995
+ status_code = http_response.status
996
+ response_content = http_response.body
997
+ unless status_code == 200 || status_code == 202
998
+ error_model = JSON.load(response_content)
999
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1000
+ end
1001
+
1002
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1003
+
1004
+ result
1005
+ end
1006
+
1007
+ promise.execute
1008
+ end
1009
+
1010
+ #
1011
+ # Stops a running streaming job. This will cause a running streaming job to
1012
+ # stop processing input events and producing output.
1013
+ #
1014
+ # @param resource_group_name [String] The name of the resource group that
1015
+ # contains the resource. You can obtain this value from the Azure Resource
1016
+ # Manager API or the portal.
1017
+ # @param job_name [String] The name of the streaming job.
1018
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1019
+ # will be added to the HTTP request.
1020
+ #
1021
+ #
1022
+ def begin_stop(resource_group_name, job_name, custom_headers = nil)
1023
+ response = begin_stop_async(resource_group_name, job_name, custom_headers).value!
1024
+ nil
1025
+ end
1026
+
1027
+ #
1028
+ # Stops a running streaming job. This will cause a running streaming job to
1029
+ # stop processing input events and producing output.
1030
+ #
1031
+ # @param resource_group_name [String] The name of the resource group that
1032
+ # contains the resource. You can obtain this value from the Azure Resource
1033
+ # Manager API or the portal.
1034
+ # @param job_name [String] The name of the streaming job.
1035
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1036
+ # will be added to the HTTP request.
1037
+ #
1038
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1039
+ #
1040
+ def begin_stop_with_http_info(resource_group_name, job_name, custom_headers = nil)
1041
+ begin_stop_async(resource_group_name, job_name, custom_headers).value!
1042
+ end
1043
+
1044
+ #
1045
+ # Stops a running streaming job. This will cause a running streaming job to
1046
+ # stop processing input events and producing output.
1047
+ #
1048
+ # @param resource_group_name [String] The name of the resource group that
1049
+ # contains the resource. You can obtain this value from the Azure Resource
1050
+ # Manager API or the portal.
1051
+ # @param job_name [String] The name of the streaming job.
1052
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1053
+ # to the HTTP request.
1054
+ #
1055
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1056
+ #
1057
+ def begin_stop_async(resource_group_name, job_name, custom_headers = nil)
1058
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1059
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1060
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1061
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
1062
+
1063
+
1064
+ request_headers = {}
1065
+
1066
+ # Set Headers
1067
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1068
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1069
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/stop'
1070
+
1071
+ request_url = @base_url || @client.base_url
1072
+
1073
+ options = {
1074
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1075
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'jobName' => job_name},
1076
+ query_params: {'api-version' => @client.api_version},
1077
+ headers: request_headers.merge(custom_headers || {}),
1078
+ base_url: request_url
1079
+ }
1080
+ promise = @client.make_request_async(:post, path_template, options)
1081
+
1082
+ promise = promise.then do |result|
1083
+ http_response = result.response
1084
+ status_code = http_response.status
1085
+ response_content = http_response.body
1086
+ unless status_code == 200 || status_code == 202
1087
+ error_model = JSON.load(response_content)
1088
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1089
+ end
1090
+
1091
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1092
+
1093
+ result
1094
+ end
1095
+
1096
+ promise.execute
1097
+ end
1098
+
1099
+ #
1100
+ # Lists all of the streaming jobs in the specified resource group.
1101
+ #
1102
+ # @param next_page_link [String] The NextLink from the previous successful call
1103
+ # to List operation.
1104
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1105
+ # will be added to the HTTP request.
1106
+ #
1107
+ # @return [StreamingJobListResult] operation results.
1108
+ #
1109
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
1110
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
1111
+ response.body unless response.nil?
1112
+ end
1113
+
1114
+ #
1115
+ # Lists all of the streaming jobs in the specified resource group.
1116
+ #
1117
+ # @param next_page_link [String] The NextLink from the previous successful call
1118
+ # to List operation.
1119
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1120
+ # will be added to the HTTP request.
1121
+ #
1122
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1123
+ #
1124
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
1125
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
1126
+ end
1127
+
1128
+ #
1129
+ # Lists all of the streaming jobs in the specified resource group.
1130
+ #
1131
+ # @param next_page_link [String] The NextLink from the previous successful call
1132
+ # to List operation.
1133
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1134
+ # to the HTTP request.
1135
+ #
1136
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1137
+ #
1138
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
1139
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1140
+
1141
+
1142
+ request_headers = {}
1143
+
1144
+ # Set Headers
1145
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1146
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1147
+ path_template = '{nextLink}'
1148
+
1149
+ request_url = @base_url || @client.base_url
1150
+
1151
+ options = {
1152
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1153
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1154
+ headers: request_headers.merge(custom_headers || {}),
1155
+ base_url: request_url
1156
+ }
1157
+ promise = @client.make_request_async(:get, path_template, options)
1158
+
1159
+ promise = promise.then do |result|
1160
+ http_response = result.response
1161
+ status_code = http_response.status
1162
+ response_content = http_response.body
1163
+ unless status_code == 200
1164
+ error_model = JSON.load(response_content)
1165
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1166
+ end
1167
+
1168
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1169
+ # Deserialize Response
1170
+ if status_code == 200
1171
+ begin
1172
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1173
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJobListResult.mapper()
1174
+ result.body = @client.deserialize(result_mapper, parsed_response)
1175
+ rescue Exception => e
1176
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1177
+ end
1178
+ end
1179
+
1180
+ result
1181
+ end
1182
+
1183
+ promise.execute
1184
+ end
1185
+
1186
+ #
1187
+ # Lists all of the streaming jobs in the given subscription.
1188
+ #
1189
+ # @param next_page_link [String] The NextLink from the previous successful call
1190
+ # to List operation.
1191
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1192
+ # will be added to the HTTP request.
1193
+ #
1194
+ # @return [StreamingJobListResult] operation results.
1195
+ #
1196
+ def list_next(next_page_link, custom_headers = nil)
1197
+ response = list_next_async(next_page_link, custom_headers).value!
1198
+ response.body unless response.nil?
1199
+ end
1200
+
1201
+ #
1202
+ # Lists all of the streaming jobs in the given subscription.
1203
+ #
1204
+ # @param next_page_link [String] The NextLink from the previous successful call
1205
+ # to List operation.
1206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1207
+ # will be added to the HTTP request.
1208
+ #
1209
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1210
+ #
1211
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
1212
+ list_next_async(next_page_link, custom_headers).value!
1213
+ end
1214
+
1215
+ #
1216
+ # Lists all of the streaming jobs in the given subscription.
1217
+ #
1218
+ # @param next_page_link [String] The NextLink from the previous successful call
1219
+ # to List operation.
1220
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1221
+ # to the HTTP request.
1222
+ #
1223
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1224
+ #
1225
+ def list_next_async(next_page_link, custom_headers = nil)
1226
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1227
+
1228
+
1229
+ request_headers = {}
1230
+
1231
+ # Set Headers
1232
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1233
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1234
+ path_template = '{nextLink}'
1235
+
1236
+ request_url = @base_url || @client.base_url
1237
+
1238
+ options = {
1239
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1240
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1241
+ headers: request_headers.merge(custom_headers || {}),
1242
+ base_url: request_url
1243
+ }
1244
+ promise = @client.make_request_async(:get, path_template, options)
1245
+
1246
+ promise = promise.then do |result|
1247
+ http_response = result.response
1248
+ status_code = http_response.status
1249
+ response_content = http_response.body
1250
+ unless status_code == 200
1251
+ error_model = JSON.load(response_content)
1252
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1253
+ end
1254
+
1255
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1256
+ # Deserialize Response
1257
+ if status_code == 200
1258
+ begin
1259
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1260
+ result_mapper = Azure::ARM::StreamAnalytics::Models::StreamingJobListResult.mapper()
1261
+ result.body = @client.deserialize(result_mapper, parsed_response)
1262
+ rescue Exception => e
1263
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1264
+ end
1265
+ end
1266
+
1267
+ result
1268
+ end
1269
+
1270
+ promise.execute
1271
+ end
1272
+
1273
+ #
1274
+ # Lists all of the streaming jobs in the specified resource group.
1275
+ #
1276
+ # @param resource_group_name [String] The name of the resource group that
1277
+ # contains the resource. You can obtain this value from the Azure Resource
1278
+ # Manager API or the portal.
1279
+ # @param expand [String] The $expand OData query parameter. This is a
1280
+ # comma-separated list of additional streaming job properties to include in the
1281
+ # response, beyond the default set returned when this parameter is absent. The
1282
+ # default set is all streaming job properties other than 'inputs',
1283
+ # 'transformation', 'outputs', and 'functions'.
1284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1285
+ # will be added to the HTTP request.
1286
+ #
1287
+ # @return [StreamingJobListResult] which provide lazy access to pages of the
1288
+ # response.
1289
+ #
1290
+ def list_by_resource_group_as_lazy(resource_group_name, expand = nil, custom_headers = nil)
1291
+ response = list_by_resource_group_async(resource_group_name, expand, custom_headers).value!
1292
+ unless response.nil?
1293
+ page = response.body
1294
+ page.next_method = Proc.new do |next_page_link|
1295
+ list_by_resource_group_next_async(next_page_link, custom_headers)
1296
+ end
1297
+ page
1298
+ end
1299
+ end
1300
+
1301
+ #
1302
+ # Lists all of the streaming jobs in the given subscription.
1303
+ #
1304
+ # @param expand [String] The $expand OData query parameter. This is a
1305
+ # comma-separated list of additional streaming job properties to include in the
1306
+ # response, beyond the default set returned when this parameter is absent. The
1307
+ # default set is all streaming job properties other than 'inputs',
1308
+ # 'transformation', 'outputs', and 'functions'.
1309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1310
+ # will be added to the HTTP request.
1311
+ #
1312
+ # @return [StreamingJobListResult] which provide lazy access to pages of the
1313
+ # response.
1314
+ #
1315
+ def list_as_lazy(expand = nil, custom_headers = nil)
1316
+ response = list_async(expand, custom_headers).value!
1317
+ unless response.nil?
1318
+ page = response.body
1319
+ page.next_method = Proc.new do |next_page_link|
1320
+ list_next_async(next_page_link, custom_headers)
1321
+ end
1322
+ page
1323
+ end
1324
+ end
1325
+
1326
+ end
1327
+ end