azure_cognitiveservices_luisauthoring 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring.rb +142 -0
  4. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb +2212 -0
  5. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/azure_accounts.rb +453 -0
  6. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/examples.rb +508 -0
  7. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb +668 -0
  8. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/luis_authoring_client.rb +167 -0
  9. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb +11482 -0
  10. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/app_version_setting_object.rb +57 -0
  11. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_create_object.rb +106 -0
  12. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_info_response.rb +158 -0
  13. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_publish_object.rb +59 -0
  14. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_setting_update_object.rb +47 -0
  15. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_settings.rb +58 -0
  16. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_update_object.rb +57 -0
  17. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/available_culture.rb +57 -0
  18. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/available_prebuilt_entity_model.rb +68 -0
  19. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/azure_account_info_object.rb +68 -0
  20. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/batch_label_example.rb +70 -0
  21. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/child_entity.rb +57 -0
  22. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list.rb +85 -0
  23. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_entity_extractor.rb +123 -0
  24. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_create_object.rb +66 -0
  25. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_patch_object.rb +55 -0
  26. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_update_object.rb +66 -0
  27. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/collaborators_array.rb +55 -0
  28. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_child_model_create_object.rb +47 -0
  29. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_extractor.rb +123 -0
  30. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_model.rb +65 -0
  31. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/custom_prebuilt_model.rb +125 -0
  32. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/endpoint_info.rb +125 -0
  33. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/enqueue_training_response.rb +58 -0
  34. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entities_suggestion_example.rb +106 -0
  35. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_extractor.rb +125 -0
  36. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label.rb +71 -0
  37. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label_object.rb +71 -0
  38. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_model_info.rb +87 -0
  39. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_prediction.rb +81 -0
  40. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role.rb +57 -0
  41. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role_create_object.rb +46 -0
  42. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role_update_object.rb +46 -0
  43. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/error_response.rb +65 -0
  44. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/example_label_object.rb +78 -0
  45. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item.rb +57 -0
  46. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_create_object.rb +46 -0
  47. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_update_object.rb +46 -0
  48. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/feature_info_object.rb +68 -0
  49. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/features_response_object.rb +75 -0
  50. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_entity.rb +77 -0
  51. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_model_create_object.rb +47 -0
  52. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_model_update_object.rb +47 -0
  53. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_extractor.rb +123 -0
  54. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_model.rb +65 -0
  55. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_model.rb +97 -0
  56. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intent_classifier.rb +89 -0
  57. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intent_prediction.rb +57 -0
  58. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intents_suggestion_example.rb +106 -0
  59. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonentity.rb +70 -0
  60. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonmodel_feature.rb +90 -0
  61. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonregex_feature.rb +68 -0
  62. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonutterance.rb +77 -0
  63. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_example_response.rb +57 -0
  64. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_text_object.rb +57 -0
  65. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/labeled_utterance.rb +148 -0
  66. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/luis_app.rb +318 -0
  67. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_create_object.rb +46 -0
  68. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info.rb +83 -0
  69. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info_response.rb +196 -0
  70. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_training_details.rb +91 -0
  71. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_training_info.rb +58 -0
  72. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_update_object.rb +46 -0
  73. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_error.rb +57 -0
  74. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_status.rb +58 -0
  75. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_status_type.rb +17 -0
  76. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any.rb +84 -0
  77. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_entity_extractor.rb +123 -0
  78. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_create_object.rb +65 -0
  79. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_update_object.rb +65 -0
  80. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_create_object.rb +57 -0
  81. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_feature_info.rb +70 -0
  82. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule.rb +57 -0
  83. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_create_object.rb +57 -0
  84. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_info.rb +68 -0
  85. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_update_object.rb +68 -0
  86. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_update_object.rb +70 -0
  87. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/personal_assistants_response.rb +74 -0
  88. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phrase_list_feature_info.rb +91 -0
  89. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phraselist_create_object.rb +81 -0
  90. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phraselist_update_object.rb +94 -0
  91. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain.rb +119 -0
  92. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_base_object.rb +47 -0
  93. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_object.rb +58 -0
  94. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_item.rb +69 -0
  95. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_model_create_object.rb +58 -0
  96. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_object.rb +58 -0
  97. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity.rb +65 -0
  98. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity_extractor.rb +103 -0
  99. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/production_or_staging_endpoint_info.rb +100 -0
  100. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/publish_setting_update_object.rb +71 -0
  101. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/publish_settings.rb +82 -0
  102. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_entity.rb +76 -0
  103. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_entity_extractor.rb +114 -0
  104. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_create_object.rb +57 -0
  105. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_update_object.rb +57 -0
  106. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list.rb +65 -0
  107. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list_response.rb +70 -0
  108. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/task_update_object.rb +46 -0
  109. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/training_status.rb +17 -0
  110. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/user_access_list.rb +65 -0
  111. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/user_collaborator.rb +47 -0
  112. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/version_info.rb +177 -0
  113. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_base_update_object.rb +65 -0
  114. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_object.rb +65 -0
  115. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/module_definition.rb +9 -0
  116. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/pattern.rb +963 -0
  117. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/permissions.rb +427 -0
  118. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/settings.rb +237 -0
  119. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/train.rb +247 -0
  120. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb +854 -0
  121. data/lib/azure_cognitiveservices_luisauthoring.rb +6 -0
  122. data/lib/module_definition.rb +7 -0
  123. data/lib/profiles/latest/luisauthoring_latest_profile_client.rb +38 -0
  124. data/lib/profiles/latest/luisauthoring_module_definition.rb +8 -0
  125. data/lib/profiles/latest/modules/luisauthoring_profile_module.rb +497 -0
  126. data/lib/version.rb +7 -0
  127. metadata +244 -0
