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,566 @@
|
|
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 RoleAssignments
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the RoleAssignments 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 role assignments for 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 custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Array<RoleAssignmentResourceFormat>] 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 role assignments for the specified 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 role assignments for the specified 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}/roleAssignments'
|
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::RoleAssignmentListResult.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
|
+
# Creates or updates a role assignment in the hub.
|
120
|
+
#
|
121
|
+
# @param resource_group_name [String] The name of the resource group.
|
122
|
+
# @param hub_name [String] The name of the hub.
|
123
|
+
# @param assignment_name [String] The assignment name
|
124
|
+
# @param parameters [RoleAssignmentResourceFormat] Parameters supplied to the
|
125
|
+
# CreateOrUpdate RoleAssignment operation.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [RoleAssignmentResourceFormat] operation results.
|
130
|
+
#
|
131
|
+
def create_or_update(resource_group_name, hub_name, assignment_name, parameters, custom_headers = nil)
|
132
|
+
response = create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers).value!
|
133
|
+
response.body unless response.nil?
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# @param resource_group_name [String] The name of the resource group.
|
138
|
+
# @param hub_name [String] The name of the hub.
|
139
|
+
# @param assignment_name [String] The assignment name
|
140
|
+
# @param parameters [RoleAssignmentResourceFormat] Parameters supplied to the
|
141
|
+
# CreateOrUpdate RoleAssignment operation.
|
142
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
143
|
+
# will be added to the HTTP request.
|
144
|
+
#
|
145
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
146
|
+
# response.
|
147
|
+
#
|
148
|
+
def create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers = nil)
|
149
|
+
# Send request
|
150
|
+
promise = begin_create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers)
|
151
|
+
|
152
|
+
promise = promise.then do |response|
|
153
|
+
# Defining deserialization method.
|
154
|
+
deserialize_method = lambda do |parsed_response|
|
155
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleAssignmentResourceFormat.mapper()
|
156
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Waiting for response.
|
160
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
161
|
+
end
|
162
|
+
|
163
|
+
promise
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Gets the role assignment in the hub.
|
168
|
+
#
|
169
|
+
# @param resource_group_name [String] The name of the resource group.
|
170
|
+
# @param hub_name [String] The name of the hub.
|
171
|
+
# @param assignment_name [String] The name of the role assignment.
|
172
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
173
|
+
# will be added to the HTTP request.
|
174
|
+
#
|
175
|
+
# @return [RoleAssignmentResourceFormat] operation results.
|
176
|
+
#
|
177
|
+
def get(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
178
|
+
response = get_async(resource_group_name, hub_name, assignment_name, custom_headers).value!
|
179
|
+
response.body unless response.nil?
|
180
|
+
end
|
181
|
+
|
182
|
+
#
|
183
|
+
# Gets the role assignment in the hub.
|
184
|
+
#
|
185
|
+
# @param resource_group_name [String] The name of the resource group.
|
186
|
+
# @param hub_name [String] The name of the hub.
|
187
|
+
# @param assignment_name [String] The name of the role assignment.
|
188
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
189
|
+
# will be added to the HTTP request.
|
190
|
+
#
|
191
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
192
|
+
#
|
193
|
+
def get_with_http_info(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
194
|
+
get_async(resource_group_name, hub_name, assignment_name, custom_headers).value!
|
195
|
+
end
|
196
|
+
|
197
|
+
#
|
198
|
+
# Gets the role assignment in the hub.
|
199
|
+
#
|
200
|
+
# @param resource_group_name [String] The name of the resource group.
|
201
|
+
# @param hub_name [String] The name of the hub.
|
202
|
+
# @param assignment_name [String] The name of the role assignment.
|
203
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
204
|
+
# to the HTTP request.
|
205
|
+
#
|
206
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
207
|
+
#
|
208
|
+
def get_async(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
209
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
210
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
211
|
+
fail ArgumentError, 'assignment_name is nil' if assignment_name.nil?
|
212
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
213
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
214
|
+
|
215
|
+
|
216
|
+
request_headers = {}
|
217
|
+
|
218
|
+
# Set Headers
|
219
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
220
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
221
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/roleAssignments/{assignmentName}'
|
222
|
+
|
223
|
+
request_url = @base_url || @client.base_url
|
224
|
+
|
225
|
+
options = {
|
226
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
227
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'assignmentName' => assignment_name,'subscriptionId' => @client.subscription_id},
|
228
|
+
query_params: {'api-version' => @client.api_version},
|
229
|
+
headers: request_headers.merge(custom_headers || {}),
|
230
|
+
base_url: request_url
|
231
|
+
}
|
232
|
+
promise = @client.make_request_async(:get, path_template, options)
|
233
|
+
|
234
|
+
promise = promise.then do |result|
|
235
|
+
http_response = result.response
|
236
|
+
status_code = http_response.status
|
237
|
+
response_content = http_response.body
|
238
|
+
unless status_code == 200
|
239
|
+
error_model = JSON.load(response_content)
|
240
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
241
|
+
end
|
242
|
+
|
243
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
244
|
+
# Deserialize Response
|
245
|
+
if status_code == 200
|
246
|
+
begin
|
247
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
248
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleAssignmentResourceFormat.mapper()
|
249
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
250
|
+
rescue Exception => e
|
251
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
result
|
256
|
+
end
|
257
|
+
|
258
|
+
promise.execute
|
259
|
+
end
|
260
|
+
|
261
|
+
#
|
262
|
+
# Deletes the role assignment in the hub.
|
263
|
+
#
|
264
|
+
# @param resource_group_name [String] The name of the resource group.
|
265
|
+
# @param hub_name [String] The name of the hub.
|
266
|
+
# @param assignment_name [String] The name of the role assignment.
|
267
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
268
|
+
# will be added to the HTTP request.
|
269
|
+
#
|
270
|
+
#
|
271
|
+
def delete(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
272
|
+
response = delete_async(resource_group_name, hub_name, assignment_name, custom_headers).value!
|
273
|
+
nil
|
274
|
+
end
|
275
|
+
|
276
|
+
#
|
277
|
+
# Deletes the role assignment in the hub.
|
278
|
+
#
|
279
|
+
# @param resource_group_name [String] The name of the resource group.
|
280
|
+
# @param hub_name [String] The name of the hub.
|
281
|
+
# @param assignment_name [String] The name of the role assignment.
|
282
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
283
|
+
# will be added to the HTTP request.
|
284
|
+
#
|
285
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
286
|
+
#
|
287
|
+
def delete_with_http_info(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
288
|
+
delete_async(resource_group_name, hub_name, assignment_name, custom_headers).value!
|
289
|
+
end
|
290
|
+
|
291
|
+
#
|
292
|
+
# Deletes the role assignment in the hub.
|
293
|
+
#
|
294
|
+
# @param resource_group_name [String] The name of the resource group.
|
295
|
+
# @param hub_name [String] The name of the hub.
|
296
|
+
# @param assignment_name [String] The name of the role assignment.
|
297
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
298
|
+
# to the HTTP request.
|
299
|
+
#
|
300
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
301
|
+
#
|
302
|
+
def delete_async(resource_group_name, hub_name, assignment_name, custom_headers = nil)
|
303
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
304
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
305
|
+
fail ArgumentError, 'assignment_name is nil' if assignment_name.nil?
|
306
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
307
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
308
|
+
|
309
|
+
|
310
|
+
request_headers = {}
|
311
|
+
|
312
|
+
# Set Headers
|
313
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
314
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
315
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/roleAssignments/{assignmentName}'
|
316
|
+
|
317
|
+
request_url = @base_url || @client.base_url
|
318
|
+
|
319
|
+
options = {
|
320
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
321
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'assignmentName' => assignment_name,'subscriptionId' => @client.subscription_id},
|
322
|
+
query_params: {'api-version' => @client.api_version},
|
323
|
+
headers: request_headers.merge(custom_headers || {}),
|
324
|
+
base_url: request_url
|
325
|
+
}
|
326
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
327
|
+
|
328
|
+
promise = promise.then do |result|
|
329
|
+
http_response = result.response
|
330
|
+
status_code = http_response.status
|
331
|
+
response_content = http_response.body
|
332
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
333
|
+
error_model = JSON.load(response_content)
|
334
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
335
|
+
end
|
336
|
+
|
337
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
338
|
+
|
339
|
+
result
|
340
|
+
end
|
341
|
+
|
342
|
+
promise.execute
|
343
|
+
end
|
344
|
+
|
345
|
+
#
|
346
|
+
# Creates or updates a role assignment in the hub.
|
347
|
+
#
|
348
|
+
# @param resource_group_name [String] The name of the resource group.
|
349
|
+
# @param hub_name [String] The name of the hub.
|
350
|
+
# @param assignment_name [String] The assignment name
|
351
|
+
# @param parameters [RoleAssignmentResourceFormat] Parameters supplied to the
|
352
|
+
# CreateOrUpdate RoleAssignment operation.
|
353
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
354
|
+
# will be added to the HTTP request.
|
355
|
+
#
|
356
|
+
# @return [RoleAssignmentResourceFormat] operation results.
|
357
|
+
#
|
358
|
+
def begin_create_or_update(resource_group_name, hub_name, assignment_name, parameters, custom_headers = nil)
|
359
|
+
response = begin_create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers).value!
|
360
|
+
response.body unless response.nil?
|
361
|
+
end
|
362
|
+
|
363
|
+
#
|
364
|
+
# Creates or updates a role assignment in the hub.
|
365
|
+
#
|
366
|
+
# @param resource_group_name [String] The name of the resource group.
|
367
|
+
# @param hub_name [String] The name of the hub.
|
368
|
+
# @param assignment_name [String] The assignment name
|
369
|
+
# @param parameters [RoleAssignmentResourceFormat] Parameters supplied to the
|
370
|
+
# CreateOrUpdate RoleAssignment operation.
|
371
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
372
|
+
# will be added to the HTTP request.
|
373
|
+
#
|
374
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
375
|
+
#
|
376
|
+
def begin_create_or_update_with_http_info(resource_group_name, hub_name, assignment_name, parameters, custom_headers = nil)
|
377
|
+
begin_create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers).value!
|
378
|
+
end
|
379
|
+
|
380
|
+
#
|
381
|
+
# Creates or updates a role assignment in the hub.
|
382
|
+
#
|
383
|
+
# @param resource_group_name [String] The name of the resource group.
|
384
|
+
# @param hub_name [String] The name of the hub.
|
385
|
+
# @param assignment_name [String] The assignment name
|
386
|
+
# @param parameters [RoleAssignmentResourceFormat] Parameters supplied to the
|
387
|
+
# CreateOrUpdate RoleAssignment operation.
|
388
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
389
|
+
# to the HTTP request.
|
390
|
+
#
|
391
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
392
|
+
#
|
393
|
+
def begin_create_or_update_async(resource_group_name, hub_name, assignment_name, parameters, custom_headers = nil)
|
394
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
395
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
396
|
+
fail ArgumentError, 'assignment_name is nil' if assignment_name.nil?
|
397
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
398
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
399
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
400
|
+
|
401
|
+
|
402
|
+
request_headers = {}
|
403
|
+
|
404
|
+
# Set Headers
|
405
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
406
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
407
|
+
|
408
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
409
|
+
|
410
|
+
# Serialize Request
|
411
|
+
request_mapper = Azure::ARM::CustomerInsights::Models::RoleAssignmentResourceFormat.mapper()
|
412
|
+
request_content = @client.serialize(request_mapper, parameters)
|
413
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
414
|
+
|
415
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/roleAssignments/{assignmentName}'
|
416
|
+
|
417
|
+
request_url = @base_url || @client.base_url
|
418
|
+
|
419
|
+
options = {
|
420
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
421
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'assignmentName' => assignment_name,'subscriptionId' => @client.subscription_id},
|
422
|
+
query_params: {'api-version' => @client.api_version},
|
423
|
+
body: request_content,
|
424
|
+
headers: request_headers.merge(custom_headers || {}),
|
425
|
+
base_url: request_url
|
426
|
+
}
|
427
|
+
promise = @client.make_request_async(:put, path_template, options)
|
428
|
+
|
429
|
+
promise = promise.then do |result|
|
430
|
+
http_response = result.response
|
431
|
+
status_code = http_response.status
|
432
|
+
response_content = http_response.body
|
433
|
+
unless status_code == 200 || status_code == 202
|
434
|
+
error_model = JSON.load(response_content)
|
435
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
436
|
+
end
|
437
|
+
|
438
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
439
|
+
# Deserialize Response
|
440
|
+
if status_code == 200
|
441
|
+
begin
|
442
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
443
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleAssignmentResourceFormat.mapper()
|
444
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
445
|
+
rescue Exception => e
|
446
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
447
|
+
end
|
448
|
+
end
|
449
|
+
|
450
|
+
result
|
451
|
+
end
|
452
|
+
|
453
|
+
promise.execute
|
454
|
+
end
|
455
|
+
|
456
|
+
#
|
457
|
+
# Gets all the role assignments for the specified hub.
|
458
|
+
#
|
459
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
460
|
+
# to List operation.
|
461
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
462
|
+
# will be added to the HTTP request.
|
463
|
+
#
|
464
|
+
# @return [RoleAssignmentListResult] operation results.
|
465
|
+
#
|
466
|
+
def list_by_hub_next(next_page_link, custom_headers = nil)
|
467
|
+
response = list_by_hub_next_async(next_page_link, custom_headers).value!
|
468
|
+
response.body unless response.nil?
|
469
|
+
end
|
470
|
+
|
471
|
+
#
|
472
|
+
# Gets all the role assignments for the specified hub.
|
473
|
+
#
|
474
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
475
|
+
# to List operation.
|
476
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
477
|
+
# will be added to the HTTP request.
|
478
|
+
#
|
479
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
480
|
+
#
|
481
|
+
def list_by_hub_next_with_http_info(next_page_link, custom_headers = nil)
|
482
|
+
list_by_hub_next_async(next_page_link, custom_headers).value!
|
483
|
+
end
|
484
|
+
|
485
|
+
#
|
486
|
+
# Gets all the role assignments for the specified hub.
|
487
|
+
#
|
488
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
489
|
+
# to List operation.
|
490
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
491
|
+
# to the HTTP request.
|
492
|
+
#
|
493
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
494
|
+
#
|
495
|
+
def list_by_hub_next_async(next_page_link, custom_headers = nil)
|
496
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
497
|
+
|
498
|
+
|
499
|
+
request_headers = {}
|
500
|
+
|
501
|
+
# Set Headers
|
502
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
503
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
504
|
+
path_template = '{nextLink}'
|
505
|
+
|
506
|
+
request_url = @base_url || @client.base_url
|
507
|
+
|
508
|
+
options = {
|
509
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
510
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
511
|
+
headers: request_headers.merge(custom_headers || {}),
|
512
|
+
base_url: request_url
|
513
|
+
}
|
514
|
+
promise = @client.make_request_async(:get, path_template, options)
|
515
|
+
|
516
|
+
promise = promise.then do |result|
|
517
|
+
http_response = result.response
|
518
|
+
status_code = http_response.status
|
519
|
+
response_content = http_response.body
|
520
|
+
unless status_code == 200
|
521
|
+
error_model = JSON.load(response_content)
|
522
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
523
|
+
end
|
524
|
+
|
525
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
526
|
+
# Deserialize Response
|
527
|
+
if status_code == 200
|
528
|
+
begin
|
529
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
530
|
+
result_mapper = Azure::ARM::CustomerInsights::Models::RoleAssignmentListResult.mapper()
|
531
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
532
|
+
rescue Exception => e
|
533
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
534
|
+
end
|
535
|
+
end
|
536
|
+
|
537
|
+
result
|
538
|
+
end
|
539
|
+
|
540
|
+
promise.execute
|
541
|
+
end
|
542
|
+
|
543
|
+
#
|
544
|
+
# Gets all the role assignments for the specified hub.
|
545
|
+
#
|
546
|
+
# @param resource_group_name [String] The name of the resource group.
|
547
|
+
# @param hub_name [String] The name of the hub.
|
548
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
549
|
+
# will be added to the HTTP request.
|
550
|
+
#
|
551
|
+
# @return [RoleAssignmentListResult] which provide lazy access to pages of the
|
552
|
+
# response.
|
553
|
+
#
|
554
|
+
def list_by_hub_as_lazy(resource_group_name, hub_name, custom_headers = nil)
|
555
|
+
response = list_by_hub_async(resource_group_name, hub_name, custom_headers).value!
|
556
|
+
unless response.nil?
|
557
|
+
page = response.body
|
558
|
+
page.next_method = Proc.new do |next_page_link|
|
559
|
+
list_by_hub_next_async(next_page_link, custom_headers)
|
560
|
+
end
|
561
|
+
page
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
end
|
566
|
+
end
|