azure_mgmt_customer_insights 0.15.2 → 0.16.0

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