@@ -0,0 +1,453 @@
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::CognitiveServices::LuisAuthoring::V2_0
7
+ #
8
+ # AzureAccounts
9
+ #
10
+ class AzureAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AzureAccounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [LuisAuthoringClient] reference to the LuisAuthoringClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # apps - Assign a LUIS azure account to an application
26
+ #
27
+ # Assigns an azure account to the application.
28
+ #
29
+ # @param app_id The application ID.
30
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
31
+ # information object.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [OperationStatus] operation results.
36
+ #
37
+ def assign_to_app(app_id, azure_account_info_object:nil, custom_headers:nil)
38
+ response = assign_to_app_async(app_id, azure_account_info_object:azure_account_info_object, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # apps - Assign a LUIS azure account to an application
44
+ #
45
+ # Assigns an azure account to the application.
46
+ #
47
+ # @param app_id The application ID.
48
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
49
+ # information object.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def assign_to_app_with_http_info(app_id, azure_account_info_object:nil, custom_headers:nil)
56
+ assign_to_app_async(app_id, azure_account_info_object:azure_account_info_object, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # apps - Assign a LUIS azure account to an application
61
+ #
62
+ # Assigns an azure account to the application.
63
+ #
64
+ # @param app_id The application ID.
65
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
66
+ # information object.
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 assign_to_app_async(app_id, azure_account_info_object:nil, custom_headers:nil)
73
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
74
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+
84
+ # Serialize Request
85
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::AzureAccountInfoObject.mapper()
86
+ request_content = @client.serialize(request_mapper, azure_account_info_object)
87
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
88
+
89
+ path_template = 'apps/{appId}/azureaccounts'
90
+
91
+ request_url = @base_url || @client.base_url
92
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'appId' => app_id},
97
+ body: request_content,
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:post, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 201
108
+ error_model = JSON.load(response_content)
109
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ # Deserialize Response
114
+ if status_code == 201
115
+ begin
116
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
117
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response)
119
+ rescue Exception => e
120
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
+ end
122
+ end
123
+
124
+ result
125
+ end
126
+
127
+ promise.execute
128
+ end
129
+
130
+ #
131
+ # apps - Get LUIS azure accounts assigned to the application
132
+ #
133
+ # Gets the LUIS azure accounts assigned to the application for the user using
134
+ # his ARM token.
135
+ #
136
+ # @param app_id The application ID.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [Array] operation results.
141
+ #
142
+ def get_assigned(app_id, custom_headers:nil)
143
+ response = get_assigned_async(app_id, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # apps - Get LUIS azure accounts assigned to the application
149
+ #
150
+ # Gets the LUIS azure accounts assigned to the application for the user using
151
+ # his ARM token.
152
+ #
153
+ # @param app_id The application ID.
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
158
+ #
159
+ def get_assigned_with_http_info(app_id, custom_headers:nil)
160
+ get_assigned_async(app_id, custom_headers:custom_headers).value!
161
+ end
162
+
163
+ #
164
+ # apps - Get LUIS azure accounts assigned to the application
165
+ #
166
+ # Gets the LUIS azure accounts assigned to the application for the user using
167
+ # his ARM token.
168
+ #
169
+ # @param app_id The application ID.
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_assigned_async(app_id, custom_headers:nil)
176
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
177
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'apps/{appId}/azureaccounts'
187
+
188
+ request_url = @base_url || @client.base_url
189
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
190
+
191
+ options = {
192
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
193
+ path_params: {'appId' => app_id},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = {
214
+ client_side_validation: true,
215
+ required: false,
216
+ serialized_name: 'parsed_response',
217
+ type: {
218
+ name: 'Sequence',
219
+ element: {
220
+ client_side_validation: true,
221
+ required: false,
222
+ serialized_name: 'AzureAccountInfoObjectElementType',
223
+ type: {
224
+ name: 'Composite',
225
+ class_name: 'AzureAccountInfoObject'
226
+ }
227
+ }
228
+ }
229
+ }
230
+ result.body = @client.deserialize(result_mapper, parsed_response)
231
+ rescue Exception => e
232
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
233
+ end
234
+ end
235
+
236
+ result
237
+ end
238
+
239
+ promise.execute
240
+ end
241
+
242
+ #
243
+ # apps - Removes an assigned LUIS azure account from an application
244
+ #
245
+ # Removes assigned azure account from the application.
246
+ #
247
+ # @param app_id The application ID.
248
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
249
+ # information object.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [OperationStatus] operation results.
254
+ #
255
+ def remove_from_app(app_id, azure_account_info_object:nil, custom_headers:nil)
256
+ response = remove_from_app_async(app_id, azure_account_info_object:azure_account_info_object, custom_headers:custom_headers).value!
257
+ response.body unless response.nil?
258
+ end
259
+
260
+ #
261
+ # apps - Removes an assigned LUIS azure account from an application
262
+ #
263
+ # Removes assigned azure account from the application.
264
+ #
265
+ # @param app_id The application ID.
266
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
267
+ # information object.
268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
+ # will be added to the HTTP request.
270
+ #
271
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
272
+ #
273
+ def remove_from_app_with_http_info(app_id, azure_account_info_object:nil, custom_headers:nil)
274
+ remove_from_app_async(app_id, azure_account_info_object:azure_account_info_object, custom_headers:custom_headers).value!
275
+ end
276
+
277
+ #
278
+ # apps - Removes an assigned LUIS azure account from an application
279
+ #
280
+ # Removes assigned azure account from the application.
281
+ #
282
+ # @param app_id The application ID.
283
+ # @param azure_account_info_object [AzureAccountInfoObject] The azure account
284
+ # information object.
285
+ # @param [Hash{String => String}] A hash of custom headers that will be added
286
+ # to the HTTP request.
287
+ #
288
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
289
+ #
290
+ def remove_from_app_async(app_id, azure_account_info_object:nil, custom_headers:nil)
291
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
292
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
293
+
294
+
295
+ request_headers = {}
296
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
297
+
298
+ # Set Headers
299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
301
+
302
+ # Serialize Request
303
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::AzureAccountInfoObject.mapper()
304
+ request_content = @client.serialize(request_mapper, azure_account_info_object)
305
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
306
+
307
+ path_template = 'apps/{appId}/azureaccounts'
308
+
309
+ request_url = @base_url || @client.base_url
310
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
311
+
312
+ options = {
313
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
314
+ path_params: {'appId' => app_id},
315
+ body: request_content,
316
+ headers: request_headers.merge(custom_headers || {}),
317
+ base_url: request_url
318
+ }
319
+ promise = @client.make_request_async(:delete, path_template, options)
320
+
321
+ promise = promise.then do |result|
322
+ http_response = result.response
323
+ status_code = http_response.status
324
+ response_content = http_response.body
325
+ unless status_code == 200
326
+ error_model = JSON.load(response_content)
327
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
328
+ end
329
+
330
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
331
+ # Deserialize Response
332
+ if status_code == 200
333
+ begin
334
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
335
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
336
+ result.body = @client.deserialize(result_mapper, parsed_response)
337
+ rescue Exception => e
338
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
339
+ end
340
+ end
341
+
342
+ result
343
+ end
344
+
345
+ promise.execute
346
+ end
347
+
348
+ #
349
+ # user - Get LUIS azure accounts
350
+ #
351
+ # Gets the LUIS azure accounts for the user using his ARM token.
352
+ #
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [Array] operation results.
357
+ #
358
+ def get_user_luisaccounts(custom_headers:nil)
359
+ response = get_user_luisaccounts_async(custom_headers:custom_headers).value!
360
+ response.body unless response.nil?
361
+ end
362
+
363
+ #
364
+ # user - Get LUIS azure accounts
365
+ #
366
+ # Gets the LUIS azure accounts for the user using his ARM token.
367
+ #
368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
369
+ # will be added to the HTTP request.
370
+ #
371
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
372
+ #
373
+ def get_user_luisaccounts_with_http_info(custom_headers:nil)
374
+ get_user_luisaccounts_async(custom_headers:custom_headers).value!
375
+ end
376
+
377
+ #
378
+ # user - Get LUIS azure accounts
379
+ #
380
+ # Gets the LUIS azure accounts for the user using his ARM token.
381
+ #
382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
383
+ # to the HTTP request.
384
+ #
385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
+ #
387
+ def get_user_luisaccounts_async(custom_headers:nil)
388
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
389
+
390
+
391
+ request_headers = {}
392
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
393
+
394
+ # Set Headers
395
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
396
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
397
+ path_template = 'azureaccounts'
398
+
399
+ request_url = @base_url || @client.base_url
400
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
401
+
402
+ options = {
403
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:get, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 200
414
+ error_model = JSON.load(response_content)
415
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ # Deserialize Response
420
+ if status_code == 200
421
+ begin
422
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
423
+ result_mapper = {
424
+ client_side_validation: true,
425
+ required: false,
426
+ serialized_name: 'parsed_response',
427
+ type: {
428
+ name: 'Sequence',
429
+ element: {
430
+ client_side_validation: true,
431
+ required: false,
432
+ serialized_name: 'AzureAccountInfoObjectElementType',
433
+ type: {
434
+ name: 'Composite',
435
+ class_name: 'AzureAccountInfoObject'
436
+ }
437
+ }
438
+ }
439
+ }
440
+ result.body = @client.deserialize(result_mapper, parsed_response)
441
+ rescue Exception => e
442
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
443
+ end
444
+ end
445
+
446
+ result
447
+ end
448
+
449
+ promise.execute
450
+ end
451
+
452
+ end
453
+ end