Class: Azure::DataShare::Mgmt::V2019_11_01::ProviderShareSubscriptions
- Inherits:
-
Object
- Object
- Azure::DataShare::Mgmt::V2019_11_01::ProviderShareSubscriptions
- Includes:
- MsRestAzure
- Defined in:
- lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb
Overview
Creates a Microsoft.DataShare management client.
Instance Attribute Summary collapse
-
#client ⇒ DataShareManagementClient
readonly
Reference to the DataShareManagementClient.
Instance Method Summary collapse
-
#begin_revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Revoke share subscription in a provider share.
-
#begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Revoke share subscription in a provider share.
-
#begin_revoke_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Revoke share subscription in a provider share.
-
#get_by_share(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Get share subscription in a provider share.
-
#get_by_share_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Get share subscription in a provider share.
-
#get_by_share_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get share subscription in a provider share.
-
#initialize(client) ⇒ ProviderShareSubscriptions
constructor
Creates and initializes a new instance of the ProviderShareSubscriptions class.
-
#list_by_share(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ Array<ProviderShareSubscription>
List of available share subscriptions to a provider share.
-
#list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ ProviderShareSubscriptionList
List of available share subscriptions to a provider share.
-
#list_by_share_async(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ Concurrent::Promise
List of available share subscriptions to a provider share.
-
#list_by_share_next(next_page_link, custom_headers: nil) ⇒ ProviderShareSubscriptionList
List of available share subscriptions to a provider share.
-
#list_by_share_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
List of available share subscriptions to a provider share.
-
#list_by_share_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List of available share subscriptions to a provider share.
-
#list_by_share_with_http_info(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List of available share subscriptions to a provider share.
-
#reinstate(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Reinstate share subscription in a provider share.
-
#reinstate_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Reinstate share subscription in a provider share.
-
#reinstate_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Reinstate share subscription in a provider share.
-
#revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Revoke share subscription in a provider share.
-
#revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
Constructor Details
#initialize(client) ⇒ ProviderShareSubscriptions
Creates and initializes a new instance of the ProviderShareSubscriptions class.
17 18 19 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ DataShareManagementClient (readonly)
Returns reference to the DataShareManagementClient.
22 23 24 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 22 def client @client end |
Instance Method Details
#begin_revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Revoke share subscription in a provider share.
Revoke share subscription in a provider share
will be added to the HTTP request.
409 410 411 412 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 409 def begin_revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) response = begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Revoke share subscription in a provider share.
Revoke share subscription in a provider share
to the HTTP request.
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 446 def begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'share_name is nil' if share_name.nil? fail ArgumentError, 'provider_share_subscription_id is nil' if provider_share_subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'providerShareSubscriptionId' => provider_share_subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_revoke_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Revoke share subscription in a provider share.
Revoke share subscription in a provider share
will be added to the HTTP request.
428 429 430 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 428 def begin_revoke_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! end |
#get_by_share(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Get share subscription in a provider share.
Get share subscription in a provider share
will be added to the HTTP request.
38 39 40 41 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 38 def get_by_share(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) response = get_by_share_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_by_share_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Get share subscription in a provider share.
Get share subscription in a provider share
to the HTTP request.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 75 def get_by_share_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'share_name is nil' if share_name.nil? fail ArgumentError, 'provider_share_subscription_id is nil' if provider_share_subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'providerShareSubscriptionId' => provider_share_subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_by_share_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get share subscription in a provider share.
Get share subscription in a provider share
will be added to the HTTP request.
57 58 59 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 57 def get_by_share_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) get_by_share_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! end |
#list_by_share(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ Array<ProviderShareSubscription>
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
will be added to the HTTP request.
146 147 148 149 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 146 def list_by_share(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil) first_page = list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ ProviderShareSubscriptionList
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
will be added to the HTTP request.
the response.
624 625 626 627 628 629 630 631 632 633 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 624 def list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil) response = list_by_share_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_share_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_share_async(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ Concurrent::Promise
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
to the HTTP request.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 183 def list_by_share_async(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'share_name is nil' if share_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name}, query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscriptionList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_share_next(next_page_link, custom_headers: nil) ⇒ ProviderShareSubscriptionList
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
to List operation. will be added to the HTTP request.
525 526 527 528 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 525 def list_by_share_next(next_page_link, custom_headers:nil) response = list_by_share_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_share_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
to List operation. to the HTTP request.
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 558 def list_by_share_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscriptionList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_share_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
to List operation. will be added to the HTTP request.
542 543 544 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 542 def list_by_share_next_with_http_info(next_page_link, custom_headers:nil) list_by_share_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_share_with_http_info(resource_group_name, account_name, share_name, skip_token: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List of available share subscriptions to a provider share.
List share subscriptions in a provider share
will be added to the HTTP request.
165 166 167 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 165 def list_by_share_with_http_info(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil) list_by_share_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value! end |
#reinstate(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Reinstate share subscription in a provider share.
Reinstate share subscription in a provider share
will be added to the HTTP request.
301 302 303 304 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 301 def reinstate(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) response = reinstate_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#reinstate_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
Reinstate share subscription in a provider share.
Reinstate share subscription in a provider share
to the HTTP request.
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 338 def reinstate_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, 'share_name is nil' if share_name.nil? fail ArgumentError, 'provider_share_subscription_id is nil' if provider_share_subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'providerShareSubscriptionId' => provider_share_subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#reinstate_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Reinstate share subscription in a provider share.
Reinstate share subscription in a provider share
will be added to the HTTP request.
320 321 322 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 320 def reinstate_with_http_info(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) reinstate_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! end |
#revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ ProviderShareSubscription
Revoke share subscription in a provider share.
Revoke share subscription in a provider share
will be added to the HTTP request.
253 254 255 256 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 253 def revoke(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) response = revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb', line 269 def revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:nil) # Send request promise = begin_revoke_async(resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ProviderShareSubscription.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::AZURE_ASYNC_OPERATION) end promise end |