azure_mgmt_adhybridhealth_service 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service.rb +143 -0
  4. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/ad_domain_service_members.rb +259 -0
  5. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_service.rb +131 -0
  6. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_service_members_operations.rb +535 -0
  7. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb +2287 -0
  8. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_replication_status.rb +117 -0
  9. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_service_members.rb +356 -0
  10. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_user_preference.rb +293 -0
  11. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adhybrid_health_service.rb +185 -0
  12. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/alerts_operations.rb +240 -0
  13. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/configuration.rb +500 -0
  14. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/dimensions_operations.rb +229 -0
  15. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/additional_information.rb +80 -0
  16. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_configuration.rb +120 -0
  17. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_service_member.rb +499 -0
  18. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_service_members.rb +120 -0
  19. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/agent.rb +113 -0
  20. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert.rb +290 -0
  21. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert_feedback.rb +127 -0
  22. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert_feedbacks.rb +55 -0
  23. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alerts.rb +120 -0
  24. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/algorithm_step_type.rb +27 -0
  25. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/associated_object.rb +167 -0
  26. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_delta.rb +103 -0
  27. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_delta_operation_type.rb +19 -0
  28. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mapping.rb +81 -0
  29. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mapping_type.rb +18 -0
  30. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mpping_source.rb +87 -0
  31. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported.rb +61 -0
  32. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported_delta.rb +100 -0
  33. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported_entry.rb +139 -0
  34. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector.rb +236 -0
  35. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_connection_error.rb +123 -0
  36. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_connection_errors.rb +56 -0
  37. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_metadata.rb +74 -0
  38. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_metadata_details.rb +57 -0
  39. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_object_error.rb +197 -0
  40. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_object_errors.rb +56 -0
  41. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connectors.rb +55 -0
  42. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/credential.rb +76 -0
  43. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/credentials.rb +55 -0
  44. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/data_freshness_details.rb +55 -0
  45. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/delta_operation_type.rb +22 -0
  46. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/dimension.rb +142 -0
  47. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/dimensions.rb +120 -0
  48. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/display.rb +69 -0
  49. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_count.rb +68 -0
  50. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_counts.rb +55 -0
  51. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_detail.rb +93 -0
  52. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_report_users_entries.rb +56 -0
  53. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_report_users_entry.rb +91 -0
  54. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_error.rb +444 -0
  55. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_errors.rb +55 -0
  56. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_status.rb +80 -0
  57. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_statuses.rb +120 -0
  58. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/extension_error_info.rb +68 -0
  59. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/forest_summary.rb +129 -0
  60. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/global_configuration.rb +99 -0
  61. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/global_configurations.rb +56 -0
  62. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/health_status.rb +19 -0
  63. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/help_link.rb +57 -0
  64. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/hotfix.rb +69 -0
  65. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/hotfixes.rb +55 -0
  66. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/import_error.rb +186 -0
  67. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/import_errors.rb +55 -0
  68. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/inbound_replication_neighbor.rb +179 -0
  69. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/inbound_replication_neighbors.rb +57 -0
  70. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/item.rb +57 -0
  71. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/items.rb +55 -0
  72. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/level.rb +17 -0
  73. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/merged_export_error.rb +280 -0
  74. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/merged_export_errors.rb +55 -0
  75. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_group.rb +69 -0
  76. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_metadata.rb +169 -0
  77. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_metadata_list.rb +120 -0
  78. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_set.rb +66 -0
  79. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_sets.rb +75 -0
  80. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metrics.rb +120 -0
  81. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/module_configuration.rb +78 -0
  82. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/module_configurations.rb +56 -0
  83. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/monitoring_level.rb +17 -0
  84. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/object_with_sync_error.rb +211 -0
  85. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/operation.rb +57 -0
  86. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/operation_list_response.rb +125 -0
  87. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/partition.rb +136 -0
  88. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/partition_scope.rb +103 -0
  89. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_hash_sync_configuration.rb +58 -0
  90. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_management_settings.rb +148 -0
  91. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_operation_types.rb +17 -0
  92. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_details_list.rb +89 -0
  93. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_status.rb +70 -0
  94. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_summary.rb +124 -0
  95. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_summary_list.rb +56 -0
  96. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/result.rb +46 -0
  97. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/risky_ipblob_uri.rb +102 -0
  98. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/risky_ipblob_uris.rb +55 -0
  99. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/rule_error_info.rb +91 -0
  100. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_profile.rb +77 -0
  101. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_profiles.rb +55 -0
  102. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_step.rb +113 -0
  103. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_configuration.rb +134 -0
  104. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_member.rb +336 -0
  105. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_members.rb +120 -0
  106. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_properties.rb +331 -0
  107. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/services.rb +120 -0
  108. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/state.rb +19 -0
  109. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tabular_export_error.rb +79 -0
  110. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tenant.rb +292 -0
  111. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tenant_onboarding_details.rb +60 -0
  112. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/user_preference.rb +54 -0
  113. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_delta.rb +58 -0
  114. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_delta_operation_type.rb +18 -0
  115. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_type.rb +20 -0
  116. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/module_definition.rb +9 -0
  117. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/operations.rb +219 -0
  118. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/reports.rb +109 -0
  119. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/service.rb +131 -0
  120. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/service_members_operations.rb +1736 -0
  121. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb +3162 -0
  122. data/lib/azure_mgmt_adhybridhealth_service.rb +6 -0
  123. data/lib/module_definition.rb +7 -0
  124. data/lib/profiles/latest/adhybridhealthservice_latest_profile_client.rb +40 -0
  125. data/lib/profiles/latest/adhybridhealthservice_module_definition.rb +8 -0
  126. data/lib/profiles/latest/modules/adhybridhealthservice_profile_module.rb +493 -0
  127. data/lib/version.rb +7 -0
  128. metadata +243 -0
