azure_mgmt_customer_insights 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_customer_insights.rb +6 -0
  4. data/lib/generated/azure_mgmt_customer_insights.rb +144 -0
  5. data/lib/generated/azure_mgmt_customer_insights/authorization_policies.rb +634 -0
  6. data/lib/generated/azure_mgmt_customer_insights/connector_mappings.rb +548 -0
  7. data/lib/generated/azure_mgmt_customer_insights/connectors.rb +606 -0
  8. data/lib/generated/azure_mgmt_customer_insights/customer_insights_management_client.rb +191 -0
  9. data/lib/generated/azure_mgmt_customer_insights/hubs.rb +841 -0
  10. data/lib/generated/azure_mgmt_customer_insights/images.rb +242 -0
  11. data/lib/generated/azure_mgmt_customer_insights/interactions.rb +591 -0
  12. data/lib/generated/azure_mgmt_customer_insights/kpi.rb +689 -0
  13. data/lib/generated/azure_mgmt_customer_insights/links.rb +565 -0
  14. data/lib/generated/azure_mgmt_customer_insights/models/assignment_principal.rb +71 -0
  15. data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy.rb +87 -0
  16. data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy_list_result.rb +95 -0
  17. data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy_resource_format.rb +111 -0
  18. data/lib/generated/azure_mgmt_customer_insights/models/azure_blob_connector_properties.rb +44 -0
  19. data/lib/generated/azure_mgmt_customer_insights/models/calculation_window_types.rb +19 -0
  20. data/lib/generated/azure_mgmt_customer_insights/models/canonical_profile_definition.rb +63 -0
  21. data/lib/generated/azure_mgmt_customer_insights/models/canonical_profile_definition_properties_item.rb +86 -0
  22. data/lib/generated/azure_mgmt_customer_insights/models/canonical_property_value_type.rb +18 -0
  23. data/lib/generated/azure_mgmt_customer_insights/models/cardinality_types.rb +17 -0
  24. data/lib/generated/azure_mgmt_customer_insights/models/completion_operation_types.rb +17 -0
  25. data/lib/generated/azure_mgmt_customer_insights/models/connector_list_result.rb +94 -0
  26. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_availability.rb +56 -0
  27. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_complete_operation.rb +57 -0
  28. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_error_management.rb +57 -0
  29. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_format.rb +97 -0
  30. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_list_result.rb +95 -0
  31. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_properties.rb +131 -0
  32. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_resource_format.rb +226 -0
  33. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_states.rb +21 -0
  34. data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_structure.rb +74 -0
  35. data/lib/generated/azure_mgmt_customer_insights/models/connector_resource_format.rb +183 -0
  36. data/lib/generated/azure_mgmt_customer_insights/models/connector_states.rb +20 -0
  37. data/lib/generated/azure_mgmt_customer_insights/models/connector_types.rb +20 -0
  38. data/lib/generated/azure_mgmt_customer_insights/models/crm_connector_entities.rb +64 -0
  39. data/lib/generated/azure_mgmt_customer_insights/models/crm_connector_properties.rb +93 -0
  40. data/lib/generated/azure_mgmt_customer_insights/models/data_source_precedence.rb +102 -0
  41. data/lib/generated/azure_mgmt_customer_insights/models/data_source_type.rb +17 -0
  42. data/lib/generated/azure_mgmt_customer_insights/models/enriching_kpi.rb +229 -0
  43. data/lib/generated/azure_mgmt_customer_insights/models/entity_type.rb +18 -0
  44. data/lib/generated/azure_mgmt_customer_insights/models/entity_type_definition.rb +243 -0
  45. data/lib/generated/azure_mgmt_customer_insights/models/entity_types.rb +18 -0
  46. data/lib/generated/azure_mgmt_customer_insights/models/error_management_types.rb +17 -0
  47. data/lib/generated/azure_mgmt_customer_insights/models/frequency_types.rb +19 -0
  48. data/lib/generated/azure_mgmt_customer_insights/models/get_image_upload_url_input.rb +64 -0
  49. data/lib/generated/azure_mgmt_customer_insights/models/hub.rb +135 -0
  50. data/lib/generated/azure_mgmt_customer_insights/models/hub_billing_info_format.rb +74 -0
  51. data/lib/generated/azure_mgmt_customer_insights/models/hub_list_result.rb +94 -0
  52. data/lib/generated/azure_mgmt_customer_insights/models/image_definition.rb +64 -0
  53. data/lib/generated/azure_mgmt_customer_insights/models/instance_operation_type.rb +16 -0
  54. data/lib/generated/azure_mgmt_customer_insights/models/interaction_list_result.rb +95 -0
  55. data/lib/generated/azure_mgmt_customer_insights/models/interaction_resource_format.rb +434 -0
  56. data/lib/generated/azure_mgmt_customer_insights/models/kpi_alias.rb +54 -0
  57. data/lib/generated/azure_mgmt_customer_insights/models/kpi_definition.rb +293 -0
  58. data/lib/generated/azure_mgmt_customer_insights/models/kpi_extract.rb +54 -0
  59. data/lib/generated/azure_mgmt_customer_insights/models/kpi_functions.rb +22 -0
  60. data/lib/generated/azure_mgmt_customer_insights/models/kpi_group_by_metadata.rb +71 -0
  61. data/lib/generated/azure_mgmt_customer_insights/models/kpi_list_result.rb +94 -0
  62. data/lib/generated/azure_mgmt_customer_insights/models/kpi_participant_profiles_metadata.rb +44 -0
  63. data/lib/generated/azure_mgmt_customer_insights/models/kpi_resource_format.rb +317 -0
  64. data/lib/generated/azure_mgmt_customer_insights/models/kpi_thresholds.rb +64 -0
  65. data/lib/generated/azure_mgmt_customer_insights/models/link_list_result.rb +94 -0
  66. data/lib/generated/azure_mgmt_customer_insights/models/link_resource_format.rb +235 -0
  67. data/lib/generated/azure_mgmt_customer_insights/models/link_types.rb +16 -0
  68. data/lib/generated/azure_mgmt_customer_insights/models/metadata_definition_base.rb +152 -0
  69. data/lib/generated/azure_mgmt_customer_insights/models/participant.rb +117 -0
  70. data/lib/generated/azure_mgmt_customer_insights/models/participant_profile_property_reference.rb +56 -0
  71. data/lib/generated/azure_mgmt_customer_insights/models/participant_property_reference.rb +54 -0
  72. data/lib/generated/azure_mgmt_customer_insights/models/permission_types.rb +17 -0
  73. data/lib/generated/azure_mgmt_customer_insights/models/prediction_distribution_definition.rb +73 -0
  74. data/lib/generated/azure_mgmt_customer_insights/models/prediction_distribution_definition_distributions_item.rb +85 -0
  75. data/lib/generated/azure_mgmt_customer_insights/models/prediction_grades_item.rb +64 -0
  76. data/lib/generated/azure_mgmt_customer_insights/models/prediction_list_result.rb +95 -0
  77. data/lib/generated/azure_mgmt_customer_insights/models/prediction_mappings.rb +64 -0
  78. data/lib/generated/azure_mgmt_customer_insights/models/prediction_model_life_cycle.rb +32 -0
  79. data/lib/generated/azure_mgmt_customer_insights/models/prediction_model_status.rb +161 -0
  80. data/lib/generated/azure_mgmt_customer_insights/models/prediction_resource_format.rb +279 -0
  81. data/lib/generated/azure_mgmt_customer_insights/models/prediction_system_generated_entities.rb +85 -0
  82. data/lib/generated/azure_mgmt_customer_insights/models/prediction_training_results.rb +98 -0
  83. data/lib/generated/azure_mgmt_customer_insights/models/profile_enum_valid_values_format.rb +61 -0
  84. data/lib/generated/azure_mgmt_customer_insights/models/profile_list_result.rb +94 -0
  85. data/lib/generated/azure_mgmt_customer_insights/models/profile_resource_format.rb +312 -0
  86. data/lib/generated/azure_mgmt_customer_insights/models/property_definition.rb +218 -0
  87. data/lib/generated/azure_mgmt_customer_insights/models/provisioning_states.rb +20 -0
  88. data/lib/generated/azure_mgmt_customer_insights/models/proxy_resource.rb +67 -0
  89. data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_field_mapping.rb +66 -0
  90. data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_list_result.rb +95 -0
  91. data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_resource_format.rb +218 -0
  92. data/lib/generated/azure_mgmt_customer_insights/models/relationship_list_result.rb +95 -0
  93. data/lib/generated/azure_mgmt_customer_insights/models/relationship_resource_format.rb +219 -0
  94. data/lib/generated/azure_mgmt_customer_insights/models/relationship_type_field_mapping.rb +55 -0
  95. data/lib/generated/azure_mgmt_customer_insights/models/relationship_type_mapping.rb +55 -0
  96. data/lib/generated/azure_mgmt_customer_insights/models/relationships_lookup.rb +107 -0
  97. data/lib/generated/azure_mgmt_customer_insights/models/resource.rb +94 -0
  98. data/lib/generated/azure_mgmt_customer_insights/models/resource_set_description.rb +69 -0
  99. data/lib/generated/azure_mgmt_customer_insights/models/role_assignment_list_result.rb +95 -0
  100. data/lib/generated/azure_mgmt_customer_insights/models/role_assignment_resource_format.rb +306 -0
  101. data/lib/generated/azure_mgmt_customer_insights/models/role_list_result.rb +94 -0
  102. data/lib/generated/azure_mgmt_customer_insights/models/role_resource_format.rb +78 -0
  103. data/lib/generated/azure_mgmt_customer_insights/models/role_types.rb +20 -0
  104. data/lib/generated/azure_mgmt_customer_insights/models/salesforce_connector_properties.rb +63 -0
  105. data/lib/generated/azure_mgmt_customer_insights/models/salesforce_discover_setting.rb +44 -0
  106. data/lib/generated/azure_mgmt_customer_insights/models/salesforce_table.rb +84 -0
  107. data/lib/generated/azure_mgmt_customer_insights/models/status.rb +17 -0
  108. data/lib/generated/azure_mgmt_customer_insights/models/strong_id.rb +95 -0
  109. data/lib/generated/azure_mgmt_customer_insights/models/suggest_relationship_links_response.rb +65 -0
  110. data/lib/generated/azure_mgmt_customer_insights/models/type_properties_mapping.rb +66 -0
  111. data/lib/generated/azure_mgmt_customer_insights/models/view_list_result.rb +94 -0
  112. data/lib/generated/azure_mgmt_customer_insights/models/view_resource_format.rb +139 -0
  113. data/lib/generated/azure_mgmt_customer_insights/models/widget_type_list_result.rb +95 -0
  114. data/lib/generated/azure_mgmt_customer_insights/models/widget_type_resource_format.rb +160 -0
  115. data/lib/generated/azure_mgmt_customer_insights/module_definition.rb +8 -0
  116. data/lib/generated/azure_mgmt_customer_insights/predictions.rb +896 -0
  117. data/lib/generated/azure_mgmt_customer_insights/profiles.rb +733 -0
  118. data/lib/generated/azure_mgmt_customer_insights/relationship_links.rb +610 -0
  119. data/lib/generated/azure_mgmt_customer_insights/relationships.rb +606 -0
  120. data/lib/generated/azure_mgmt_customer_insights/role_assignments.rb +566 -0
  121. data/lib/generated/azure_mgmt_customer_insights/roles.rb +227 -0
  122. data/lib/generated/azure_mgmt_customer_insights/version.rb +8 -0
  123. data/lib/generated/azure_mgmt_customer_insights/views.rb +530 -0
  124. data/lib/generated/azure_mgmt_customer_insights/widget_types.rb +323 -0
  125. metadata +236 -0
