azure_mgmt_logic 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/LICENSE.txt +21 -0
  4. data/Rakefile +5 -0
  5. data/azure_mgmt_logic.gemspec +34 -0
  6. data/lib/azure_mgmt_logic.rb +5 -0
  7. data/lib/generated/azure_mgmt_logic/integration_account_agreements.rb +549 -0
  8. data/lib/generated/azure_mgmt_logic/integration_account_certificates.rb +545 -0
  9. data/lib/generated/azure_mgmt_logic/integration_account_maps.rb +546 -0
  10. data/lib/generated/azure_mgmt_logic/integration_account_partners.rb +546 -0
  11. data/lib/generated/azure_mgmt_logic/integration_account_schemas.rb +546 -0
  12. data/lib/generated/azure_mgmt_logic/integration_accounts.rb +939 -0
  13. data/lib/generated/azure_mgmt_logic/logic_management_client.rb +86 -0
  14. data/lib/generated/azure_mgmt_logic/models/agreement_content.rb +67 -0
  15. data/lib/generated/azure_mgmt_logic/models/agreement_type.rb +18 -0
  16. data/lib/generated/azure_mgmt_logic/models/as2acknowledgement_connection_settings.rb +78 -0
  17. data/lib/generated/azure_mgmt_logic/models/as2agreement_content.rb +56 -0
  18. data/lib/generated/azure_mgmt_logic/models/as2envelope_settings.rb +87 -0
  19. data/lib/generated/azure_mgmt_logic/models/as2error_settings.rb +56 -0
  20. data/lib/generated/azure_mgmt_logic/models/as2mdn_settings.rb +132 -0
  21. data/lib/generated/azure_mgmt_logic/models/as2message_connection_settings.rb +78 -0
  22. data/lib/generated/azure_mgmt_logic/models/as2one_way_agreement.rb +67 -0
  23. data/lib/generated/azure_mgmt_logic/models/as2protocol_settings.rb +112 -0
  24. data/lib/generated/azure_mgmt_logic/models/as2security_settings.rb +131 -0
  25. data/lib/generated/azure_mgmt_logic/models/as2validation_settings.rb +135 -0
  26. data/lib/generated/azure_mgmt_logic/models/b2bpartner_content.rb +53 -0
  27. data/lib/generated/azure_mgmt_logic/models/business_identity.rb +54 -0
  28. data/lib/generated/azure_mgmt_logic/models/callback_url.rb +44 -0
  29. data/lib/generated/azure_mgmt_logic/models/edifact_acknowledgement_settings.rb +151 -0
  30. data/lib/generated/azure_mgmt_logic/models/edifact_agreement_content.rb +56 -0
  31. data/lib/generated/azure_mgmt_logic/models/edifact_character_set.rb +29 -0
  32. data/lib/generated/azure_mgmt_logic/models/edifact_decimal_indicator.rb +17 -0
  33. data/lib/generated/azure_mgmt_logic/models/edifact_delimiter_override.rb +159 -0
  34. data/lib/generated/azure_mgmt_logic/models/edifact_envelope_override.rb +188 -0
  35. data/lib/generated/azure_mgmt_logic/models/edifact_envelope_settings.rb +452 -0
  36. data/lib/generated/azure_mgmt_logic/models/edifact_framing_settings.rb +153 -0
  37. data/lib/generated/azure_mgmt_logic/models/edifact_message_filter.rb +46 -0
  38. data/lib/generated/azure_mgmt_logic/models/edifact_message_identifier.rb +45 -0
  39. data/lib/generated/azure_mgmt_logic/models/edifact_one_way_agreement.rb +67 -0
  40. data/lib/generated/azure_mgmt_logic/models/edifact_processing_settings.rb +88 -0
  41. data/lib/generated/azure_mgmt_logic/models/edifact_protocol_settings.rb +195 -0
  42. data/lib/generated/azure_mgmt_logic/models/edifact_schema_reference.rb +104 -0
  43. data/lib/generated/azure_mgmt_logic/models/edifact_validation_override.rb +111 -0
  44. data/lib/generated/azure_mgmt_logic/models/edifact_validation_settings.rb +145 -0
  45. data/lib/generated/azure_mgmt_logic/models/encryption_algorithm.rb +21 -0
  46. data/lib/generated/azure_mgmt_logic/models/hashing_algorithm.rb +19 -0
  47. data/lib/generated/azure_mgmt_logic/models/integration_account.rb +97 -0
  48. data/lib/generated/azure_mgmt_logic/models/integration_account_agreement.rb +173 -0
  49. data/lib/generated/azure_mgmt_logic/models/integration_account_agreement_filter.rb +47 -0
  50. data/lib/generated/azure_mgmt_logic/models/integration_account_agreement_list_result.rb +94 -0
  51. data/lib/generated/azure_mgmt_logic/models/integration_account_certificate.rb +129 -0
  52. data/lib/generated/azure_mgmt_logic/models/integration_account_certificate_list_result.rb +95 -0
  53. data/lib/generated/azure_mgmt_logic/models/integration_account_content_hash.rb +54 -0
  54. data/lib/generated/azure_mgmt_logic/models/integration_account_content_link.rb +85 -0
  55. data/lib/generated/azure_mgmt_logic/models/integration_account_list_result.rb +93 -0
  56. data/lib/generated/azure_mgmt_logic/models/integration_account_map.rb +152 -0
  57. data/lib/generated/azure_mgmt_logic/models/integration_account_map_filter.rb +46 -0
  58. data/lib/generated/azure_mgmt_logic/models/integration_account_map_list_result.rb +94 -0
  59. data/lib/generated/azure_mgmt_logic/models/integration_account_partner.rb +131 -0
  60. data/lib/generated/azure_mgmt_logic/models/integration_account_partner_filter.rb +46 -0
  61. data/lib/generated/azure_mgmt_logic/models/integration_account_partner_list_result.rb +94 -0
  62. data/lib/generated/azure_mgmt_logic/models/integration_account_resource.rb +91 -0
  63. data/lib/generated/azure_mgmt_logic/models/integration_account_schema.rb +162 -0
  64. data/lib/generated/azure_mgmt_logic/models/integration_account_schema_filter.rb +46 -0
  65. data/lib/generated/azure_mgmt_logic/models/integration_account_schema_list_result.rb +94 -0
  66. data/lib/generated/azure_mgmt_logic/models/integration_account_sku.rb +46 -0
  67. data/lib/generated/azure_mgmt_logic/models/key_vault_key_reference.rb +65 -0
  68. data/lib/generated/azure_mgmt_logic/models/key_vault_key_reference_key_vault.rb +66 -0
  69. data/lib/generated/azure_mgmt_logic/models/list_callback_url_parameters.rb +44 -0
  70. data/lib/generated/azure_mgmt_logic/models/map_type.rb +16 -0
  71. data/lib/generated/azure_mgmt_logic/models/message_filter_type.rb +17 -0
  72. data/lib/generated/azure_mgmt_logic/models/partner_content.rb +45 -0
  73. data/lib/generated/azure_mgmt_logic/models/partner_type.rb +16 -0
  74. data/lib/generated/azure_mgmt_logic/models/schema_type.rb +16 -0
  75. data/lib/generated/azure_mgmt_logic/models/segment_terminator_suffix.rb +19 -0
  76. data/lib/generated/azure_mgmt_logic/models/sku_name.rb +20 -0
  77. data/lib/generated/azure_mgmt_logic/models/trailing_separator_policy.rb +18 -0
  78. data/lib/generated/azure_mgmt_logic/models/usage_indicator.rb +18 -0
  79. data/lib/generated/azure_mgmt_logic/models/x12acknowledgement_settings.rb +193 -0
  80. data/lib/generated/azure_mgmt_logic/models/x12agreement_content.rb +56 -0
  81. data/lib/generated/azure_mgmt_logic/models/x12character_set.rb +18 -0
  82. data/lib/generated/azure_mgmt_logic/models/x12date_format.rb +17 -0
  83. data/lib/generated/azure_mgmt_logic/models/x12delimiter_overrides.rb +128 -0
  84. data/lib/generated/azure_mgmt_logic/models/x12envelope_override.rb +141 -0
  85. data/lib/generated/azure_mgmt_logic/models/x12envelope_settings.rb +286 -0
  86. data/lib/generated/azure_mgmt_logic/models/x12framing_settings.rb +109 -0
  87. data/lib/generated/azure_mgmt_logic/models/x12message_filter.rb +46 -0
  88. data/lib/generated/azure_mgmt_logic/models/x12message_identifier.rb +44 -0
  89. data/lib/generated/azure_mgmt_logic/models/x12one_way_agreement.rb +67 -0
  90. data/lib/generated/azure_mgmt_logic/models/x12processing_settings.rb +99 -0
  91. data/lib/generated/azure_mgmt_logic/models/x12protocol_settings.rb +204 -0
  92. data/lib/generated/azure_mgmt_logic/models/x12schema_reference.rb +74 -0
  93. data/lib/generated/azure_mgmt_logic/models/x12security_settings.rb +74 -0
  94. data/lib/generated/azure_mgmt_logic/models/x12time_format.rb +19 -0
  95. data/lib/generated/azure_mgmt_logic/models/x12validation_override.rb +111 -0
  96. data/lib/generated/azure_mgmt_logic/models/x12validation_settings.rb +145 -0
  97. data/lib/generated/azure_mgmt_logic/module_definition.rb +8 -0
  98. data/lib/generated/azure_mgmt_logic/version.rb +8 -0
  99. data/lib/generated/azure_mgmt_logic.rb +116 -0
  100. metadata +212 -0
