azure_mgmt_healthcare_apis 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis.rb +69 -0
  4. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/healthcare_apis_management_client.rb +147 -0
  5. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/azure_entity_resource.rb +77 -0
  6. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/check_name_availability_parameters.rb +58 -0
  7. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/error_details.rb +47 -0
  8. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/error_details_internal.rb +71 -0
  9. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/kind.rb +17 -0
  10. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/managed_service_identity_type.rb +16 -0
  11. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/operation.rb +73 -0
  12. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/operation_display.rb +83 -0
  13. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/operation_list_result.rb +102 -0
  14. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/operation_result_status.rb +19 -0
  15. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/operation_results_description.rb +97 -0
  16. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_endpoint.rb +47 -0
  17. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_endpoint_connection.rb +101 -0
  18. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_endpoint_connection_list_result.rb +57 -0
  19. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_endpoint_connection_provisioning_state.rb +18 -0
  20. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_endpoint_service_connection_status.rb +17 -0
  21. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_link_resource.rb +115 -0
  22. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_link_resource_list_result.rb +55 -0
  23. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/private_link_service_connection_state.rb +72 -0
  24. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/provisioning_state.rb +23 -0
  25. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/proxy_resource.rb +65 -0
  26. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/public_network_access.rb +16 -0
  27. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/resource.rb +86 -0
  28. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_access_policy_entry.rb +50 -0
  29. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_authentication_configuration_info.rb +68 -0
  30. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_cors_configuration_info.rb +118 -0
  31. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_cosmos_db_configuration_info.rb +62 -0
  32. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_export_configuration_info.rb +46 -0
  33. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/service_name_unavailability_reason.rb +16 -0
  34. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_description.rb +127 -0
  35. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_description_list_result.rb +100 -0
  36. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_name_availability_info.rb +73 -0
  37. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_patch_description.rb +67 -0
  38. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_properties.rb +156 -0
  39. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_resource.rb +142 -0
  40. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/services_resource_identity.rb +73 -0
  41. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/models/tracked_resource.rb +95 -0
  42. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/module_definition.rb +9 -0
  43. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/operation_results.rb +129 -0
  44. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/operations.rb +219 -0
  45. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/private_endpoint_connections.rb +557 -0
  46. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/private_link_resources.rb +233 -0
  47. data/lib/2020-03-30/generated/azure_mgmt_healthcare_apis/services.rb +1103 -0
  48. data/lib/azure_mgmt_healthcare_apis.rb +6 -0
  49. data/lib/module_definition.rb +7 -0
  50. data/lib/profiles/latest/healthcareapis_latest_profile_client.rb +40 -0
  51. data/lib/profiles/latest/healthcareapis_module_definition.rb +8 -0
  52. data/lib/profiles/latest/modules/healthcareapis_profile_module.rb +217 -0
  53. data/lib/version.rb +7 -0
  54. metadata +169 -0
