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