Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[AutoPR apimanagement/resource-manager] [API Management] New Api version introduced along with new contracts for the Diagnostics resource #1387

Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ def make_request_async(method, path, options = {})
fail ArgumentError, 'path is nil' if path.nil?

request_url = options[:base_url] || @base_url
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
@request_headers['Content-Type'] = options[:headers]['Content-Type']
end

request_headers = @request_headers
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
Expand All @@ -245,7 +242,9 @@ def make_request_async(method, path, options = {})
#
def add_telemetry
sdk_information = 'azure_mgmt_api_management'
sdk_information = "#{sdk_information}/0.17.0"
if defined? Azure::ApiManagement::Mgmt::V2016_07_07::VERSION
sdk_information = "#{sdk_information}/#{Azure::ApiManagement::Mgmt::V2016_07_07::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def initialize(client)
#
# @return [Array<ProductContract>] operation results.
#
def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil)
first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers)
def list_by_api(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil)
first_page = list_by_api_as_lazy(resource_group_name, service_name, api_id, filter, top, skip, custom_headers)
first_page.get_all_items
end

Expand All @@ -64,8 +64,8 @@ def list_by_api(resource_group_name, service_name, api_id, filter:nil, top:nil,
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil)
list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value!
def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil)
list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value!
end

#
Expand All @@ -87,24 +87,15 @@ def list_by_api_with_http_info(resource_group_name, service_name, api_id, filter
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil)
def list_by_api_async(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'service_name is nil' if service_name.nil?
fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
fail ArgumentError, 'api_id is nil' if api_id.nil?
fail ArgumentError, "'api_id' should satisfy the constraint - 'MaxLength': '256'" if !api_id.nil? && api_id.length > 256
fail ArgumentError, "'api_id' should satisfy the constraint - 'MinLength': '1'" if !api_id.nil? && api_id.length < 1
fail ArgumentError, "'api_id' should satisfy the constraint - 'Pattern': '^[^*#&+:<>?]+$'" if !api_id.nil? && api_id.match(Regexp.new('^^[^*#&+:<>?]+$$')).nil?
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'

# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
Expand Down Expand Up @@ -159,8 +150,8 @@ def list_by_api_async(resource_group_name, service_name, api_id, filter:nil, top
#
# @return [ProductCollection] operation results.
#
def list_by_api_next(next_page_link, custom_headers:nil)
response = list_by_api_next_async(next_page_link, custom_headers:custom_headers).value!
def list_by_api_next(next_page_link, custom_headers = nil)
response = list_by_api_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end

Expand All @@ -174,8 +165,8 @@ def list_by_api_next(next_page_link, custom_headers:nil)
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_api_next_with_http_info(next_page_link, custom_headers:nil)
list_by_api_next_async(next_page_link, custom_headers:custom_headers).value!
def list_by_api_next_with_http_info(next_page_link, custom_headers = nil)
list_by_api_next_async(next_page_link, custom_headers).value!
end

#
Expand All @@ -188,12 +179,11 @@ def list_by_api_next_with_http_info(next_page_link, custom_headers:nil)
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_api_next_async(next_page_link, custom_headers:nil)
def list_by_api_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
Expand Down Expand Up @@ -257,12 +247,12 @@ def list_by_api_next_async(next_page_link, custom_headers:nil)
# @return [ProductCollection] which provide lazy access to pages of the
# response.
#
def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter:nil, top:nil, skip:nil, custom_headers:nil)
response = list_by_api_async(resource_group_name, service_name, api_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value!
def list_by_api_as_lazy(resource_group_name, service_name, api_id, filter = nil, top = nil, skip = nil, custom_headers = nil)
response = list_by_api_async(resource_group_name, service_name, api_id, filter, top, skip, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_api_next_async(next_page_link, custom_headers:custom_headers)
list_by_api_next_async(next_page_link, custom_headers)
end
page
end
Expand Down
Loading