azure_mgmt_automation 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_automation.rb +6 -0
  4. data/lib/generated/azure_mgmt_automation.rb +183 -0
  5. data/lib/generated/azure_mgmt_automation/activity_operations.rb +332 -0
  6. data/lib/generated/azure_mgmt_automation/agent_registration_information.rb +223 -0
  7. data/lib/generated/azure_mgmt_automation/automation_account_operations.rb +822 -0
  8. data/lib/generated/azure_mgmt_automation/automation_client.rb +245 -0
  9. data/lib/generated/azure_mgmt_automation/certificate_operations.rb +642 -0
  10. data/lib/generated/azure_mgmt_automation/connection_operations.rb +653 -0
  11. data/lib/generated/azure_mgmt_automation/connection_type_operations.rb +528 -0
  12. data/lib/generated/azure_mgmt_automation/credential_operations.rb +642 -0
  13. data/lib/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb +534 -0
  14. data/lib/generated/azure_mgmt_automation/dsc_configuration_operations.rb +629 -0
  15. data/lib/generated/azure_mgmt_automation/dsc_node_configuration_operations.rb +532 -0
  16. data/lib/generated/azure_mgmt_automation/dsc_node_operations.rb +530 -0
  17. data/lib/generated/azure_mgmt_automation/fields.rb +124 -0
  18. data/lib/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb +524 -0
  19. data/lib/generated/azure_mgmt_automation/job_operations.rb +888 -0
  20. data/lib/generated/azure_mgmt_automation/job_schedule_operations.rb +515 -0
  21. data/lib/generated/azure_mgmt_automation/job_stream_operations.rb +333 -0
  22. data/lib/generated/azure_mgmt_automation/models/activity.rb +133 -0
  23. data/lib/generated/azure_mgmt_automation/models/activity_list_result.rb +94 -0
  24. data/lib/generated/azure_mgmt_automation/models/activity_output_type.rb +54 -0
  25. data/lib/generated/azure_mgmt_automation/models/activity_parameter.rb +129 -0
  26. data/lib/generated/azure_mgmt_automation/models/activity_parameter_set.rb +63 -0
  27. data/lib/generated/azure_mgmt_automation/models/advanced_schedule.rb +89 -0
  28. data/lib/generated/azure_mgmt_automation/models/advanced_schedule_monthly_occurrence.rb +58 -0
  29. data/lib/generated/azure_mgmt_automation/models/agent_registration.rb +76 -0
  30. data/lib/generated/azure_mgmt_automation/models/agent_registration_key_name.rb +16 -0
  31. data/lib/generated/azure_mgmt_automation/models/agent_registration_keys.rb +54 -0
  32. data/lib/generated/azure_mgmt_automation/models/agent_registration_regenerate_key_parameter.rb +84 -0
  33. data/lib/generated/azure_mgmt_automation/models/automation_account.rb +154 -0
  34. data/lib/generated/azure_mgmt_automation/models/automation_account_create_or_update_parameters.rb +85 -0
  35. data/lib/generated/azure_mgmt_automation/models/automation_account_list_result.rb +94 -0
  36. data/lib/generated/azure_mgmt_automation/models/automation_account_state.rb +17 -0
  37. data/lib/generated/azure_mgmt_automation/models/automation_account_update_parameters.rb +83 -0
  38. data/lib/generated/azure_mgmt_automation/models/certificate.rb +121 -0
  39. data/lib/generated/azure_mgmt_automation/models/certificate_create_or_update_parameters.rb +87 -0
  40. data/lib/generated/azure_mgmt_automation/models/certificate_list_result.rb +94 -0
  41. data/lib/generated/azure_mgmt_automation/models/certificate_update_parameters.rb +54 -0
  42. data/lib/generated/azure_mgmt_automation/models/connection.rb +119 -0
  43. data/lib/generated/azure_mgmt_automation/models/connection_create_or_update_parameters.rb +84 -0
  44. data/lib/generated/azure_mgmt_automation/models/connection_list_result.rb +94 -0
  45. data/lib/generated/azure_mgmt_automation/models/connection_type.rb +118 -0
  46. data/lib/generated/azure_mgmt_automation/models/connection_type_association_property.rb +44 -0
  47. data/lib/generated/azure_mgmt_automation/models/connection_type_create_or_update_parameters.rb +75 -0
  48. data/lib/generated/azure_mgmt_automation/models/connection_type_list_result.rb +95 -0
  49. data/lib/generated/azure_mgmt_automation/models/connection_update_parameters.rb +72 -0
  50. data/lib/generated/azure_mgmt_automation/models/content_hash.rb +55 -0
  51. data/lib/generated/azure_mgmt_automation/models/content_link.rb +65 -0
  52. data/lib/generated/azure_mgmt_automation/models/content_source.rb +77 -0
  53. data/lib/generated/azure_mgmt_automation/models/content_source_type.rb +16 -0
  54. data/lib/generated/azure_mgmt_automation/models/credential.rb +98 -0
  55. data/lib/generated/azure_mgmt_automation/models/credential_create_or_update_parameters.rb +74 -0
  56. data/lib/generated/azure_mgmt_automation/models/credential_list_result.rb +94 -0
  57. data/lib/generated/azure_mgmt_automation/models/credential_update_parameters.rb +74 -0
  58. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job.rb +186 -0
  59. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_create_parameters.rb +102 -0
  60. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_list_result.rb +95 -0
  61. data/lib/generated/azure_mgmt_automation/models/dsc_configuration.rb +193 -0
  62. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_association_property.rb +44 -0
  63. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_create_or_update_parameters.rb +132 -0
  64. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_list_result.rb +95 -0
  65. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_parameter.rb +75 -0
  66. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_provisioning_state.rb +15 -0
  67. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_state.rb +17 -0
  68. data/lib/generated/azure_mgmt_automation/models/dsc_meta_configuration.rb +111 -0
  69. data/lib/generated/azure_mgmt_automation/models/dsc_node.rb +161 -0
  70. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration.rb +86 -0
  71. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_association_property.rb +44 -0
  72. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_create_or_update_parameters.rb +69 -0
  73. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_list_result.rb +95 -0
  74. data/lib/generated/azure_mgmt_automation/models/dsc_node_list_result.rb +94 -0
  75. data/lib/generated/azure_mgmt_automation/models/dsc_node_report.rb +265 -0
  76. data/lib/generated/azure_mgmt_automation/models/dsc_node_report_list_result.rb +94 -0
  77. data/lib/generated/azure_mgmt_automation/models/dsc_node_update_parameters.rb +56 -0
  78. data/lib/generated/azure_mgmt_automation/models/dsc_report_error.rb +95 -0
  79. data/lib/generated/azure_mgmt_automation/models/dsc_report_resource.rb +143 -0
  80. data/lib/generated/azure_mgmt_automation/models/dsc_report_resource_navigation.rb +44 -0
  81. data/lib/generated/azure_mgmt_automation/models/error_response.rb +54 -0
  82. data/lib/generated/azure_mgmt_automation/models/field_definition.rb +67 -0
  83. data/lib/generated/azure_mgmt_automation/models/http_status_code.rb +61 -0
  84. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker.rb +65 -0
  85. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group.rb +85 -0
  86. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group_update_parameters.rb +46 -0
  87. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_groups_list_result.rb +95 -0
  88. data/lib/generated/azure_mgmt_automation/models/job.rb +188 -0
  89. data/lib/generated/azure_mgmt_automation/models/job_create_parameters.rb +112 -0
  90. data/lib/generated/azure_mgmt_automation/models/job_list_result.rb +94 -0
  91. data/lib/generated/azure_mgmt_automation/models/job_schedule.rb +105 -0
  92. data/lib/generated/azure_mgmt_automation/models/job_schedule_create_parameters.rb +84 -0
  93. data/lib/generated/azure_mgmt_automation/models/job_schedule_list_result.rb +94 -0
  94. data/lib/generated/azure_mgmt_automation/models/job_status.rb +27 -0
  95. data/lib/generated/azure_mgmt_automation/models/job_stream.rb +113 -0
  96. data/lib/generated/azure_mgmt_automation/models/job_stream_list_result.rb +94 -0
  97. data/lib/generated/azure_mgmt_automation/models/job_stream_type.rb +21 -0
  98. data/lib/generated/azure_mgmt_automation/models/module_create_or_update_parameters.rb +83 -0
  99. data/lib/generated/azure_mgmt_automation/models/module_error_info.rb +54 -0
  100. data/lib/generated/azure_mgmt_automation/models/module_list_result.rb +94 -0
  101. data/lib/generated/azure_mgmt_automation/models/module_model.rb +198 -0
  102. data/lib/generated/azure_mgmt_automation/models/module_provisioning_state.rb +30 -0
  103. data/lib/generated/azure_mgmt_automation/models/module_update_parameters.rb +83 -0
  104. data/lib/generated/azure_mgmt_automation/models/operation.rb +55 -0
  105. data/lib/generated/azure_mgmt_automation/models/operation_display.rb +65 -0
  106. data/lib/generated/azure_mgmt_automation/models/operation_list_result.rb +53 -0
  107. data/lib/generated/azure_mgmt_automation/models/resource.rb +94 -0
  108. data/lib/generated/azure_mgmt_automation/models/run_as_credential_association_property.rb +44 -0
  109. data/lib/generated/azure_mgmt_automation/models/runbook.rb +263 -0
  110. data/lib/generated/azure_mgmt_automation/models/runbook_association_property.rb +44 -0
  111. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_parameters.rb +44 -0
  112. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_properties.rb +99 -0
  113. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_parameters.rb +147 -0
  114. data/lib/generated/azure_mgmt_automation/models/runbook_draft.rb +112 -0
  115. data/lib/generated/azure_mgmt_automation/models/runbook_draft_undo_edit_result.rb +68 -0
  116. data/lib/generated/azure_mgmt_automation/models/runbook_list_result.rb +94 -0
  117. data/lib/generated/azure_mgmt_automation/models/runbook_parameter.rb +75 -0
  118. data/lib/generated/azure_mgmt_automation/models/runbook_provisioning_state.rb +15 -0
  119. data/lib/generated/azure_mgmt_automation/models/runbook_state.rb +17 -0
  120. data/lib/generated/azure_mgmt_automation/models/runbook_type_enum.rb +20 -0
  121. data/lib/generated/azure_mgmt_automation/models/runbook_update_parameters.rb +113 -0
  122. data/lib/generated/azure_mgmt_automation/models/schedule.rb +199 -0
  123. data/lib/generated/azure_mgmt_automation/models/schedule_association_property.rb +44 -0
  124. data/lib/generated/azure_mgmt_automation/models/schedule_create_or_update_parameters.rb +116 -0
  125. data/lib/generated/azure_mgmt_automation/models/schedule_day.rb +21 -0
  126. data/lib/generated/azure_mgmt_automation/models/schedule_frequency.rb +19 -0
  127. data/lib/generated/azure_mgmt_automation/models/schedule_list_result.rb +94 -0
  128. data/lib/generated/azure_mgmt_automation/models/schedule_update_parameters.rb +65 -0
  129. data/lib/generated/azure_mgmt_automation/models/sku.rb +65 -0
  130. data/lib/generated/azure_mgmt_automation/models/sku_name_enum.rb +16 -0
  131. data/lib/generated/azure_mgmt_automation/models/statistics.rb +89 -0
  132. data/lib/generated/azure_mgmt_automation/models/statistics_list_result.rb +52 -0
  133. data/lib/generated/azure_mgmt_automation/models/sub_resource.rb +44 -0
  134. data/lib/generated/azure_mgmt_automation/models/test_job.rb +144 -0
  135. data/lib/generated/azure_mgmt_automation/models/test_job_create_parameters.rb +73 -0
  136. data/lib/generated/azure_mgmt_automation/models/type_field.rb +54 -0
  137. data/lib/generated/azure_mgmt_automation/models/type_field_list_result.rb +52 -0
  138. data/lib/generated/azure_mgmt_automation/models/usage.rb +95 -0
  139. data/lib/generated/azure_mgmt_automation/models/usage_counter_name.rb +54 -0
  140. data/lib/generated/azure_mgmt_automation/models/usage_list_result.rb +52 -0
  141. data/lib/generated/azure_mgmt_automation/models/variable.rb +104 -0
  142. data/lib/generated/azure_mgmt_automation/models/variable_create_or_update_parameters.rb +74 -0
  143. data/lib/generated/azure_mgmt_automation/models/variable_list_result.rb +94 -0
  144. data/lib/generated/azure_mgmt_automation/models/variable_update_parameters.rb +64 -0
  145. data/lib/generated/azure_mgmt_automation/models/webhook.rb +168 -0
  146. data/lib/generated/azure_mgmt_automation/models/webhook_create_or_update_parameters.rb +115 -0
  147. data/lib/generated/azure_mgmt_automation/models/webhook_list_result.rb +94 -0
  148. data/lib/generated/azure_mgmt_automation/models/webhook_update_parameters.rb +94 -0
  149. data/lib/generated/azure_mgmt_automation/module_definition.rb +8 -0
  150. data/lib/generated/azure_mgmt_automation/module_model_operations.rb +633 -0
  151. data/lib/generated/azure_mgmt_automation/node_reports.rb +438 -0
  152. data/lib/generated/azure_mgmt_automation/object_data_types.rb +219 -0
  153. data/lib/generated/azure_mgmt_automation/operations.rb +106 -0
  154. data/lib/generated/azure_mgmt_automation/runbook_draft_operations.rb +605 -0
  155. data/lib/generated/azure_mgmt_automation/runbook_operations.rb +719 -0
  156. data/lib/generated/azure_mgmt_automation/schedule_operations.rb +626 -0
  157. data/lib/generated/azure_mgmt_automation/statistics_operations.rb +119 -0
  158. data/lib/generated/azure_mgmt_automation/test_job_streams.rb +333 -0
  159. data/lib/generated/azure_mgmt_automation/test_jobs.rb +486 -0
  160. data/lib/generated/azure_mgmt_automation/usages.rb +116 -0
  161. data/lib/generated/azure_mgmt_automation/variable_operations.rb +636 -0
  162. data/lib/generated/azure_mgmt_automation/version.rb +8 -0
  163. data/lib/generated/azure_mgmt_automation/webhook_operations.rb +737 -0
  164. metadata +275 -0
