azure_mgmt_automation 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,245 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class AutomationClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Client Api Version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] Gets subscription credentials which uniquely identify
24
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
25
+ # for every service call.
26
+ attr_accessor :subscription_id
27
+
28
+ # @return [String] Gets or sets the preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
+ # Running Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
+ # is generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [AutomationAccountOperations] automation_account_operations
40
+ attr_reader :automation_account_operations
41
+
42
+ # @return [Operations] operations
43
+ attr_reader :operations
44
+
45
+ # @return [StatisticsOperations] statistics_operations
46
+ attr_reader :statistics_operations
47
+
48
+ # @return [Usages] usages
49
+ attr_reader :usages
50
+
51
+ # @return [CertificateOperations] certificate_operations
52
+ attr_reader :certificate_operations
53
+
54
+ # @return [ConnectionOperations] connection_operations
55
+ attr_reader :connection_operations
56
+
57
+ # @return [ConnectionTypeOperations] connection_type_operations
58
+ attr_reader :connection_type_operations
59
+
60
+ # @return [CredentialOperations] credential_operations
61
+ attr_reader :credential_operations
62
+
63
+ # @return [DscCompilationJobOperations] dsc_compilation_job_operations
64
+ attr_reader :dsc_compilation_job_operations
65
+
66
+ # @return [DscConfigurationOperations] dsc_configuration_operations
67
+ attr_reader :dsc_configuration_operations
68
+
69
+ # @return [AgentRegistrationInformation] agent_registration_information
70
+ attr_reader :agent_registration_information
71
+
72
+ # @return [DscNodeOperations] dsc_node_operations
73
+ attr_reader :dsc_node_operations
74
+
75
+ # @return [NodeReports] node_reports
76
+ attr_reader :node_reports
77
+
78
+ # @return [DscNodeConfigurationOperations]
79
+ # dsc_node_configuration_operations
80
+ attr_reader :dsc_node_configuration_operations
81
+
82
+ # @return [HybridRunbookWorkerGroupOperations]
83
+ # hybrid_runbook_worker_group_operations
84
+ attr_reader :hybrid_runbook_worker_group_operations
85
+
86
+ # @return [JobOperations] job_operations
87
+ attr_reader :job_operations
88
+
89
+ # @return [JobStreamOperations] job_stream_operations
90
+ attr_reader :job_stream_operations
91
+
92
+ # @return [JobScheduleOperations] job_schedule_operations
93
+ attr_reader :job_schedule_operations
94
+
95
+ # @return [ActivityOperations] activity_operations
96
+ attr_reader :activity_operations
97
+
98
+ # @return [ModuleModelOperations] module_model_operations
99
+ attr_reader :module_model_operations
100
+
101
+ # @return [ObjectDataTypes] object_data_types
102
+ attr_reader :object_data_types
103
+
104
+ # @return [Fields] fields
105
+ attr_reader :fields
106
+
107
+ # @return [RunbookDraftOperations] runbook_draft_operations
108
+ attr_reader :runbook_draft_operations
109
+
110
+ # @return [RunbookOperations] runbook_operations
111
+ attr_reader :runbook_operations
112
+
113
+ # @return [TestJobStreams] test_job_streams
114
+ attr_reader :test_job_streams
115
+
116
+ # @return [TestJobs] test_jobs
117
+ attr_reader :test_jobs
118
+
119
+ # @return [ScheduleOperations] schedule_operations
120
+ attr_reader :schedule_operations
121
+
122
+ # @return [VariableOperations] variable_operations
123
+ attr_reader :variable_operations
124
+
125
+ # @return [WebhookOperations] webhook_operations
126
+ attr_reader :webhook_operations
127
+
128
+ #
129
+ # Creates initializes a new instance of the AutomationClient class.
130
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
131
+ # @param base_url [String] the base URI of the service.
132
+ # @param options [Array] filters to be applied to the HTTP requests.
133
+ #
134
+ def initialize(credentials = nil, base_url = nil, options = nil)
135
+ super(credentials, options)
136
+ @base_url = base_url || 'https://management.azure.com'
137
+
138
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
139
+ @credentials = credentials
140
+
141
+ @automation_account_operations = AutomationAccountOperations.new(self)
142
+ @operations = Operations.new(self)
143
+ @statistics_operations = StatisticsOperations.new(self)
144
+ @usages = Usages.new(self)
145
+ @certificate_operations = CertificateOperations.new(self)
146
+ @connection_operations = ConnectionOperations.new(self)
147
+ @connection_type_operations = ConnectionTypeOperations.new(self)
148
+ @credential_operations = CredentialOperations.new(self)
149
+ @dsc_compilation_job_operations = DscCompilationJobOperations.new(self)
150
+ @dsc_configuration_operations = DscConfigurationOperations.new(self)
151
+ @agent_registration_information = AgentRegistrationInformation.new(self)
152
+ @dsc_node_operations = DscNodeOperations.new(self)
153
+ @node_reports = NodeReports.new(self)
154
+ @dsc_node_configuration_operations = DscNodeConfigurationOperations.new(self)
155
+ @hybrid_runbook_worker_group_operations = HybridRunbookWorkerGroupOperations.new(self)
156
+ @job_operations = JobOperations.new(self)
157
+ @job_stream_operations = JobStreamOperations.new(self)
158
+ @job_schedule_operations = JobScheduleOperations.new(self)
159
+ @activity_operations = ActivityOperations.new(self)
160
+ @module_model_operations = ModuleModelOperations.new(self)
161
+ @object_data_types = ObjectDataTypes.new(self)
162
+ @fields = Fields.new(self)
163
+ @runbook_draft_operations = RunbookDraftOperations.new(self)
164
+ @runbook_operations = RunbookOperations.new(self)
165
+ @test_job_streams = TestJobStreams.new(self)
166
+ @test_jobs = TestJobs.new(self)
167
+ @schedule_operations = ScheduleOperations.new(self)
168
+ @variable_operations = VariableOperations.new(self)
169
+ @webhook_operations = WebhookOperations.new(self)
170
+ @api_version = '2015-10-31'
171
+ @accept_language = 'en-US'
172
+ @long_running_operation_retry_timeout = 30
173
+ @generate_client_request_id = true
174
+ add_telemetry
175
+ end
176
+
177
+ #
178
+ # Makes a request and returns the body of the response.
179
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
180
+ # @param path [String] the path, relative to {base_url}.
181
+ # @param options [Hash{String=>String}] specifying any request options like :body.
182
+ # @return [Hash{String=>String}] containing the body of the response.
183
+ # Example:
184
+ #
185
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
186
+ # path = "/path"
187
+ # options = {
188
+ # body: request_content,
189
+ # query_params: {'api-version' => '2016-02-01'}
190
+ # }
191
+ # result = @client.make_request(:put, path, options)
192
+ #
193
+ def make_request(method, path, options = {})
194
+ result = make_request_with_http_info(method, path, options)
195
+ result.body unless result.nil?
196
+ end
197
+
198
+ #
199
+ # Makes a request and returns the operation response.
200
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
201
+ # @param path [String] the path, relative to {base_url}.
202
+ # @param options [Hash{String=>String}] specifying any request options like :body.
203
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
204
+ #
205
+ def make_request_with_http_info(method, path, options = {})
206
+ result = make_request_async(method, path, options).value!
207
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
208
+ result
209
+ end
210
+
211
+ #
212
+ # Makes a request asynchronously.
213
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
214
+ # @param path [String] the path, relative to {base_url}.
215
+ # @param options [Hash{String=>String}] specifying any request options like :body.
216
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
217
+ #
218
+ def make_request_async(method, path, options = {})
219
+ fail ArgumentError, 'method is nil' if method.nil?
220
+ fail ArgumentError, 'path is nil' if path.nil?
221
+
222
+ request_url = options[:base_url] || @base_url
223
+
224
+ request_headers = @request_headers
225
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
226
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
227
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
228
+
229
+ super(request_url, method, path, options)
230
+ end
231
+
232
+
233
+ private
234
+ #
235
+ # Adds telemetry information.
236
+ #
237
+ def add_telemetry
238
+ sdk_information = 'azure_mgmt_automation'
239
+ if defined? Azure::ARM::Automation::VERSION
240
+ sdk_information = "#{sdk_information}/#{Azure::ARM::Automation::VERSION}"
241
+ end
242
+ add_user_agent_information(sdk_information)
243
+ end
244
+ end
245
+ end
@@ -0,0 +1,642 @@
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 CertificateOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the CertificateOperations 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
+ # Delete the certificate.
26
+ #
27
+ # @param resource_group_name [String] The resource group name.
28
+ # @param automation_account_name [String] The automation account name.
29
+ # @param certificate_name [String] The name of certificate.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ #
34
+ def delete(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
35
+ response = delete_async(resource_group_name, automation_account_name, certificate_name, custom_headers).value!
36
+ nil
37
+ end
38
+
39
+ #
40
+ # Delete the certificate.
41
+ #
42
+ # @param resource_group_name [String] The resource group name.
43
+ # @param automation_account_name [String] The automation account name.
44
+ # @param certificate_name [String] The name of certificate.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
49
+ #
50
+ def delete_with_http_info(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
51
+ delete_async(resource_group_name, automation_account_name, certificate_name, custom_headers).value!
52
+ end
53
+
54
+ #
55
+ # Delete the certificate.
56
+ #
57
+ # @param resource_group_name [String] The resource group name.
58
+ # @param automation_account_name [String] The automation account name.
59
+ # @param certificate_name [String] The name of certificate.
60
+ # @param [Hash{String => String}] A hash of custom headers that will be added
61
+ # to the HTTP request.
62
+ #
63
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
64
+ #
65
+ def delete_async(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
68
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
70
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
+
72
+
73
+ request_headers = {}
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id},
85
+ query_params: {'api-version' => @client.api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:delete, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ #
109
+ # Retrieve the certificate identified by certificate name.
110
+ #
111
+ # @param resource_group_name [String] The resource group name.
112
+ # @param automation_account_name [String] The automation account name.
113
+ # @param certificate_name [String] The name of certificate.
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [Certificate] operation results.
118
+ #
119
+ def get(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
120
+ response = get_async(resource_group_name, automation_account_name, certificate_name, custom_headers).value!
121
+ response.body unless response.nil?
122
+ end
123
+
124
+ #
125
+ # Retrieve the certificate identified by certificate name.
126
+ #
127
+ # @param resource_group_name [String] The resource group name.
128
+ # @param automation_account_name [String] The automation account name.
129
+ # @param certificate_name [String] The name of certificate.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
134
+ #
135
+ def get_with_http_info(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
136
+ get_async(resource_group_name, automation_account_name, certificate_name, custom_headers).value!
137
+ end
138
+
139
+ #
140
+ # Retrieve the certificate identified by certificate name.
141
+ #
142
+ # @param resource_group_name [String] The resource group name.
143
+ # @param automation_account_name [String] The automation account name.
144
+ # @param certificate_name [String] The name of certificate.
145
+ # @param [Hash{String => String}] A hash of custom headers that will be added
146
+ # to the HTTP request.
147
+ #
148
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
149
+ #
150
+ def get_async(resource_group_name, automation_account_name, certificate_name, custom_headers = nil)
151
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
152
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
153
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
154
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
155
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
156
+
157
+
158
+ request_headers = {}
159
+
160
+ # Set Headers
161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
163
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id},
170
+ query_params: {'api-version' => @client.api_version},
171
+ headers: request_headers.merge(custom_headers || {}),
172
+ base_url: request_url
173
+ }
174
+ promise = @client.make_request_async(:get, path_template, options)
175
+
176
+ promise = promise.then do |result|
177
+ http_response = result.response
178
+ status_code = http_response.status
179
+ response_content = http_response.body
180
+ unless status_code == 200
181
+ error_model = JSON.load(response_content)
182
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
183
+ end
184
+
185
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
186
+ # Deserialize Response
187
+ if status_code == 200
188
+ begin
189
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
190
+ result_mapper = Azure::ARM::Automation::Models::Certificate.mapper()
191
+ result.body = @client.deserialize(result_mapper, parsed_response)
192
+ rescue Exception => e
193
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
194
+ end
195
+ end
196
+
197
+ result
198
+ end
199
+
200
+ promise.execute
201
+ end
202
+
203
+ #
204
+ # Create a certificate.
205
+ #
206
+ # @param resource_group_name [String] The resource group name.
207
+ # @param automation_account_name [String] The automation account name.
208
+ # @param certificate_name [String] The parameters supplied to the create or
209
+ # update certificate operation.
210
+ # @param parameters [CertificateCreateOrUpdateParameters] The parameters
211
+ # supplied to the create or update certificate operation.
212
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
213
+ # will be added to the HTTP request.
214
+ #
215
+ # @return [Certificate] operation results.
216
+ #
217
+ def create_or_update(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
218
+ response = create_or_update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers).value!
219
+ response.body unless response.nil?
220
+ end
221
+
222
+ #
223
+ # Create a certificate.
224
+ #
225
+ # @param resource_group_name [String] The resource group name.
226
+ # @param automation_account_name [String] The automation account name.
227
+ # @param certificate_name [String] The parameters supplied to the create or
228
+ # update certificate operation.
229
+ # @param parameters [CertificateCreateOrUpdateParameters] The parameters
230
+ # supplied to the create or update certificate operation.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
235
+ #
236
+ def create_or_update_with_http_info(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
237
+ create_or_update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers).value!
238
+ end
239
+
240
+ #
241
+ # Create a certificate.
242
+ #
243
+ # @param resource_group_name [String] The resource group name.
244
+ # @param automation_account_name [String] The automation account name.
245
+ # @param certificate_name [String] The parameters supplied to the create or
246
+ # update certificate operation.
247
+ # @param parameters [CertificateCreateOrUpdateParameters] The parameters
248
+ # supplied to the create or update certificate operation.
249
+ # @param [Hash{String => String}] A hash of custom headers that will be added
250
+ # to the HTTP request.
251
+ #
252
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
253
+ #
254
+ def create_or_update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
255
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
256
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
257
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
258
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
259
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
260
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
261
+
262
+
263
+ request_headers = {}
264
+
265
+ # Set Headers
266
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
267
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
268
+
269
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
270
+
271
+ # Serialize Request
272
+ request_mapper = Azure::ARM::Automation::Models::CertificateCreateOrUpdateParameters.mapper()
273
+ request_content = @client.serialize(request_mapper, parameters)
274
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
275
+
276
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'
277
+
278
+ request_url = @base_url || @client.base_url
279
+
280
+ options = {
281
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
282
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id},
283
+ query_params: {'api-version' => @client.api_version},
284
+ body: request_content,
285
+ headers: request_headers.merge(custom_headers || {}),
286
+ base_url: request_url
287
+ }
288
+ promise = @client.make_request_async(:put, path_template, options)
289
+
290
+ promise = promise.then do |result|
291
+ http_response = result.response
292
+ status_code = http_response.status
293
+ response_content = http_response.body
294
+ unless status_code == 201 || status_code == 200
295
+ error_model = JSON.load(response_content)
296
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
297
+ end
298
+
299
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
300
+ # Deserialize Response
301
+ if status_code == 201
302
+ begin
303
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
304
+ result_mapper = Azure::ARM::Automation::Models::Certificate.mapper()
305
+ result.body = @client.deserialize(result_mapper, parsed_response)
306
+ rescue Exception => e
307
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
308
+ end
309
+ end
310
+ # Deserialize Response
311
+ if status_code == 200
312
+ begin
313
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
314
+ result_mapper = Azure::ARM::Automation::Models::Certificate.mapper()
315
+ result.body = @client.deserialize(result_mapper, parsed_response)
316
+ rescue Exception => e
317
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
318
+ end
319
+ end
320
+
321
+ result
322
+ end
323
+
324
+ promise.execute
325
+ end
326
+
327
+ #
328
+ # Update a certificate.
329
+ #
330
+ # @param resource_group_name [String] The resource group name.
331
+ # @param automation_account_name [String] The automation account name.
332
+ # @param certificate_name [String] The parameters supplied to the update
333
+ # certificate operation.
334
+ # @param parameters [CertificateUpdateParameters] The parameters supplied to
335
+ # the update certificate operation.
336
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
337
+ # will be added to the HTTP request.
338
+ #
339
+ # @return [Certificate] operation results.
340
+ #
341
+ def update(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
342
+ response = update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers).value!
343
+ response.body unless response.nil?
344
+ end
345
+
346
+ #
347
+ # Update a certificate.
348
+ #
349
+ # @param resource_group_name [String] The resource group name.
350
+ # @param automation_account_name [String] The automation account name.
351
+ # @param certificate_name [String] The parameters supplied to the update
352
+ # certificate operation.
353
+ # @param parameters [CertificateUpdateParameters] The parameters supplied to
354
+ # the update certificate operation.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
359
+ #
360
+ def update_with_http_info(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
361
+ update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers).value!
362
+ end
363
+
364
+ #
365
+ # Update a certificate.
366
+ #
367
+ # @param resource_group_name [String] The resource group name.
368
+ # @param automation_account_name [String] The automation account name.
369
+ # @param certificate_name [String] The parameters supplied to the update
370
+ # certificate operation.
371
+ # @param parameters [CertificateUpdateParameters] The parameters supplied to
372
+ # the update certificate operation.
373
+ # @param [Hash{String => String}] A hash of custom headers that will be added
374
+ # to the HTTP request.
375
+ #
376
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
377
+ #
378
+ def update_async(resource_group_name, automation_account_name, certificate_name, parameters, custom_headers = nil)
379
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
380
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
381
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
382
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
383
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
384
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
385
+
386
+
387
+ request_headers = {}
388
+
389
+ # Set Headers
390
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
391
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
392
+
393
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
394
+
395
+ # Serialize Request
396
+ request_mapper = Azure::ARM::Automation::Models::CertificateUpdateParameters.mapper()
397
+ request_content = @client.serialize(request_mapper, parameters)
398
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
399
+
400
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'
401
+
402
+ request_url = @base_url || @client.base_url
403
+
404
+ options = {
405
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
406
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id},
407
+ query_params: {'api-version' => @client.api_version},
408
+ body: request_content,
409
+ headers: request_headers.merge(custom_headers || {}),
410
+ base_url: request_url
411
+ }
412
+ promise = @client.make_request_async(:patch, path_template, options)
413
+
414
+ promise = promise.then do |result|
415
+ http_response = result.response
416
+ status_code = http_response.status
417
+ response_content = http_response.body
418
+ unless status_code == 200
419
+ error_model = JSON.load(response_content)
420
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
421
+ end
422
+
423
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
424
+ # Deserialize Response
425
+ if status_code == 200
426
+ begin
427
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
428
+ result_mapper = Azure::ARM::Automation::Models::Certificate.mapper()
429
+ result.body = @client.deserialize(result_mapper, parsed_response)
430
+ rescue Exception => e
431
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
432
+ end
433
+ end
434
+
435
+ result
436
+ end
437
+
438
+ promise.execute
439
+ end
440
+
441
+ #
442
+ # Retrieve a list of certificates.
443
+ #
444
+ # @param resource_group_name [String] The resource group name.
445
+ # @param automation_account_name [String] The automation account name.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [Array<Certificate>] operation results.
450
+ #
451
+ def list_by_automation_account(resource_group_name, automation_account_name, custom_headers = nil)
452
+ first_page = list_by_automation_account_as_lazy(resource_group_name, automation_account_name, custom_headers)
453
+ first_page.get_all_items
454
+ end
455
+
456
+ #
457
+ # Retrieve a list of certificates.
458
+ #
459
+ # @param resource_group_name [String] The resource group name.
460
+ # @param automation_account_name [String] The automation account name.
461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
462
+ # will be added to the HTTP request.
463
+ #
464
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
465
+ #
466
+ def list_by_automation_account_with_http_info(resource_group_name, automation_account_name, custom_headers = nil)
467
+ list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
468
+ end
469
+
470
+ #
471
+ # Retrieve a list of certificates.
472
+ #
473
+ # @param resource_group_name [String] The resource group name.
474
+ # @param automation_account_name [String] The automation account name.
475
+ # @param [Hash{String => String}] A hash of custom headers that will be added
476
+ # to the HTTP request.
477
+ #
478
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
479
+ #
480
+ def list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers = nil)
481
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
482
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
483
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+
486
+
487
+ request_headers = {}
488
+
489
+ # Set Headers
490
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
491
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
492
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'
493
+
494
+ request_url = @base_url || @client.base_url
495
+
496
+ options = {
497
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
498
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'subscriptionId' => @client.subscription_id},
499
+ query_params: {'api-version' => @client.api_version},
500
+ headers: request_headers.merge(custom_headers || {}),
501
+ base_url: request_url
502
+ }
503
+ promise = @client.make_request_async(:get, path_template, options)
504
+
505
+ promise = promise.then do |result|
506
+ http_response = result.response
507
+ status_code = http_response.status
508
+ response_content = http_response.body
509
+ unless status_code == 200
510
+ error_model = JSON.load(response_content)
511
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
512
+ end
513
+
514
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
515
+ # Deserialize Response
516
+ if status_code == 200
517
+ begin
518
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
519
+ result_mapper = Azure::ARM::Automation::Models::CertificateListResult.mapper()
520
+ result.body = @client.deserialize(result_mapper, parsed_response)
521
+ rescue Exception => e
522
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
523
+ end
524
+ end
525
+
526
+ result
527
+ end
528
+
529
+ promise.execute
530
+ end
531
+
532
+ #
533
+ # Retrieve a list of certificates.
534
+ #
535
+ # @param next_page_link [String] The NextLink from the previous successful call
536
+ # to List operation.
537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
538
+ # will be added to the HTTP request.
539
+ #
540
+ # @return [CertificateListResult] operation results.
541
+ #
542
+ def list_by_automation_account_next(next_page_link, custom_headers = nil)
543
+ response = list_by_automation_account_next_async(next_page_link, custom_headers).value!
544
+ response.body unless response.nil?
545
+ end
546
+
547
+ #
548
+ # Retrieve a list of certificates.
549
+ #
550
+ # @param next_page_link [String] The NextLink from the previous successful call
551
+ # to List operation.
552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
553
+ # will be added to the HTTP request.
554
+ #
555
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
556
+ #
557
+ def list_by_automation_account_next_with_http_info(next_page_link, custom_headers = nil)
558
+ list_by_automation_account_next_async(next_page_link, custom_headers).value!
559
+ end
560
+
561
+ #
562
+ # Retrieve a list of certificates.
563
+ #
564
+ # @param next_page_link [String] The NextLink from the previous successful call
565
+ # to List operation.
566
+ # @param [Hash{String => String}] A hash of custom headers that will be added
567
+ # to the HTTP request.
568
+ #
569
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
570
+ #
571
+ def list_by_automation_account_next_async(next_page_link, custom_headers = nil)
572
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
573
+
574
+
575
+ request_headers = {}
576
+
577
+ # Set Headers
578
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
579
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
580
+ path_template = '{nextLink}'
581
+
582
+ request_url = @base_url || @client.base_url
583
+
584
+ options = {
585
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
586
+ skip_encoding_path_params: {'nextLink' => next_page_link},
587
+ headers: request_headers.merge(custom_headers || {}),
588
+ base_url: request_url
589
+ }
590
+ promise = @client.make_request_async(:get, path_template, options)
591
+
592
+ promise = promise.then do |result|
593
+ http_response = result.response
594
+ status_code = http_response.status
595
+ response_content = http_response.body
596
+ unless status_code == 200
597
+ error_model = JSON.load(response_content)
598
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
599
+ end
600
+
601
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
602
+ # Deserialize Response
603
+ if status_code == 200
604
+ begin
605
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
606
+ result_mapper = Azure::ARM::Automation::Models::CertificateListResult.mapper()
607
+ result.body = @client.deserialize(result_mapper, parsed_response)
608
+ rescue Exception => e
609
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
610
+ end
611
+ end
612
+
613
+ result
614
+ end
615
+
616
+ promise.execute
617
+ end
618
+
619
+ #
620
+ # Retrieve a list of certificates.
621
+ #
622
+ # @param resource_group_name [String] The resource group name.
623
+ # @param automation_account_name [String] The automation account name.
624
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
625
+ # will be added to the HTTP request.
626
+ #
627
+ # @return [CertificateListResult] which provide lazy access to pages of the
628
+ # response.
629
+ #
630
+ def list_by_automation_account_as_lazy(resource_group_name, automation_account_name, custom_headers = nil)
631
+ response = list_by_automation_account_async(resource_group_name, automation_account_name, custom_headers).value!
632
+ unless response.nil?
633
+ page = response.body
634
+ page.next_method = Proc.new do |next_page_link|
635
+ list_by_automation_account_next_async(next_page_link, custom_headers)
636
+ end
637
+ page
638
+ end
639
+ end
640
+
641
+ end
642
+ end