@@ -0,0 +1,233 @@
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::HealthcareApis::Mgmt::V2020_03_30
7
+ #
8
+ # Azure Healthcare APIs Client
9
+ #
10
+ class PrivateLinkResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResources class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HealthcareApisManagementClient] reference to the HealthcareApisManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the private link resources that need to be created for a service.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group that
28
+ # contains the service instance.
29
+ # @param resource_name [String] The name of the service instance.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [PrivateLinkResourceListResult] operation results.
34
+ #
35
+ def list_by_service(resource_group_name, resource_name, custom_headers:nil)
36
+ response = list_by_service_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Gets the private link resources that need to be created for a service.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group that
44
+ # contains the service instance.
45
+ # @param resource_name [String] The name of the service instance.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_by_service_with_http_info(resource_group_name, resource_name, custom_headers:nil)
52
+ list_by_service_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets the private link resources that need to be created for a service.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group that
59
+ # contains the service instance.
60
+ # @param resource_name [String] The name of the service instance.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_by_service_async(resource_group_name, resource_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
72
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
73
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
74
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
75
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
+
77
+
78
+ request_headers = {}
79
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
91
+ query_params: {'api-version' => @client.api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
108
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::PrivateLinkResourceListResult.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Gets a private link resource that need to be created for a service.
128
+ #
129
+ # @param resource_group_name [String] The name of the resource group that
130
+ # contains the service instance.
131
+ # @param resource_name [String] The name of the service instance.
132
+ # @param group_name [String] The name of the private link resource group.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [PrivateLinkResource] operation results.
137
+ #
138
+ def get(resource_group_name, resource_name, group_name, custom_headers:nil)
139
+ response = get_async(resource_group_name, resource_name, group_name, custom_headers:custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Gets a private link resource that need to be created for a service.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group that
147
+ # contains the service instance.
148
+ # @param resource_name [String] The name of the service instance.
149
+ # @param group_name [String] The name of the private link resource group.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(resource_group_name, resource_name, group_name, custom_headers:nil)
156
+ get_async(resource_group_name, resource_name, group_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Gets a private link resource that need to be created for a service.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group that
163
+ # contains the service instance.
164
+ # @param resource_name [String] The name of the service instance.
165
+ # @param group_name [String] The name of the private link resource group.
166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
167
+ # to the HTTP request.
168
+ #
169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
170
+ #
171
+ def get_async(resource_group_name, resource_name, group_name, custom_headers:nil)
172
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
173
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
174
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
175
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
176
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
177
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
178
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
179
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
180
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
181
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
182
+
183
+
184
+ request_headers = {}
185
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
186
+
187
+ # Set Headers
188
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
189
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
190
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}'
191
+
192
+ request_url = @base_url || @client.base_url
193
+
194
+ options = {
195
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
196
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'groupName' => group_name},
197
+ query_params: {'api-version' => @client.api_version},
198
+ headers: request_headers.merge(custom_headers || {}),
199
+ base_url: request_url
200
+ }
201
+ promise = @client.make_request_async(:get, path_template, options)
202
+
203
+ promise = promise.then do |result|
204
+ http_response = result.response
205
+ status_code = http_response.status
206
+ response_content = http_response.body
207
+ unless status_code == 200
208
+ error_model = JSON.load(response_content)
209
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
210
+ end
211
+
212
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
213
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
214
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
215
+ # Deserialize Response
216
+ if status_code == 200
217
+ begin
218
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
219
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::PrivateLinkResource.mapper()
220
+ result.body = @client.deserialize(result_mapper, parsed_response)
221
+ rescue Exception => e
222
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
223
+ end
224
+ end
225
+
226
+ result
227
+ end
228
+
229
+ promise.execute
230
+ end
231
+
232
+ end
233
+ end
@@ -0,0 +1,1103 @@
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::HealthcareApis::Mgmt::V2020_03_30
7
+ #
8
+ # Azure Healthcare APIs Client
9
+ #
10
+ class Services
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Services class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HealthcareApisManagementClient] reference to the HealthcareApisManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get the metadata of a service instance.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group that
28
+ # contains the service instance.
29
+ # @param resource_name [String] The name of the service instance.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [ServicesDescription] operation results.
34
+ #
35
+ def get(resource_group_name, resource_name, custom_headers:nil)
36
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Get the metadata of a service instance.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group that
44
+ # contains the service instance.
45
+ # @param resource_name [String] The name of the service instance.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
52
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Get the metadata of a service instance.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group that
59
+ # contains the service instance.
60
+ # @param resource_name [String] The name of the service instance.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
73
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
74
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
75
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
76
+
77
+
78
+ request_headers = {}
79
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
91
+ query_params: {'api-version' => @client.api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
108
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Create or update the metadata of a service instance.
128
+ #
129
+ # @param resource_group_name [String] The name of the resource group that
130
+ # contains the service instance.
131
+ # @param resource_name [String] The name of the service instance.
132
+ # @param service_description [ServicesDescription] The service instance
133
+ # metadata.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [ServicesDescription] operation results.
138
+ #
139
+ def create_or_update(resource_group_name, resource_name, service_description, custom_headers:nil)
140
+ response = create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:custom_headers).value!
141
+ response.body unless response.nil?
142
+ end
143
+
144
+ #
145
+ # @param resource_group_name [String] The name of the resource group that
146
+ # contains the service instance.
147
+ # @param resource_name [String] The name of the service instance.
148
+ # @param service_description [ServicesDescription] The service instance
149
+ # metadata.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [Concurrent::Promise] promise which provides async access to http
154
+ # response.
155
+ #
156
+ def create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:nil)
157
+ # Send request
158
+ promise = begin_create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:custom_headers)
159
+
160
+ promise = promise.then do |response|
161
+ # Defining deserialization method.
162
+ deserialize_method = lambda do |parsed_response|
163
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
164
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
165
+ end
166
+
167
+ # Waiting for response.
168
+ @client.get_long_running_operation_result(response, deserialize_method)
169
+ end
170
+
171
+ promise
172
+ end
173
+
174
+ #
175
+ # Update the metadata of a service instance.
176
+ #
177
+ # @param resource_group_name [String] The name of the resource group that
178
+ # contains the service instance.
179
+ # @param resource_name [String] The name of the service instance.
180
+ # @param service_patch_description [ServicesPatchDescription] The service
181
+ # instance metadata and security metadata.
182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
183
+ # will be added to the HTTP request.
184
+ #
185
+ # @return [ServicesDescription] operation results.
186
+ #
187
+ def update(resource_group_name, resource_name, service_patch_description, custom_headers:nil)
188
+ response = update_async(resource_group_name, resource_name, service_patch_description, custom_headers:custom_headers).value!
189
+ response.body unless response.nil?
190
+ end
191
+
192
+ #
193
+ # @param resource_group_name [String] The name of the resource group that
194
+ # contains the service instance.
195
+ # @param resource_name [String] The name of the service instance.
196
+ # @param service_patch_description [ServicesPatchDescription] The service
197
+ # instance metadata and security metadata.
198
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
199
+ # will be added to the HTTP request.
200
+ #
201
+ # @return [Concurrent::Promise] promise which provides async access to http
202
+ # response.
203
+ #
204
+ def update_async(resource_group_name, resource_name, service_patch_description, custom_headers:nil)
205
+ # Send request
206
+ promise = begin_update_async(resource_group_name, resource_name, service_patch_description, custom_headers:custom_headers)
207
+
208
+ promise = promise.then do |response|
209
+ # Defining deserialization method.
210
+ deserialize_method = lambda do |parsed_response|
211
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
212
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
213
+ end
214
+
215
+ # Waiting for response.
216
+ @client.get_long_running_operation_result(response, deserialize_method)
217
+ end
218
+
219
+ promise
220
+ end
221
+
222
+ #
223
+ # Delete a service instance.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group that
226
+ # contains the service instance.
227
+ # @param resource_name [String] The name of the service instance.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ def delete(resource_group_name, resource_name, custom_headers:nil)
232
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
233
+ nil
234
+ end
235
+
236
+ #
237
+ # @param resource_group_name [String] The name of the resource group that
238
+ # contains the service instance.
239
+ # @param resource_name [String] The name of the service instance.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [Concurrent::Promise] promise which provides async access to http
244
+ # response.
245
+ #
246
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
247
+ # Send request
248
+ promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
249
+
250
+ promise = promise.then do |response|
251
+ # Defining deserialization method.
252
+ deserialize_method = lambda do |parsed_response|
253
+ end
254
+
255
+ # Waiting for response.
256
+ @client.get_long_running_operation_result(response, deserialize_method)
257
+ end
258
+
259
+ promise
260
+ end
261
+
262
+ #
263
+ # Get all the service instances in a subscription.
264
+ #
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [Array<ServicesDescription>] operation results.
269
+ #
270
+ def list(custom_headers:nil)
271
+ first_page = list_as_lazy(custom_headers:custom_headers)
272
+ first_page.get_all_items
273
+ end
274
+
275
+ #
276
+ # Get all the service instances in a subscription.
277
+ #
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
282
+ #
283
+ def list_with_http_info(custom_headers:nil)
284
+ list_async(custom_headers:custom_headers).value!
285
+ end
286
+
287
+ #
288
+ # Get all the service instances in a subscription.
289
+ #
290
+ # @param [Hash{String => String}] A hash of custom headers that will be added
291
+ # to the HTTP request.
292
+ #
293
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
294
+ #
295
+ def list_async(custom_headers:nil)
296
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
297
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
298
+
299
+
300
+ request_headers = {}
301
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
302
+
303
+ # Set Headers
304
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
305
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
306
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services'
307
+
308
+ request_url = @base_url || @client.base_url
309
+
310
+ options = {
311
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
312
+ path_params: {'subscriptionId' => @client.subscription_id},
313
+ query_params: {'api-version' => @client.api_version},
314
+ headers: request_headers.merge(custom_headers || {}),
315
+ base_url: request_url
316
+ }
317
+ promise = @client.make_request_async(:get, path_template, options)
318
+
319
+ promise = promise.then do |result|
320
+ http_response = result.response
321
+ status_code = http_response.status
322
+ response_content = http_response.body
323
+ unless status_code == 200
324
+ error_model = JSON.load(response_content)
325
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
326
+ end
327
+
328
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
329
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
330
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
331
+ # Deserialize Response
332
+ if status_code == 200
333
+ begin
334
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
335
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescriptionListResult.mapper()
336
+ result.body = @client.deserialize(result_mapper, parsed_response)
337
+ rescue Exception => e
338
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
339
+ end
340
+ end
341
+
342
+ result
343
+ end
344
+
345
+ promise.execute
346
+ end
347
+
348
+ #
349
+ # Get all the service instances in a resource group.
350
+ #
351
+ # @param resource_group_name [String] The name of the resource group that
352
+ # contains the service instance.
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [Array<ServicesDescription>] operation results.
357
+ #
358
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
359
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
360
+ first_page.get_all_items
361
+ end
362
+
363
+ #
364
+ # Get all the service instances in a resource group.
365
+ #
366
+ # @param resource_group_name [String] The name of the resource group that
367
+ # contains the service instance.
368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
369
+ # will be added to the HTTP request.
370
+ #
371
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
372
+ #
373
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
374
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
375
+ end
376
+
377
+ #
378
+ # Get all the service instances in a resource group.
379
+ #
380
+ # @param resource_group_name [String] The name of the resource group that
381
+ # contains the service instance.
382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
383
+ # to the HTTP request.
384
+ #
385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
+ #
387
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
388
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
389
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
390
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
391
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
392
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
393
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
394
+
395
+
396
+ request_headers = {}
397
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
398
+
399
+ # Set Headers
400
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
401
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services'
403
+
404
+ request_url = @base_url || @client.base_url
405
+
406
+ options = {
407
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
408
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
409
+ query_params: {'api-version' => @client.api_version},
410
+ headers: request_headers.merge(custom_headers || {}),
411
+ base_url: request_url
412
+ }
413
+ promise = @client.make_request_async(:get, path_template, options)
414
+
415
+ promise = promise.then do |result|
416
+ http_response = result.response
417
+ status_code = http_response.status
418
+ response_content = http_response.body
419
+ unless status_code == 200
420
+ error_model = JSON.load(response_content)
421
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
422
+ end
423
+
424
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
425
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
426
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
427
+ # Deserialize Response
428
+ if status_code == 200
429
+ begin
430
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
431
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescriptionListResult.mapper()
432
+ result.body = @client.deserialize(result_mapper, parsed_response)
433
+ rescue Exception => e
434
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
435
+ end
436
+ end
437
+
438
+ result
439
+ end
440
+
441
+ promise.execute
442
+ end
443
+
444
+ #
445
+ # Check if a service instance name is available.
446
+ #
447
+ # @param check_name_availability_inputs [CheckNameAvailabilityParameters] Set
448
+ # the name parameter in the CheckNameAvailabilityParameters structure to the
449
+ # name of the service instance to check.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [ServicesNameAvailabilityInfo] operation results.
454
+ #
455
+ def check_name_availability(check_name_availability_inputs, custom_headers:nil)
456
+ response = check_name_availability_async(check_name_availability_inputs, custom_headers:custom_headers).value!
457
+ response.body unless response.nil?
458
+ end
459
+
460
+ #
461
+ # Check if a service instance name is available.
462
+ #
463
+ # @param check_name_availability_inputs [CheckNameAvailabilityParameters] Set
464
+ # the name parameter in the CheckNameAvailabilityParameters structure to the
465
+ # name of the service instance to check.
466
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
467
+ # will be added to the HTTP request.
468
+ #
469
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
470
+ #
471
+ def check_name_availability_with_http_info(check_name_availability_inputs, custom_headers:nil)
472
+ check_name_availability_async(check_name_availability_inputs, custom_headers:custom_headers).value!
473
+ end
474
+
475
+ #
476
+ # Check if a service instance name is available.
477
+ #
478
+ # @param check_name_availability_inputs [CheckNameAvailabilityParameters] Set
479
+ # the name parameter in the CheckNameAvailabilityParameters structure to the
480
+ # name of the service instance to check.
481
+ # @param [Hash{String => String}] A hash of custom headers that will be added
482
+ # to the HTTP request.
483
+ #
484
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
485
+ #
486
+ def check_name_availability_async(check_name_availability_inputs, custom_headers:nil)
487
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
488
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
489
+ fail ArgumentError, 'check_name_availability_inputs is nil' if check_name_availability_inputs.nil?
490
+
491
+
492
+ request_headers = {}
493
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
494
+
495
+ # Set Headers
496
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
497
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
498
+
499
+ # Serialize Request
500
+ request_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::CheckNameAvailabilityParameters.mapper()
501
+ request_content = @client.serialize(request_mapper, check_name_availability_inputs)
502
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
503
+
504
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability'
505
+
506
+ request_url = @base_url || @client.base_url
507
+
508
+ options = {
509
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
510
+ path_params: {'subscriptionId' => @client.subscription_id},
511
+ query_params: {'api-version' => @client.api_version},
512
+ body: request_content,
513
+ headers: request_headers.merge(custom_headers || {}),
514
+ base_url: request_url
515
+ }
516
+ promise = @client.make_request_async(:post, path_template, options)
517
+
518
+ promise = promise.then do |result|
519
+ http_response = result.response
520
+ status_code = http_response.status
521
+ response_content = http_response.body
522
+ unless status_code == 200
523
+ error_model = JSON.load(response_content)
524
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
525
+ end
526
+
527
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
528
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
529
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
530
+ # Deserialize Response
531
+ if status_code == 200
532
+ begin
533
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
534
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesNameAvailabilityInfo.mapper()
535
+ result.body = @client.deserialize(result_mapper, parsed_response)
536
+ rescue Exception => e
537
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
538
+ end
539
+ end
540
+
541
+ result
542
+ end
543
+
544
+ promise.execute
545
+ end
546
+
547
+ #
548
+ # Create or update the metadata of a service instance.
549
+ #
550
+ # @param resource_group_name [String] The name of the resource group that
551
+ # contains the service instance.
552
+ # @param resource_name [String] The name of the service instance.
553
+ # @param service_description [ServicesDescription] The service instance
554
+ # metadata.
555
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
556
+ # will be added to the HTTP request.
557
+ #
558
+ # @return [ServicesDescription] operation results.
559
+ #
560
+ def begin_create_or_update(resource_group_name, resource_name, service_description, custom_headers:nil)
561
+ response = begin_create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:custom_headers).value!
562
+ response.body unless response.nil?
563
+ end
564
+
565
+ #
566
+ # Create or update the metadata of a service instance.
567
+ #
568
+ # @param resource_group_name [String] The name of the resource group that
569
+ # contains the service instance.
570
+ # @param resource_name [String] The name of the service instance.
571
+ # @param service_description [ServicesDescription] The service instance
572
+ # metadata.
573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
+ # will be added to the HTTP request.
575
+ #
576
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
577
+ #
578
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, service_description, custom_headers:nil)
579
+ begin_create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:custom_headers).value!
580
+ end
581
+
582
+ #
583
+ # Create or update the metadata of a service instance.
584
+ #
585
+ # @param resource_group_name [String] The name of the resource group that
586
+ # contains the service instance.
587
+ # @param resource_name [String] The name of the service instance.
588
+ # @param service_description [ServicesDescription] The service instance
589
+ # metadata.
590
+ # @param [Hash{String => String}] A hash of custom headers that will be added
591
+ # to the HTTP request.
592
+ #
593
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
594
+ #
595
+ def begin_create_or_update_async(resource_group_name, resource_name, service_description, custom_headers:nil)
596
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
597
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
598
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
599
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
600
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
601
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
602
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
603
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
604
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
605
+ fail ArgumentError, 'service_description is nil' if service_description.nil?
606
+
607
+
608
+ request_headers = {}
609
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
610
+
611
+ # Set Headers
612
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
613
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
614
+
615
+ # Serialize Request
616
+ request_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
617
+ request_content = @client.serialize(request_mapper, service_description)
618
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
619
+
620
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'
621
+
622
+ request_url = @base_url || @client.base_url
623
+
624
+ options = {
625
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
626
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
627
+ query_params: {'api-version' => @client.api_version},
628
+ body: request_content,
629
+ headers: request_headers.merge(custom_headers || {}),
630
+ base_url: request_url
631
+ }
632
+ promise = @client.make_request_async(:put, path_template, options)
633
+
634
+ promise = promise.then do |result|
635
+ http_response = result.response
636
+ status_code = http_response.status
637
+ response_content = http_response.body
638
+ unless status_code == 200 || status_code == 201
639
+ error_model = JSON.load(response_content)
640
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
641
+ end
642
+
643
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
644
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
645
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
646
+ # Deserialize Response
647
+ if status_code == 200
648
+ begin
649
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
650
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
651
+ result.body = @client.deserialize(result_mapper, parsed_response)
652
+ rescue Exception => e
653
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
654
+ end
655
+ end
656
+ # Deserialize Response
657
+ if status_code == 201
658
+ begin
659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
660
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
661
+ result.body = @client.deserialize(result_mapper, parsed_response)
662
+ rescue Exception => e
663
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
664
+ end
665
+ end
666
+
667
+ result
668
+ end
669
+
670
+ promise.execute
671
+ end
672
+
673
+ #
674
+ # Update the metadata of a service instance.
675
+ #
676
+ # @param resource_group_name [String] The name of the resource group that
677
+ # contains the service instance.
678
+ # @param resource_name [String] The name of the service instance.
679
+ # @param service_patch_description [ServicesPatchDescription] The service
680
+ # instance metadata and security metadata.
681
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
682
+ # will be added to the HTTP request.
683
+ #
684
+ # @return [ServicesDescription] operation results.
685
+ #
686
+ def begin_update(resource_group_name, resource_name, service_patch_description, custom_headers:nil)
687
+ response = begin_update_async(resource_group_name, resource_name, service_patch_description, custom_headers:custom_headers).value!
688
+ response.body unless response.nil?
689
+ end
690
+
691
+ #
692
+ # Update the metadata of a service instance.
693
+ #
694
+ # @param resource_group_name [String] The name of the resource group that
695
+ # contains the service instance.
696
+ # @param resource_name [String] The name of the service instance.
697
+ # @param service_patch_description [ServicesPatchDescription] The service
698
+ # instance metadata and security metadata.
699
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
700
+ # will be added to the HTTP request.
701
+ #
702
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
703
+ #
704
+ def begin_update_with_http_info(resource_group_name, resource_name, service_patch_description, custom_headers:nil)
705
+ begin_update_async(resource_group_name, resource_name, service_patch_description, custom_headers:custom_headers).value!
706
+ end
707
+
708
+ #
709
+ # Update the metadata of a service instance.
710
+ #
711
+ # @param resource_group_name [String] The name of the resource group that
712
+ # contains the service instance.
713
+ # @param resource_name [String] The name of the service instance.
714
+ # @param service_patch_description [ServicesPatchDescription] The service
715
+ # instance metadata and security metadata.
716
+ # @param [Hash{String => String}] A hash of custom headers that will be added
717
+ # to the HTTP request.
718
+ #
719
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
720
+ #
721
+ def begin_update_async(resource_group_name, resource_name, service_patch_description, custom_headers:nil)
722
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
723
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
724
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
725
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
726
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
727
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
728
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
729
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
730
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
731
+ fail ArgumentError, 'service_patch_description is nil' if service_patch_description.nil?
732
+
733
+
734
+ request_headers = {}
735
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
736
+
737
+ # Set Headers
738
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
739
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
740
+
741
+ # Serialize Request
742
+ request_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesPatchDescription.mapper()
743
+ request_content = @client.serialize(request_mapper, service_patch_description)
744
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
745
+
746
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'
747
+
748
+ request_url = @base_url || @client.base_url
749
+
750
+ options = {
751
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
752
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
753
+ query_params: {'api-version' => @client.api_version},
754
+ body: request_content,
755
+ headers: request_headers.merge(custom_headers || {}),
756
+ base_url: request_url
757
+ }
758
+ promise = @client.make_request_async(:patch, path_template, options)
759
+
760
+ promise = promise.then do |result|
761
+ http_response = result.response
762
+ status_code = http_response.status
763
+ response_content = http_response.body
764
+ unless status_code == 200
765
+ error_model = JSON.load(response_content)
766
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
767
+ end
768
+
769
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
770
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
771
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
772
+ # Deserialize Response
773
+ if status_code == 200
774
+ begin
775
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
776
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescription.mapper()
777
+ result.body = @client.deserialize(result_mapper, parsed_response)
778
+ rescue Exception => e
779
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
780
+ end
781
+ end
782
+
783
+ result
784
+ end
785
+
786
+ promise.execute
787
+ end
788
+
789
+ #
790
+ # Delete a service instance.
791
+ #
792
+ # @param resource_group_name [String] The name of the resource group that
793
+ # contains the service instance.
794
+ # @param resource_name [String] The name of the service instance.
795
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
796
+ # will be added to the HTTP request.
797
+ #
798
+ #
799
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
800
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
801
+ nil
802
+ end
803
+
804
+ #
805
+ # Delete a service instance.
806
+ #
807
+ # @param resource_group_name [String] The name of the resource group that
808
+ # contains the service instance.
809
+ # @param resource_name [String] The name of the service instance.
810
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
811
+ # will be added to the HTTP request.
812
+ #
813
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
814
+ #
815
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
816
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
817
+ end
818
+
819
+ #
820
+ # Delete a service instance.
821
+ #
822
+ # @param resource_group_name [String] The name of the resource group that
823
+ # contains the service instance.
824
+ # @param resource_name [String] The name of the service instance.
825
+ # @param [Hash{String => String}] A hash of custom headers that will be added
826
+ # to the HTTP request.
827
+ #
828
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
829
+ #
830
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
831
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
832
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
833
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
834
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
835
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
836
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
837
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
838
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '24'" if !resource_name.nil? && resource_name.length > 24
839
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
840
+
841
+
842
+ request_headers = {}
843
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
844
+
845
+ # Set Headers
846
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
847
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
848
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}'
849
+
850
+ request_url = @base_url || @client.base_url
851
+
852
+ options = {
853
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
854
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
855
+ query_params: {'api-version' => @client.api_version},
856
+ headers: request_headers.merge(custom_headers || {}),
857
+ base_url: request_url
858
+ }
859
+ promise = @client.make_request_async(:delete, path_template, options)
860
+
861
+ promise = promise.then do |result|
862
+ http_response = result.response
863
+ status_code = http_response.status
864
+ response_content = http_response.body
865
+ unless status_code == 202 || status_code == 204
866
+ error_model = JSON.load(response_content)
867
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
868
+ end
869
+
870
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
871
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
872
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
873
+
874
+ result
875
+ end
876
+
877
+ promise.execute
878
+ end
879
+
880
+ #
881
+ # Get all the service instances in a subscription.
882
+ #
883
+ # @param next_page_link [String] The NextLink from the previous successful call
884
+ # to List operation.
885
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
886
+ # will be added to the HTTP request.
887
+ #
888
+ # @return [ServicesDescriptionListResult] operation results.
889
+ #
890
+ def list_next(next_page_link, custom_headers:nil)
891
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
892
+ response.body unless response.nil?
893
+ end
894
+
895
+ #
896
+ # Get all the service instances in a subscription.
897
+ #
898
+ # @param next_page_link [String] The NextLink from the previous successful call
899
+ # to List operation.
900
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
901
+ # will be added to the HTTP request.
902
+ #
903
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
904
+ #
905
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
906
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
907
+ end
908
+
909
+ #
910
+ # Get all the service instances in a subscription.
911
+ #
912
+ # @param next_page_link [String] The NextLink from the previous successful call
913
+ # to List operation.
914
+ # @param [Hash{String => String}] A hash of custom headers that will be added
915
+ # to the HTTP request.
916
+ #
917
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
918
+ #
919
+ def list_next_async(next_page_link, custom_headers:nil)
920
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
921
+
922
+
923
+ request_headers = {}
924
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
925
+
926
+ # Set Headers
927
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
928
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
929
+ path_template = '{nextLink}'
930
+
931
+ request_url = @base_url || @client.base_url
932
+
933
+ options = {
934
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
935
+ skip_encoding_path_params: {'nextLink' => next_page_link},
936
+ headers: request_headers.merge(custom_headers || {}),
937
+ base_url: request_url
938
+ }
939
+ promise = @client.make_request_async(:get, path_template, options)
940
+
941
+ promise = promise.then do |result|
942
+ http_response = result.response
943
+ status_code = http_response.status
944
+ response_content = http_response.body
945
+ unless status_code == 200
946
+ error_model = JSON.load(response_content)
947
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
948
+ end
949
+
950
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
951
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
952
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
953
+ # Deserialize Response
954
+ if status_code == 200
955
+ begin
956
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
957
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescriptionListResult.mapper()
958
+ result.body = @client.deserialize(result_mapper, parsed_response)
959
+ rescue Exception => e
960
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
961
+ end
962
+ end
963
+
964
+ result
965
+ end
966
+
967
+ promise.execute
968
+ end
969
+
970
+ #
971
+ # Get all the service instances in a resource group.
972
+ #
973
+ # @param next_page_link [String] The NextLink from the previous successful call
974
+ # to List operation.
975
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
976
+ # will be added to the HTTP request.
977
+ #
978
+ # @return [ServicesDescriptionListResult] operation results.
979
+ #
980
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
981
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
982
+ response.body unless response.nil?
983
+ end
984
+
985
+ #
986
+ # Get all the service instances in a resource group.
987
+ #
988
+ # @param next_page_link [String] The NextLink from the previous successful call
989
+ # to List operation.
990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
991
+ # will be added to the HTTP request.
992
+ #
993
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
994
+ #
995
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
996
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
997
+ end
998
+
999
+ #
1000
+ # Get all the service instances in a resource group.
1001
+ #
1002
+ # @param next_page_link [String] The NextLink from the previous successful call
1003
+ # to List operation.
1004
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1005
+ # to the HTTP request.
1006
+ #
1007
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1008
+ #
1009
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1010
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1011
+
1012
+
1013
+ request_headers = {}
1014
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1015
+
1016
+ # Set Headers
1017
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1018
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1019
+ path_template = '{nextLink}'
1020
+
1021
+ request_url = @base_url || @client.base_url
1022
+
1023
+ options = {
1024
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1025
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1026
+ headers: request_headers.merge(custom_headers || {}),
1027
+ base_url: request_url
1028
+ }
1029
+ promise = @client.make_request_async(:get, path_template, options)
1030
+
1031
+ promise = promise.then do |result|
1032
+ http_response = result.response
1033
+ status_code = http_response.status
1034
+ response_content = http_response.body
1035
+ unless status_code == 200
1036
+ error_model = JSON.load(response_content)
1037
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1038
+ end
1039
+
1040
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1041
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1042
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1043
+ # Deserialize Response
1044
+ if status_code == 200
1045
+ begin
1046
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1047
+ result_mapper = Azure::HealthcareApis::Mgmt::V2020_03_30::Models::ServicesDescriptionListResult.mapper()
1048
+ result.body = @client.deserialize(result_mapper, parsed_response)
1049
+ rescue Exception => e
1050
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1051
+ end
1052
+ end
1053
+
1054
+ result
1055
+ end
1056
+
1057
+ promise.execute
1058
+ end
1059
+
1060
+ #
1061
+ # Get all the service instances in a subscription.
1062
+ #
1063
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1064
+ # will be added to the HTTP request.
1065
+ #
1066
+ # @return [ServicesDescriptionListResult] which provide lazy access to pages of
1067
+ # the response.
1068
+ #
1069
+ def list_as_lazy(custom_headers:nil)
1070
+ response = list_async(custom_headers:custom_headers).value!
1071
+ unless response.nil?
1072
+ page = response.body
1073
+ page.next_method = Proc.new do |next_page_link|
1074
+ list_next_async(next_page_link, custom_headers:custom_headers)
1075
+ end
1076
+ page
1077
+ end
1078
+ end
1079
+
1080
+ #
1081
+ # Get all the service instances in a resource group.
1082
+ #
1083
+ # @param resource_group_name [String] The name of the resource group that
1084
+ # contains the service instance.
1085
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1086
+ # will be added to the HTTP request.
1087
+ #
1088
+ # @return [ServicesDescriptionListResult] which provide lazy access to pages of
1089
+ # the response.
1090
+ #
1091
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1092
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1093
+ unless response.nil?
1094
+ page = response.body
1095
+ page.next_method = Proc.new do |next_page_link|
1096
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1097
+ end
1098
+ page
1099
+ end
1100
+ end
1101
+
1102
+ end
1103
+ end