Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def initialize(client)
#
# Check available SKUs.
#
# @param location [String] Resource location.
# @param skus [Array<SkuName>] The SKU of the resource.
# @param kind [Kind] The Kind of the resource. Possible values include:
# 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
Expand All @@ -36,14 +37,15 @@ def initialize(client)
#
# @return [CheckSkuAvailabilityResultList] operation results.
#
def list(skus, kind, type, custom_headers = nil)
response = list_async(skus, kind, type, custom_headers).value!
def list(location, skus, kind, type, custom_headers = nil)
response = list_async(location, skus, kind, type, custom_headers).value!
response.body unless response.nil?
end

#
# Check available SKUs.
#
# @param location [String] Resource location.
# @param skus [Array<SkuName>] The SKU of the resource.
# @param kind [Kind] The Kind of the resource. Possible values include:
# 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
Expand All @@ -56,13 +58,14 @@ def list(skus, kind, type, custom_headers = nil)
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_with_http_info(skus, kind, type, custom_headers = nil)
list_async(skus, kind, type, custom_headers).value!
def list_with_http_info(location, skus, kind, type, custom_headers = nil)
list_async(location, skus, kind, type, custom_headers).value!
end

#
# Check available SKUs.
#
# @param location [String] Resource location.
# @param skus [Array<SkuName>] The SKU of the resource.
# @param kind [Kind] The Kind of the resource. Possible values include:
# 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
Expand All @@ -75,10 +78,10 @@ def list_with_http_info(skus, kind, type, custom_headers = nil)
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_async(skus, kind, type, custom_headers = nil)
def list_async(location, skus, kind, type, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.location is nil' if @client.location.nil?
fail ArgumentError, 'location is nil' if location.nil?
fail ArgumentError, 'skus is nil' if skus.nil?
fail ArgumentError, 'kind is nil' if kind.nil?
fail ArgumentError, 'type is nil' if type.nil?
Expand Down Expand Up @@ -109,7 +112,7 @@ def list_async(skus, kind, type, custom_headers = nil)

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'location' => @client.location},
path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
query_params: {'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class CognitiveServicesManagementClient < MsRestAzure::AzureServiceClient
# Current version is 2017-04-18
attr_reader :api_version

# @return [String] Resource location.
attr_accessor :location

# @return [String] Gets or sets the preferred language for the response.
attr_accessor :accept_language

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def self.mapper()
},
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
Expand All @@ -96,6 +97,7 @@ def self.mapper()
},
name: {
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
Expand Down Expand Up @@ -148,6 +150,7 @@ def self.mapper()
},
type: {
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
Expand Down