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