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,571 @@
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 Links
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Links class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [CustomerInsightsManagementClient] reference to the CustomerInsightsManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Creates a link or updates an existing link in the hub.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group.
31
+ # @param hub_name [String] The name of the hub.
32
+ # @param link_name [String] The name of the link.
33
+ # @param parameters [LinkResourceFormat] Parameters supplied to the
34
+ # CreateOrUpdate Link operation.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [LinkResourceFormat] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, hub_name, link_name, parameters, custom_headers:nil)
41
+ response = create_or_update_async(resource_group_name, hub_name, link_name, parameters, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param hub_name [String] The name of the hub.
48
+ # @param link_name [String] The name of the link.
49
+ # @param parameters [LinkResourceFormat] Parameters supplied to the
50
+ # CreateOrUpdate Link operation.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [Concurrent::Promise] promise which provides async access to http
55
+ # response.
56
+ #
57
+ def create_or_update_async(resource_group_name, hub_name, link_name, parameters, custom_headers:nil)
58
+ # Send request
59
+ promise = begin_create_or_update_async(resource_group_name, hub_name, link_name, parameters, custom_headers:custom_headers)
60
+
61
+ promise = promise.then do |response|
62
+ # Defining deserialization method.
63
+ deserialize_method = lambda do |parsed_response|
64
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::LinkResourceFormat.mapper()
65
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
66
+ end
67
+
68
+ # Waiting for response.
69
+ @client.get_long_running_operation_result(response, deserialize_method)
70
+ end
71
+
72
+ promise
73
+ end
74
+
75
+ #
76
+ # Gets a link in the hub.
77
+ #
78
+ # @param resource_group_name [String] The name of the resource group.
79
+ # @param hub_name [String] The name of the hub.
80
+ # @param link_name [String] The name of the link.
81
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
82
+ # will be added to the HTTP request.
83
+ #
84
+ # @return [LinkResourceFormat] operation results.
85
+ #
86
+ def get(resource_group_name, hub_name, link_name, custom_headers:nil)
87
+ response = get_async(resource_group_name, hub_name, link_name, custom_headers:custom_headers).value!
88
+ response.body unless response.nil?
89
+ end
90
+
91
+ #
92
+ # Gets a link in the hub.
93
+ #
94
+ # @param resource_group_name [String] The name of the resource group.
95
+ # @param hub_name [String] The name of the hub.
96
+ # @param link_name [String] The name of the link.
97
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
98
+ # will be added to the HTTP request.
99
+ #
100
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
101
+ #
102
+ def get_with_http_info(resource_group_name, hub_name, link_name, custom_headers:nil)
103
+ get_async(resource_group_name, hub_name, link_name, custom_headers:custom_headers).value!
104
+ end
105
+
106
+ #
107
+ # Gets a link in the hub.
108
+ #
109
+ # @param resource_group_name [String] The name of the resource group.
110
+ # @param hub_name [String] The name of the hub.
111
+ # @param link_name [String] The name of the link.
112
+ # @param [Hash{String => String}] A hash of custom headers that will be added
113
+ # to the HTTP request.
114
+ #
115
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
116
+ #
117
+ def get_async(resource_group_name, hub_name, link_name, custom_headers:nil)
118
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
119
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
120
+ fail ArgumentError, 'link_name is nil' if link_name.nil?
121
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
122
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
123
+
124
+
125
+ request_headers = {}
126
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
127
+
128
+ # Set Headers
129
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
130
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
131
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/links/{linkName}'
132
+
133
+ request_url = @base_url || @client.base_url
134
+
135
+ options = {
136
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
137
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'linkName' => link_name,'subscriptionId' => @client.subscription_id},
138
+ query_params: {'api-version' => @client.api_version},
139
+ headers: request_headers.merge(custom_headers || {}),
140
+ base_url: request_url
141
+ }
142
+ promise = @client.make_request_async(:get, path_template, options)
143
+
144
+ promise = promise.then do |result|
145
+ http_response = result.response
146
+ status_code = http_response.status
147
+ response_content = http_response.body
148
+ unless status_code == 200
149
+ error_model = JSON.load(response_content)
150
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
151
+ end
152
+
153
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
154
+ # Deserialize Response
155
+ if status_code == 200
156
+ begin
157
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
158
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::LinkResourceFormat.mapper()
159
+ result.body = @client.deserialize(result_mapper, parsed_response)
160
+ rescue Exception => e
161
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
162
+ end
163
+ end
164
+
165
+ result
166
+ end
167
+
168
+ promise.execute
169
+ end
170
+
171
+ #
172
+ # Deletes a link in the hub.
173
+ #
174
+ # @param resource_group_name [String] The name of the resource group.
175
+ # @param hub_name [String] The name of the hub.
176
+ # @param link_name [String] The name of the link.
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ #
181
+ def delete(resource_group_name, hub_name, link_name, custom_headers:nil)
182
+ response = delete_async(resource_group_name, hub_name, link_name, custom_headers:custom_headers).value!
183
+ nil
184
+ end
185
+
186
+ #
187
+ # Deletes a link in the hub.
188
+ #
189
+ # @param resource_group_name [String] The name of the resource group.
190
+ # @param hub_name [String] The name of the hub.
191
+ # @param link_name [String] The name of the link.
192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
193
+ # will be added to the HTTP request.
194
+ #
195
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
196
+ #
197
+ def delete_with_http_info(resource_group_name, hub_name, link_name, custom_headers:nil)
198
+ delete_async(resource_group_name, hub_name, link_name, custom_headers:custom_headers).value!
199
+ end
200
+
201
+ #
202
+ # Deletes a link in the hub.
203
+ #
204
+ # @param resource_group_name [String] The name of the resource group.
205
+ # @param hub_name [String] The name of the hub.
206
+ # @param link_name [String] The name of the link.
207
+ # @param [Hash{String => String}] A hash of custom headers that will be added
208
+ # to the HTTP request.
209
+ #
210
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
211
+ #
212
+ def delete_async(resource_group_name, hub_name, link_name, custom_headers:nil)
213
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
214
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
215
+ fail ArgumentError, 'link_name is nil' if link_name.nil?
216
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
217
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
218
+
219
+
220
+ request_headers = {}
221
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
222
+
223
+ # Set Headers
224
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
225
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
226
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/links/{linkName}'
227
+
228
+ request_url = @base_url || @client.base_url
229
+
230
+ options = {
231
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
232
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'linkName' => link_name,'subscriptionId' => @client.subscription_id},
233
+ query_params: {'api-version' => @client.api_version},
234
+ headers: request_headers.merge(custom_headers || {}),
235
+ base_url: request_url
236
+ }
237
+ promise = @client.make_request_async(:delete, path_template, options)
238
+
239
+ promise = promise.then do |result|
240
+ http_response = result.response
241
+ status_code = http_response.status
242
+ response_content = http_response.body
243
+ unless status_code == 200 || status_code == 202
244
+ error_model = JSON.load(response_content)
245
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
246
+ end
247
+
248
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
249
+
250
+ result
251
+ end
252
+
253
+ promise.execute
254
+ end
255
+
256
+ #
257
+ # Gets all the links in the specified hub.
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group.
260
+ # @param hub_name [String] The name of the hub.
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [Array<LinkResourceFormat>] operation results.
265
+ #
266
+ def list_by_hub(resource_group_name, hub_name, custom_headers:nil)
267
+ first_page = list_by_hub_as_lazy(resource_group_name, hub_name, custom_headers:custom_headers)
268
+ first_page.get_all_items
269
+ end
270
+
271
+ #
272
+ # Gets all the links in the specified hub.
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group.
275
+ # @param hub_name [String] The name of the hub.
276
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
277
+ # will be added to the HTTP request.
278
+ #
279
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
280
+ #
281
+ def list_by_hub_with_http_info(resource_group_name, hub_name, custom_headers:nil)
282
+ list_by_hub_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
283
+ end
284
+
285
+ #
286
+ # Gets all the links in the specified hub.
287
+ #
288
+ # @param resource_group_name [String] The name of the resource group.
289
+ # @param hub_name [String] The name of the hub.
290
+ # @param [Hash{String => String}] A hash of custom headers that will be added
291
+ # to the HTTP request.
292
+ #
293
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
294
+ #
295
+ def list_by_hub_async(resource_group_name, hub_name, custom_headers:nil)
296
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
297
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
298
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
299
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
300
+
301
+
302
+ request_headers = {}
303
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
304
+
305
+ # Set Headers
306
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
307
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
308
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/links'
309
+
310
+ request_url = @base_url || @client.base_url
311
+
312
+ options = {
313
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
314
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
315
+ query_params: {'api-version' => @client.api_version},
316
+ headers: request_headers.merge(custom_headers || {}),
317
+ base_url: request_url
318
+ }
319
+ promise = @client.make_request_async(:get, path_template, options)
320
+
321
+ promise = promise.then do |result|
322
+ http_response = result.response
323
+ status_code = http_response.status
324
+ response_content = http_response.body
325
+ unless status_code == 200
326
+ error_model = JSON.load(response_content)
327
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
328
+ end
329
+
330
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
331
+ # Deserialize Response
332
+ if status_code == 200
333
+ begin
334
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
335
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::LinkListResult.mapper()
336
+ result.body = @client.deserialize(result_mapper, parsed_response)
337
+ rescue Exception => e
338
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
339
+ end
340
+ end
341
+
342
+ result
343
+ end
344
+
345
+ promise.execute
346
+ end
347
+
348
+ #
349
+ # Creates a link or updates an existing link 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 link_name [String] The name of the link.
354
+ # @param parameters [LinkResourceFormat] Parameters supplied to the
355
+ # CreateOrUpdate Link 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 [LinkResourceFormat] operation results.
360
+ #
361
+ def begin_create_or_update(resource_group_name, hub_name, link_name, parameters, custom_headers:nil)
362
+ response = begin_create_or_update_async(resource_group_name, hub_name, link_name, parameters, custom_headers:custom_headers).value!
363
+ response.body unless response.nil?
364
+ end
365
+
366
+ #
367
+ # Creates a link or updates an existing link 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 link_name [String] The name of the link.
372
+ # @param parameters [LinkResourceFormat] Parameters supplied to the
373
+ # CreateOrUpdate Link 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, link_name, parameters, custom_headers:nil)
380
+ begin_create_or_update_async(resource_group_name, hub_name, link_name, parameters, custom_headers:custom_headers).value!
381
+ end
382
+
383
+ #
384
+ # Creates a link or updates an existing link 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 link_name [String] The name of the link.
389
+ # @param parameters [LinkResourceFormat] Parameters supplied to the
390
+ # CreateOrUpdate Link 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, link_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, 'link_name is nil' if link_name.nil?
400
+ fail ArgumentError, "'link_name' should satisfy the constraint - 'MaxLength': '512'" if !link_name.nil? && link_name.length > 512
401
+ fail ArgumentError, "'link_name' should satisfy the constraint - 'MinLength': '1'" if !link_name.nil? && link_name.length < 1
402
+ fail ArgumentError, "'link_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z][a-zA-Z0-9_]+$'" if !link_name.nil? && link_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::LinkResourceFormat.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}/links/{linkName}'
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,'linkName' => link_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::LinkResourceFormat.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 links in 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 [LinkListResult] 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 links in 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 links in 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::LinkListResult.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 links in 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 [LinkListResult] which provide lazy access to pages of the response.
558
+ #
559
+ def list_by_hub_as_lazy(resource_group_name, hub_name, custom_headers:nil)
560
+ response = list_by_hub_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
561
+ unless response.nil?
562
+ page = response.body
563
+ page.next_method = Proc.new do |next_page_link|
564
+ list_by_hub_next_async(next_page_link, custom_headers:custom_headers)
565
+ end
566
+ page
567
+ end
568
+ end
569
+
570
+ end
571
+ end