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.
- checksums.yaml +4 -4
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights.rb +132 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/authorization_policies.rb +641 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/connector_mappings.rb +554 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/connectors.rb +612 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/customer_insights_management_client.rb +192 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/hubs.rb +848 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/images.rb +240 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/interactions.rb +597 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/kpi.rb +696 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/links.rb +571 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/assignment_principal.rb +76 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/authorization_policy.rb +93 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/authorization_policy_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/authorization_policy_resource_format.rb +120 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/azure_blob_connector_properties.rb +46 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/calculation_window_types.rb +19 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/cardinality_types.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/completion_operation_types.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_availability.rb +59 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_complete_operation.rb +60 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_error_management.rb +60 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_format.rb +104 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_properties.rb +141 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_resource_format.rb +245 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_states.rb +21 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_mapping_structure.rb +79 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_resource_format.rb +199 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_states.rb +20 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/connector_types.rb +20 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/crm_connector_entities.rb +68 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/crm_connector_properties.rb +100 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/data_source_precedence.rb +109 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/data_source_type.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/enriching_kpi.rb +256 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/entity_type_definition.rb +268 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/entity_types.rb +18 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/error_management_types.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/frequency_types.rb +19 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/get_image_upload_url_input.rb +68 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/hub.rb +147 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/hub_billing_info_format.rb +78 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/hub_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/image_definition.rb +68 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/instance_operation_type.rb +16 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/interaction_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/interaction_resource_format.rb +475 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_alias.rb +57 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_definition.rb +320 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_extract.rb +57 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_functions.rb +22 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_group_by_metadata.rb +76 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_participant_profiles_metadata.rb +46 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_resource_format.rb +347 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/kpi_thresholds.rb +68 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/link_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/link_resource_format.rb +230 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/link_types.rb +16 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/metadata_definition_base.rb +166 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/operation.rb +59 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/operation_display.rb +72 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/operation_list_result.rb +103 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/participant.rb +127 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/participant_property_reference.rb +59 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/permission_types.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/profile_enum_valid_values_format.rb +65 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/profile_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/profile_resource_format.rb +342 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/property_definition.rb +237 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/provisioning_states.rb +20 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/proxy_resource.rb +71 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_link_field_mapping.rb +70 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_link_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_link_resource_format.rb +238 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_resource_format.rb +239 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_type_field_mapping.rb +58 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationship_type_mapping.rb +58 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/relationships_lookup.rb +115 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/resource.rb +101 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/resource_set_description.rb +74 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/role_assignment_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/role_assignment_resource_format.rb +333 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/role_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/role_resource_format.rb +84 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/role_types.rb +20 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/salesforce_connector_properties.rb +67 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/salesforce_discover_setting.rb +46 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/salesforce_table.rb +90 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/status.rb +17 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/strong_id.rb +103 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/suggest_relationship_links_response.rb +69 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/type_properties_mapping.rb +82 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/view_list_result.rb +98 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/view_resource_format.rb +151 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/widget_type_list_result.rb +99 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/models/widget_type_resource_format.rb +174 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/module_definition.rb +9 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/operations.rb +218 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/profiles.rb +742 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/relationship_links.rb +616 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/relationships.rb +612 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/role_assignments.rb +572 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/roles.rb +229 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/views.rb +535 -0
- data/lib/2017-01-01/generated/azure_mgmt_customer_insights/widget_types.rb +326 -0
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/authorization_policies.rb +39 -35
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/connector_mappings.rb +33 -30
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/connectors.rb +41 -38
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/customer_insights_management_client.rb +4 -1
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/hubs.rb +58 -54
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/images.rb +12 -14
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/interactions.rb +37 -34
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/kpi.rb +47 -43
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/links.rb +37 -34
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/operations.rb +15 -13
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/predictions.rb +59 -55
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/profiles.rb +47 -43
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/relationship_links.rb +41 -38
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/relationships.rb +41 -38
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/role_assignments.rb +37 -34
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/roles.rb +15 -13
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/views.rb +33 -30
- data/lib/2017-04-26/generated/azure_mgmt_customer_insights/widget_types.rb +21 -18
- data/lib/azure_mgmt_customer_insights.rb +1 -0
- data/lib/profiles/latest/customerinsights_latest_profile_client.rb +28 -9
- data/lib/profiles/latest/customerinsights_module_definition.rb +0 -1
- data/lib/profiles/latest/modules/customerinsights_profile_module.rb +356 -337
- data/lib/version.rb +1 -1
- metadata +110 -2
data/lib/2017-01-01/generated/azure_mgmt_customer_insights/customer_insights_management_client.rb
ADDED
@@ -0,0 +1,192 @@
|
|
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
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class CustomerInsightsManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Gets subscription credentials which uniquely identify
|
21
|
+
# Microsoft Azure subscription. The subscription ID forms part of the URI
|
22
|
+
# for every service call.
|
23
|
+
attr_accessor :subscription_id
|
24
|
+
|
25
|
+
# @return [String] Client Api Version.
|
26
|
+
attr_reader :api_version
|
27
|
+
|
28
|
+
# @return [String] Gets or sets the preferred language for the response.
|
29
|
+
attr_accessor :accept_language
|
30
|
+
|
31
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
32
|
+
# Running Operations. Default value is 30.
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
34
|
+
|
35
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
36
|
+
# is generated and included in each request. Default is true.
|
37
|
+
attr_accessor :generate_client_request_id
|
38
|
+
|
39
|
+
# @return [Operations] operations
|
40
|
+
attr_reader :operations
|
41
|
+
|
42
|
+
# @return [Hubs] hubs
|
43
|
+
attr_reader :hubs
|
44
|
+
|
45
|
+
# @return [Profiles] profiles
|
46
|
+
attr_reader :profiles
|
47
|
+
|
48
|
+
# @return [Interactions] interactions
|
49
|
+
attr_reader :interactions
|
50
|
+
|
51
|
+
# @return [Relationships] relationships
|
52
|
+
attr_reader :relationships
|
53
|
+
|
54
|
+
# @return [RelationshipLinks] relationship_links
|
55
|
+
attr_reader :relationship_links
|
56
|
+
|
57
|
+
# @return [AuthorizationPolicies] authorization_policies
|
58
|
+
attr_reader :authorization_policies
|
59
|
+
|
60
|
+
# @return [Connectors] connectors
|
61
|
+
attr_reader :connectors
|
62
|
+
|
63
|
+
# @return [ConnectorMappings] connector_mappings
|
64
|
+
attr_reader :connector_mappings
|
65
|
+
|
66
|
+
# @return [Kpi] kpi
|
67
|
+
attr_reader :kpi
|
68
|
+
|
69
|
+
# @return [WidgetTypes] widget_types
|
70
|
+
attr_reader :widget_types
|
71
|
+
|
72
|
+
# @return [Views] views
|
73
|
+
attr_reader :views
|
74
|
+
|
75
|
+
# @return [Links] links
|
76
|
+
attr_reader :links
|
77
|
+
|
78
|
+
# @return [Roles] roles
|
79
|
+
attr_reader :roles
|
80
|
+
|
81
|
+
# @return [RoleAssignments] role_assignments
|
82
|
+
attr_reader :role_assignments
|
83
|
+
|
84
|
+
# @return [Images] images
|
85
|
+
attr_reader :images
|
86
|
+
|
87
|
+
#
|
88
|
+
# Creates initializes a new instance of the CustomerInsightsManagementClient class.
|
89
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
90
|
+
# @param base_url [String] the base URI of the service.
|
91
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
92
|
+
#
|
93
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
94
|
+
super(credentials, options)
|
95
|
+
@base_url = base_url || 'https://management.azure.com'
|
96
|
+
|
97
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
98
|
+
@credentials = credentials
|
99
|
+
|
100
|
+
@operations = Operations.new(self)
|
101
|
+
@hubs = Hubs.new(self)
|
102
|
+
@profiles = Profiles.new(self)
|
103
|
+
@interactions = Interactions.new(self)
|
104
|
+
@relationships = Relationships.new(self)
|
105
|
+
@relationship_links = RelationshipLinks.new(self)
|
106
|
+
@authorization_policies = AuthorizationPolicies.new(self)
|
107
|
+
@connectors = Connectors.new(self)
|
108
|
+
@connector_mappings = ConnectorMappings.new(self)
|
109
|
+
@kpi = Kpi.new(self)
|
110
|
+
@widget_types = WidgetTypes.new(self)
|
111
|
+
@views = Views.new(self)
|
112
|
+
@links = Links.new(self)
|
113
|
+
@roles = Roles.new(self)
|
114
|
+
@role_assignments = RoleAssignments.new(self)
|
115
|
+
@images = Images.new(self)
|
116
|
+
@api_version = '2017-01-01'
|
117
|
+
@accept_language = 'en-US'
|
118
|
+
@long_running_operation_retry_timeout = 30
|
119
|
+
@generate_client_request_id = true
|
120
|
+
add_telemetry
|
121
|
+
end
|
122
|
+
|
123
|
+
#
|
124
|
+
# Makes a request and returns the body of the response.
|
125
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
126
|
+
# @param path [String] the path, relative to {base_url}.
|
127
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
128
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
129
|
+
# Example:
|
130
|
+
#
|
131
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
132
|
+
# path = "/path"
|
133
|
+
# options = {
|
134
|
+
# body: request_content,
|
135
|
+
# query_params: {'api-version' => '2016-02-01'}
|
136
|
+
# }
|
137
|
+
# result = @client.make_request(:put, path, options)
|
138
|
+
#
|
139
|
+
def make_request(method, path, options = {})
|
140
|
+
result = make_request_with_http_info(method, path, options)
|
141
|
+
result.body unless result.nil?
|
142
|
+
end
|
143
|
+
|
144
|
+
#
|
145
|
+
# Makes a request and returns the operation response.
|
146
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
147
|
+
# @param path [String] the path, relative to {base_url}.
|
148
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
149
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
150
|
+
#
|
151
|
+
def make_request_with_http_info(method, path, options = {})
|
152
|
+
result = make_request_async(method, path, options).value!
|
153
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Makes a request asynchronously.
|
159
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
160
|
+
# @param path [String] the path, relative to {base_url}.
|
161
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
162
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
163
|
+
#
|
164
|
+
def make_request_async(method, path, options = {})
|
165
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
166
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
167
|
+
|
168
|
+
request_url = options[:base_url] || @base_url
|
169
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
170
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
171
|
+
end
|
172
|
+
|
173
|
+
request_headers = @request_headers
|
174
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
175
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
176
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
177
|
+
|
178
|
+
super(request_url, method, path, options)
|
179
|
+
end
|
180
|
+
|
181
|
+
|
182
|
+
private
|
183
|
+
#
|
184
|
+
# Adds telemetry information.
|
185
|
+
#
|
186
|
+
def add_telemetry
|
187
|
+
sdk_information = 'azure_mgmt_customer_insights'
|
188
|
+
sdk_information = "#{sdk_information}/0.16.0"
|
189
|
+
add_user_agent_information(sdk_information)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
@@ -0,0 +1,848 @@
|
|
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 Hubs
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the Hubs 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 hub, or updates an existing 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 parameters [Hub] Parameters supplied to the CreateOrUpdate Hub
|
33
|
+
# 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 [Hub] operation results.
|
38
|
+
#
|
39
|
+
def create_or_update(resource_group_name, hub_name, parameters, custom_headers:nil)
|
40
|
+
response = create_or_update_async(resource_group_name, hub_name, parameters, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Creates a hub, or updates an existing hub.
|
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 [Hub] Parameters supplied to the CreateOrUpdate Hub
|
50
|
+
# 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 create_or_update_with_http_info(resource_group_name, hub_name, parameters, custom_headers:nil)
|
57
|
+
create_or_update_async(resource_group_name, hub_name, parameters, custom_headers:custom_headers).value!
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# Creates a hub, or updates an existing hub.
|
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 [Hub] Parameters supplied to the CreateOrUpdate Hub
|
66
|
+
# 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 create_or_update_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, "'hub_name' should satisfy the constraint - 'MaxLength': '64'" if !hub_name.nil? && hub_name.length > 64
|
76
|
+
fail ArgumentError, "'hub_name' should satisfy the constraint - 'MinLength': '1'" if !hub_name.nil? && hub_name.length < 1
|
77
|
+
fail ArgumentError, "'hub_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z][a-zA-Z0-9]+$'" if !hub_name.nil? && hub_name.match(Regexp.new('^^[a-zA-Z][a-zA-Z0-9]+$$')).nil?
|
78
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
79
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
81
|
+
|
82
|
+
|
83
|
+
request_headers = {}
|
84
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
85
|
+
|
86
|
+
# Set Headers
|
87
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
88
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
89
|
+
|
90
|
+
# Serialize Request
|
91
|
+
request_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
92
|
+
request_content = @client.serialize(request_mapper, parameters)
|
93
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
94
|
+
|
95
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}'
|
96
|
+
|
97
|
+
request_url = @base_url || @client.base_url
|
98
|
+
|
99
|
+
options = {
|
100
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
101
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
102
|
+
query_params: {'api-version' => @client.api_version},
|
103
|
+
body: request_content,
|
104
|
+
headers: request_headers.merge(custom_headers || {}),
|
105
|
+
base_url: request_url
|
106
|
+
}
|
107
|
+
promise = @client.make_request_async(:put, path_template, options)
|
108
|
+
|
109
|
+
promise = promise.then do |result|
|
110
|
+
http_response = result.response
|
111
|
+
status_code = http_response.status
|
112
|
+
response_content = http_response.body
|
113
|
+
unless status_code == 201 || status_code == 200
|
114
|
+
error_model = JSON.load(response_content)
|
115
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
116
|
+
end
|
117
|
+
|
118
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
119
|
+
# Deserialize Response
|
120
|
+
if status_code == 201
|
121
|
+
begin
|
122
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
123
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
124
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
125
|
+
rescue Exception => e
|
126
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
# Deserialize Response
|
130
|
+
if status_code == 200
|
131
|
+
begin
|
132
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
133
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
134
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
135
|
+
rescue Exception => e
|
136
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
result
|
141
|
+
end
|
142
|
+
|
143
|
+
promise.execute
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Updates a Hub.
|
148
|
+
#
|
149
|
+
# @param resource_group_name [String] The name of the resource group.
|
150
|
+
# @param hub_name [String] The name of the Hub.
|
151
|
+
# @param parameters [Hub] Parameters supplied to the Update Hub operation.
|
152
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
153
|
+
# will be added to the HTTP request.
|
154
|
+
#
|
155
|
+
# @return [Hub] operation results.
|
156
|
+
#
|
157
|
+
def update(resource_group_name, hub_name, parameters, custom_headers:nil)
|
158
|
+
response = update_async(resource_group_name, hub_name, parameters, custom_headers:custom_headers).value!
|
159
|
+
response.body unless response.nil?
|
160
|
+
end
|
161
|
+
|
162
|
+
#
|
163
|
+
# Updates a Hub.
|
164
|
+
#
|
165
|
+
# @param resource_group_name [String] The name of the resource group.
|
166
|
+
# @param hub_name [String] The name of the Hub.
|
167
|
+
# @param parameters [Hub] Parameters supplied to the Update Hub operation.
|
168
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
169
|
+
# will be added to the HTTP request.
|
170
|
+
#
|
171
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
172
|
+
#
|
173
|
+
def update_with_http_info(resource_group_name, hub_name, parameters, custom_headers:nil)
|
174
|
+
update_async(resource_group_name, hub_name, parameters, custom_headers:custom_headers).value!
|
175
|
+
end
|
176
|
+
|
177
|
+
#
|
178
|
+
# Updates a 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 parameters [Hub] Parameters supplied to the Update Hub operation.
|
183
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
184
|
+
# to the HTTP request.
|
185
|
+
#
|
186
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
187
|
+
#
|
188
|
+
def update_async(resource_group_name, hub_name, parameters, custom_headers:nil)
|
189
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
190
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
191
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
192
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
193
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
194
|
+
|
195
|
+
|
196
|
+
request_headers = {}
|
197
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
198
|
+
|
199
|
+
# Set Headers
|
200
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
201
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
202
|
+
|
203
|
+
# Serialize Request
|
204
|
+
request_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
205
|
+
request_content = @client.serialize(request_mapper, parameters)
|
206
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
207
|
+
|
208
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}'
|
209
|
+
|
210
|
+
request_url = @base_url || @client.base_url
|
211
|
+
|
212
|
+
options = {
|
213
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
214
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
215
|
+
query_params: {'api-version' => @client.api_version},
|
216
|
+
body: request_content,
|
217
|
+
headers: request_headers.merge(custom_headers || {}),
|
218
|
+
base_url: request_url
|
219
|
+
}
|
220
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
221
|
+
|
222
|
+
promise = promise.then do |result|
|
223
|
+
http_response = result.response
|
224
|
+
status_code = http_response.status
|
225
|
+
response_content = http_response.body
|
226
|
+
unless status_code == 200
|
227
|
+
error_model = JSON.load(response_content)
|
228
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
229
|
+
end
|
230
|
+
|
231
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
232
|
+
# Deserialize Response
|
233
|
+
if status_code == 200
|
234
|
+
begin
|
235
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
236
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
237
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
238
|
+
rescue Exception => e
|
239
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
result
|
244
|
+
end
|
245
|
+
|
246
|
+
promise.execute
|
247
|
+
end
|
248
|
+
|
249
|
+
#
|
250
|
+
# Deletes the specified hub.
|
251
|
+
#
|
252
|
+
# @param resource_group_name [String] The name of the resource group.
|
253
|
+
# @param hub_name [String] The name of the hub.
|
254
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
255
|
+
# will be added to the HTTP request.
|
256
|
+
#
|
257
|
+
def delete(resource_group_name, hub_name, custom_headers:nil)
|
258
|
+
response = delete_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
|
259
|
+
nil
|
260
|
+
end
|
261
|
+
|
262
|
+
#
|
263
|
+
# @param resource_group_name [String] The name of the resource group.
|
264
|
+
# @param hub_name [String] The name of the hub.
|
265
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
266
|
+
# will be added to the HTTP request.
|
267
|
+
#
|
268
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
269
|
+
# response.
|
270
|
+
#
|
271
|
+
def delete_async(resource_group_name, hub_name, custom_headers:nil)
|
272
|
+
# Send request
|
273
|
+
promise = begin_delete_async(resource_group_name, hub_name, custom_headers:custom_headers)
|
274
|
+
|
275
|
+
promise = promise.then do |response|
|
276
|
+
# Defining deserialization method.
|
277
|
+
deserialize_method = lambda do |parsed_response|
|
278
|
+
end
|
279
|
+
|
280
|
+
# Waiting for response.
|
281
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
282
|
+
end
|
283
|
+
|
284
|
+
promise
|
285
|
+
end
|
286
|
+
|
287
|
+
#
|
288
|
+
# Gets information about the specified hub.
|
289
|
+
#
|
290
|
+
# @param resource_group_name [String] The name of the resource group.
|
291
|
+
# @param hub_name [String] The name of the hub.
|
292
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
293
|
+
# will be added to the HTTP request.
|
294
|
+
#
|
295
|
+
# @return [Hub] operation results.
|
296
|
+
#
|
297
|
+
def get(resource_group_name, hub_name, custom_headers:nil)
|
298
|
+
response = get_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
|
299
|
+
response.body unless response.nil?
|
300
|
+
end
|
301
|
+
|
302
|
+
#
|
303
|
+
# Gets information about the specified hub.
|
304
|
+
#
|
305
|
+
# @param resource_group_name [String] The name of the resource group.
|
306
|
+
# @param hub_name [String] The name of the hub.
|
307
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
308
|
+
# will be added to the HTTP request.
|
309
|
+
#
|
310
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
311
|
+
#
|
312
|
+
def get_with_http_info(resource_group_name, hub_name, custom_headers:nil)
|
313
|
+
get_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
|
314
|
+
end
|
315
|
+
|
316
|
+
#
|
317
|
+
# Gets information about the specified hub.
|
318
|
+
#
|
319
|
+
# @param resource_group_name [String] The name of the resource group.
|
320
|
+
# @param hub_name [String] The name of the hub.
|
321
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
322
|
+
# to the HTTP request.
|
323
|
+
#
|
324
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
325
|
+
#
|
326
|
+
def get_async(resource_group_name, hub_name, custom_headers:nil)
|
327
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
328
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
329
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
330
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
331
|
+
|
332
|
+
|
333
|
+
request_headers = {}
|
334
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
335
|
+
|
336
|
+
# Set Headers
|
337
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
338
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
339
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}'
|
340
|
+
|
341
|
+
request_url = @base_url || @client.base_url
|
342
|
+
|
343
|
+
options = {
|
344
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
345
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
346
|
+
query_params: {'api-version' => @client.api_version},
|
347
|
+
headers: request_headers.merge(custom_headers || {}),
|
348
|
+
base_url: request_url
|
349
|
+
}
|
350
|
+
promise = @client.make_request_async(:get, path_template, options)
|
351
|
+
|
352
|
+
promise = promise.then do |result|
|
353
|
+
http_response = result.response
|
354
|
+
status_code = http_response.status
|
355
|
+
response_content = http_response.body
|
356
|
+
unless status_code == 200
|
357
|
+
error_model = JSON.load(response_content)
|
358
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
359
|
+
end
|
360
|
+
|
361
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
362
|
+
# Deserialize Response
|
363
|
+
if status_code == 200
|
364
|
+
begin
|
365
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
366
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::Hub.mapper()
|
367
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
368
|
+
rescue Exception => e
|
369
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
result
|
374
|
+
end
|
375
|
+
|
376
|
+
promise.execute
|
377
|
+
end
|
378
|
+
|
379
|
+
#
|
380
|
+
# Gets all the hubs in a resource group.
|
381
|
+
#
|
382
|
+
# @param resource_group_name [String] The name of the resource group.
|
383
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
384
|
+
# will be added to the HTTP request.
|
385
|
+
#
|
386
|
+
# @return [Array<Hub>] operation results.
|
387
|
+
#
|
388
|
+
def list_by_resource_group(resource_group_name, custom_headers:nil)
|
389
|
+
first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
|
390
|
+
first_page.get_all_items
|
391
|
+
end
|
392
|
+
|
393
|
+
#
|
394
|
+
# Gets all the hubs in a resource group.
|
395
|
+
#
|
396
|
+
# @param resource_group_name [String] The name of the resource group.
|
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 list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
|
403
|
+
list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
404
|
+
end
|
405
|
+
|
406
|
+
#
|
407
|
+
# Gets all the hubs in a resource group.
|
408
|
+
#
|
409
|
+
# @param resource_group_name [String] The name of the resource group.
|
410
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
411
|
+
# to the HTTP request.
|
412
|
+
#
|
413
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
414
|
+
#
|
415
|
+
def list_by_resource_group_async(resource_group_name, custom_headers:nil)
|
416
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
417
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
418
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
419
|
+
|
420
|
+
|
421
|
+
request_headers = {}
|
422
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
423
|
+
|
424
|
+
# Set Headers
|
425
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
426
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
427
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs'
|
428
|
+
|
429
|
+
request_url = @base_url || @client.base_url
|
430
|
+
|
431
|
+
options = {
|
432
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
433
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
434
|
+
query_params: {'api-version' => @client.api_version},
|
435
|
+
headers: request_headers.merge(custom_headers || {}),
|
436
|
+
base_url: request_url
|
437
|
+
}
|
438
|
+
promise = @client.make_request_async(:get, path_template, options)
|
439
|
+
|
440
|
+
promise = promise.then do |result|
|
441
|
+
http_response = result.response
|
442
|
+
status_code = http_response.status
|
443
|
+
response_content = http_response.body
|
444
|
+
unless status_code == 200
|
445
|
+
error_model = JSON.load(response_content)
|
446
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
447
|
+
end
|
448
|
+
|
449
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
450
|
+
# Deserialize Response
|
451
|
+
if status_code == 200
|
452
|
+
begin
|
453
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
454
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::HubListResult.mapper()
|
455
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
456
|
+
rescue Exception => e
|
457
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
result
|
462
|
+
end
|
463
|
+
|
464
|
+
promise.execute
|
465
|
+
end
|
466
|
+
|
467
|
+
#
|
468
|
+
# Gets all hubs in the specified subscription.
|
469
|
+
#
|
470
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
471
|
+
# will be added to the HTTP request.
|
472
|
+
#
|
473
|
+
# @return [Array<Hub>] operation results.
|
474
|
+
#
|
475
|
+
def list(custom_headers:nil)
|
476
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
477
|
+
first_page.get_all_items
|
478
|
+
end
|
479
|
+
|
480
|
+
#
|
481
|
+
# Gets all hubs in the specified subscription.
|
482
|
+
#
|
483
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
484
|
+
# will be added to the HTTP request.
|
485
|
+
#
|
486
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
487
|
+
#
|
488
|
+
def list_with_http_info(custom_headers:nil)
|
489
|
+
list_async(custom_headers:custom_headers).value!
|
490
|
+
end
|
491
|
+
|
492
|
+
#
|
493
|
+
# Gets all hubs in the specified subscription.
|
494
|
+
#
|
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_async(custom_headers:nil)
|
501
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
502
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
503
|
+
|
504
|
+
|
505
|
+
request_headers = {}
|
506
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
507
|
+
|
508
|
+
# Set Headers
|
509
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
510
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
511
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CustomerInsights/hubs'
|
512
|
+
|
513
|
+
request_url = @base_url || @client.base_url
|
514
|
+
|
515
|
+
options = {
|
516
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
517
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
518
|
+
query_params: {'api-version' => @client.api_version},
|
519
|
+
headers: request_headers.merge(custom_headers || {}),
|
520
|
+
base_url: request_url
|
521
|
+
}
|
522
|
+
promise = @client.make_request_async(:get, path_template, options)
|
523
|
+
|
524
|
+
promise = promise.then do |result|
|
525
|
+
http_response = result.response
|
526
|
+
status_code = http_response.status
|
527
|
+
response_content = http_response.body
|
528
|
+
unless status_code == 200
|
529
|
+
error_model = JSON.load(response_content)
|
530
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
531
|
+
end
|
532
|
+
|
533
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
534
|
+
# Deserialize Response
|
535
|
+
if status_code == 200
|
536
|
+
begin
|
537
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
538
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::HubListResult.mapper()
|
539
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
540
|
+
rescue Exception => e
|
541
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
result
|
546
|
+
end
|
547
|
+
|
548
|
+
promise.execute
|
549
|
+
end
|
550
|
+
|
551
|
+
#
|
552
|
+
# Deletes the specified hub.
|
553
|
+
#
|
554
|
+
# @param resource_group_name [String] The name of the resource group.
|
555
|
+
# @param hub_name [String] The name of the hub.
|
556
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
557
|
+
# will be added to the HTTP request.
|
558
|
+
#
|
559
|
+
#
|
560
|
+
def begin_delete(resource_group_name, hub_name, custom_headers:nil)
|
561
|
+
response = begin_delete_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
|
562
|
+
nil
|
563
|
+
end
|
564
|
+
|
565
|
+
#
|
566
|
+
# Deletes the specified hub.
|
567
|
+
#
|
568
|
+
# @param resource_group_name [String] The name of the resource group.
|
569
|
+
# @param hub_name [String] The name of the hub.
|
570
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
571
|
+
# will be added to the HTTP request.
|
572
|
+
#
|
573
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
574
|
+
#
|
575
|
+
def begin_delete_with_http_info(resource_group_name, hub_name, custom_headers:nil)
|
576
|
+
begin_delete_async(resource_group_name, hub_name, custom_headers:custom_headers).value!
|
577
|
+
end
|
578
|
+
|
579
|
+
#
|
580
|
+
# Deletes the specified hub.
|
581
|
+
#
|
582
|
+
# @param resource_group_name [String] The name of the resource group.
|
583
|
+
# @param hub_name [String] The name of the hub.
|
584
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
585
|
+
# to the HTTP request.
|
586
|
+
#
|
587
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
588
|
+
#
|
589
|
+
def begin_delete_async(resource_group_name, hub_name, custom_headers:nil)
|
590
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
591
|
+
fail ArgumentError, 'hub_name is nil' if hub_name.nil?
|
592
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
593
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
594
|
+
|
595
|
+
|
596
|
+
request_headers = {}
|
597
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
598
|
+
|
599
|
+
# Set Headers
|
600
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
601
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
602
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}'
|
603
|
+
|
604
|
+
request_url = @base_url || @client.base_url
|
605
|
+
|
606
|
+
options = {
|
607
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
608
|
+
path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
|
609
|
+
query_params: {'api-version' => @client.api_version},
|
610
|
+
headers: request_headers.merge(custom_headers || {}),
|
611
|
+
base_url: request_url
|
612
|
+
}
|
613
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
614
|
+
|
615
|
+
promise = promise.then do |result|
|
616
|
+
http_response = result.response
|
617
|
+
status_code = http_response.status
|
618
|
+
response_content = http_response.body
|
619
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
620
|
+
error_model = JSON.load(response_content)
|
621
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
622
|
+
end
|
623
|
+
|
624
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
625
|
+
|
626
|
+
result
|
627
|
+
end
|
628
|
+
|
629
|
+
promise.execute
|
630
|
+
end
|
631
|
+
|
632
|
+
#
|
633
|
+
# Gets all the hubs in a resource group.
|
634
|
+
#
|
635
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
636
|
+
# to List operation.
|
637
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
638
|
+
# will be added to the HTTP request.
|
639
|
+
#
|
640
|
+
# @return [HubListResult] operation results.
|
641
|
+
#
|
642
|
+
def list_by_resource_group_next(next_page_link, custom_headers:nil)
|
643
|
+
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
644
|
+
response.body unless response.nil?
|
645
|
+
end
|
646
|
+
|
647
|
+
#
|
648
|
+
# Gets all the hubs in a resource group.
|
649
|
+
#
|
650
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
651
|
+
# to List operation.
|
652
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
653
|
+
# will be added to the HTTP request.
|
654
|
+
#
|
655
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
656
|
+
#
|
657
|
+
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
|
658
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
659
|
+
end
|
660
|
+
|
661
|
+
#
|
662
|
+
# Gets all the hubs in a resource group.
|
663
|
+
#
|
664
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
665
|
+
# to List operation.
|
666
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
667
|
+
# to the HTTP request.
|
668
|
+
#
|
669
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
670
|
+
#
|
671
|
+
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
|
672
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
673
|
+
|
674
|
+
|
675
|
+
request_headers = {}
|
676
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
677
|
+
|
678
|
+
# Set Headers
|
679
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
680
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
681
|
+
path_template = '{nextLink}'
|
682
|
+
|
683
|
+
request_url = @base_url || @client.base_url
|
684
|
+
|
685
|
+
options = {
|
686
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
687
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
688
|
+
headers: request_headers.merge(custom_headers || {}),
|
689
|
+
base_url: request_url
|
690
|
+
}
|
691
|
+
promise = @client.make_request_async(:get, path_template, options)
|
692
|
+
|
693
|
+
promise = promise.then do |result|
|
694
|
+
http_response = result.response
|
695
|
+
status_code = http_response.status
|
696
|
+
response_content = http_response.body
|
697
|
+
unless status_code == 200
|
698
|
+
error_model = JSON.load(response_content)
|
699
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
700
|
+
end
|
701
|
+
|
702
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
703
|
+
# Deserialize Response
|
704
|
+
if status_code == 200
|
705
|
+
begin
|
706
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
707
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::HubListResult.mapper()
|
708
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
709
|
+
rescue Exception => e
|
710
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
711
|
+
end
|
712
|
+
end
|
713
|
+
|
714
|
+
result
|
715
|
+
end
|
716
|
+
|
717
|
+
promise.execute
|
718
|
+
end
|
719
|
+
|
720
|
+
#
|
721
|
+
# Gets all hubs in the specified subscription.
|
722
|
+
#
|
723
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
724
|
+
# to List operation.
|
725
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
726
|
+
# will be added to the HTTP request.
|
727
|
+
#
|
728
|
+
# @return [HubListResult] operation results.
|
729
|
+
#
|
730
|
+
def list_next(next_page_link, custom_headers:nil)
|
731
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
732
|
+
response.body unless response.nil?
|
733
|
+
end
|
734
|
+
|
735
|
+
#
|
736
|
+
# Gets all hubs in the specified subscription.
|
737
|
+
#
|
738
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
739
|
+
# to List operation.
|
740
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
741
|
+
# will be added to the HTTP request.
|
742
|
+
#
|
743
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
744
|
+
#
|
745
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
746
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
747
|
+
end
|
748
|
+
|
749
|
+
#
|
750
|
+
# Gets all hubs in the specified subscription.
|
751
|
+
#
|
752
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
753
|
+
# to List operation.
|
754
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
755
|
+
# to the HTTP request.
|
756
|
+
#
|
757
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
758
|
+
#
|
759
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
760
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
761
|
+
|
762
|
+
|
763
|
+
request_headers = {}
|
764
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
765
|
+
|
766
|
+
# Set Headers
|
767
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
768
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
769
|
+
path_template = '{nextLink}'
|
770
|
+
|
771
|
+
request_url = @base_url || @client.base_url
|
772
|
+
|
773
|
+
options = {
|
774
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
775
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
776
|
+
headers: request_headers.merge(custom_headers || {}),
|
777
|
+
base_url: request_url
|
778
|
+
}
|
779
|
+
promise = @client.make_request_async(:get, path_template, options)
|
780
|
+
|
781
|
+
promise = promise.then do |result|
|
782
|
+
http_response = result.response
|
783
|
+
status_code = http_response.status
|
784
|
+
response_content = http_response.body
|
785
|
+
unless status_code == 200
|
786
|
+
error_model = JSON.load(response_content)
|
787
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
788
|
+
end
|
789
|
+
|
790
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
791
|
+
# Deserialize Response
|
792
|
+
if status_code == 200
|
793
|
+
begin
|
794
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
795
|
+
result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::HubListResult.mapper()
|
796
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
797
|
+
rescue Exception => e
|
798
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
802
|
+
result
|
803
|
+
end
|
804
|
+
|
805
|
+
promise.execute
|
806
|
+
end
|
807
|
+
|
808
|
+
#
|
809
|
+
# Gets all the hubs in a resource group.
|
810
|
+
#
|
811
|
+
# @param resource_group_name [String] The name of the resource group.
|
812
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
813
|
+
# will be added to the HTTP request.
|
814
|
+
#
|
815
|
+
# @return [HubListResult] which provide lazy access to pages of the response.
|
816
|
+
#
|
817
|
+
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
|
818
|
+
response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
819
|
+
unless response.nil?
|
820
|
+
page = response.body
|
821
|
+
page.next_method = Proc.new do |next_page_link|
|
822
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
|
823
|
+
end
|
824
|
+
page
|
825
|
+
end
|
826
|
+
end
|
827
|
+
|
828
|
+
#
|
829
|
+
# Gets all hubs in the specified subscription.
|
830
|
+
#
|
831
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
832
|
+
# will be added to the HTTP request.
|
833
|
+
#
|
834
|
+
# @return [HubListResult] which provide lazy access to pages of the response.
|
835
|
+
#
|
836
|
+
def list_as_lazy(custom_headers:nil)
|
837
|
+
response = list_async(custom_headers:custom_headers).value!
|
838
|
+
unless response.nil?
|
839
|
+
page = response.body
|
840
|
+
page.next_method = Proc.new do |next_page_link|
|
841
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
842
|
+
end
|
843
|
+
page
|
844
|
+
end
|
845
|
+
end
|
846
|
+
|
847
|
+
end
|
848
|
+
end
|