@@ -0,0 +1,733 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CustomerInsights
7
+ #
8
+ # The Azure Customer Insights management API provides a RESTful set of web
9
+ # services that interact with Azure Customer Insights service to manage your
10
+ # resources. The API has entities that capture the relationship between an
11
+ # end user and the Azure Customer Insights service.
12
+ #
13
+ class Profiles
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Profiles class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [CustomerInsightsManagementClient] reference to the CustomerInsightsManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Creates a profile within a Hub, or updates an existing profile.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group.
31
+ # @param hub_name [String] The name of the hub.
32
+ # @param profile_name [String] The name of the profile.
33
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
34
+ # create/delete Profile type operation
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [ProfileResourceFormat] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, hub_name, profile_name, parameters, custom_headers = nil)
41
+ response = create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param hub_name [String] The name of the hub.
48
+ # @param profile_name [String] The name of the profile.
49
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
50
+ # create/delete Profile type operation
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [Concurrent::Promise] promise which provides async access to http
55
+ # response.
56
+ #
57
+ def create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers = nil)
58
+ # Send request
59
+ promise = begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers)
60
+
61
+ promise = promise.then do |response|
62
+ # Defining deserialization method.
63
+ deserialize_method = lambda do |parsed_response|
64
+ result_mapper = Azure::ARM::CustomerInsights::Models::ProfileResourceFormat.mapper()
65
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
66
+ end
67
+
68
+ # Waiting for response.
69
+ @client.get_long_running_operation_result(response, deserialize_method)
70
+ end
71
+
72
+ promise
73
+ end
74
+
75
+ #
76
+ # Gets information about the specified profile.
77
+ #
78
+ # @param resource_group_name [String] The name of the resource group.
79
+ # @param hub_name [String] The name of the hub.
80
+ # @param profile_name [String] The name of the profile.
81
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
82
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
83
+ # will be added to the HTTP request.
84
+ #
85
+ # @return [ProfileResourceFormat] operation results.
86
+ #
87
+ def get(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
88
+ response = get_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers).value!
89
+ response.body unless response.nil?
90
+ end
91
+
92
+ #
93
+ # Gets information about the specified profile.
94
+ #
95
+ # @param resource_group_name [String] The name of the resource group.
96
+ # @param hub_name [String] The name of the hub.
97
+ # @param profile_name [String] The name of the profile.
98
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
99
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
100
+ # will be added to the HTTP request.
101
+ #
102
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
103
+ #
104
+ def get_with_http_info(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
105
+ get_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers).value!
106
+ end
107
+
108
+ #
109
+ # Gets information about the specified profile.
110
+ #
111
+ # @param resource_group_name [String] The name of the resource group.
112
+ # @param hub_name [String] The name of the hub.
113
+ # @param profile_name [String] The name of the profile.
114
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
115
+ # @param [Hash{String => String}] A hash of custom headers that will be added
116
+ # to the HTTP request.
117
+ #
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def get_async(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
121
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
122
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
123
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
124
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
125
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
126
+
127
+
128
+ request_headers = {}
129
+
130
+ # Set Headers
131
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
132
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
133
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
134
+
135
+ request_url = @base_url || @client.base_url
136
+
137
+ options = {
138
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
139
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
140
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
141
+ headers: request_headers.merge(custom_headers || {}),
142
+ base_url: request_url
143
+ }
144
+ promise = @client.make_request_async(:get, path_template, options)
145
+
146
+ promise = promise.then do |result|
147
+ http_response = result.response
148
+ status_code = http_response.status
149
+ response_content = http_response.body
150
+ unless status_code == 200
151
+ error_model = JSON.load(response_content)
152
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
153
+ end
154
+
155
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
156
+ # Deserialize Response
157
+ if status_code == 200
158
+ begin
159
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
160
+ result_mapper = Azure::ARM::CustomerInsights::Models::ProfileResourceFormat.mapper()
161
+ result.body = @client.deserialize(result_mapper, parsed_response)
162
+ rescue Exception => e
163
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
164
+ end
165
+ end
166
+
167
+ result
168
+ end
169
+
170
+ promise.execute
171
+ end
172
+
173
+ #
174
+ # Deletes a profile within a hub
175
+ #
176
+ # @param resource_group_name [String] The name of the resource group.
177
+ # @param hub_name [String] The name of the hub.
178
+ # @param profile_name [String] The name of the profile.
179
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
181
+ # will be added to the HTTP request.
182
+ #
183
+ def delete(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
184
+ response = delete_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers).value!
185
+ nil
186
+ end
187
+
188
+ #
189
+ # @param resource_group_name [String] The name of the resource group.
190
+ # @param hub_name [String] The name of the hub.
191
+ # @param profile_name [String] The name of the profile.
192
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [Concurrent::Promise] promise which provides async access to http
197
+ # response.
198
+ #
199
+ def delete_async(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
200
+ # Send request
201
+ promise = begin_delete_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers)
202
+
203
+ promise = promise.then do |response|
204
+ # Defining deserialization method.
205
+ deserialize_method = lambda do |parsed_response|
206
+ end
207
+
208
+ # Waiting for response.
209
+ @client.get_long_running_operation_result(response, deserialize_method)
210
+ end
211
+
212
+ promise
213
+ end
214
+
215
+ #
216
+ # Gets all profile in the hub.
217
+ #
218
+ # @param resource_group_name [String] The name of the resource group.
219
+ # @param hub_name [String] The name of the hub.
220
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
221
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
222
+ # will be added to the HTTP request.
223
+ #
224
+ # @return [Array<ProfileResourceFormat>] operation results.
225
+ #
226
+ def list_by_hub(resource_group_name, hub_name, locale_code = 'en-us', custom_headers = nil)
227
+ first_page = list_by_hub_as_lazy(resource_group_name, hub_name, locale_code, custom_headers)
228
+ first_page.get_all_items
229
+ end
230
+
231
+ #
232
+ # Gets all profile in the hub.
233
+ #
234
+ # @param resource_group_name [String] The name of the resource group.
235
+ # @param hub_name [String] The name of the hub.
236
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
237
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
238
+ # will be added to the HTTP request.
239
+ #
240
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
241
+ #
242
+ def list_by_hub_with_http_info(resource_group_name, hub_name, locale_code = 'en-us', custom_headers = nil)
243
+ list_by_hub_async(resource_group_name, hub_name, locale_code, custom_headers).value!
244
+ end
245
+
246
+ #
247
+ # Gets all profile in the hub.
248
+ #
249
+ # @param resource_group_name [String] The name of the resource group.
250
+ # @param hub_name [String] The name of the hub.
251
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
252
+ # @param [Hash{String => String}] A hash of custom headers that will be added
253
+ # to the HTTP request.
254
+ #
255
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
256
+ #
257
+ def list_by_hub_async(resource_group_name, hub_name, locale_code = 'en-us', custom_headers = nil)
258
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
259
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
260
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
261
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
262
+
263
+
264
+ request_headers = {}
265
+
266
+ # Set Headers
267
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
268
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
269
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles'
270
+
271
+ request_url = @base_url || @client.base_url
272
+
273
+ options = {
274
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
275
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
276
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
277
+ headers: request_headers.merge(custom_headers || {}),
278
+ base_url: request_url
279
+ }
280
+ promise = @client.make_request_async(:get, path_template, options)
281
+
282
+ promise = promise.then do |result|
283
+ http_response = result.response
284
+ status_code = http_response.status
285
+ response_content = http_response.body
286
+ unless status_code == 200
287
+ error_model = JSON.load(response_content)
288
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
289
+ end
290
+
291
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
292
+ # Deserialize Response
293
+ if status_code == 200
294
+ begin
295
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
296
+ result_mapper = Azure::ARM::CustomerInsights::Models::ProfileListResult.mapper()
297
+ result.body = @client.deserialize(result_mapper, parsed_response)
298
+ rescue Exception => e
299
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
300
+ end
301
+ end
302
+
303
+ result
304
+ end
305
+
306
+ promise.execute
307
+ end
308
+
309
+ #
310
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
311
+ # Enrichment happens through participants of the Interaction on an Interaction
312
+ # KPI and through Relationships for Profile KPIs.
313
+ #
314
+ # @param resource_group_name [String] The name of the resource group.
315
+ # @param hub_name [String] The name of the hub.
316
+ # @param profile_name [String] The name of the profile.
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [Array] operation results.
321
+ #
322
+ def get_enriching_kpis(resource_group_name, hub_name, profile_name, custom_headers = nil)
323
+ response = get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers).value!
324
+ response.body unless response.nil?
325
+ end
326
+
327
+ #
328
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
329
+ # Enrichment happens through participants of the Interaction on an Interaction
330
+ # KPI and through Relationships for Profile KPIs.
331
+ #
332
+ # @param resource_group_name [String] The name of the resource group.
333
+ # @param hub_name [String] The name of the hub.
334
+ # @param profile_name [String] The name of the profile.
335
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
336
+ # will be added to the HTTP request.
337
+ #
338
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
339
+ #
340
+ def get_enriching_kpis_with_http_info(resource_group_name, hub_name, profile_name, custom_headers = nil)
341
+ get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers).value!
342
+ end
343
+
344
+ #
345
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
346
+ # Enrichment happens through participants of the Interaction on an Interaction
347
+ # KPI and through Relationships for Profile KPIs.
348
+ #
349
+ # @param resource_group_name [String] The name of the resource group.
350
+ # @param hub_name [String] The name of the hub.
351
+ # @param profile_name [String] The name of the profile.
352
+ # @param [Hash{String => String}] A hash of custom headers that will be added
353
+ # to the HTTP request.
354
+ #
355
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
356
+ #
357
+ def get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers = nil)
358
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
359
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
360
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
361
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
362
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
363
+
364
+
365
+ request_headers = {}
366
+
367
+ # Set Headers
368
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
369
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
370
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}/getEnrichingKpis'
371
+
372
+ request_url = @base_url || @client.base_url
373
+
374
+ options = {
375
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
376
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
377
+ query_params: {'api-version' => @client.api_version},
378
+ headers: request_headers.merge(custom_headers || {}),
379
+ base_url: request_url
380
+ }
381
+ promise = @client.make_request_async(:post, path_template, options)
382
+
383
+ promise = promise.then do |result|
384
+ http_response = result.response
385
+ status_code = http_response.status
386
+ response_content = http_response.body
387
+ unless status_code == 200
388
+ error_model = JSON.load(response_content)
389
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
390
+ end
391
+
392
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
393
+ # Deserialize Response
394
+ if status_code == 200
395
+ begin
396
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
397
+ result_mapper = {
398
+ required: false,
399
+ serialized_name: 'parsed_response',
400
+ type: {
401
+ name: 'Sequence',
402
+ element: {
403
+ required: false,
404
+ serialized_name: 'KpiDefinitionElementType',
405
+ type: {
406
+ name: 'Composite',
407
+ class_name: 'KpiDefinition'
408
+ }
409
+ }
410
+ }
411
+ }
412
+ result.body = @client.deserialize(result_mapper, parsed_response)
413
+ rescue Exception => e
414
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
415
+ end
416
+ end
417
+
418
+ result
419
+ end
420
+
421
+ promise.execute
422
+ end
423
+
424
+ #
425
+ # Creates a profile within a Hub, or updates an existing profile.
426
+ #
427
+ # @param resource_group_name [String] The name of the resource group.
428
+ # @param hub_name [String] The name of the hub.
429
+ # @param profile_name [String] The name of the profile.
430
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
431
+ # create/delete Profile type operation
432
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
433
+ # will be added to the HTTP request.
434
+ #
435
+ # @return [ProfileResourceFormat] operation results.
436
+ #
437
+ def begin_create_or_update(resource_group_name, hub_name, profile_name, parameters, custom_headers = nil)
438
+ response = begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers).value!
439
+ response.body unless response.nil?
440
+ end
441
+
442
+ #
443
+ # Creates a profile within a Hub, or updates an existing profile.
444
+ #
445
+ # @param resource_group_name [String] The name of the resource group.
446
+ # @param hub_name [String] The name of the hub.
447
+ # @param profile_name [String] The name of the profile.
448
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
449
+ # create/delete Profile type operation
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
+ #
455
+ def begin_create_or_update_with_http_info(resource_group_name, hub_name, profile_name, parameters, custom_headers = nil)
456
+ begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers).value!
457
+ end
458
+
459
+ #
460
+ # Creates a profile within a Hub, or updates an existing profile.
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group.
463
+ # @param hub_name [String] The name of the hub.
464
+ # @param profile_name [String] The name of the profile.
465
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
466
+ # create/delete Profile type operation
467
+ # @param [Hash{String => String}] A hash of custom headers that will be added
468
+ # to the HTTP request.
469
+ #
470
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
471
+ #
472
+ def begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers = nil)
473
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
474
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
475
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
476
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
477
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
478
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
479
+
480
+
481
+ request_headers = {}
482
+
483
+ # Set Headers
484
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
485
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
486
+
487
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
488
+
489
+ # Serialize Request
490
+ request_mapper = Azure::ARM::CustomerInsights::Models::ProfileResourceFormat.mapper()
491
+ request_content = @client.serialize(request_mapper, parameters)
492
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
493
+
494
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
495
+
496
+ request_url = @base_url || @client.base_url
497
+
498
+ options = {
499
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
500
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
501
+ query_params: {'api-version' => @client.api_version},
502
+ body: request_content,
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:put, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200 || status_code == 202
513
+ error_model = JSON.load(response_content)
514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ # Deserialize Response
519
+ if status_code == 200
520
+ begin
521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
+ result_mapper = Azure::ARM::CustomerInsights::Models::ProfileResourceFormat.mapper()
523
+ result.body = @client.deserialize(result_mapper, parsed_response)
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ #
536
+ # Deletes a profile within a hub
537
+ #
538
+ # @param resource_group_name [String] The name of the resource group.
539
+ # @param hub_name [String] The name of the hub.
540
+ # @param profile_name [String] The name of the profile.
541
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
542
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
543
+ # will be added to the HTTP request.
544
+ #
545
+ #
546
+ def begin_delete(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
547
+ response = begin_delete_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers).value!
548
+ nil
549
+ end
550
+
551
+ #
552
+ # Deletes a profile within a hub
553
+ #
554
+ # @param resource_group_name [String] The name of the resource group.
555
+ # @param hub_name [String] The name of the hub.
556
+ # @param profile_name [String] The name of the profile.
557
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
558
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
559
+ # will be added to the HTTP request.
560
+ #
561
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
562
+ #
563
+ def begin_delete_with_http_info(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
564
+ begin_delete_async(resource_group_name, hub_name, profile_name, locale_code, custom_headers).value!
565
+ end
566
+
567
+ #
568
+ # Deletes a profile within a hub
569
+ #
570
+ # @param resource_group_name [String] The name of the resource group.
571
+ # @param hub_name [String] The name of the hub.
572
+ # @param profile_name [String] The name of the profile.
573
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
574
+ # @param [Hash{String => String}] A hash of custom headers that will be added
575
+ # to the HTTP request.
576
+ #
577
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
578
+ #
579
+ def begin_delete_async(resource_group_name, hub_name, profile_name, locale_code = 'en-us', custom_headers = nil)
580
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
581
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
582
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
583
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
584
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
585
+
586
+
587
+ request_headers = {}
588
+
589
+ # Set Headers
590
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
591
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
592
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
593
+
594
+ request_url = @base_url || @client.base_url
595
+
596
+ options = {
597
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
598
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
599
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
600
+ headers: request_headers.merge(custom_headers || {}),
601
+ base_url: request_url
602
+ }
603
+ promise = @client.make_request_async(:delete, path_template, options)
604
+
605
+ promise = promise.then do |result|
606
+ http_response = result.response
607
+ status_code = http_response.status
608
+ response_content = http_response.body
609
+ unless status_code == 200 || status_code == 202 || status_code == 204
610
+ error_model = JSON.load(response_content)
611
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
612
+ end
613
+
614
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
615
+
616
+ result
617
+ end
618
+
619
+ promise.execute
620
+ end
621
+
622
+ #
623
+ # Gets all profile in the hub.
624
+ #
625
+ # @param next_page_link [String] The NextLink from the previous successful call
626
+ # to List operation.
627
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
628
+ # will be added to the HTTP request.
629
+ #
630
+ # @return [ProfileListResult] operation results.
631
+ #
632
+ def list_by_hub_next(next_page_link, custom_headers = nil)
633
+ response = list_by_hub_next_async(next_page_link, custom_headers).value!
634
+ response.body unless response.nil?
635
+ end
636
+
637
+ #
638
+ # Gets all profile in the hub.
639
+ #
640
+ # @param next_page_link [String] The NextLink from the previous successful call
641
+ # to List operation.
642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
643
+ # will be added to the HTTP request.
644
+ #
645
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
646
+ #
647
+ def list_by_hub_next_with_http_info(next_page_link, custom_headers = nil)
648
+ list_by_hub_next_async(next_page_link, custom_headers).value!
649
+ end
650
+
651
+ #
652
+ # Gets all profile in the hub.
653
+ #
654
+ # @param next_page_link [String] The NextLink from the previous successful call
655
+ # to List operation.
656
+ # @param [Hash{String => String}] A hash of custom headers that will be added
657
+ # to the HTTP request.
658
+ #
659
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
660
+ #
661
+ def list_by_hub_next_async(next_page_link, custom_headers = nil)
662
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
663
+
664
+
665
+ request_headers = {}
666
+
667
+ # Set Headers
668
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
669
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
670
+ path_template = '{nextLink}'
671
+
672
+ request_url = @base_url || @client.base_url
673
+
674
+ options = {
675
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
676
+ skip_encoding_path_params: {'nextLink' => next_page_link},
677
+ headers: request_headers.merge(custom_headers || {}),
678
+ base_url: request_url
679
+ }
680
+ promise = @client.make_request_async(:get, path_template, options)
681
+
682
+ promise = promise.then do |result|
683
+ http_response = result.response
684
+ status_code = http_response.status
685
+ response_content = http_response.body
686
+ unless status_code == 200
687
+ error_model = JSON.load(response_content)
688
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
689
+ end
690
+
691
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
692
+ # Deserialize Response
693
+ if status_code == 200
694
+ begin
695
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
696
+ result_mapper = Azure::ARM::CustomerInsights::Models::ProfileListResult.mapper()
697
+ result.body = @client.deserialize(result_mapper, parsed_response)
698
+ rescue Exception => e
699
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
700
+ end
701
+ end
702
+
703
+ result
704
+ end
705
+
706
+ promise.execute
707
+ end
708
+
709
+ #
710
+ # Gets all profile in the hub.
711
+ #
712
+ # @param resource_group_name [String] The name of the resource group.
713
+ # @param hub_name [String] The name of the hub.
714
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
715
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
716
+ # will be added to the HTTP request.
717
+ #
718
+ # @return [ProfileListResult] which provide lazy access to pages of the
719
+ # response.
720
+ #
721
+ def list_by_hub_as_lazy(resource_group_name, hub_name, locale_code = 'en-us', custom_headers = nil)
722
+ response = list_by_hub_async(resource_group_name, hub_name, locale_code, custom_headers).value!
723
+ unless response.nil?
724
+ page = response.body
725
+ page.next_method = Proc.new do |next_page_link|
726
+ list_by_hub_next_async(next_page_link, custom_headers)
727
+ end
728
+ page
729
+ end
730
+ end
731
+
732
+ end
733
+ end