azure_mgmt_customer_insights 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/azure_mgmt_customer_insights.rb +6 -0
- data/lib/generated/azure_mgmt_customer_insights.rb +144 -0
- data/lib/generated/azure_mgmt_customer_insights/authorization_policies.rb +634 -0
- data/lib/generated/azure_mgmt_customer_insights/connector_mappings.rb +548 -0
- data/lib/generated/azure_mgmt_customer_insights/connectors.rb +606 -0
- data/lib/generated/azure_mgmt_customer_insights/customer_insights_management_client.rb +191 -0
- data/lib/generated/azure_mgmt_customer_insights/hubs.rb +841 -0
- data/lib/generated/azure_mgmt_customer_insights/images.rb +242 -0
- data/lib/generated/azure_mgmt_customer_insights/interactions.rb +591 -0
- data/lib/generated/azure_mgmt_customer_insights/kpi.rb +689 -0
- data/lib/generated/azure_mgmt_customer_insights/links.rb +565 -0
- data/lib/generated/azure_mgmt_customer_insights/models/assignment_principal.rb +71 -0
- data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy.rb +87 -0
- data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/authorization_policy_resource_format.rb +111 -0
- data/lib/generated/azure_mgmt_customer_insights/models/azure_blob_connector_properties.rb +44 -0
- data/lib/generated/azure_mgmt_customer_insights/models/calculation_window_types.rb +19 -0
- data/lib/generated/azure_mgmt_customer_insights/models/canonical_profile_definition.rb +63 -0
- data/lib/generated/azure_mgmt_customer_insights/models/canonical_profile_definition_properties_item.rb +86 -0
- data/lib/generated/azure_mgmt_customer_insights/models/canonical_property_value_type.rb +18 -0
- data/lib/generated/azure_mgmt_customer_insights/models/cardinality_types.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/completion_operation_types.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_availability.rb +56 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_complete_operation.rb +57 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_error_management.rb +57 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_format.rb +97 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_properties.rb +131 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_resource_format.rb +226 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_states.rb +21 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_mapping_structure.rb +74 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_resource_format.rb +183 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_states.rb +20 -0
- data/lib/generated/azure_mgmt_customer_insights/models/connector_types.rb +20 -0
- data/lib/generated/azure_mgmt_customer_insights/models/crm_connector_entities.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/crm_connector_properties.rb +93 -0
- data/lib/generated/azure_mgmt_customer_insights/models/data_source_precedence.rb +102 -0
- data/lib/generated/azure_mgmt_customer_insights/models/data_source_type.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/enriching_kpi.rb +229 -0
- data/lib/generated/azure_mgmt_customer_insights/models/entity_type.rb +18 -0
- data/lib/generated/azure_mgmt_customer_insights/models/entity_type_definition.rb +243 -0
- data/lib/generated/azure_mgmt_customer_insights/models/entity_types.rb +18 -0
- data/lib/generated/azure_mgmt_customer_insights/models/error_management_types.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/frequency_types.rb +19 -0
- data/lib/generated/azure_mgmt_customer_insights/models/get_image_upload_url_input.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/hub.rb +135 -0
- data/lib/generated/azure_mgmt_customer_insights/models/hub_billing_info_format.rb +74 -0
- data/lib/generated/azure_mgmt_customer_insights/models/hub_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/image_definition.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/instance_operation_type.rb +16 -0
- data/lib/generated/azure_mgmt_customer_insights/models/interaction_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/interaction_resource_format.rb +434 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_alias.rb +54 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_definition.rb +293 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_extract.rb +54 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_functions.rb +22 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_group_by_metadata.rb +71 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_participant_profiles_metadata.rb +44 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_resource_format.rb +317 -0
- data/lib/generated/azure_mgmt_customer_insights/models/kpi_thresholds.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/link_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/link_resource_format.rb +235 -0
- data/lib/generated/azure_mgmt_customer_insights/models/link_types.rb +16 -0
- data/lib/generated/azure_mgmt_customer_insights/models/metadata_definition_base.rb +152 -0
- data/lib/generated/azure_mgmt_customer_insights/models/participant.rb +117 -0
- data/lib/generated/azure_mgmt_customer_insights/models/participant_profile_property_reference.rb +56 -0
- data/lib/generated/azure_mgmt_customer_insights/models/participant_property_reference.rb +54 -0
- data/lib/generated/azure_mgmt_customer_insights/models/permission_types.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_distribution_definition.rb +73 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_distribution_definition_distributions_item.rb +85 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_grades_item.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_mappings.rb +64 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_model_life_cycle.rb +32 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_model_status.rb +161 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_resource_format.rb +279 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_system_generated_entities.rb +85 -0
- data/lib/generated/azure_mgmt_customer_insights/models/prediction_training_results.rb +98 -0
- data/lib/generated/azure_mgmt_customer_insights/models/profile_enum_valid_values_format.rb +61 -0
- data/lib/generated/azure_mgmt_customer_insights/models/profile_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/profile_resource_format.rb +312 -0
- data/lib/generated/azure_mgmt_customer_insights/models/property_definition.rb +218 -0
- data/lib/generated/azure_mgmt_customer_insights/models/provisioning_states.rb +20 -0
- data/lib/generated/azure_mgmt_customer_insights/models/proxy_resource.rb +67 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_field_mapping.rb +66 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_link_resource_format.rb +218 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_resource_format.rb +219 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_type_field_mapping.rb +55 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationship_type_mapping.rb +55 -0
- data/lib/generated/azure_mgmt_customer_insights/models/relationships_lookup.rb +107 -0
- data/lib/generated/azure_mgmt_customer_insights/models/resource.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/resource_set_description.rb +69 -0
- data/lib/generated/azure_mgmt_customer_insights/models/role_assignment_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/role_assignment_resource_format.rb +306 -0
- data/lib/generated/azure_mgmt_customer_insights/models/role_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/role_resource_format.rb +78 -0
- data/lib/generated/azure_mgmt_customer_insights/models/role_types.rb +20 -0
- data/lib/generated/azure_mgmt_customer_insights/models/salesforce_connector_properties.rb +63 -0
- data/lib/generated/azure_mgmt_customer_insights/models/salesforce_discover_setting.rb +44 -0
- data/lib/generated/azure_mgmt_customer_insights/models/salesforce_table.rb +84 -0
- data/lib/generated/azure_mgmt_customer_insights/models/status.rb +17 -0
- data/lib/generated/azure_mgmt_customer_insights/models/strong_id.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/suggest_relationship_links_response.rb +65 -0
- data/lib/generated/azure_mgmt_customer_insights/models/type_properties_mapping.rb +66 -0
- data/lib/generated/azure_mgmt_customer_insights/models/view_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_customer_insights/models/view_resource_format.rb +139 -0
- data/lib/generated/azure_mgmt_customer_insights/models/widget_type_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_customer_insights/models/widget_type_resource_format.rb +160 -0
- data/lib/generated/azure_mgmt_customer_insights/module_definition.rb +8 -0
- data/lib/generated/azure_mgmt_customer_insights/predictions.rb +896 -0
- data/lib/generated/azure_mgmt_customer_insights/profiles.rb +733 -0
- data/lib/generated/azure_mgmt_customer_insights/relationship_links.rb +610 -0
- data/lib/generated/azure_mgmt_customer_insights/relationships.rb +606 -0
- data/lib/generated/azure_mgmt_customer_insights/role_assignments.rb +566 -0
- data/lib/generated/azure_mgmt_customer_insights/roles.rb +227 -0
- data/lib/generated/azure_mgmt_customer_insights/version.rb +8 -0
- data/lib/generated/azure_mgmt_customer_insights/views.rb +530 -0
- data/lib/generated/azure_mgmt_customer_insights/widget_types.rb +323 -0
- metadata +236 -0
@@ -0,0 +1,227 @@
|
|
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 Roles
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the Roles 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
|
+
# Gets all the roles for 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 custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Array<RoleResourceFormat>] operation results.
|
36
|
+
#
|
37
|
+
def list_by_hub(resource_group_name, hub_name, custom_headers = nil)
|
38
|
+
first_page = list_by_hub_as_lazy(resource_group_name, hub_name, custom_headers)
|
39
|
+
first_page.get_all_items
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Gets all the roles for the hub.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] The name of the resource group.
|
46
|
+
# @param hub_name [String] The name of the hub.
|
47
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
48
|
+
# will be added to the HTTP request.
|
49
|
+
#
|
50
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
51
|
+
#
|
52
|
+
def list_by_hub_with_http_info(resource_group_name, hub_name, custom_headers = nil)
|
53
|
+
list_by_hub_async(resource_group_name, hub_name, custom_headers).value!
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Gets all the roles for the hub.
|
58
|
+
#
|
59
|
+
# @param resource_group_name [String] The name of the resource group.
|
60
|
+
# @param hub_name [String] The name of the hub.
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def list_by_hub_async(resource_group_name, hub_name, custom_headers = nil)
|
67
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
68
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
69
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
70
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
71
|
+
|
72
|
+
|
73
|
+
request_headers = {}
|
74
|
+
|
75
|
+
# Set Headers
|
76
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
77
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
78
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/roles'
|
79
|
+
|
80
|
+
request_url = @base_url || @client.base_url
|
81
|
+
|
82
|
+
options = {
|
83
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
84
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
85
|
+
query_params: {'api-version' => @client.api_version},
|
86
|
+
headers: request_headers.merge(custom_headers || {}),
|
87
|
+
base_url: request_url
|
88
|
+
}
|
89
|
+
promise = @client.make_request_async(:get, path_template, options)
|
90
|
+
|
91
|
+
promise = promise.then do |result|
|
92
|
+
http_response = result.response
|
93
|
+
status_code = http_response.status
|
94
|
+
response_content = http_response.body
|
95
|
+
unless status_code == 200
|
96
|
+
error_model = JSON.load(response_content)
|
97
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
98
|
+
end
|
99
|
+
|
100
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
101
|
+
# Deserialize Response
|
102
|
+
if status_code == 200
|
103
|
+
begin
|
104
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
105
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleListResult.mapper()
|
106
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
107
|
+
rescue Exception => e
|
108
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
result
|
113
|
+
end
|
114
|
+
|
115
|
+
promise.execute
|
116
|
+
end
|
117
|
+
|
118
|
+
#
|
119
|
+
# Gets all the roles for the hub.
|
120
|
+
#
|
121
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
122
|
+
# to List operation.
|
123
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
124
|
+
# will be added to the HTTP request.
|
125
|
+
#
|
126
|
+
# @return [RoleListResult] operation results.
|
127
|
+
#
|
128
|
+
def list_by_hub_next(next_page_link, custom_headers = nil)
|
129
|
+
response = list_by_hub_next_async(next_page_link, custom_headers).value!
|
130
|
+
response.body unless response.nil?
|
131
|
+
end
|
132
|
+
|
133
|
+
#
|
134
|
+
# Gets all the roles for the hub.
|
135
|
+
#
|
136
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
137
|
+
# to List operation.
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
139
|
+
# will be added to the HTTP request.
|
140
|
+
#
|
141
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
142
|
+
#
|
143
|
+
def list_by_hub_next_with_http_info(next_page_link, custom_headers = nil)
|
144
|
+
list_by_hub_next_async(next_page_link, custom_headers).value!
|
145
|
+
end
|
146
|
+
|
147
|
+
#
|
148
|
+
# Gets all the roles for the hub.
|
149
|
+
#
|
150
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
151
|
+
# to List operation.
|
152
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
153
|
+
# to the HTTP request.
|
154
|
+
#
|
155
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
156
|
+
#
|
157
|
+
def list_by_hub_next_async(next_page_link, custom_headers = nil)
|
158
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
159
|
+
|
160
|
+
|
161
|
+
request_headers = {}
|
162
|
+
|
163
|
+
# Set Headers
|
164
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
165
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
166
|
+
path_template = '{nextLink}'
|
167
|
+
|
168
|
+
request_url = @base_url || @client.base_url
|
169
|
+
|
170
|
+
options = {
|
171
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
172
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
173
|
+
headers: request_headers.merge(custom_headers || {}),
|
174
|
+
base_url: request_url
|
175
|
+
}
|
176
|
+
promise = @client.make_request_async(:get, path_template, options)
|
177
|
+
|
178
|
+
promise = promise.then do |result|
|
179
|
+
http_response = result.response
|
180
|
+
status_code = http_response.status
|
181
|
+
response_content = http_response.body
|
182
|
+
unless status_code == 200
|
183
|
+
error_model = JSON.load(response_content)
|
184
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
185
|
+
end
|
186
|
+
|
187
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
188
|
+
# Deserialize Response
|
189
|
+
if status_code == 200
|
190
|
+
begin
|
191
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
192
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleListResult.mapper()
|
193
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
194
|
+
rescue Exception => e
|
195
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
result
|
200
|
+
end
|
201
|
+
|
202
|
+
promise.execute
|
203
|
+
end
|
204
|
+
|
205
|
+
#
|
206
|
+
# Gets all the roles for the hub.
|
207
|
+
#
|
208
|
+
# @param resource_group_name [String] The name of the resource group.
|
209
|
+
# @param hub_name [String] The name of the hub.
|
210
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
211
|
+
# will be added to the HTTP request.
|
212
|
+
#
|
213
|
+
# @return [RoleListResult] which provide lazy access to pages of the response.
|
214
|
+
#
|
215
|
+
def list_by_hub_as_lazy(resource_group_name, hub_name, custom_headers = nil)
|
216
|
+
response = list_by_hub_async(resource_group_name, hub_name, custom_headers).value!
|
217
|
+
unless response.nil?
|
218
|
+
page = response.body
|
219
|
+
page.next_method = Proc.new do |next_page_link|
|
220
|
+
list_by_hub_next_async(next_page_link, custom_headers)
|
221
|
+
end
|
222
|
+
page
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
end
|
@@ -0,0 +1,530 @@
|
|
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 Views
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the Views 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
|
+
# Gets all available views for given user in the specified 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 user_id [String] The user ID. Use * to retreive hub level views.
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
34
|
+
# will be added to the HTTP request.
|
35
|
+
#
|
36
|
+
# @return [Array<ViewResourceFormat>] operation results.
|
37
|
+
#
|
38
|
+
def list_by_hub(resource_group_name, hub_name, user_id, custom_headers = nil)
|
39
|
+
first_page = list_by_hub_as_lazy(resource_group_name, hub_name, user_id, custom_headers)
|
40
|
+
first_page.get_all_items
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Gets all available views for given user in the specified hub.
|
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 user_id [String] The user ID. Use * to retreive hub level views.
|
49
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
50
|
+
# will be added to the HTTP request.
|
51
|
+
#
|
52
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
53
|
+
#
|
54
|
+
def list_by_hub_with_http_info(resource_group_name, hub_name, user_id, custom_headers = nil)
|
55
|
+
list_by_hub_async(resource_group_name, hub_name, user_id, custom_headers).value!
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Gets all available views for given user in the specified hub.
|
60
|
+
#
|
61
|
+
# @param resource_group_name [String] The name of the resource group.
|
62
|
+
# @param hub_name [String] The name of the hub.
|
63
|
+
# @param user_id [String] The user ID. Use * to retreive hub level views.
|
64
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
65
|
+
# to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
68
|
+
#
|
69
|
+
def list_by_hub_async(resource_group_name, hub_name, user_id, custom_headers = nil)
|
70
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
71
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
72
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
73
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
74
|
+
fail ArgumentError, 'user_id is nil' if user_id.nil?
|
75
|
+
|
76
|
+
|
77
|
+
request_headers = {}
|
78
|
+
|
79
|
+
# Set Headers
|
80
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
81
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
82
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/views'
|
83
|
+
|
84
|
+
request_url = @base_url || @client.base_url
|
85
|
+
|
86
|
+
options = {
|
87
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
88
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
89
|
+
query_params: {'api-version' => @client.api_version,'userId' => user_id},
|
90
|
+
headers: request_headers.merge(custom_headers || {}),
|
91
|
+
base_url: request_url
|
92
|
+
}
|
93
|
+
promise = @client.make_request_async(:get, path_template, options)
|
94
|
+
|
95
|
+
promise = promise.then do |result|
|
96
|
+
http_response = result.response
|
97
|
+
status_code = http_response.status
|
98
|
+
response_content = http_response.body
|
99
|
+
unless status_code == 200
|
100
|
+
error_model = JSON.load(response_content)
|
101
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
102
|
+
end
|
103
|
+
|
104
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
105
|
+
# Deserialize Response
|
106
|
+
if status_code == 200
|
107
|
+
begin
|
108
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
109
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::ViewListResult.mapper()
|
110
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
111
|
+
rescue Exception => e
|
112
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
promise.execute
|
120
|
+
end
|
121
|
+
|
122
|
+
#
|
123
|
+
# Creates a view or updates an exisiting view in the hub.
|
124
|
+
#
|
125
|
+
# @param resource_group_name [String] The name of the resource group.
|
126
|
+
# @param hub_name [String] The name of the hub.
|
127
|
+
# @param view_name [String] The name of the view.
|
128
|
+
# @param parameters [ViewResourceFormat] Parameters supplied to the
|
129
|
+
# CreateOrUpdate View operation.
|
130
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
131
|
+
# will be added to the HTTP request.
|
132
|
+
#
|
133
|
+
# @return [ViewResourceFormat] operation results.
|
134
|
+
#
|
135
|
+
def create_or_update(resource_group_name, hub_name, view_name, parameters, custom_headers = nil)
|
136
|
+
response = create_or_update_async(resource_group_name, hub_name, view_name, parameters, custom_headers).value!
|
137
|
+
response.body unless response.nil?
|
138
|
+
end
|
139
|
+
|
140
|
+
#
|
141
|
+
# Creates a view or updates an exisiting view in the hub.
|
142
|
+
#
|
143
|
+
# @param resource_group_name [String] The name of the resource group.
|
144
|
+
# @param hub_name [String] The name of the hub.
|
145
|
+
# @param view_name [String] The name of the view.
|
146
|
+
# @param parameters [ViewResourceFormat] Parameters supplied to the
|
147
|
+
# CreateOrUpdate View operation.
|
148
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
149
|
+
# will be added to the HTTP request.
|
150
|
+
#
|
151
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
152
|
+
#
|
153
|
+
def create_or_update_with_http_info(resource_group_name, hub_name, view_name, parameters, custom_headers = nil)
|
154
|
+
create_or_update_async(resource_group_name, hub_name, view_name, parameters, custom_headers).value!
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Creates a view or updates an exisiting view in the hub.
|
159
|
+
#
|
160
|
+
# @param resource_group_name [String] The name of the resource group.
|
161
|
+
# @param hub_name [String] The name of the hub.
|
162
|
+
# @param view_name [String] The name of the view.
|
163
|
+
# @param parameters [ViewResourceFormat] Parameters supplied to the
|
164
|
+
# CreateOrUpdate View operation.
|
165
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
166
|
+
# to the HTTP request.
|
167
|
+
#
|
168
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
169
|
+
#
|
170
|
+
def create_or_update_async(resource_group_name, hub_name, view_name, parameters, custom_headers = nil)
|
171
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
172
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
173
|
+
fail ArgumentError, 'view_name is nil' if view_name.nil?
|
174
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
175
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
176
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
177
|
+
|
178
|
+
|
179
|
+
request_headers = {}
|
180
|
+
|
181
|
+
# Set Headers
|
182
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
183
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
184
|
+
|
185
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
186
|
+
|
187
|
+
# Serialize Request
|
188
|
+
request_mapper = Azure::ARM::CustomerInsights::Models::ViewResourceFormat.mapper()
|
189
|
+
request_content = @client.serialize(request_mapper, parameters)
|
190
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
191
|
+
|
192
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/views/{viewName}'
|
193
|
+
|
194
|
+
request_url = @base_url || @client.base_url
|
195
|
+
|
196
|
+
options = {
|
197
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
198
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'viewName' => view_name,'subscriptionId' => @client.subscription_id},
|
199
|
+
query_params: {'api-version' => @client.api_version},
|
200
|
+
body: request_content,
|
201
|
+
headers: request_headers.merge(custom_headers || {}),
|
202
|
+
base_url: request_url
|
203
|
+
}
|
204
|
+
promise = @client.make_request_async(:put, path_template, options)
|
205
|
+
|
206
|
+
promise = promise.then do |result|
|
207
|
+
http_response = result.response
|
208
|
+
status_code = http_response.status
|
209
|
+
response_content = http_response.body
|
210
|
+
unless status_code == 200
|
211
|
+
error_model = JSON.load(response_content)
|
212
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
213
|
+
end
|
214
|
+
|
215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
216
|
+
# Deserialize Response
|
217
|
+
if status_code == 200
|
218
|
+
begin
|
219
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
220
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::ViewResourceFormat.mapper()
|
221
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
222
|
+
rescue Exception => e
|
223
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
result
|
228
|
+
end
|
229
|
+
|
230
|
+
promise.execute
|
231
|
+
end
|
232
|
+
|
233
|
+
#
|
234
|
+
# Gets a view in the hub.
|
235
|
+
#
|
236
|
+
# @param resource_group_name [String] The name of the resource group.
|
237
|
+
# @param hub_name [String] The name of the hub.
|
238
|
+
# @param view_name [String] The name of the view.
|
239
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
240
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
241
|
+
# will be added to the HTTP request.
|
242
|
+
#
|
243
|
+
# @return [ViewResourceFormat] operation results.
|
244
|
+
#
|
245
|
+
def get(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
246
|
+
response = get_async(resource_group_name, hub_name, view_name, user_id, custom_headers).value!
|
247
|
+
response.body unless response.nil?
|
248
|
+
end
|
249
|
+
|
250
|
+
#
|
251
|
+
# Gets a view in the hub.
|
252
|
+
#
|
253
|
+
# @param resource_group_name [String] The name of the resource group.
|
254
|
+
# @param hub_name [String] The name of the hub.
|
255
|
+
# @param view_name [String] The name of the view.
|
256
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
257
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
258
|
+
# will be added to the HTTP request.
|
259
|
+
#
|
260
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
261
|
+
#
|
262
|
+
def get_with_http_info(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
263
|
+
get_async(resource_group_name, hub_name, view_name, user_id, custom_headers).value!
|
264
|
+
end
|
265
|
+
|
266
|
+
#
|
267
|
+
# Gets a view in the hub.
|
268
|
+
#
|
269
|
+
# @param resource_group_name [String] The name of the resource group.
|
270
|
+
# @param hub_name [String] The name of the hub.
|
271
|
+
# @param view_name [String] The name of the view.
|
272
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
273
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
274
|
+
# to the HTTP request.
|
275
|
+
#
|
276
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
277
|
+
#
|
278
|
+
def get_async(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
279
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
280
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
281
|
+
fail ArgumentError, 'view_name is nil' if view_name.nil?
|
282
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
283
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
284
|
+
fail ArgumentError, 'user_id is nil' if user_id.nil?
|
285
|
+
|
286
|
+
|
287
|
+
request_headers = {}
|
288
|
+
|
289
|
+
# Set Headers
|
290
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
291
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
292
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/views/{viewName}'
|
293
|
+
|
294
|
+
request_url = @base_url || @client.base_url
|
295
|
+
|
296
|
+
options = {
|
297
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
298
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'viewName' => view_name,'subscriptionId' => @client.subscription_id},
|
299
|
+
query_params: {'api-version' => @client.api_version,'userId' => user_id},
|
300
|
+
headers: request_headers.merge(custom_headers || {}),
|
301
|
+
base_url: request_url
|
302
|
+
}
|
303
|
+
promise = @client.make_request_async(:get, path_template, options)
|
304
|
+
|
305
|
+
promise = promise.then do |result|
|
306
|
+
http_response = result.response
|
307
|
+
status_code = http_response.status
|
308
|
+
response_content = http_response.body
|
309
|
+
unless status_code == 200
|
310
|
+
error_model = JSON.load(response_content)
|
311
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
312
|
+
end
|
313
|
+
|
314
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
315
|
+
# Deserialize Response
|
316
|
+
if status_code == 200
|
317
|
+
begin
|
318
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
319
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::ViewResourceFormat.mapper()
|
320
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
321
|
+
rescue Exception => e
|
322
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
result
|
327
|
+
end
|
328
|
+
|
329
|
+
promise.execute
|
330
|
+
end
|
331
|
+
|
332
|
+
#
|
333
|
+
# Deletes a view in the specified hub.
|
334
|
+
#
|
335
|
+
# @param resource_group_name [String] The name of the resource group.
|
336
|
+
# @param hub_name [String] The name of the hub.
|
337
|
+
# @param view_name [String] The name of the view.
|
338
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
339
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
340
|
+
# will be added to the HTTP request.
|
341
|
+
#
|
342
|
+
#
|
343
|
+
def delete(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
344
|
+
response = delete_async(resource_group_name, hub_name, view_name, user_id, custom_headers).value!
|
345
|
+
nil
|
346
|
+
end
|
347
|
+
|
348
|
+
#
|
349
|
+
# Deletes a view in the specified hub.
|
350
|
+
#
|
351
|
+
# @param resource_group_name [String] The name of the resource group.
|
352
|
+
# @param hub_name [String] The name of the hub.
|
353
|
+
# @param view_name [String] The name of the view.
|
354
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
355
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
356
|
+
# will be added to the HTTP request.
|
357
|
+
#
|
358
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
359
|
+
#
|
360
|
+
def delete_with_http_info(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
361
|
+
delete_async(resource_group_name, hub_name, view_name, user_id, custom_headers).value!
|
362
|
+
end
|
363
|
+
|
364
|
+
#
|
365
|
+
# Deletes a view in the specified hub.
|
366
|
+
#
|
367
|
+
# @param resource_group_name [String] The name of the resource group.
|
368
|
+
# @param hub_name [String] The name of the hub.
|
369
|
+
# @param view_name [String] The name of the view.
|
370
|
+
# @param user_id [String] The user ID. Use * to retreive hub level view.
|
371
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
372
|
+
# to the HTTP request.
|
373
|
+
#
|
374
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
375
|
+
#
|
376
|
+
def delete_async(resource_group_name, hub_name, view_name, user_id, custom_headers = nil)
|
377
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
378
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
379
|
+
fail ArgumentError, 'view_name is nil' if view_name.nil?
|
380
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
381
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
382
|
+
fail ArgumentError, 'user_id is nil' if user_id.nil?
|
383
|
+
|
384
|
+
|
385
|
+
request_headers = {}
|
386
|
+
|
387
|
+
# Set Headers
|
388
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
389
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
390
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/views/{viewName}'
|
391
|
+
|
392
|
+
request_url = @base_url || @client.base_url
|
393
|
+
|
394
|
+
options = {
|
395
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
396
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'viewName' => view_name,'subscriptionId' => @client.subscription_id},
|
397
|
+
query_params: {'api-version' => @client.api_version,'userId' => user_id},
|
398
|
+
headers: request_headers.merge(custom_headers || {}),
|
399
|
+
base_url: request_url
|
400
|
+
}
|
401
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
402
|
+
|
403
|
+
promise = promise.then do |result|
|
404
|
+
http_response = result.response
|
405
|
+
status_code = http_response.status
|
406
|
+
response_content = http_response.body
|
407
|
+
unless status_code == 200
|
408
|
+
error_model = JSON.load(response_content)
|
409
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
410
|
+
end
|
411
|
+
|
412
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
413
|
+
|
414
|
+
result
|
415
|
+
end
|
416
|
+
|
417
|
+
promise.execute
|
418
|
+
end
|
419
|
+
|
420
|
+
#
|
421
|
+
# Gets all available views for given user in the specified hub.
|
422
|
+
#
|
423
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
424
|
+
# to List operation.
|
425
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
426
|
+
# will be added to the HTTP request.
|
427
|
+
#
|
428
|
+
# @return [ViewListResult] operation results.
|
429
|
+
#
|
430
|
+
def list_by_hub_next(next_page_link, custom_headers = nil)
|
431
|
+
response = list_by_hub_next_async(next_page_link, custom_headers).value!
|
432
|
+
response.body unless response.nil?
|
433
|
+
end
|
434
|
+
|
435
|
+
#
|
436
|
+
# Gets all available views for given user in the specified hub.
|
437
|
+
#
|
438
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
439
|
+
# to List operation.
|
440
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
441
|
+
# will be added to the HTTP request.
|
442
|
+
#
|
443
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
444
|
+
#
|
445
|
+
def list_by_hub_next_with_http_info(next_page_link, custom_headers = nil)
|
446
|
+
list_by_hub_next_async(next_page_link, custom_headers).value!
|
447
|
+
end
|
448
|
+
|
449
|
+
#
|
450
|
+
# Gets all available views for given user in the specified hub.
|
451
|
+
#
|
452
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
453
|
+
# to List operation.
|
454
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
455
|
+
# to the HTTP request.
|
456
|
+
#
|
457
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
458
|
+
#
|
459
|
+
def list_by_hub_next_async(next_page_link, custom_headers = nil)
|
460
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
461
|
+
|
462
|
+
|
463
|
+
request_headers = {}
|
464
|
+
|
465
|
+
# Set Headers
|
466
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
467
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
468
|
+
path_template = '{nextLink}'
|
469
|
+
|
470
|
+
request_url = @base_url || @client.base_url
|
471
|
+
|
472
|
+
options = {
|
473
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
474
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
475
|
+
headers: request_headers.merge(custom_headers || {}),
|
476
|
+
base_url: request_url
|
477
|
+
}
|
478
|
+
promise = @client.make_request_async(:get, path_template, options)
|
479
|
+
|
480
|
+
promise = promise.then do |result|
|
481
|
+
http_response = result.response
|
482
|
+
status_code = http_response.status
|
483
|
+
response_content = http_response.body
|
484
|
+
unless status_code == 200
|
485
|
+
error_model = JSON.load(response_content)
|
486
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
487
|
+
end
|
488
|
+
|
489
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
490
|
+
# Deserialize Response
|
491
|
+
if status_code == 200
|
492
|
+
begin
|
493
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
494
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::ViewListResult.mapper()
|
495
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
496
|
+
rescue Exception => e
|
497
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
result
|
502
|
+
end
|
503
|
+
|
504
|
+
promise.execute
|
505
|
+
end
|
506
|
+
|
507
|
+
#
|
508
|
+
# Gets all available views for given user in the specified hub.
|
509
|
+
#
|
510
|
+
# @param resource_group_name [String] The name of the resource group.
|
511
|
+
# @param hub_name [String] The name of the hub.
|
512
|
+
# @param user_id [String] The user ID. Use * to retreive hub level views.
|
513
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
514
|
+
# will be added to the HTTP request.
|
515
|
+
#
|
516
|
+
# @return [ViewListResult] which provide lazy access to pages of the response.
|
517
|
+
#
|
518
|
+
def list_by_hub_as_lazy(resource_group_name, hub_name, user_id, custom_headers = nil)
|
519
|
+
response = list_by_hub_async(resource_group_name, hub_name, user_id, custom_headers).value!
|
520
|
+
unless response.nil?
|
521
|
+
page = response.body
|
522
|
+
page.next_method = Proc.new do |next_page_link|
|
523
|
+
list_by_hub_next_async(next_page_link, custom_headers)
|
524
|
+
end
|
525
|
+
page
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
end
|
530
|
+
end
|