@@ -0,0 +1,545 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Logic
7
+ #
8
+ # IntegrationAccountCertificates
9
+ #
10
+ class IntegrationAccountCertificates
11
+ include Azure::ARM::Logic::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the IntegrationAccountCertificates class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return reference to the LogicManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets a list of integration account certificates.
27
+ #
28
+ # @param resource_group_name [String] The resource group name.
29
+ # @param integration_account_name [String] The integration account name.
30
+ # @param top [Integer] The number of items to be included in the result.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [IntegrationAccountCertificateListResult] which provide lazy access
35
+ # to pages of the response.
36
+ #
37
+ def list_as_lazy(resource_group_name, integration_account_name, top = nil, custom_headers = nil)
38
+ response = list_async(resource_group_name, integration_account_name, top, custom_headers).value!
39
+ unless response.nil?
40
+ page = response.body
41
+ page.next_method = Proc.new do |next_link|
42
+ list_next_async(next_link, custom_headers)
43
+ end
44
+ page
45
+ end
46
+ end
47
+
48
+ #
49
+ # Gets a list of integration account certificates.
50
+ #
51
+ # @param resource_group_name [String] The resource group name.
52
+ # @param integration_account_name [String] The integration account name.
53
+ # @param top [Integer] The number of items to be included in the result.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [Array<IntegrationAccountCertificate>] operation results.
58
+ #
59
+ def list(resource_group_name, integration_account_name, top = nil, custom_headers = nil)
60
+ first_page = list_as_lazy(resource_group_name, integration_account_name, top, custom_headers)
61
+ first_page.get_all_items
62
+ end
63
+
64
+ #
65
+ # Gets a list of integration account certificates.
66
+ #
67
+ # @param resource_group_name [String] The resource group name.
68
+ # @param integration_account_name [String] The integration account name.
69
+ # @param top [Integer] The number of items to be included in the result.
70
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
71
+ # will be added to the HTTP request.
72
+ #
73
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
74
+ #
75
+ def list_with_http_info(resource_group_name, integration_account_name, top = nil, custom_headers = nil)
76
+ list_async(resource_group_name, integration_account_name, top, custom_headers).value!
77
+ end
78
+
79
+ #
80
+ # Gets a list of integration account certificates.
81
+ #
82
+ # @param resource_group_name [String] The resource group name.
83
+ # @param integration_account_name [String] The integration account name.
84
+ # @param top [Integer] The number of items to be included in the result.
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def list_async(resource_group_name, integration_account_name, top = nil, custom_headers = nil)
91
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
92
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
93
+ fail ArgumentError, 'integration_account_name is nil' if integration_account_name.nil?
94
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
95
+
96
+
97
+ request_headers = {}
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates'
103
+ options = {
104
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
105
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'integrationAccountName' => integration_account_name},
106
+ query_params: {'api-version' => @client.api_version,'$top' => top},
107
+ headers: request_headers.merge(custom_headers || {})
108
+ }
109
+
110
+ request_url = @base_url || @client.base_url
111
+
112
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
113
+ promise = request.run_promise do |req|
114
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
115
+ end
116
+
117
+ promise = promise.then do |http_response|
118
+ status_code = http_response.status
119
+ response_content = http_response.body
120
+ unless status_code == 200
121
+ error_model = JSON.load(response_content)
122
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
123
+ end
124
+
125
+ # Create Result
126
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
127
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
128
+ # Deserialize Response
129
+ if status_code == 200
130
+ begin
131
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
132
+ result_mapper = IntegrationAccountCertificateListResult.mapper()
133
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
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
+ # Gets an integration account certificate.
147
+ #
148
+ # @param resource_group_name [String] The resource group name.
149
+ # @param integration_account_name [String] The integration account name.
150
+ # @param certificate_name [String] The integration account certificate name.
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [IntegrationAccountCertificate] operation results.
155
+ #
156
+ def get(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
157
+ response = get_async(resource_group_name, integration_account_name, certificate_name, custom_headers).value!
158
+ response.body unless response.nil?
159
+ end
160
+
161
+ #
162
+ # Gets an integration account certificate.
163
+ #
164
+ # @param resource_group_name [String] The resource group name.
165
+ # @param integration_account_name [String] The integration account name.
166
+ # @param certificate_name [String] The integration account certificate name.
167
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
168
+ # will be added to the HTTP request.
169
+ #
170
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
171
+ #
172
+ def get_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
173
+ get_async(resource_group_name, integration_account_name, certificate_name, custom_headers).value!
174
+ end
175
+
176
+ #
177
+ # Gets an integration account certificate.
178
+ #
179
+ # @param resource_group_name [String] The resource group name.
180
+ # @param integration_account_name [String] The integration account name.
181
+ # @param certificate_name [String] The integration account certificate name.
182
+ # @param [Hash{String => String}] A hash of custom headers that will be added
183
+ # to the HTTP request.
184
+ #
185
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
186
+ #
187
+ def get_async(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
189
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
190
+ fail ArgumentError, 'integration_account_name is nil' if integration_account_name.nil?
191
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
192
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
193
+
194
+
195
+ request_headers = {}
196
+
197
+ # Set Headers
198
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
199
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
200
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'
201
+ options = {
202
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
203
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'integrationAccountName' => integration_account_name,'certificateName' => certificate_name},
204
+ query_params: {'api-version' => @client.api_version},
205
+ headers: request_headers.merge(custom_headers || {})
206
+ }
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
211
+ promise = request.run_promise do |req|
212
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
213
+ end
214
+
215
+ promise = promise.then do |http_response|
216
+ status_code = http_response.status
217
+ response_content = http_response.body
218
+ unless status_code == 200
219
+ error_model = JSON.load(response_content)
220
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
221
+ end
222
+
223
+ # Create Result
224
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
225
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
226
+ # Deserialize Response
227
+ if status_code == 200
228
+ begin
229
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
230
+ result_mapper = IntegrationAccountCertificate.mapper()
231
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
232
+ rescue Exception => e
233
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
234
+ end
235
+ end
236
+
237
+ result
238
+ end
239
+
240
+ promise.execute
241
+ end
242
+
243
+ #
244
+ # Creates or updates an integration account certificate.
245
+ #
246
+ # @param resource_group_name [String] The resource group name.
247
+ # @param integration_account_name [String] The integration account name.
248
+ # @param certificate_name [String] The integration account certificate name.
249
+ # @param certificate [IntegrationAccountCertificate] The integration account
250
+ # certificate.
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [IntegrationAccountCertificate] operation results.
255
+ #
256
+ def create_or_update(resource_group_name, integration_account_name, certificate_name, certificate, custom_headers = nil)
257
+ response = create_or_update_async(resource_group_name, integration_account_name, certificate_name, certificate, custom_headers).value!
258
+ response.body unless response.nil?
259
+ end
260
+
261
+ #
262
+ # Creates or updates an integration account certificate.
263
+ #
264
+ # @param resource_group_name [String] The resource group name.
265
+ # @param integration_account_name [String] The integration account name.
266
+ # @param certificate_name [String] The integration account certificate name.
267
+ # @param certificate [IntegrationAccountCertificate] The integration account
268
+ # certificate.
269
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
270
+ # will be added to the HTTP request.
271
+ #
272
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
273
+ #
274
+ def create_or_update_with_http_info(resource_group_name, integration_account_name, certificate_name, certificate, custom_headers = nil)
275
+ create_or_update_async(resource_group_name, integration_account_name, certificate_name, certificate, custom_headers).value!
276
+ end
277
+
278
+ #
279
+ # Creates or updates an integration account certificate.
280
+ #
281
+ # @param resource_group_name [String] The resource group name.
282
+ # @param integration_account_name [String] The integration account name.
283
+ # @param certificate_name [String] The integration account certificate name.
284
+ # @param certificate [IntegrationAccountCertificate] The integration account
285
+ # certificate.
286
+ # @param [Hash{String => String}] A hash of custom headers that will be added
287
+ # to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
290
+ #
291
+ def create_or_update_async(resource_group_name, integration_account_name, certificate_name, certificate, custom_headers = nil)
292
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
293
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
294
+ fail ArgumentError, 'integration_account_name is nil' if integration_account_name.nil?
295
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
296
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
297
+ fail ArgumentError, 'certificate is nil' if certificate.nil?
298
+
299
+
300
+ request_headers = {}
301
+
302
+ # Set Headers
303
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
304
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
305
+
306
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
307
+
308
+ # Serialize Request
309
+ request_mapper = IntegrationAccountCertificate.mapper()
310
+ request_content = @client.serialize(request_mapper, certificate, 'certificate')
311
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
312
+
313
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'
314
+ options = {
315
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
316
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'integrationAccountName' => integration_account_name,'certificateName' => certificate_name},
317
+ query_params: {'api-version' => @client.api_version},
318
+ body: request_content,
319
+ headers: request_headers.merge(custom_headers || {})
320
+ }
321
+
322
+ request_url = @base_url || @client.base_url
323
+
324
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
325
+ promise = request.run_promise do |req|
326
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
327
+ end
328
+
329
+ promise = promise.then do |http_response|
330
+ status_code = http_response.status
331
+ response_content = http_response.body
332
+ unless status_code == 200 || status_code == 201
333
+ error_model = JSON.load(response_content)
334
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
335
+ end
336
+
337
+ # Create Result
338
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
339
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
340
+ # Deserialize Response
341
+ if status_code == 200
342
+ begin
343
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
344
+ result_mapper = IntegrationAccountCertificate.mapper()
345
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
346
+ rescue Exception => e
347
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
348
+ end
349
+ end
350
+ # Deserialize Response
351
+ if status_code == 201
352
+ begin
353
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
354
+ result_mapper = IntegrationAccountCertificate.mapper()
355
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
356
+ rescue Exception => e
357
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
358
+ end
359
+ end
360
+
361
+ result
362
+ end
363
+
364
+ promise.execute
365
+ end
366
+
367
+ #
368
+ # Deletes an integration account certificate.
369
+ #
370
+ # @param resource_group_name [String] The resource group name.
371
+ # @param integration_account_name [String] The integration account name.
372
+ # @param certificate_name [String] The integration account certificate name.
373
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
374
+ # will be added to the HTTP request.
375
+ #
376
+ #
377
+ def delete(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
378
+ response = delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers).value!
379
+ nil
380
+ end
381
+
382
+ #
383
+ # Deletes an integration account certificate.
384
+ #
385
+ # @param resource_group_name [String] The resource group name.
386
+ # @param integration_account_name [String] The integration account name.
387
+ # @param certificate_name [String] The integration account certificate name.
388
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
389
+ # will be added to the HTTP request.
390
+ #
391
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
392
+ #
393
+ def delete_with_http_info(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
394
+ delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers).value!
395
+ end
396
+
397
+ #
398
+ # Deletes an integration account certificate.
399
+ #
400
+ # @param resource_group_name [String] The resource group name.
401
+ # @param integration_account_name [String] The integration account name.
402
+ # @param certificate_name [String] The integration account certificate name.
403
+ # @param [Hash{String => String}] A hash of custom headers that will be added
404
+ # to the HTTP request.
405
+ #
406
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
407
+ #
408
+ def delete_async(resource_group_name, integration_account_name, certificate_name, custom_headers = nil)
409
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
410
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
411
+ fail ArgumentError, 'integration_account_name is nil' if integration_account_name.nil?
412
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
413
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
414
+
415
+
416
+ request_headers = {}
417
+
418
+ # Set Headers
419
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
420
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
421
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'
422
+ options = {
423
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
424
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'integrationAccountName' => integration_account_name,'certificateName' => certificate_name},
425
+ query_params: {'api-version' => @client.api_version},
426
+ headers: request_headers.merge(custom_headers || {})
427
+ }
428
+
429
+ request_url = @base_url || @client.base_url
430
+
431
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
432
+ promise = request.run_promise do |req|
433
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
434
+ end
435
+
436
+ promise = promise.then do |http_response|
437
+ status_code = http_response.status
438
+ response_content = http_response.body
439
+ unless status_code == 200 || status_code == 204
440
+ error_model = JSON.load(response_content)
441
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
442
+ end
443
+
444
+ # Create Result
445
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
446
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
447
+
448
+ result
449
+ end
450
+
451
+ promise.execute
452
+ end
453
+
454
+ #
455
+ # Gets a list of integration account certificates.
456
+ #
457
+ # @param next_page_link [String] The NextLink from the previous successful
458
+ # call to List operation.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [IntegrationAccountCertificateListResult] operation results.
463
+ #
464
+ def list_next(next_page_link, custom_headers = nil)
465
+ response = list_next_async(next_page_link, custom_headers).value!
466
+ response.body unless response.nil?
467
+ end
468
+
469
+ #
470
+ # Gets a list of integration account certificates.
471
+ #
472
+ # @param next_page_link [String] The NextLink from the previous successful
473
+ # call to List operation.
474
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
475
+ # will be added to the HTTP request.
476
+ #
477
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
478
+ #
479
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
480
+ list_next_async(next_page_link, custom_headers).value!
481
+ end
482
+
483
+ #
484
+ # Gets a list of integration account certificates.
485
+ #
486
+ # @param next_page_link [String] The NextLink from the previous successful
487
+ # call to List operation.
488
+ # @param [Hash{String => String}] A hash of custom headers that will be added
489
+ # to the HTTP request.
490
+ #
491
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
492
+ #
493
+ def list_next_async(next_page_link, custom_headers = nil)
494
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
495
+
496
+
497
+ request_headers = {}
498
+
499
+ # Set Headers
500
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
501
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
502
+ path_template = '{nextLink}'
503
+ options = {
504
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
505
+ skip_encoding_path_params: {'nextLink' => next_page_link},
506
+ headers: request_headers.merge(custom_headers || {})
507
+ }
508
+
509
+ request_url = @base_url || @client.base_url
510
+
511
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
512
+ promise = request.run_promise do |req|
513
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
514
+ end
515
+
516
+ promise = promise.then do |http_response|
517
+ status_code = http_response.status
518
+ response_content = http_response.body
519
+ unless status_code == 200
520
+ error_model = JSON.load(response_content)
521
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
522
+ end
523
+
524
+ # Create Result
525
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
526
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
527
+ # Deserialize Response
528
+ if status_code == 200
529
+ begin
530
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
531
+ result_mapper = IntegrationAccountCertificateListResult.mapper()
532
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
533
+ rescue Exception => e
534
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
535
+ end
536
+ end
537
+
538
+ result
539
+ end
540
+
541
+ promise.execute
542
+ end
543
+
544
+ end
545
+ end