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