@@ -0,0 +1,116 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Automation
7
+ #
8
+ # Automation Client
9
+ #
10
+ class Usages
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Usages class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AutomationClient] reference to the AutomationClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Retrieve the usage for the account id.
26
+ #
27
+ # @param resource_group_name [String] The resource group name.
28
+ # @param automation_account_name [String] The automation account name.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [UsageListResult] operation results.
33
+ #
34
+ def list_by_automation_account(resource_group_name, automation_account_name, custom_headers = nil)
35
+ response = list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Retrieve the usage for the account id.
41
+ #
42
+ # @param resource_group_name [String] The resource group name.
43
+ # @param automation_account_name [String] The automation account name.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_by_automation_account_with_http_info(resource_group_name, automation_account_name, custom_headers = nil)
50
+ list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Retrieve the usage for the account id.
55
+ #
56
+ # @param resource_group_name [String] The resource group name.
57
+ # @param automation_account_name [String] The automation account name.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers = nil)
64
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
65
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
66
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'subscriptionId' => @client.subscription_id},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::ARM::Automation::Models::UsageListResult.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ end
116
+ end
@@ -0,0 +1,636 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Automation
7
+ #
8
+ # Automation Client
9
+ #
10
+ class VariableOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VariableOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AutomationClient] reference to the AutomationClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Create a variable.
26
+ #
27
+ # @param resource_group_name [String] The resource group name.
28
+ # @param automation_account_name [String] The automation account name.
29
+ # @param variable_name [String] The variable name.
30
+ # @param parameters [VariableCreateOrUpdateParameters] The parameters supplied
31
+ # to the create or update variable operation.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Variable] operation results.
36
+ #
37
+ def create_or_update(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
38
+ response = create_or_update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Create a variable.
44
+ #
45
+ # @param resource_group_name [String] The resource group name.
46
+ # @param automation_account_name [String] The automation account name.
47
+ # @param variable_name [String] The variable name.
48
+ # @param parameters [VariableCreateOrUpdateParameters] The parameters supplied
49
+ # to the create or update variable operation.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def create_or_update_with_http_info(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
56
+ create_or_update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Create a variable.
61
+ #
62
+ # @param resource_group_name [String] The resource group name.
63
+ # @param automation_account_name [String] The automation account name.
64
+ # @param variable_name [String] The variable name.
65
+ # @param parameters [VariableCreateOrUpdateParameters] The parameters supplied
66
+ # to the create or update variable operation.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def create_or_update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
74
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
75
+ fail ArgumentError, 'variable_name is nil' if variable_name.nil?
76
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
77
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
78
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
79
+
80
+
81
+ request_headers = {}
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
+
89
+ # Serialize Request
90
+ request_mapper = Azure::ARM::Automation::Models::VariableCreateOrUpdateParameters.mapper()
91
+ request_content = @client.serialize(request_mapper, parameters)
92
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
93
+
94
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
98
+ options = {
99
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'variableName' => variable_name,'subscriptionId' => @client.subscription_id},
101
+ query_params: {'api-version' => @client.api_version},
102
+ body: request_content,
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:put, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200 || status_code == 201
113
+ error_model = JSON.load(response_content)
114
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ # Deserialize Response
119
+ if status_code == 200
120
+ begin
121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
122
+ result_mapper = Azure::ARM::Automation::Models::Variable.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
124
+ rescue Exception => e
125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
126
+ end
127
+ end
128
+ # Deserialize Response
129
+ if status_code == 201
130
+ begin
131
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
132
+ result_mapper = Azure::ARM::Automation::Models::Variable.mapper()
133
+ result.body = @client.deserialize(result_mapper, parsed_response)
134
+ rescue Exception => e
135
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
136
+ end
137
+ end
138
+
139
+ result
140
+ end
141
+
142
+ promise.execute
143
+ end
144
+
145
+ #
146
+ # Update a variable.
147
+ #
148
+ # @param resource_group_name [String] The resource group name.
149
+ # @param automation_account_name [String] The automation account name.
150
+ # @param variable_name [String] The variable name.
151
+ # @param parameters [VariableUpdateParameters] The parameters supplied to the
152
+ # update variable operation.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [Variable] operation results.
157
+ #
158
+ def update(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
159
+ response = update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers).value!
160
+ response.body unless response.nil?
161
+ end
162
+
163
+ #
164
+ # Update a variable.
165
+ #
166
+ # @param resource_group_name [String] The resource group name.
167
+ # @param automation_account_name [String] The automation account name.
168
+ # @param variable_name [String] The variable name.
169
+ # @param parameters [VariableUpdateParameters] The parameters supplied to the
170
+ # update variable operation.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
175
+ #
176
+ def update_with_http_info(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
177
+ update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers).value!
178
+ end
179
+
180
+ #
181
+ # Update a variable.
182
+ #
183
+ # @param resource_group_name [String] The resource group name.
184
+ # @param automation_account_name [String] The automation account name.
185
+ # @param variable_name [String] The variable name.
186
+ # @param parameters [VariableUpdateParameters] The parameters supplied to the
187
+ # update variable operation.
188
+ # @param [Hash{String => String}] A hash of custom headers that will be added
189
+ # to the HTTP request.
190
+ #
191
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
192
+ #
193
+ def update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers = nil)
194
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
195
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
196
+ fail ArgumentError, 'variable_name is nil' if variable_name.nil?
197
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
198
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
199
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
200
+
201
+
202
+ request_headers = {}
203
+
204
+ # Set Headers
205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+
208
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
209
+
210
+ # Serialize Request
211
+ request_mapper = Azure::ARM::Automation::Models::VariableUpdateParameters.mapper()
212
+ request_content = @client.serialize(request_mapper, parameters)
213
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
214
+
215
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'
216
+
217
+ request_url = @base_url || @client.base_url
218
+
219
+ options = {
220
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
221
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'variableName' => variable_name,'subscriptionId' => @client.subscription_id},
222
+ query_params: {'api-version' => @client.api_version},
223
+ body: request_content,
224
+ headers: request_headers.merge(custom_headers || {}),
225
+ base_url: request_url
226
+ }
227
+ promise = @client.make_request_async(:patch, path_template, options)
228
+
229
+ promise = promise.then do |result|
230
+ http_response = result.response
231
+ status_code = http_response.status
232
+ response_content = http_response.body
233
+ unless status_code == 200
234
+ error_model = JSON.load(response_content)
235
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
236
+ end
237
+
238
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
239
+ # Deserialize Response
240
+ if status_code == 200
241
+ begin
242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
243
+ result_mapper = Azure::ARM::Automation::Models::Variable.mapper()
244
+ result.body = @client.deserialize(result_mapper, parsed_response)
245
+ rescue Exception => e
246
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
247
+ end
248
+ end
249
+
250
+ result
251
+ end
252
+
253
+ promise.execute
254
+ end
255
+
256
+ #
257
+ # Delete the variable.
258
+ #
259
+ # @param resource_group_name [String] The resource group name.
260
+ # @param automation_account_name [String] The automation account name.
261
+ # @param variable_name [String] The name of variable.
262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
263
+ # will be added to the HTTP request.
264
+ #
265
+ #
266
+ def delete(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
267
+ response = delete_async(resource_group_name, automation_account_name, variable_name, custom_headers).value!
268
+ nil
269
+ end
270
+
271
+ #
272
+ # Delete the variable.
273
+ #
274
+ # @param resource_group_name [String] The resource group name.
275
+ # @param automation_account_name [String] The automation account name.
276
+ # @param variable_name [String] The name of variable.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
281
+ #
282
+ def delete_with_http_info(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
283
+ delete_async(resource_group_name, automation_account_name, variable_name, custom_headers).value!
284
+ end
285
+
286
+ #
287
+ # Delete the variable.
288
+ #
289
+ # @param resource_group_name [String] The resource group name.
290
+ # @param automation_account_name [String] The automation account name.
291
+ # @param variable_name [String] The name of variable.
292
+ # @param [Hash{String => String}] A hash of custom headers that will be added
293
+ # to the HTTP request.
294
+ #
295
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
296
+ #
297
+ def delete_async(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
298
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
299
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
300
+ fail ArgumentError, 'variable_name is nil' if variable_name.nil?
301
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
302
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
303
+
304
+
305
+ request_headers = {}
306
+
307
+ # Set Headers
308
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
309
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
310
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'
311
+
312
+ request_url = @base_url || @client.base_url
313
+
314
+ options = {
315
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
316
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'variableName' => variable_name,'subscriptionId' => @client.subscription_id},
317
+ query_params: {'api-version' => @client.api_version},
318
+ headers: request_headers.merge(custom_headers || {}),
319
+ base_url: request_url
320
+ }
321
+ promise = @client.make_request_async(:delete, path_template, options)
322
+
323
+ promise = promise.then do |result|
324
+ http_response = result.response
325
+ status_code = http_response.status
326
+ response_content = http_response.body
327
+ unless status_code == 200
328
+ error_model = JSON.load(response_content)
329
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
330
+ end
331
+
332
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
333
+
334
+ result
335
+ end
336
+
337
+ promise.execute
338
+ end
339
+
340
+ #
341
+ # Retrieve the variable identified by variable name.
342
+ #
343
+ # @param resource_group_name [String] The resource group name.
344
+ # @param automation_account_name [String] The automation account name.
345
+ # @param variable_name [String] The name of variable.
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ # @return [Variable] operation results.
350
+ #
351
+ def get(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
352
+ response = get_async(resource_group_name, automation_account_name, variable_name, custom_headers).value!
353
+ response.body unless response.nil?
354
+ end
355
+
356
+ #
357
+ # Retrieve the variable identified by variable name.
358
+ #
359
+ # @param resource_group_name [String] The resource group name.
360
+ # @param automation_account_name [String] The automation account name.
361
+ # @param variable_name [String] The name of variable.
362
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
363
+ # will be added to the HTTP request.
364
+ #
365
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
366
+ #
367
+ def get_with_http_info(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
368
+ get_async(resource_group_name, automation_account_name, variable_name, custom_headers).value!
369
+ end
370
+
371
+ #
372
+ # Retrieve the variable identified by variable name.
373
+ #
374
+ # @param resource_group_name [String] The resource group name.
375
+ # @param automation_account_name [String] The automation account name.
376
+ # @param variable_name [String] The name of variable.
377
+ # @param [Hash{String => String}] A hash of custom headers that will be added
378
+ # to the HTTP request.
379
+ #
380
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
381
+ #
382
+ def get_async(resource_group_name, automation_account_name, variable_name, custom_headers = nil)
383
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
384
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
385
+ fail ArgumentError, 'variable_name is nil' if variable_name.nil?
386
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
387
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
388
+
389
+
390
+ request_headers = {}
391
+
392
+ # Set Headers
393
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
394
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
395
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'
396
+
397
+ request_url = @base_url || @client.base_url
398
+
399
+ options = {
400
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
401
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'variableName' => variable_name,'subscriptionId' => @client.subscription_id},
402
+ query_params: {'api-version' => @client.api_version},
403
+ headers: request_headers.merge(custom_headers || {}),
404
+ base_url: request_url
405
+ }
406
+ promise = @client.make_request_async(:get, path_template, options)
407
+
408
+ promise = promise.then do |result|
409
+ http_response = result.response
410
+ status_code = http_response.status
411
+ response_content = http_response.body
412
+ unless status_code == 200
413
+ error_model = JSON.load(response_content)
414
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
415
+ end
416
+
417
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
418
+ # Deserialize Response
419
+ if status_code == 200
420
+ begin
421
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
422
+ result_mapper = Azure::ARM::Automation::Models::Variable.mapper()
423
+ result.body = @client.deserialize(result_mapper, parsed_response)
424
+ rescue Exception => e
425
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
426
+ end
427
+ end
428
+
429
+ result
430
+ end
431
+
432
+ promise.execute
433
+ end
434
+
435
+ #
436
+ # Retrieve a list of variables.
437
+ #
438
+ # @param resource_group_name [String] The resource group name.
439
+ # @param automation_account_name [String] The automation account name.
440
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
441
+ # will be added to the HTTP request.
442
+ #
443
+ # @return [Array<Variable>] operation results.
444
+ #
445
+ def list_by_automation_account(resource_group_name, automation_account_name, custom_headers = nil)
446
+ first_page = list_by_automation_account_as_lazy(resource_group_name, automation_account_name, custom_headers)
447
+ first_page.get_all_items
448
+ end
449
+
450
+ #
451
+ # Retrieve a list of variables.
452
+ #
453
+ # @param resource_group_name [String] The resource group name.
454
+ # @param automation_account_name [String] The automation account name.
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
459
+ #
460
+ def list_by_automation_account_with_http_info(resource_group_name, automation_account_name, custom_headers = nil)
461
+ list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
462
+ end
463
+
464
+ #
465
+ # Retrieve a list of variables.
466
+ #
467
+ # @param resource_group_name [String] The resource group name.
468
+ # @param automation_account_name [String] The automation account name.
469
+ # @param [Hash{String => String}] A hash of custom headers that will be added
470
+ # to the HTTP request.
471
+ #
472
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
473
+ #
474
+ def list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers = nil)
475
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
476
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
477
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
478
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
479
+
480
+
481
+ request_headers = {}
482
+
483
+ # Set Headers
484
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
485
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
486
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'
487
+
488
+ request_url = @base_url || @client.base_url
489
+
490
+ options = {
491
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
492
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'subscriptionId' => @client.subscription_id},
493
+ query_params: {'api-version' => @client.api_version},
494
+ headers: request_headers.merge(custom_headers || {}),
495
+ base_url: request_url
496
+ }
497
+ promise = @client.make_request_async(:get, path_template, options)
498
+
499
+ promise = promise.then do |result|
500
+ http_response = result.response
501
+ status_code = http_response.status
502
+ response_content = http_response.body
503
+ unless status_code == 200
504
+ error_model = JSON.load(response_content)
505
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
506
+ end
507
+
508
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
509
+ # Deserialize Response
510
+ if status_code == 200
511
+ begin
512
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
513
+ result_mapper = Azure::ARM::Automation::Models::VariableListResult.mapper()
514
+ result.body = @client.deserialize(result_mapper, parsed_response)
515
+ rescue Exception => e
516
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
517
+ end
518
+ end
519
+
520
+ result
521
+ end
522
+
523
+ promise.execute
524
+ end
525
+
526
+ #
527
+ # Retrieve a list of variables.
528
+ #
529
+ # @param next_page_link [String] The NextLink from the previous successful call
530
+ # to List operation.
531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
532
+ # will be added to the HTTP request.
533
+ #
534
+ # @return [VariableListResult] operation results.
535
+ #
536
+ def list_by_automation_account_next(next_page_link, custom_headers = nil)
537
+ response = list_by_automation_account_next_async(next_page_link, custom_headers).value!
538
+ response.body unless response.nil?
539
+ end
540
+
541
+ #
542
+ # Retrieve a list of variables.
543
+ #
544
+ # @param next_page_link [String] The NextLink from the previous successful call
545
+ # to List operation.
546
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
547
+ # will be added to the HTTP request.
548
+ #
549
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
550
+ #
551
+ def list_by_automation_account_next_with_http_info(next_page_link, custom_headers = nil)
552
+ list_by_automation_account_next_async(next_page_link, custom_headers).value!
553
+ end
554
+
555
+ #
556
+ # Retrieve a list of variables.
557
+ #
558
+ # @param next_page_link [String] The NextLink from the previous successful call
559
+ # to List operation.
560
+ # @param [Hash{String => String}] A hash of custom headers that will be added
561
+ # to the HTTP request.
562
+ #
563
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
564
+ #
565
+ def list_by_automation_account_next_async(next_page_link, custom_headers = nil)
566
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
567
+
568
+
569
+ request_headers = {}
570
+
571
+ # Set Headers
572
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
573
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
574
+ path_template = '{nextLink}'
575
+
576
+ request_url = @base_url || @client.base_url
577
+
578
+ options = {
579
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
580
+ skip_encoding_path_params: {'nextLink' => next_page_link},
581
+ headers: request_headers.merge(custom_headers || {}),
582
+ base_url: request_url
583
+ }
584
+ promise = @client.make_request_async(:get, path_template, options)
585
+
586
+ promise = promise.then do |result|
587
+ http_response = result.response
588
+ status_code = http_response.status
589
+ response_content = http_response.body
590
+ unless status_code == 200
591
+ error_model = JSON.load(response_content)
592
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
593
+ end
594
+
595
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ result_mapper = Azure::ARM::Automation::Models::VariableListResult.mapper()
601
+ result.body = @client.deserialize(result_mapper, parsed_response)
602
+ rescue Exception => e
603
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
604
+ end
605
+ end
606
+
607
+ result
608
+ end
609
+
610
+ promise.execute
611
+ end
612
+
613
+ #
614
+ # Retrieve a list of variables.
615
+ #
616
+ # @param resource_group_name [String] The resource group name.
617
+ # @param automation_account_name [String] The automation account name.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [VariableListResult] which provide lazy access to pages of the
622
+ # response.
623
+ #
624
+ def list_by_automation_account_as_lazy(resource_group_name, automation_account_name, custom_headers = nil)
625
+ response = list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
626
+ unless response.nil?
627
+ page = response.body
628
+ page.next_method = Proc.new do |next_page_link|
629
+ list_by_automation_account_next_async(next_page_link, custom_headers)
630
+ end
631
+ page
632
+ end
633
+ end
634
+
635
+ end
636
+ end