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

Commit

Permalink
[AutoPR] automation/resource-manager (#1323)
Browse files Browse the repository at this point in the history
* Generated from da1a51b7fc9dc3e5988ad259a215ebeb7a730b96 (#1312)

Added GroupType property in HybridWorkerGroup

* Generated from 242fce7837617e22108998354a5e903be42a3be3 (#1333)

Refactoring Job Definitions
  • Loading branch information
AutorestCI authored and sarangan12 committed Jun 13, 2018
1 parent 5452f6b commit a94a49b
Show file tree
Hide file tree
Showing 162 changed files with 3,756 additions and 2,693 deletions.
496 changes: 271 additions & 225 deletions azure_sdk/lib/latest/modules/automation_profile_module.rb

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 @@ -25,6 +25,7 @@ def initialize(client)
# Retrieve the activity in the module identified by module name and activity
# name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param activity_name [String] The name of activity.
Expand All @@ -33,15 +34,16 @@ def initialize(client)
#
# @return [Activity] operation results.
#
def get(automation_account_name, module_name, activity_name, custom_headers:nil)
response = get_async(automation_account_name, module_name, activity_name, custom_headers:custom_headers).value!
def get(resource_group_name, automation_account_name, module_name, activity_name, custom_headers = nil)
response = get_async(resource_group_name, automation_account_name, module_name, activity_name, custom_headers).value!
response.body unless response.nil?
end

#
# Retrieve the activity in the module identified by module name and activity
# name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param activity_name [String] The name of activity.
Expand All @@ -50,14 +52,15 @@ def get(automation_account_name, module_name, activity_name, custom_headers:nil)
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_with_http_info(automation_account_name, module_name, activity_name, custom_headers:nil)
get_async(automation_account_name, module_name, activity_name, custom_headers:custom_headers).value!
def get_with_http_info(resource_group_name, automation_account_name, module_name, activity_name, custom_headers = nil)
get_async(resource_group_name, automation_account_name, module_name, activity_name, custom_headers).value!
end

#
# Retrieve the activity in the module identified by module name and activity
# name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param activity_name [String] The name of activity.
Expand All @@ -66,9 +69,8 @@ def get_with_http_info(automation_account_name, module_name, activity_name, cust
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_async(automation_account_name, module_name, activity_name, custom_headers:nil)
fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
fail ArgumentError, "'@client.resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !@client.resource_group_name.nil? && @client.resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
def get_async(resource_group_name, automation_account_name, module_name, activity_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
fail ArgumentError, 'module_name is nil' if module_name.nil?
fail ArgumentError, 'activity_name is nil' if activity_name.nil?
Expand All @@ -77,7 +79,6 @@ def get_async(automation_account_name, module_name, activity_name, custom_header


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

# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
Expand All @@ -88,7 +89,7 @@ def get_async(automation_account_name, module_name, activity_name, custom_header

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => @client.resource_group_name,'automationAccountName' => automation_account_name,'moduleName' => module_name,'activityName' => activity_name,'subscriptionId' => @client.subscription_id},
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'moduleName' => module_name,'activityName' => activity_name,'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
Expand Down Expand Up @@ -125,53 +126,54 @@ def get_async(automation_account_name, module_name, activity_name, custom_header
#
# Retrieve a list of activities in the module identified by module name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Activity>] operation results.
#
def list_by_module(automation_account_name, module_name, custom_headers:nil)
first_page = list_by_module_as_lazy(automation_account_name, module_name, custom_headers:custom_headers)
def list_by_module(resource_group_name, automation_account_name, module_name, custom_headers = nil)
first_page = list_by_module_as_lazy(resource_group_name, automation_account_name, module_name, custom_headers)
first_page.get_all_items
end

#
# Retrieve a list of activities in the module identified by module name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_module_with_http_info(automation_account_name, module_name, custom_headers:nil)
list_by_module_async(automation_account_name, module_name, custom_headers:custom_headers).value!
def list_by_module_with_http_info(resource_group_name, automation_account_name, module_name, custom_headers = nil)
list_by_module_async(resource_group_name, automation_account_name, module_name, custom_headers).value!
end

#
# Retrieve a list of activities in the module identified by module name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_module_async(automation_account_name, module_name, custom_headers:nil)
fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
fail ArgumentError, "'@client.resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !@client.resource_group_name.nil? && @client.resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
def list_by_module_async(resource_group_name, automation_account_name, module_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
fail ArgumentError, 'module_name is nil' if module_name.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?


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

# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
Expand All @@ -182,7 +184,7 @@ def list_by_module_async(automation_account_name, module_name, custom_headers:ni

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => @client.resource_group_name,'automationAccountName' => automation_account_name,'moduleName' => module_name,'subscriptionId' => @client.subscription_id},
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'moduleName' => module_name,'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
Expand Down Expand Up @@ -226,8 +228,8 @@ def list_by_module_async(automation_account_name, module_name, custom_headers:ni
#
# @return [ActivityListResult] operation results.
#
def list_by_module_next(next_page_link, custom_headers:nil)
response = list_by_module_next_async(next_page_link, custom_headers:custom_headers).value!
def list_by_module_next(next_page_link, custom_headers = nil)
response = list_by_module_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end

Expand All @@ -241,8 +243,8 @@ def list_by_module_next(next_page_link, custom_headers:nil)
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_module_next_with_http_info(next_page_link, custom_headers:nil)
list_by_module_next_async(next_page_link, custom_headers:custom_headers).value!
def list_by_module_next_with_http_info(next_page_link, custom_headers = nil)
list_by_module_next_async(next_page_link, custom_headers).value!
end

#
Expand All @@ -255,12 +257,11 @@ def list_by_module_next_with_http_info(next_page_link, custom_headers:nil)
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_module_next_async(next_page_link, custom_headers:nil)
def list_by_module_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 @@ -307,6 +308,7 @@ def list_by_module_next_async(next_page_link, custom_headers:nil)
#
# Retrieve a list of activities in the module identified by module name.
#
# @param resource_group_name [String] Name of an Azure Resource group.
# @param automation_account_name [String] The automation account name.
# @param module_name [String] The name of module.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
Expand All @@ -315,12 +317,12 @@ def list_by_module_next_async(next_page_link, custom_headers:nil)
# @return [ActivityListResult] which provide lazy access to pages of the
# response.
#
def list_by_module_as_lazy(automation_account_name, module_name, custom_headers:nil)
response = list_by_module_async(automation_account_name, module_name, custom_headers:custom_headers).value!
def list_by_module_as_lazy(resource_group_name, automation_account_name, module_name, custom_headers = nil)
response = list_by_module_async(resource_group_name, automation_account_name, module_name, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_module_next_async(next_page_link, custom_headers:custom_headers)
list_by_module_next_async(next_page_link, custom_headers)
end
page
end
Expand Down
Loading

0 comments on commit a94a49b

Please sign in to comment.