@@ -0,0 +1,293 @@
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::ADHybridHealthService::Mgmt::V2014_01_01
7
+ #
8
+ # REST APIs for Azure Active Directory Connect Health
9
+ #
10
+ class AddsServicesUserPreference
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AddsServicesUserPreference class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ADHybridHealthService] reference to the ADHybridHealthService
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the user preferences for a given feature.
26
+ #
27
+ # @param service_name [String] The name of the service.
28
+ # @param feature_name [String] The name of the feature.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [UserPreference] operation results.
33
+ #
34
+ def get(service_name, feature_name, custom_headers:nil)
35
+ response = get_async(service_name, feature_name, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Gets the user preferences for a given feature.
41
+ #
42
+ # @param service_name [String] The name of the service.
43
+ # @param feature_name [String] The name of the feature.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def get_with_http_info(service_name, feature_name, custom_headers:nil)
50
+ get_async(service_name, feature_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets the user preferences for a given feature.
55
+ #
56
+ # @param service_name [String] The name of the service.
57
+ # @param feature_name [String] The name of the feature.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def get_async(service_name, feature_name, custom_headers:nil)
64
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
65
+ fail ArgumentError, 'feature_name is nil' if feature_name.nil?
66
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'serviceName' => service_name,'featureName' => feature_name},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
99
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::UserPreference.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Deletes the user preferences for a given feature.
119
+ #
120
+ # @param service_name [String] The name of the service.
121
+ # @param feature_name [String] The name of the feature.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ #
126
+ def delete(service_name, feature_name, custom_headers:nil)
127
+ response = delete_async(service_name, feature_name, custom_headers:custom_headers).value!
128
+ nil
129
+ end
130
+
131
+ #
132
+ # Deletes the user preferences for a given feature.
133
+ #
134
+ # @param service_name [String] The name of the service.
135
+ # @param feature_name [String] The name of the feature.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
140
+ #
141
+ def delete_with_http_info(service_name, feature_name, custom_headers:nil)
142
+ delete_async(service_name, feature_name, custom_headers:custom_headers).value!
143
+ end
144
+
145
+ #
146
+ # Deletes the user preferences for a given feature.
147
+ #
148
+ # @param service_name [String] The name of the service.
149
+ # @param feature_name [String] The name of the feature.
150
+ # @param [Hash{String => String}] A hash of custom headers that will be added
151
+ # to the HTTP request.
152
+ #
153
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
154
+ #
155
+ def delete_async(service_name, feature_name, custom_headers:nil)
156
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
157
+ fail ArgumentError, 'feature_name is nil' if feature_name.nil?
158
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
159
+
160
+
161
+ request_headers = {}
162
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
163
+
164
+ # Set Headers
165
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
166
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
167
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference'
168
+
169
+ request_url = @base_url || @client.base_url
170
+
171
+ options = {
172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
173
+ path_params: {'serviceName' => service_name,'featureName' => feature_name},
174
+ query_params: {'api-version' => @client.api_version},
175
+ headers: request_headers.merge(custom_headers || {}),
176
+ base_url: request_url
177
+ }
178
+ promise = @client.make_request_async(:delete, path_template, options)
179
+
180
+ promise = promise.then do |result|
181
+ http_response = result.response
182
+ status_code = http_response.status
183
+ response_content = http_response.body
184
+ unless status_code == 200
185
+ error_model = JSON.load(response_content)
186
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
187
+ end
188
+
189
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
190
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
191
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
192
+
193
+ result
194
+ end
195
+
196
+ promise.execute
197
+ end
198
+
199
+ #
200
+ # Adds the user preferences for a given feature.
201
+ #
202
+ # @param service_name [String] The name of the service.
203
+ # @param feature_name [String] The name of the feature.
204
+ # @param setting [UserPreference] The user preference setting.
205
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
206
+ # will be added to the HTTP request.
207
+ #
208
+ #
209
+ def add(service_name, feature_name, setting, custom_headers:nil)
210
+ response = add_async(service_name, feature_name, setting, custom_headers:custom_headers).value!
211
+ nil
212
+ end
213
+
214
+ #
215
+ # Adds the user preferences for a given feature.
216
+ #
217
+ # @param service_name [String] The name of the service.
218
+ # @param feature_name [String] The name of the feature.
219
+ # @param setting [UserPreference] The user preference setting.
220
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
221
+ # will be added to the HTTP request.
222
+ #
223
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
224
+ #
225
+ def add_with_http_info(service_name, feature_name, setting, custom_headers:nil)
226
+ add_async(service_name, feature_name, setting, custom_headers:custom_headers).value!
227
+ end
228
+
229
+ #
230
+ # Adds the user preferences for a given feature.
231
+ #
232
+ # @param service_name [String] The name of the service.
233
+ # @param feature_name [String] The name of the feature.
234
+ # @param setting [UserPreference] The user preference setting.
235
+ # @param [Hash{String => String}] A hash of custom headers that will be added
236
+ # to the HTTP request.
237
+ #
238
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
239
+ #
240
+ def add_async(service_name, feature_name, setting, custom_headers:nil)
241
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
242
+ fail ArgumentError, 'feature_name is nil' if feature_name.nil?
243
+ fail ArgumentError, 'setting is nil' if setting.nil?
244
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
245
+
246
+
247
+ request_headers = {}
248
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
249
+
250
+ # Set Headers
251
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
252
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
253
+
254
+ # Serialize Request
255
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::UserPreference.mapper()
256
+ request_content = @client.serialize(request_mapper, setting)
257
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
258
+
259
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference'
260
+
261
+ request_url = @base_url || @client.base_url
262
+
263
+ options = {
264
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
265
+ path_params: {'serviceName' => service_name,'featureName' => feature_name},
266
+ query_params: {'api-version' => @client.api_version},
267
+ body: request_content,
268
+ headers: request_headers.merge(custom_headers || {}),
269
+ base_url: request_url
270
+ }
271
+ promise = @client.make_request_async(:post, path_template, options)
272
+
273
+ promise = promise.then do |result|
274
+ http_response = result.response
275
+ status_code = http_response.status
276
+ response_content = http_response.body
277
+ unless status_code == 200
278
+ error_model = JSON.load(response_content)
279
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
280
+ end
281
+
282
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
283
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
284
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
285
+
286
+ result
287
+ end
288
+
289
+ promise.execute
290
+ end
291
+
292
+ end
293
+ end
@@ -0,0 +1,185 @@
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::ADHybridHealthService::Mgmt::V2014_01_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ADHybridHealthService < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The version of the API to be used with the client
21
+ # request.
22
+ attr_reader :api_version
23
+
24
+ # @return [String] The preferred language for the response.
25
+ attr_accessor :accept_language
26
+
27
+ # @return [Integer] The retry timeout in seconds for Long Running
28
+ # Operations. Default value is 30.
29
+ attr_accessor :long_running_operation_retry_timeout
30
+
31
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
32
+ # generated. When set to true a unique x-ms-client-request-id value is
33
+ # generated and included in each request. Default is true.
34
+ attr_accessor :generate_client_request_id
35
+
36
+ # @return [AddsServices] adds_services
37
+ attr_reader :adds_services
38
+
39
+ # @return [AlertsOperations] alerts_operations
40
+ attr_reader :alerts_operations
41
+
42
+ # @return [Configuration] configuration
43
+ attr_reader :configuration
44
+
45
+ # @return [DimensionsOperations] dimensions_operations
46
+ attr_reader :dimensions_operations
47
+
48
+ # @return [AddsServiceMembersOperations] adds_service_members_operations
49
+ attr_reader :adds_service_members_operations
50
+
51
+ # @return [AdDomainServiceMembers] ad_domain_service_members
52
+ attr_reader :ad_domain_service_members
53
+
54
+ # @return [AddsServicesUserPreference] adds_services_user_preference
55
+ attr_reader :adds_services_user_preference
56
+
57
+ # @return [AddsService] adds_service
58
+ attr_reader :adds_service
59
+
60
+ # @return [AddsServicesReplicationStatus] adds_services_replication_status
61
+ attr_reader :adds_services_replication_status
62
+
63
+ # @return [AddsServicesServiceMembers] adds_services_service_members
64
+ attr_reader :adds_services_service_members
65
+
66
+ # @return [Operations] operations
67
+ attr_reader :operations
68
+
69
+ # @return [Reports] reports
70
+ attr_reader :reports
71
+
72
+ # @return [ServicesOperations] services_operations
73
+ attr_reader :services_operations
74
+
75
+ # @return [Service] service
76
+ attr_reader :service
77
+
78
+ # @return [ServiceMembersOperations] service_members_operations
79
+ attr_reader :service_members_operations
80
+
81
+ #
82
+ # Creates initializes a new instance of the ADHybridHealthService class.
83
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
84
+ # @param base_url [String] the base URI of the service.
85
+ # @param options [Array] filters to be applied to the HTTP requests.
86
+ #
87
+ def initialize(credentials = nil, base_url = nil, options = nil)
88
+ super(credentials, options)
89
+ @base_url = base_url || 'https://management.azure.com'
90
+
91
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
92
+ @credentials = credentials
93
+
94
+ @adds_services = AddsServices.new(self)
95
+ @alerts_operations = AlertsOperations.new(self)
96
+ @configuration = Configuration.new(self)
97
+ @dimensions_operations = DimensionsOperations.new(self)
98
+ @adds_service_members_operations = AddsServiceMembersOperations.new(self)
99
+ @ad_domain_service_members = AdDomainServiceMembers.new(self)
100
+ @adds_services_user_preference = AddsServicesUserPreference.new(self)
101
+ @adds_service = AddsService.new(self)
102
+ @adds_services_replication_status = AddsServicesReplicationStatus.new(self)
103
+ @adds_services_service_members = AddsServicesServiceMembers.new(self)
104
+ @operations = Operations.new(self)
105
+ @reports = Reports.new(self)
106
+ @services_operations = ServicesOperations.new(self)
107
+ @service = Service.new(self)
108
+ @service_members_operations = ServiceMembersOperations.new(self)
109
+ @api_version = '2014-01-01'
110
+ @accept_language = 'en-US'
111
+ @long_running_operation_retry_timeout = 30
112
+ @generate_client_request_id = true
113
+ add_telemetry
114
+ end
115
+
116
+ #
117
+ # Makes a request and returns the body of the response.
118
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
119
+ # @param path [String] the path, relative to {base_url}.
120
+ # @param options [Hash{String=>String}] specifying any request options like :body.
121
+ # @return [Hash{String=>String}] containing the body of the response.
122
+ # Example:
123
+ #
124
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
125
+ # path = "/path"
126
+ # options = {
127
+ # body: request_content,
128
+ # query_params: {'api-version' => '2016-02-01'}
129
+ # }
130
+ # result = @client.make_request(:put, path, options)
131
+ #
132
+ def make_request(method, path, options = {})
133
+ result = make_request_with_http_info(method, path, options)
134
+ result.body unless result.nil?
135
+ end
136
+
137
+ #
138
+ # Makes a request and returns the operation response.
139
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
140
+ # @param path [String] the path, relative to {base_url}.
141
+ # @param options [Hash{String=>String}] specifying any request options like :body.
142
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
143
+ #
144
+ def make_request_with_http_info(method, path, options = {})
145
+ result = make_request_async(method, path, options).value!
146
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
147
+ result
148
+ end
149
+
150
+ #
151
+ # Makes a request asynchronously.
152
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
153
+ # @param path [String] the path, relative to {base_url}.
154
+ # @param options [Hash{String=>String}] specifying any request options like :body.
155
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
156
+ #
157
+ def make_request_async(method, path, options = {})
158
+ fail ArgumentError, 'method is nil' if method.nil?
159
+ fail ArgumentError, 'path is nil' if path.nil?
160
+
161
+ request_url = options[:base_url] || @base_url
162
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
163
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
164
+ end
165
+
166
+ request_headers = @request_headers
167
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
168
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
169
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
170
+
171
+ super(request_url, method, path, options)
172
+ end
173
+
174
+
175
+ private
176
+ #
177
+ # Adds telemetry information.
178
+ #
179
+ def add_telemetry
180
+ sdk_information = 'azure_mgmt_adhybridhealth_service'
181
+ sdk_information = "#{sdk_information}/0.17.0"
182
+ add_user_agent_information(sdk_information)
183
+ end
184
+ end
185
+ end