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,174 @@
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
+ module Models
8
+ #
9
+ # The WidgetTypeResourceFormat
10
+ #
11
+ class WidgetTypeResourceFormat < ProxyResource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Name of the widget type.
16
+ attr_accessor :widget_type_name
17
+
18
+ # @return [String] Definition for widget type.
19
+ attr_accessor :definition
20
+
21
+ # @return [String] Description for widget type.
22
+ attr_accessor :description
23
+
24
+ # @return [Hash{String => String}] Localized display name for the widget
25
+ # type.
26
+ attr_accessor :display_name
27
+
28
+ # @return [String] The image URL.
29
+ attr_accessor :image_url
30
+
31
+ # @return [String] The hub name.
32
+ attr_accessor :tenant_id
33
+
34
+ # @return [String] The widget version.
35
+ attr_accessor :widget_version
36
+
37
+ # @return [DateTime] Date time when widget type was last modified.
38
+ attr_accessor :changed
39
+
40
+ # @return [DateTime] Date time when widget type was created.
41
+ attr_accessor :created
42
+
43
+
44
+ #
45
+ # Mapper for WidgetTypeResourceFormat class as Ruby Hash.
46
+ # This will be used for serialization/deserialization.
47
+ #
48
+ def self.mapper()
49
+ {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'WidgetTypeResourceFormat',
53
+ type: {
54
+ name: 'Composite',
55
+ class_name: 'WidgetTypeResourceFormat',
56
+ model_properties: {
57
+ id: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ read_only: true,
61
+ serialized_name: 'id',
62
+ type: {
63
+ name: 'String'
64
+ }
65
+ },
66
+ name: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ read_only: true,
70
+ serialized_name: 'name',
71
+ type: {
72
+ name: 'String'
73
+ }
74
+ },
75
+ type: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ read_only: true,
79
+ serialized_name: 'type',
80
+ type: {
81
+ name: 'String'
82
+ }
83
+ },
84
+ widget_type_name: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ read_only: true,
88
+ serialized_name: 'properties.widgetTypeName',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ },
93
+ definition: {
94
+ client_side_validation: true,
95
+ required: true,
96
+ serialized_name: 'properties.definition',
97
+ type: {
98
+ name: 'String'
99
+ }
100
+ },
101
+ description: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ serialized_name: 'properties.description',
105
+ type: {
106
+ name: 'String'
107
+ }
108
+ },
109
+ display_name: {
110
+ client_side_validation: true,
111
+ required: false,
112
+ serialized_name: 'properties.displayName',
113
+ type: {
114
+ name: 'Dictionary',
115
+ value: {
116
+ client_side_validation: true,
117
+ required: false,
118
+ serialized_name: 'StringElementType',
119
+ type: {
120
+ name: 'String'
121
+ }
122
+ }
123
+ }
124
+ },
125
+ image_url: {
126
+ client_side_validation: true,
127
+ required: false,
128
+ serialized_name: 'properties.imageUrl',
129
+ type: {
130
+ name: 'String'
131
+ }
132
+ },
133
+ tenant_id: {
134
+ client_side_validation: true,
135
+ required: false,
136
+ read_only: true,
137
+ serialized_name: 'properties.tenantId',
138
+ type: {
139
+ name: 'String'
140
+ }
141
+ },
142
+ widget_version: {
143
+ client_side_validation: true,
144
+ required: false,
145
+ serialized_name: 'properties.widgetVersion',
146
+ type: {
147
+ name: 'String'
148
+ }
149
+ },
150
+ changed: {
151
+ client_side_validation: true,
152
+ required: false,
153
+ read_only: true,
154
+ serialized_name: 'properties.changed',
155
+ type: {
156
+ name: 'DateTime'
157
+ }
158
+ },
159
+ created: {
160
+ client_side_validation: true,
161
+ required: false,
162
+ read_only: true,
163
+ serialized_name: 'properties.created',
164
+ type: {
165
+ name: 'DateTime'
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ end
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::CustomerInsights end
8
+ module Azure::CustomerInsights::Mgmt end
9
+ module Azure::CustomerInsights::Mgmt::V2017_01_01 end
@@ -0,0 +1,218 @@
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 Operations
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Operations 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
+ # Lists all of the available Customer Insights REST API operations.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<Operation>] operation results.
34
+ #
35
+ def list(custom_headers:nil)
36
+ first_page = list_as_lazy(custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Lists all of the available Customer Insights REST API operations.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def list_with_http_info(custom_headers:nil)
49
+ list_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # Lists all of the available Customer Insights REST API operations.
54
+ #
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+
63
+
64
+ request_headers = {}
65
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'providers/Microsoft.CustomerInsights/operations'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ query_params: {'api-version' => @client.api_version},
77
+ headers: request_headers.merge(custom_headers || {}),
78
+ base_url: request_url
79
+ }
80
+ promise = @client.make_request_async(:get, path_template, options)
81
+
82
+ promise = promise.then do |result|
83
+ http_response = result.response
84
+ status_code = http_response.status
85
+ response_content = http_response.body
86
+ unless status_code == 200
87
+ error_model = JSON.load(response_content)
88
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
89
+ end
90
+
91
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ # Deserialize Response
93
+ if status_code == 200
94
+ begin
95
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
96
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::OperationListResult.mapper()
97
+ result.body = @client.deserialize(result_mapper, parsed_response)
98
+ rescue Exception => e
99
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
100
+ end
101
+ end
102
+
103
+ result
104
+ end
105
+
106
+ promise.execute
107
+ end
108
+
109
+ #
110
+ # Lists all of the available Customer Insights REST API operations.
111
+ #
112
+ # @param next_page_link [String] The NextLink from the previous successful call
113
+ # to List operation.
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [OperationListResult] operation results.
118
+ #
119
+ def list_next(next_page_link, custom_headers:nil)
120
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
121
+ response.body unless response.nil?
122
+ end
123
+
124
+ #
125
+ # Lists all of the available Customer Insights REST API operations.
126
+ #
127
+ # @param next_page_link [String] The NextLink from the previous successful call
128
+ # to List operation.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
133
+ #
134
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
135
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
136
+ end
137
+
138
+ #
139
+ # Lists all of the available Customer Insights REST API operations.
140
+ #
141
+ # @param next_page_link [String] The NextLink from the previous successful call
142
+ # to List operation.
143
+ # @param [Hash{String => String}] A hash of custom headers that will be added
144
+ # to the HTTP request.
145
+ #
146
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
147
+ #
148
+ def list_next_async(next_page_link, custom_headers:nil)
149
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
150
+
151
+
152
+ request_headers = {}
153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
154
+
155
+ # Set Headers
156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
158
+ path_template = '{nextLink}'
159
+
160
+ request_url = @base_url || @client.base_url
161
+
162
+ options = {
163
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
164
+ skip_encoding_path_params: {'nextLink' => next_page_link},
165
+ headers: request_headers.merge(custom_headers || {}),
166
+ base_url: request_url
167
+ }
168
+ promise = @client.make_request_async(:get, path_template, options)
169
+
170
+ promise = promise.then do |result|
171
+ http_response = result.response
172
+ status_code = http_response.status
173
+ response_content = http_response.body
174
+ unless status_code == 200
175
+ error_model = JSON.load(response_content)
176
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
177
+ end
178
+
179
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
180
+ # Deserialize Response
181
+ if status_code == 200
182
+ begin
183
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
184
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::OperationListResult.mapper()
185
+ result.body = @client.deserialize(result_mapper, parsed_response)
186
+ rescue Exception => e
187
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
188
+ end
189
+ end
190
+
191
+ result
192
+ end
193
+
194
+ promise.execute
195
+ end
196
+
197
+ #
198
+ # Lists all of the available Customer Insights REST API operations.
199
+ #
200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
201
+ # will be added to the HTTP request.
202
+ #
203
+ # @return [OperationListResult] which provide lazy access to pages of the
204
+ # response.
205
+ #
206
+ def list_as_lazy(custom_headers:nil)
207
+ response = list_async(custom_headers:custom_headers).value!
208
+ unless response.nil?
209
+ page = response.body
210
+ page.next_method = Proc.new do |next_page_link|
211
+ list_next_async(next_page_link, custom_headers:custom_headers)
212
+ end
213
+ page
214
+ end
215
+ end
216
+
217
+ end
218
+ end
@@ -0,0 +1,742 @@
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 Profiles
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Profiles 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 profile within a Hub, or updates an existing profile.
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 profile_name [String] The name of the profile.
33
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
34
+ # create/delete Profile type operation
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [ProfileResourceFormat] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, hub_name, profile_name, parameters, custom_headers:nil)
41
+ response = create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param hub_name [String] The name of the hub.
48
+ # @param profile_name [String] The name of the profile.
49
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
50
+ # create/delete Profile type operation
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [Concurrent::Promise] promise which provides async access to http
55
+ # response.
56
+ #
57
+ def create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:nil)
58
+ # Send request
59
+ promise = begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:custom_headers)
60
+
61
+ promise = promise.then do |response|
62
+ # Defining deserialization method.
63
+ deserialize_method = lambda do |parsed_response|
64
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileResourceFormat.mapper()
65
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
66
+ end
67
+
68
+ # Waiting for response.
69
+ @client.get_long_running_operation_result(response, deserialize_method)
70
+ end
71
+
72
+ promise
73
+ end
74
+
75
+ #
76
+ # Gets information about the specified profile.
77
+ #
78
+ # @param resource_group_name [String] The name of the resource group.
79
+ # @param hub_name [String] The name of the hub.
80
+ # @param profile_name [String] The name of the profile.
81
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
82
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
83
+ # will be added to the HTTP request.
84
+ #
85
+ # @return [ProfileResourceFormat] operation results.
86
+ #
87
+ def get(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
88
+ response = get_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers).value!
89
+ response.body unless response.nil?
90
+ end
91
+
92
+ #
93
+ # Gets information about the specified profile.
94
+ #
95
+ # @param resource_group_name [String] The name of the resource group.
96
+ # @param hub_name [String] The name of the hub.
97
+ # @param profile_name [String] The name of the profile.
98
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
99
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
100
+ # will be added to the HTTP request.
101
+ #
102
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
103
+ #
104
+ def get_with_http_info(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
105
+ get_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers).value!
106
+ end
107
+
108
+ #
109
+ # Gets information about the specified profile.
110
+ #
111
+ # @param resource_group_name [String] The name of the resource group.
112
+ # @param hub_name [String] The name of the hub.
113
+ # @param profile_name [String] The name of the profile.
114
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
115
+ # @param [Hash{String => String}] A hash of custom headers that will be added
116
+ # to the HTTP request.
117
+ #
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def get_async(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
121
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
122
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
123
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
124
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
125
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
126
+
127
+
128
+ request_headers = {}
129
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
130
+
131
+ # Set Headers
132
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
133
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
134
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
135
+
136
+ request_url = @base_url || @client.base_url
137
+
138
+ options = {
139
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
140
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
141
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
142
+ headers: request_headers.merge(custom_headers || {}),
143
+ base_url: request_url
144
+ }
145
+ promise = @client.make_request_async(:get, path_template, options)
146
+
147
+ promise = promise.then do |result|
148
+ http_response = result.response
149
+ status_code = http_response.status
150
+ response_content = http_response.body
151
+ unless status_code == 200
152
+ error_model = JSON.load(response_content)
153
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
154
+ end
155
+
156
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
157
+ # Deserialize Response
158
+ if status_code == 200
159
+ begin
160
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
161
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileResourceFormat.mapper()
162
+ result.body = @client.deserialize(result_mapper, parsed_response)
163
+ rescue Exception => e
164
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
165
+ end
166
+ end
167
+
168
+ result
169
+ end
170
+
171
+ promise.execute
172
+ end
173
+
174
+ #
175
+ # Deletes a profile within a hub
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 profile_name [String] The name of the profile.
180
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
181
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
182
+ # will be added to the HTTP request.
183
+ #
184
+ def delete(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
185
+ response = delete_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers).value!
186
+ nil
187
+ end
188
+
189
+ #
190
+ # @param resource_group_name [String] The name of the resource group.
191
+ # @param hub_name [String] The name of the hub.
192
+ # @param profile_name [String] The name of the profile.
193
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
194
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
195
+ # will be added to the HTTP request.
196
+ #
197
+ # @return [Concurrent::Promise] promise which provides async access to http
198
+ # response.
199
+ #
200
+ def delete_async(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
201
+ # Send request
202
+ promise = begin_delete_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers)
203
+
204
+ promise = promise.then do |response|
205
+ # Defining deserialization method.
206
+ deserialize_method = lambda do |parsed_response|
207
+ end
208
+
209
+ # Waiting for response.
210
+ @client.get_long_running_operation_result(response, deserialize_method)
211
+ end
212
+
213
+ promise
214
+ end
215
+
216
+ #
217
+ # Gets all profile in the hub.
218
+ #
219
+ # @param resource_group_name [String] The name of the resource group.
220
+ # @param hub_name [String] The name of the hub.
221
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
222
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
223
+ # will be added to the HTTP request.
224
+ #
225
+ # @return [Array<ProfileResourceFormat>] operation results.
226
+ #
227
+ def list_by_hub(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil)
228
+ first_page = list_by_hub_as_lazy(resource_group_name, hub_name, locale_code:locale_code, custom_headers:custom_headers)
229
+ first_page.get_all_items
230
+ end
231
+
232
+ #
233
+ # Gets all profile in the hub.
234
+ #
235
+ # @param resource_group_name [String] The name of the resource group.
236
+ # @param hub_name [String] The name of the hub.
237
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
239
+ # will be added to the HTTP request.
240
+ #
241
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
242
+ #
243
+ def list_by_hub_with_http_info(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil)
244
+ list_by_hub_async(resource_group_name, hub_name, locale_code:locale_code, custom_headers:custom_headers).value!
245
+ end
246
+
247
+ #
248
+ # Gets all profile in the hub.
249
+ #
250
+ # @param resource_group_name [String] The name of the resource group.
251
+ # @param hub_name [String] The name of the hub.
252
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
253
+ # @param [Hash{String => String}] A hash of custom headers that will be added
254
+ # to the HTTP request.
255
+ #
256
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
257
+ #
258
+ def list_by_hub_async(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil)
259
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
260
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
262
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
263
+
264
+
265
+ request_headers = {}
266
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
267
+
268
+ # Set Headers
269
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
270
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
271
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles'
272
+
273
+ request_url = @base_url || @client.base_url
274
+
275
+ options = {
276
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
277
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'subscriptionId' => @client.subscription_id},
278
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
279
+ headers: request_headers.merge(custom_headers || {}),
280
+ base_url: request_url
281
+ }
282
+ promise = @client.make_request_async(:get, path_template, options)
283
+
284
+ promise = promise.then do |result|
285
+ http_response = result.response
286
+ status_code = http_response.status
287
+ response_content = http_response.body
288
+ unless status_code == 200
289
+ error_model = JSON.load(response_content)
290
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
291
+ end
292
+
293
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
294
+ # Deserialize Response
295
+ if status_code == 200
296
+ begin
297
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
298
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileListResult.mapper()
299
+ result.body = @client.deserialize(result_mapper, parsed_response)
300
+ rescue Exception => e
301
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
302
+ end
303
+ end
304
+
305
+ result
306
+ end
307
+
308
+ promise.execute
309
+ end
310
+
311
+ #
312
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
313
+ # Enrichment happens through participants of the Interaction on an Interaction
314
+ # KPI and through Relationships for Profile KPIs.
315
+ #
316
+ # @param resource_group_name [String] The name of the resource group.
317
+ # @param hub_name [String] The name of the hub.
318
+ # @param profile_name [String] The name of the profile.
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ # @return [Array] operation results.
323
+ #
324
+ def get_enriching_kpis(resource_group_name, hub_name, profile_name, custom_headers:nil)
325
+ response = get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers:custom_headers).value!
326
+ response.body unless response.nil?
327
+ end
328
+
329
+ #
330
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
331
+ # Enrichment happens through participants of the Interaction on an Interaction
332
+ # KPI and through Relationships for Profile KPIs.
333
+ #
334
+ # @param resource_group_name [String] The name of the resource group.
335
+ # @param hub_name [String] The name of the hub.
336
+ # @param profile_name [String] The name of the profile.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
341
+ #
342
+ def get_enriching_kpis_with_http_info(resource_group_name, hub_name, profile_name, custom_headers:nil)
343
+ get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers:custom_headers).value!
344
+ end
345
+
346
+ #
347
+ # Gets the KPIs that enrich the profile Type identified by the supplied name.
348
+ # Enrichment happens through participants of the Interaction on an Interaction
349
+ # KPI and through Relationships for Profile KPIs.
350
+ #
351
+ # @param resource_group_name [String] The name of the resource group.
352
+ # @param hub_name [String] The name of the hub.
353
+ # @param profile_name [String] The name of the profile.
354
+ # @param [Hash{String => String}] A hash of custom headers that will be added
355
+ # to the HTTP request.
356
+ #
357
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
358
+ #
359
+ def get_enriching_kpis_async(resource_group_name, hub_name, profile_name, custom_headers:nil)
360
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
361
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
362
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
363
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
364
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
365
+
366
+
367
+ request_headers = {}
368
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
369
+
370
+ # Set Headers
371
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
372
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
373
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}/getEnrichingKpis'
374
+
375
+ request_url = @base_url || @client.base_url
376
+
377
+ options = {
378
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
379
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
380
+ query_params: {'api-version' => @client.api_version},
381
+ headers: request_headers.merge(custom_headers || {}),
382
+ base_url: request_url
383
+ }
384
+ promise = @client.make_request_async(:post, path_template, options)
385
+
386
+ promise = promise.then do |result|
387
+ http_response = result.response
388
+ status_code = http_response.status
389
+ response_content = http_response.body
390
+ unless status_code == 200
391
+ error_model = JSON.load(response_content)
392
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
393
+ end
394
+
395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = {
401
+ client_side_validation: true,
402
+ required: false,
403
+ serialized_name: 'parsed_response',
404
+ type: {
405
+ name: 'Sequence',
406
+ element: {
407
+ client_side_validation: true,
408
+ required: false,
409
+ serialized_name: 'KpiDefinitionElementType',
410
+ type: {
411
+ name: 'Composite',
412
+ class_name: 'KpiDefinition'
413
+ }
414
+ }
415
+ }
416
+ }
417
+ result.body = @client.deserialize(result_mapper, parsed_response)
418
+ rescue Exception => e
419
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
420
+ end
421
+ end
422
+
423
+ result
424
+ end
425
+
426
+ promise.execute
427
+ end
428
+
429
+ #
430
+ # Creates a profile within a Hub, or updates an existing profile.
431
+ #
432
+ # @param resource_group_name [String] The name of the resource group.
433
+ # @param hub_name [String] The name of the hub.
434
+ # @param profile_name [String] The name of the profile.
435
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
436
+ # create/delete Profile type operation
437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
438
+ # will be added to the HTTP request.
439
+ #
440
+ # @return [ProfileResourceFormat] operation results.
441
+ #
442
+ def begin_create_or_update(resource_group_name, hub_name, profile_name, parameters, custom_headers:nil)
443
+ response = begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:custom_headers).value!
444
+ response.body unless response.nil?
445
+ end
446
+
447
+ #
448
+ # Creates a profile within a Hub, or updates an existing profile.
449
+ #
450
+ # @param resource_group_name [String] The name of the resource group.
451
+ # @param hub_name [String] The name of the hub.
452
+ # @param profile_name [String] The name of the profile.
453
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
454
+ # create/delete Profile type operation
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
459
+ #
460
+ def begin_create_or_update_with_http_info(resource_group_name, hub_name, profile_name, parameters, custom_headers:nil)
461
+ begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:custom_headers).value!
462
+ end
463
+
464
+ #
465
+ # Creates a profile within a Hub, or updates an existing profile.
466
+ #
467
+ # @param resource_group_name [String] The name of the resource group.
468
+ # @param hub_name [String] The name of the hub.
469
+ # @param profile_name [String] The name of the profile.
470
+ # @param parameters [ProfileResourceFormat] Parameters supplied to the
471
+ # create/delete Profile type operation
472
+ # @param [Hash{String => String}] A hash of custom headers that will be added
473
+ # to the HTTP request.
474
+ #
475
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
476
+ #
477
+ def begin_create_or_update_async(resource_group_name, hub_name, profile_name, parameters, custom_headers:nil)
478
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
479
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
480
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
481
+ fail ArgumentError, "'profile_name' should satisfy the constraint - 'MaxLength': '128'" if !profile_name.nil? && profile_name.length > 128
482
+ fail ArgumentError, "'profile_name' should satisfy the constraint - 'MinLength': '1'" if !profile_name.nil? && profile_name.length < 1
483
+ fail ArgumentError, "'profile_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z][a-zA-Z0-9_]+$'" if !profile_name.nil? && profile_name.match(Regexp.new('^^[a-zA-Z][a-zA-Z0-9_]+$$')).nil?
484
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
485
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
486
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
487
+
488
+
489
+ request_headers = {}
490
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
491
+
492
+ # Set Headers
493
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
494
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
495
+
496
+ # Serialize Request
497
+ request_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileResourceFormat.mapper()
498
+ request_content = @client.serialize(request_mapper, parameters)
499
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
500
+
501
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
502
+
503
+ request_url = @base_url || @client.base_url
504
+
505
+ options = {
506
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
507
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
508
+ query_params: {'api-version' => @client.api_version},
509
+ body: request_content,
510
+ headers: request_headers.merge(custom_headers || {}),
511
+ base_url: request_url
512
+ }
513
+ promise = @client.make_request_async(:put, path_template, options)
514
+
515
+ promise = promise.then do |result|
516
+ http_response = result.response
517
+ status_code = http_response.status
518
+ response_content = http_response.body
519
+ unless status_code == 200 || status_code == 202
520
+ error_model = JSON.load(response_content)
521
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
522
+ end
523
+
524
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
525
+ # Deserialize Response
526
+ if status_code == 200
527
+ begin
528
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
529
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileResourceFormat.mapper()
530
+ result.body = @client.deserialize(result_mapper, parsed_response)
531
+ rescue Exception => e
532
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
533
+ end
534
+ end
535
+
536
+ result
537
+ end
538
+
539
+ promise.execute
540
+ end
541
+
542
+ #
543
+ # Deletes a profile within a hub
544
+ #
545
+ # @param resource_group_name [String] The name of the resource group.
546
+ # @param hub_name [String] The name of the hub.
547
+ # @param profile_name [String] The name of the profile.
548
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
+ # will be added to the HTTP request.
551
+ #
552
+ #
553
+ def begin_delete(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
554
+ response = begin_delete_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers).value!
555
+ nil
556
+ end
557
+
558
+ #
559
+ # Deletes a profile within a hub
560
+ #
561
+ # @param resource_group_name [String] The name of the resource group.
562
+ # @param hub_name [String] The name of the hub.
563
+ # @param profile_name [String] The name of the profile.
564
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
565
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
566
+ # will be added to the HTTP request.
567
+ #
568
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
569
+ #
570
+ def begin_delete_with_http_info(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
571
+ begin_delete_async(resource_group_name, hub_name, profile_name, locale_code:locale_code, custom_headers:custom_headers).value!
572
+ end
573
+
574
+ #
575
+ # Deletes a profile within a hub
576
+ #
577
+ # @param resource_group_name [String] The name of the resource group.
578
+ # @param hub_name [String] The name of the hub.
579
+ # @param profile_name [String] The name of the profile.
580
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
581
+ # @param [Hash{String => String}] A hash of custom headers that will be added
582
+ # to the HTTP request.
583
+ #
584
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
585
+ #
586
+ def begin_delete_async(resource_group_name, hub_name, profile_name, locale_code:'en-us', custom_headers:nil)
587
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
588
+ fail ArgumentError, 'hub_name is nil' if hub_name.nil?
589
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
590
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
591
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
592
+
593
+
594
+ request_headers = {}
595
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
596
+
597
+ # Set Headers
598
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
599
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
600
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/profiles/{profileName}'
601
+
602
+ request_url = @base_url || @client.base_url
603
+
604
+ options = {
605
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
606
+ path_params: {'resourceGroupName' => resource_group_name,'hubName' => hub_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
607
+ query_params: {'locale-code' => locale_code,'api-version' => @client.api_version},
608
+ headers: request_headers.merge(custom_headers || {}),
609
+ base_url: request_url
610
+ }
611
+ promise = @client.make_request_async(:delete, path_template, options)
612
+
613
+ promise = promise.then do |result|
614
+ http_response = result.response
615
+ status_code = http_response.status
616
+ response_content = http_response.body
617
+ unless status_code == 200 || status_code == 202 || status_code == 204
618
+ error_model = JSON.load(response_content)
619
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
620
+ end
621
+
622
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
623
+
624
+ result
625
+ end
626
+
627
+ promise.execute
628
+ end
629
+
630
+ #
631
+ # Gets all profile in the hub.
632
+ #
633
+ # @param next_page_link [String] The NextLink from the previous successful call
634
+ # to List operation.
635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
636
+ # will be added to the HTTP request.
637
+ #
638
+ # @return [ProfileListResult] operation results.
639
+ #
640
+ def list_by_hub_next(next_page_link, custom_headers:nil)
641
+ response = list_by_hub_next_async(next_page_link, custom_headers:custom_headers).value!
642
+ response.body unless response.nil?
643
+ end
644
+
645
+ #
646
+ # Gets all profile in the hub.
647
+ #
648
+ # @param next_page_link [String] The NextLink from the previous successful call
649
+ # to List operation.
650
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
651
+ # will be added to the HTTP request.
652
+ #
653
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
654
+ #
655
+ def list_by_hub_next_with_http_info(next_page_link, custom_headers:nil)
656
+ list_by_hub_next_async(next_page_link, custom_headers:custom_headers).value!
657
+ end
658
+
659
+ #
660
+ # Gets all profile in the hub.
661
+ #
662
+ # @param next_page_link [String] The NextLink from the previous successful call
663
+ # to List operation.
664
+ # @param [Hash{String => String}] A hash of custom headers that will be added
665
+ # to the HTTP request.
666
+ #
667
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
668
+ #
669
+ def list_by_hub_next_async(next_page_link, custom_headers:nil)
670
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
671
+
672
+
673
+ request_headers = {}
674
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
675
+
676
+ # Set Headers
677
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
678
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
679
+ path_template = '{nextLink}'
680
+
681
+ request_url = @base_url || @client.base_url
682
+
683
+ options = {
684
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
685
+ skip_encoding_path_params: {'nextLink' => next_page_link},
686
+ headers: request_headers.merge(custom_headers || {}),
687
+ base_url: request_url
688
+ }
689
+ promise = @client.make_request_async(:get, path_template, options)
690
+
691
+ promise = promise.then do |result|
692
+ http_response = result.response
693
+ status_code = http_response.status
694
+ response_content = http_response.body
695
+ unless status_code == 200
696
+ error_model = JSON.load(response_content)
697
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
698
+ end
699
+
700
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
701
+ # Deserialize Response
702
+ if status_code == 200
703
+ begin
704
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
705
+ result_mapper = Azure::CustomerInsights::Mgmt::V2017_01_01::Models::ProfileListResult.mapper()
706
+ result.body = @client.deserialize(result_mapper, parsed_response)
707
+ rescue Exception => e
708
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
709
+ end
710
+ end
711
+
712
+ result
713
+ end
714
+
715
+ promise.execute
716
+ end
717
+
718
+ #
719
+ # Gets all profile in the hub.
720
+ #
721
+ # @param resource_group_name [String] The name of the resource group.
722
+ # @param hub_name [String] The name of the hub.
723
+ # @param locale_code [String] Locale of profile to retrieve, default is en-us.
724
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
725
+ # will be added to the HTTP request.
726
+ #
727
+ # @return [ProfileListResult] which provide lazy access to pages of the
728
+ # response.
729
+ #
730
+ def list_by_hub_as_lazy(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil)
731
+ response = list_by_hub_async(resource_group_name, hub_name, locale_code:locale_code, custom_headers:custom_headers).value!
732
+ unless response.nil?
733
+ page = response.body
734
+ page.next_method = Proc.new do |next_page_link|
735
+ list_by_hub_next_async(next_page_link, custom_headers:custom_headers)
736
+ end
737
+ page
738
+ end
739
+ end
740
+
741
+ end
742
+ end