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