azure_cognitiveservices_luisauthoring 0.17.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb +122 -60
  3. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/azure_accounts.rb +43 -35
  4. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/examples.rb +32 -21
  5. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb +161 -18
  6. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/luis_authoring_client.rb +1 -1
  7. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb +766 -452
  8. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_info_response.rb +4 -4
  9. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_setting_update_object.rb +2 -2
  10. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_settings.rb +2 -1
  11. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/azure_account_info_object.rb +4 -4
  12. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/batch_label_example.rb +1 -1
  13. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list.rb +3 -3
  14. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_entity_extractor.rb +6 -6
  15. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_create_object.rb +2 -2
  16. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_patch_object.rb +1 -1
  17. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_update_object.rb +2 -2
  18. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_extractor.rb +3 -3
  19. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_model.rb +1 -1
  20. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/custom_prebuilt_model.rb +3 -3
  21. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entities_suggestion_example.rb +2 -2
  22. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_extractor.rb +3 -3
  23. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label.rb +22 -0
  24. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label_object.rb +11 -0
  25. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/example_label_object.rb +5 -4
  26. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item.rb +1 -1
  27. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_create_object.rb +1 -1
  28. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_update_object.rb +1 -1
  29. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_entity.rb +3 -3
  30. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_extractor.rb +3 -3
  31. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_model.rb +1 -1
  32. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intents_suggestion_example.rb +3 -3
  33. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonentity.rb +11 -0
  34. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonmodel_feature.rb +7 -10
  35. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_example_response.rb +2 -2
  36. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_text_object.rb +1 -1
  37. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/labeled_utterance.rb +2 -2
  38. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/luis_app.rb +2 -2
  39. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info.rb +3 -3
  40. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info_response.rb +5 -5
  41. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_entity_extractor.rb +3 -3
  42. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phraselist_create_object.rb +8 -11
  43. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity_extractor.rb +3 -3
  44. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/publish_settings.rb +3 -5
  45. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_entity_extractor.rb +5 -5
  46. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_create_object.rb +2 -2
  47. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_update_object.rb +2 -2
  48. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list.rb +1 -1
  49. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list_response.rb +1 -1
  50. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_base_update_object.rb +1 -1
  51. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_object.rb +1 -1
  52. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/pattern.rb +50 -34
  53. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/permissions.rb +17 -9
  54. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/settings.rb +33 -13
  55. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/train.rb +4 -0
  56. data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb +37 -20
  57. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring.rb +147 -0
  58. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb +2511 -0
  59. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/azure_accounts.rb +489 -0
  60. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/examples.rb +519 -0
  61. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/features.rb +914 -0
  62. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/luis_authoring_client.rb +167 -0
  63. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb +12291 -0
  64. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/app_version_setting_object.rb +57 -0
  65. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_create_object.rb +106 -0
  66. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_info_response.rb +158 -0
  67. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_publish_object.rb +59 -0
  68. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_setting_update_object.rb +47 -0
  69. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_settings.rb +59 -0
  70. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/application_update_object.rb +57 -0
  71. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/available_culture.rb +57 -0
  72. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/available_prebuilt_entity_model.rb +68 -0
  73. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/azure_account_info_object.rb +68 -0
  74. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/batch_label_example.rb +70 -0
  75. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/child_entity.rb +115 -0
  76. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/child_entity_model_create_object.rb +77 -0
  77. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/closed_list.rb +85 -0
  78. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/closed_list_entity_extractor.rb +124 -0
  79. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_create_object.rb +66 -0
  80. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_patch_object.rb +55 -0
  81. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_update_object.rb +66 -0
  82. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/collaborators_array.rb +55 -0
  83. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/composite_child_model_create_object.rb +47 -0
  84. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_extractor.rb +124 -0
  85. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_model.rb +65 -0
  86. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/custom_prebuilt_model.rb +126 -0
  87. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/endpoint_info.rb +125 -0
  88. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/enqueue_training_response.rb +58 -0
  89. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entities_suggestion_example.rb +106 -0
  90. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_extractor.rb +126 -0
  91. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_label.rb +93 -0
  92. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_label_object.rb +82 -0
  93. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_model_create_object.rb +66 -0
  94. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_model_info.rb +87 -0
  95. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_model_update_object.rb +57 -0
  96. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_prediction.rb +81 -0
  97. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_role.rb +57 -0
  98. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_role_create_object.rb +46 -0
  99. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/entity_role_update_object.rb +46 -0
  100. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/error_response.rb +65 -0
  101. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/example_label_object.rb +79 -0
  102. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item.rb +57 -0
  103. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_create_object.rb +46 -0
  104. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_update_object.rb +46 -0
  105. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/feature_info_object.rb +80 -0
  106. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/features_response_object.rb +75 -0
  107. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_entity.rb +92 -0
  108. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_model_update_object.rb +47 -0
  109. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_extractor.rb +124 -0
  110. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_model.rb +118 -0
  111. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_model_v2.rb +97 -0
  112. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/intent_classifier.rb +89 -0
  113. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/intent_prediction.rb +57 -0
  114. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/intents_suggestion_example.rb +106 -0
  115. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/json_child.rb +98 -0
  116. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/json_model_feature_information.rb +58 -0
  117. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/jsonentity.rb +81 -0
  118. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/jsonmodel_feature.rb +100 -0
  119. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/jsonregex_feature.rb +68 -0
  120. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/jsonutterance.rb +77 -0
  121. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/label_example_response.rb +57 -0
  122. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/label_text_object.rb +57 -0
  123. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/labeled_utterance.rb +148 -0
  124. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/luis_app.rb +338 -0
  125. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/luis_app_v2.rb +329 -0
  126. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_create_object.rb +46 -0
  127. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_feature_information.rb +58 -0
  128. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_info.rb +84 -0
  129. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_info_response.rb +197 -0
  130. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_training_details.rb +91 -0
  131. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_training_info.rb +58 -0
  132. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/model_update_object.rb +46 -0
  133. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/ndepth_entity_extractor.rb +146 -0
  134. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/operation_error.rb +57 -0
  135. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/operation_status.rb +58 -0
  136. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/operation_status_type.rb +17 -0
  137. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_any.rb +84 -0
  138. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_entity_extractor.rb +124 -0
  139. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_create_object.rb +65 -0
  140. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_update_object.rb +65 -0
  141. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_feature_info.rb +78 -0
  142. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule.rb +57 -0
  143. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_create_object.rb +57 -0
  144. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_info.rb +68 -0
  145. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_update_object.rb +68 -0
  146. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/personal_assistants_response.rb +74 -0
  147. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/phrase_list_feature_info.rb +99 -0
  148. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/phraselist_create_object.rb +91 -0
  149. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/phraselist_update_object.rb +107 -0
  150. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain.rb +119 -0
  151. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_base_object.rb +47 -0
  152. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_object.rb +58 -0
  153. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_item.rb +69 -0
  154. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_model_create_object.rb +58 -0
  155. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_object.rb +58 -0
  156. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity.rb +65 -0
  157. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity_extractor.rb +104 -0
  158. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/production_or_staging_endpoint_info.rb +100 -0
  159. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/publish_setting_update_object.rb +71 -0
  160. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/publish_settings.rb +80 -0
  161. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/regex_entity.rb +76 -0
  162. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/regex_entity_extractor.rb +115 -0
  163. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/regex_model_create_object.rb +57 -0
  164. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/regex_model_update_object.rb +57 -0
  165. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list.rb +65 -0
  166. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list_response.rb +70 -0
  167. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/task_update_object.rb +46 -0
  168. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/training_status.rb +17 -0
  169. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/user_access_list.rb +65 -0
  170. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/user_collaborator.rb +47 -0
  171. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/version_info.rb +177 -0
  172. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/word_list_base_update_object.rb +65 -0
  173. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/models/word_list_object.rb +65 -0
  174. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/module_definition.rb +9 -0
  175. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/pattern.rb +979 -0
  176. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/permissions.rb +435 -0
  177. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/settings.rb +257 -0
  178. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/train.rb +251 -0
  179. data/lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb +1211 -0
  180. data/lib/azure_cognitiveservices_luisauthoring.rb +1 -0
  181. data/lib/profiles/latest/modules/luisauthoring_profile_module.rb +283 -263
  182. data/lib/version.rb +1 -1
  183. metadata +128 -5
@@ -0,0 +1,2511 @@
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::V3_0_preview
7
+ #
8
+ # Apps
9
+ #
10
+ class Apps
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Apps 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
+ # Creates a new LUIS app.
26
+ #
27
+ # @param application_create_object [ApplicationCreateObject] An application
28
+ # containing Name, Description (optional), Culture, Usage Scenario (optional),
29
+ # Domain (optional) and initial version ID (optional) of the application.
30
+ # Default value for the version ID is "0.1". Note: the culture cannot be
31
+ # changed after the app is created.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Uuid] operation results.
36
+ #
37
+ def add(application_create_object, custom_headers:nil)
38
+ response = add_async(application_create_object, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Creates a new LUIS app.
44
+ #
45
+ # @param application_create_object [ApplicationCreateObject] An application
46
+ # containing Name, Description (optional), Culture, Usage Scenario (optional),
47
+ # Domain (optional) and initial version ID (optional) of the application.
48
+ # Default value for the version ID is "0.1". Note: the culture cannot be
49
+ # changed after the app is created.
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 add_with_http_info(application_create_object, custom_headers:nil)
56
+ add_async(application_create_object, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Creates a new LUIS app.
61
+ #
62
+ # @param application_create_object [ApplicationCreateObject] An application
63
+ # containing Name, Description (optional), Culture, Usage Scenario (optional),
64
+ # Domain (optional) and initial version ID (optional) of the application.
65
+ # Default value for the version ID is "0.1". Note: the culture cannot be
66
+ # changed after the app is created.
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 add_async(application_create_object, custom_headers:nil)
73
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
74
+ fail ArgumentError, 'application_create_object is nil' if application_create_object.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::V3_0_preview::Models::ApplicationCreateObject.mapper()
86
+ request_content = @client.serialize(request_mapper, application_create_object)
87
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
88
+
89
+ path_template = 'apps/'
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
+ body: request_content,
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:post, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 201
107
+ error_model = JSON.load(response_content)
108
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 201
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = {
119
+ client_side_validation: true,
120
+ required: false,
121
+ serialized_name: 'parsed_response',
122
+ type: {
123
+ name: 'String'
124
+ }
125
+ }
126
+ result.body = @client.deserialize(result_mapper, parsed_response)
127
+ rescue Exception => e
128
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
129
+ end
130
+ end
131
+
132
+ result
133
+ end
134
+
135
+ promise.execute
136
+ end
137
+
138
+ #
139
+ # Lists all of the user's applications.
140
+ #
141
+ # @param skip [Integer] The number of entries to skip. Default value is 0.
142
+ # @param take [Integer] The number of entries to return. Maximum page size is
143
+ # 500. Default is 100.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [Array] operation results.
148
+ #
149
+ def list(skip:0, take:100, custom_headers:nil)
150
+ response = list_async(skip:skip, take:take, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Lists all of the user's applications.
156
+ #
157
+ # @param skip [Integer] The number of entries to skip. Default value is 0.
158
+ # @param take [Integer] The number of entries to return. Maximum page size is
159
+ # 500. Default is 100.
160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
+ # will be added to the HTTP request.
162
+ #
163
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
164
+ #
165
+ def list_with_http_info(skip:0, take:100, custom_headers:nil)
166
+ list_async(skip:skip, take:take, custom_headers:custom_headers).value!
167
+ end
168
+
169
+ #
170
+ # Lists all of the user's applications.
171
+ #
172
+ # @param skip [Integer] The number of entries to skip. Default value is 0.
173
+ # @param take [Integer] The number of entries to return. Maximum page size is
174
+ # 500. Default is 100.
175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
176
+ # to the HTTP request.
177
+ #
178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
179
+ #
180
+ def list_async(skip:0, take:100, custom_headers:nil)
181
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
182
+ fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
183
+ fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
184
+ fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0
185
+
186
+
187
+ request_headers = {}
188
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
189
+
190
+ # Set Headers
191
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
192
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
193
+ path_template = 'apps/'
194
+
195
+ request_url = @base_url || @client.base_url
196
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
197
+
198
+ options = {
199
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
200
+ query_params: {'skip' => skip,'take' => take},
201
+ headers: request_headers.merge(custom_headers || {}),
202
+ base_url: request_url
203
+ }
204
+ promise = @client.make_request_async(:get, path_template, options)
205
+
206
+ promise = promise.then do |result|
207
+ http_response = result.response
208
+ status_code = http_response.status
209
+ response_content = http_response.body
210
+ unless status_code == 200
211
+ error_model = JSON.load(response_content)
212
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
213
+ end
214
+
215
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
216
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
217
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
218
+ # Deserialize Response
219
+ if status_code == 200
220
+ begin
221
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
222
+ result_mapper = {
223
+ client_side_validation: true,
224
+ required: false,
225
+ serialized_name: 'parsed_response',
226
+ type: {
227
+ name: 'Sequence',
228
+ element: {
229
+ client_side_validation: true,
230
+ required: false,
231
+ serialized_name: 'ApplicationInfoResponseElementType',
232
+ type: {
233
+ name: 'Composite',
234
+ class_name: 'ApplicationInfoResponse'
235
+ }
236
+ }
237
+ }
238
+ }
239
+ result.body = @client.deserialize(result_mapper, parsed_response)
240
+ rescue Exception => e
241
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
242
+ end
243
+ end
244
+
245
+ result
246
+ end
247
+
248
+ promise.execute
249
+ end
250
+
251
+ #
252
+ # Imports an application to LUIS, the application's structure is included in
253
+ # the request body.
254
+ #
255
+ # @param luis_app [LuisApp] A LUIS application structure.
256
+ # @param app_name [String] The application name to create. If not specified,
257
+ # the application name will be read from the imported object. If the
258
+ # application name already exists, an error is returned.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [Uuid] operation results.
263
+ #
264
+ def import(luis_app, app_name:nil, custom_headers:nil)
265
+ response = import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value!
266
+ response.body unless response.nil?
267
+ end
268
+
269
+ #
270
+ # Imports an application to LUIS, the application's structure is included in
271
+ # the request body.
272
+ #
273
+ # @param luis_app [LuisApp] A LUIS application structure.
274
+ # @param app_name [String] The application name to create. If not specified,
275
+ # the application name will be read from the imported object. If the
276
+ # application name already exists, an error is returned.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
281
+ #
282
+ def import_with_http_info(luis_app, app_name:nil, custom_headers:nil)
283
+ import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value!
284
+ end
285
+
286
+ #
287
+ # Imports an application to LUIS, the application's structure is included in
288
+ # the request body.
289
+ #
290
+ # @param luis_app [LuisApp] A LUIS application structure.
291
+ # @param app_name [String] The application name to create. If not specified,
292
+ # the application name will be read from the imported object. If the
293
+ # application name already exists, an error is returned.
294
+ # @param [Hash{String => String}] A hash of custom headers that will be added
295
+ # to the HTTP request.
296
+ #
297
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
298
+ #
299
+ def import_async(luis_app, app_name:nil, custom_headers:nil)
300
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
301
+ fail ArgumentError, 'luis_app is nil' if luis_app.nil?
302
+
303
+
304
+ request_headers = {}
305
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
306
+
307
+ # Set Headers
308
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
309
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
310
+
311
+ # Serialize Request
312
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::LuisApp.mapper()
313
+ request_content = @client.serialize(request_mapper, luis_app)
314
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
315
+
316
+ path_template = 'apps/import'
317
+
318
+ request_url = @base_url || @client.base_url
319
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
320
+
321
+ options = {
322
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
323
+ query_params: {'appName' => app_name},
324
+ body: request_content,
325
+ headers: request_headers.merge(custom_headers || {}),
326
+ base_url: request_url
327
+ }
328
+ promise = @client.make_request_async(:post, path_template, options)
329
+
330
+ promise = promise.then do |result|
331
+ http_response = result.response
332
+ status_code = http_response.status
333
+ response_content = http_response.body
334
+ unless status_code == 201
335
+ error_model = JSON.load(response_content)
336
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
337
+ end
338
+
339
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
340
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
341
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
342
+ # Deserialize Response
343
+ if status_code == 201
344
+ begin
345
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
346
+ result_mapper = {
347
+ client_side_validation: true,
348
+ required: false,
349
+ serialized_name: 'parsed_response',
350
+ type: {
351
+ name: 'String'
352
+ }
353
+ }
354
+ result.body = @client.deserialize(result_mapper, parsed_response)
355
+ rescue Exception => e
356
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
357
+ end
358
+ end
359
+
360
+ result
361
+ end
362
+
363
+ promise.execute
364
+ end
365
+
366
+ #
367
+ # Gets the endpoint URLs for the prebuilt Cortana applications.
368
+ #
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [PersonalAssistantsResponse] operation results.
373
+ #
374
+ def list_cortana_endpoints(custom_headers:nil)
375
+ response = list_cortana_endpoints_async(custom_headers:custom_headers).value!
376
+ response.body unless response.nil?
377
+ end
378
+
379
+ #
380
+ # Gets the endpoint URLs for the prebuilt Cortana applications.
381
+ #
382
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
383
+ # will be added to the HTTP request.
384
+ #
385
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
386
+ #
387
+ def list_cortana_endpoints_with_http_info(custom_headers:nil)
388
+ list_cortana_endpoints_async(custom_headers:custom_headers).value!
389
+ end
390
+
391
+ #
392
+ # Gets the endpoint URLs for the prebuilt Cortana applications.
393
+ #
394
+ # @param [Hash{String => String}] A hash of custom headers that will be added
395
+ # to the HTTP request.
396
+ #
397
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
398
+ #
399
+ def list_cortana_endpoints_async(custom_headers:nil)
400
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
401
+
402
+
403
+ request_headers = {}
404
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
405
+
406
+ # Set Headers
407
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
408
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
409
+ path_template = 'apps/assistants'
410
+
411
+ request_url = @base_url || @client.base_url
412
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
413
+
414
+ options = {
415
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
416
+ headers: request_headers.merge(custom_headers || {}),
417
+ base_url: request_url
418
+ }
419
+ promise = @client.make_request_async(:get, path_template, options)
420
+
421
+ promise = promise.then do |result|
422
+ http_response = result.response
423
+ status_code = http_response.status
424
+ response_content = http_response.body
425
+ unless status_code == 200
426
+ error_model = JSON.load(response_content)
427
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
428
+ end
429
+
430
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
431
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
432
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
433
+ # Deserialize Response
434
+ if status_code == 200
435
+ begin
436
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
437
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::PersonalAssistantsResponse.mapper()
438
+ result.body = @client.deserialize(result_mapper, parsed_response)
439
+ rescue Exception => e
440
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
441
+ end
442
+ end
443
+
444
+ result
445
+ end
446
+
447
+ promise.execute
448
+ end
449
+
450
+ #
451
+ # Gets the available application domains.
452
+ #
453
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
454
+ # will be added to the HTTP request.
455
+ #
456
+ # @return [Array] operation results.
457
+ #
458
+ def list_domains(custom_headers:nil)
459
+ response = list_domains_async(custom_headers:custom_headers).value!
460
+ response.body unless response.nil?
461
+ end
462
+
463
+ #
464
+ # Gets the available application domains.
465
+ #
466
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
467
+ # will be added to the HTTP request.
468
+ #
469
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
470
+ #
471
+ def list_domains_with_http_info(custom_headers:nil)
472
+ list_domains_async(custom_headers:custom_headers).value!
473
+ end
474
+
475
+ #
476
+ # Gets the available application domains.
477
+ #
478
+ # @param [Hash{String => String}] A hash of custom headers that will be added
479
+ # to the HTTP request.
480
+ #
481
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
482
+ #
483
+ def list_domains_async(custom_headers:nil)
484
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
485
+
486
+
487
+ request_headers = {}
488
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
489
+
490
+ # Set Headers
491
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
492
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
493
+ path_template = 'apps/domains'
494
+
495
+ request_url = @base_url || @client.base_url
496
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
497
+
498
+ options = {
499
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
500
+ headers: request_headers.merge(custom_headers || {}),
501
+ base_url: request_url
502
+ }
503
+ promise = @client.make_request_async(:get, path_template, options)
504
+
505
+ promise = promise.then do |result|
506
+ http_response = result.response
507
+ status_code = http_response.status
508
+ response_content = http_response.body
509
+ unless status_code == 200
510
+ error_model = JSON.load(response_content)
511
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
512
+ end
513
+
514
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
515
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
516
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
517
+ # Deserialize Response
518
+ if status_code == 200
519
+ begin
520
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
521
+ result_mapper = {
522
+ client_side_validation: true,
523
+ required: false,
524
+ serialized_name: 'parsed_response',
525
+ type: {
526
+ name: 'Sequence',
527
+ element: {
528
+ client_side_validation: true,
529
+ required: false,
530
+ serialized_name: 'StringElementType',
531
+ type: {
532
+ name: 'String'
533
+ }
534
+ }
535
+ }
536
+ }
537
+ result.body = @client.deserialize(result_mapper, parsed_response)
538
+ rescue Exception => e
539
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
540
+ end
541
+ end
542
+
543
+ result
544
+ end
545
+
546
+ promise.execute
547
+ end
548
+
549
+ #
550
+ # Gets the application available usage scenarios.
551
+ #
552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
553
+ # will be added to the HTTP request.
554
+ #
555
+ # @return [Array] operation results.
556
+ #
557
+ def list_usage_scenarios(custom_headers:nil)
558
+ response = list_usage_scenarios_async(custom_headers:custom_headers).value!
559
+ response.body unless response.nil?
560
+ end
561
+
562
+ #
563
+ # Gets the application available usage scenarios.
564
+ #
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 list_usage_scenarios_with_http_info(custom_headers:nil)
571
+ list_usage_scenarios_async(custom_headers:custom_headers).value!
572
+ end
573
+
574
+ #
575
+ # Gets the application available usage scenarios.
576
+ #
577
+ # @param [Hash{String => String}] A hash of custom headers that will be added
578
+ # to the HTTP request.
579
+ #
580
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
581
+ #
582
+ def list_usage_scenarios_async(custom_headers:nil)
583
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
584
+
585
+
586
+ request_headers = {}
587
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
588
+
589
+ # Set Headers
590
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
591
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
592
+ path_template = 'apps/usagescenarios'
593
+
594
+ request_url = @base_url || @client.base_url
595
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
596
+
597
+ options = {
598
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
599
+ headers: request_headers.merge(custom_headers || {}),
600
+ base_url: request_url
601
+ }
602
+ promise = @client.make_request_async(:get, path_template, options)
603
+
604
+ promise = promise.then do |result|
605
+ http_response = result.response
606
+ status_code = http_response.status
607
+ response_content = http_response.body
608
+ unless status_code == 200
609
+ error_model = JSON.load(response_content)
610
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
611
+ end
612
+
613
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
614
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
615
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
616
+ # Deserialize Response
617
+ if status_code == 200
618
+ begin
619
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
620
+ result_mapper = {
621
+ client_side_validation: true,
622
+ required: false,
623
+ serialized_name: 'parsed_response',
624
+ type: {
625
+ name: 'Sequence',
626
+ element: {
627
+ client_side_validation: true,
628
+ required: false,
629
+ serialized_name: 'StringElementType',
630
+ type: {
631
+ name: 'String'
632
+ }
633
+ }
634
+ }
635
+ }
636
+ result.body = @client.deserialize(result_mapper, parsed_response)
637
+ rescue Exception => e
638
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
639
+ end
640
+ end
641
+
642
+ result
643
+ end
644
+
645
+ promise.execute
646
+ end
647
+
648
+ #
649
+ # Gets a list of supported cultures. Cultures are equivalent to the written
650
+ # language and locale. For example,"en-us" represents the U.S. variation of
651
+ # English.
652
+ #
653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
654
+ # will be added to the HTTP request.
655
+ #
656
+ # @return [Array] operation results.
657
+ #
658
+ def list_supported_cultures(custom_headers:nil)
659
+ response = list_supported_cultures_async(custom_headers:custom_headers).value!
660
+ response.body unless response.nil?
661
+ end
662
+
663
+ #
664
+ # Gets a list of supported cultures. Cultures are equivalent to the written
665
+ # language and locale. For example,"en-us" represents the U.S. variation of
666
+ # English.
667
+ #
668
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
669
+ # will be added to the HTTP request.
670
+ #
671
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
672
+ #
673
+ def list_supported_cultures_with_http_info(custom_headers:nil)
674
+ list_supported_cultures_async(custom_headers:custom_headers).value!
675
+ end
676
+
677
+ #
678
+ # Gets a list of supported cultures. Cultures are equivalent to the written
679
+ # language and locale. For example,"en-us" represents the U.S. variation of
680
+ # English.
681
+ #
682
+ # @param [Hash{String => String}] A hash of custom headers that will be added
683
+ # to the HTTP request.
684
+ #
685
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
686
+ #
687
+ def list_supported_cultures_async(custom_headers:nil)
688
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
689
+
690
+
691
+ request_headers = {}
692
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
693
+
694
+ # Set Headers
695
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
696
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
697
+ path_template = 'apps/cultures'
698
+
699
+ request_url = @base_url || @client.base_url
700
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
701
+
702
+ options = {
703
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
704
+ headers: request_headers.merge(custom_headers || {}),
705
+ base_url: request_url
706
+ }
707
+ promise = @client.make_request_async(:get, path_template, options)
708
+
709
+ promise = promise.then do |result|
710
+ http_response = result.response
711
+ status_code = http_response.status
712
+ response_content = http_response.body
713
+ unless status_code == 200
714
+ error_model = JSON.load(response_content)
715
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
716
+ end
717
+
718
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
719
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
720
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
721
+ # Deserialize Response
722
+ if status_code == 200
723
+ begin
724
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
725
+ result_mapper = {
726
+ client_side_validation: true,
727
+ required: false,
728
+ serialized_name: 'parsed_response',
729
+ type: {
730
+ name: 'Sequence',
731
+ element: {
732
+ client_side_validation: true,
733
+ required: false,
734
+ serialized_name: 'AvailableCultureElementType',
735
+ type: {
736
+ name: 'Composite',
737
+ class_name: 'AvailableCulture'
738
+ }
739
+ }
740
+ }
741
+ }
742
+ result.body = @client.deserialize(result_mapper, parsed_response)
743
+ rescue Exception => e
744
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
745
+ end
746
+ end
747
+
748
+ result
749
+ end
750
+
751
+ promise.execute
752
+ end
753
+
754
+ #
755
+ # Gets the logs of the past month's endpoint queries for the application.
756
+ #
757
+ # @param app_id The application ID.
758
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
759
+ # will be added to the HTTP request.
760
+ #
761
+ # @return [NOT_IMPLEMENTED] operation results.
762
+ #
763
+ def download_query_logs(app_id, custom_headers:nil)
764
+ response = download_query_logs_async(app_id, custom_headers:custom_headers).value!
765
+ response.body unless response.nil?
766
+ end
767
+
768
+ #
769
+ # Gets the logs of the past month's endpoint queries for the application.
770
+ #
771
+ # @param app_id The application ID.
772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
773
+ # will be added to the HTTP request.
774
+ #
775
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
776
+ #
777
+ def download_query_logs_with_http_info(app_id, custom_headers:nil)
778
+ download_query_logs_async(app_id, custom_headers:custom_headers).value!
779
+ end
780
+
781
+ #
782
+ # Gets the logs of the past month's endpoint queries for the application.
783
+ #
784
+ # @param app_id The application ID.
785
+ # @param [Hash{String => String}] A hash of custom headers that will be added
786
+ # to the HTTP request.
787
+ #
788
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
789
+ #
790
+ def download_query_logs_async(app_id, custom_headers:nil)
791
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
792
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
793
+
794
+
795
+ request_headers = {}
796
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
797
+
798
+ # Set Headers
799
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
800
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
801
+ path_template = 'apps/{appId}/querylogs'
802
+
803
+ request_url = @base_url || @client.base_url
804
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
805
+
806
+ options = {
807
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
808
+ path_params: {'appId' => app_id},
809
+ headers: request_headers.merge(custom_headers || {}),
810
+ base_url: request_url
811
+ }
812
+ promise = @client.make_request_async(:get, path_template, options)
813
+
814
+ promise = promise.then do |result|
815
+ http_response = result.response
816
+ status_code = http_response.status
817
+ response_content = http_response.body
818
+ unless status_code == 200
819
+ error_model = JSON.load(response_content)
820
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
821
+ end
822
+
823
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
824
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
825
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
826
+ # Deserialize Response
827
+ if status_code == 200
828
+ begin
829
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
830
+ result_mapper = {
831
+ client_side_validation: true,
832
+ required: false,
833
+ serialized_name: 'parsed_response',
834
+ type: {
835
+ name: 'Stream'
836
+ }
837
+ }
838
+ result.body = @client.deserialize(result_mapper, parsed_response)
839
+ rescue Exception => e
840
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
841
+ end
842
+ end
843
+
844
+ result
845
+ end
846
+
847
+ promise.execute
848
+ end
849
+
850
+ #
851
+ # Gets the application info.
852
+ #
853
+ # @param app_id The application ID.
854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
+ # will be added to the HTTP request.
856
+ #
857
+ # @return [ApplicationInfoResponse] operation results.
858
+ #
859
+ def get(app_id, custom_headers:nil)
860
+ response = get_async(app_id, custom_headers:custom_headers).value!
861
+ response.body unless response.nil?
862
+ end
863
+
864
+ #
865
+ # Gets the application info.
866
+ #
867
+ # @param app_id The application ID.
868
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
869
+ # will be added to the HTTP request.
870
+ #
871
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
872
+ #
873
+ def get_with_http_info(app_id, custom_headers:nil)
874
+ get_async(app_id, custom_headers:custom_headers).value!
875
+ end
876
+
877
+ #
878
+ # Gets the application info.
879
+ #
880
+ # @param app_id The application ID.
881
+ # @param [Hash{String => String}] A hash of custom headers that will be added
882
+ # to the HTTP request.
883
+ #
884
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
885
+ #
886
+ def get_async(app_id, custom_headers:nil)
887
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
888
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
889
+
890
+
891
+ request_headers = {}
892
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
893
+
894
+ # Set Headers
895
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
896
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
897
+ path_template = 'apps/{appId}'
898
+
899
+ request_url = @base_url || @client.base_url
900
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
901
+
902
+ options = {
903
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
904
+ path_params: {'appId' => app_id},
905
+ headers: request_headers.merge(custom_headers || {}),
906
+ base_url: request_url
907
+ }
908
+ promise = @client.make_request_async(:get, path_template, options)
909
+
910
+ promise = promise.then do |result|
911
+ http_response = result.response
912
+ status_code = http_response.status
913
+ response_content = http_response.body
914
+ unless status_code == 200
915
+ error_model = JSON.load(response_content)
916
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
917
+ end
918
+
919
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
920
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
921
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
922
+ # Deserialize Response
923
+ if status_code == 200
924
+ begin
925
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
926
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ApplicationInfoResponse.mapper()
927
+ result.body = @client.deserialize(result_mapper, parsed_response)
928
+ rescue Exception => e
929
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
930
+ end
931
+ end
932
+
933
+ result
934
+ end
935
+
936
+ promise.execute
937
+ end
938
+
939
+ #
940
+ # Updates the name or description of the application.
941
+ #
942
+ # @param app_id The application ID.
943
+ # @param application_update_object [ApplicationUpdateObject] A model containing
944
+ # Name and Description of the application.
945
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
946
+ # will be added to the HTTP request.
947
+ #
948
+ # @return [OperationStatus] operation results.
949
+ #
950
+ def update(app_id, application_update_object, custom_headers:nil)
951
+ response = update_async(app_id, application_update_object, custom_headers:custom_headers).value!
952
+ response.body unless response.nil?
953
+ end
954
+
955
+ #
956
+ # Updates the name or description of the application.
957
+ #
958
+ # @param app_id The application ID.
959
+ # @param application_update_object [ApplicationUpdateObject] A model containing
960
+ # Name and Description of the application.
961
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
962
+ # will be added to the HTTP request.
963
+ #
964
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
965
+ #
966
+ def update_with_http_info(app_id, application_update_object, custom_headers:nil)
967
+ update_async(app_id, application_update_object, custom_headers:custom_headers).value!
968
+ end
969
+
970
+ #
971
+ # Updates the name or description of the application.
972
+ #
973
+ # @param app_id The application ID.
974
+ # @param application_update_object [ApplicationUpdateObject] A model containing
975
+ # Name and Description of the application.
976
+ # @param [Hash{String => String}] A hash of custom headers that will be added
977
+ # to the HTTP request.
978
+ #
979
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
980
+ #
981
+ def update_async(app_id, application_update_object, custom_headers:nil)
982
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
983
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
984
+ fail ArgumentError, 'application_update_object is nil' if application_update_object.nil?
985
+
986
+
987
+ request_headers = {}
988
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
989
+
990
+ # Set Headers
991
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
992
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
993
+
994
+ # Serialize Request
995
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ApplicationUpdateObject.mapper()
996
+ request_content = @client.serialize(request_mapper, application_update_object)
997
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
998
+
999
+ path_template = 'apps/{appId}'
1000
+
1001
+ request_url = @base_url || @client.base_url
1002
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1003
+
1004
+ options = {
1005
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1006
+ path_params: {'appId' => app_id},
1007
+ body: request_content,
1008
+ headers: request_headers.merge(custom_headers || {}),
1009
+ base_url: request_url
1010
+ }
1011
+ promise = @client.make_request_async(:put, path_template, options)
1012
+
1013
+ promise = promise.then do |result|
1014
+ http_response = result.response
1015
+ status_code = http_response.status
1016
+ response_content = http_response.body
1017
+ unless status_code == 200
1018
+ error_model = JSON.load(response_content)
1019
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1020
+ end
1021
+
1022
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1023
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1024
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1025
+ # Deserialize Response
1026
+ if status_code == 200
1027
+ begin
1028
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1029
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper()
1030
+ result.body = @client.deserialize(result_mapper, parsed_response)
1031
+ rescue Exception => e
1032
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1033
+ end
1034
+ end
1035
+
1036
+ result
1037
+ end
1038
+
1039
+ promise.execute
1040
+ end
1041
+
1042
+ #
1043
+ # Deletes an application.
1044
+ #
1045
+ # @param app_id The application ID.
1046
+ # @param force [Boolean] A flag to indicate whether to force an operation.
1047
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1048
+ # will be added to the HTTP request.
1049
+ #
1050
+ # @return [OperationStatus] operation results.
1051
+ #
1052
+ def delete(app_id, force:false, custom_headers:nil)
1053
+ response = delete_async(app_id, force:force, custom_headers:custom_headers).value!
1054
+ response.body unless response.nil?
1055
+ end
1056
+
1057
+ #
1058
+ # Deletes an application.
1059
+ #
1060
+ # @param app_id The application ID.
1061
+ # @param force [Boolean] A flag to indicate whether to force an operation.
1062
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1063
+ # will be added to the HTTP request.
1064
+ #
1065
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1066
+ #
1067
+ def delete_with_http_info(app_id, force:false, custom_headers:nil)
1068
+ delete_async(app_id, force:force, custom_headers:custom_headers).value!
1069
+ end
1070
+
1071
+ #
1072
+ # Deletes an application.
1073
+ #
1074
+ # @param app_id The application ID.
1075
+ # @param force [Boolean] A flag to indicate whether to force an operation.
1076
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1077
+ # to the HTTP request.
1078
+ #
1079
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1080
+ #
1081
+ def delete_async(app_id, force:false, custom_headers:nil)
1082
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1083
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1084
+
1085
+
1086
+ request_headers = {}
1087
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1088
+
1089
+ # Set Headers
1090
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1091
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1092
+ path_template = 'apps/{appId}'
1093
+
1094
+ request_url = @base_url || @client.base_url
1095
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1096
+
1097
+ options = {
1098
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1099
+ path_params: {'appId' => app_id},
1100
+ query_params: {'force' => force},
1101
+ headers: request_headers.merge(custom_headers || {}),
1102
+ base_url: request_url
1103
+ }
1104
+ promise = @client.make_request_async(:delete, path_template, options)
1105
+
1106
+ promise = promise.then do |result|
1107
+ http_response = result.response
1108
+ status_code = http_response.status
1109
+ response_content = http_response.body
1110
+ unless status_code == 200
1111
+ error_model = JSON.load(response_content)
1112
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1113
+ end
1114
+
1115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1118
+ # Deserialize Response
1119
+ if status_code == 200
1120
+ begin
1121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1122
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper()
1123
+ result.body = @client.deserialize(result_mapper, parsed_response)
1124
+ rescue Exception => e
1125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1126
+ end
1127
+ end
1128
+
1129
+ result
1130
+ end
1131
+
1132
+ promise.execute
1133
+ end
1134
+
1135
+ #
1136
+ # Publishes a specific version of the application.
1137
+ #
1138
+ # @param app_id The application ID.
1139
+ # @param application_publish_object [ApplicationPublishObject] The application
1140
+ # publish object. The region is the target region that the application is
1141
+ # published to.
1142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1143
+ # will be added to the HTTP request.
1144
+ #
1145
+ # @return [ProductionOrStagingEndpointInfo] operation results.
1146
+ #
1147
+ def publish(app_id, application_publish_object, custom_headers:nil)
1148
+ response = publish_async(app_id, application_publish_object, custom_headers:custom_headers).value!
1149
+ response.body unless response.nil?
1150
+ end
1151
+
1152
+ #
1153
+ # Publishes a specific version of the application.
1154
+ #
1155
+ # @param app_id The application ID.
1156
+ # @param application_publish_object [ApplicationPublishObject] The application
1157
+ # publish object. The region is the target region that the application is
1158
+ # published to.
1159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1160
+ # will be added to the HTTP request.
1161
+ #
1162
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1163
+ #
1164
+ def publish_with_http_info(app_id, application_publish_object, custom_headers:nil)
1165
+ publish_async(app_id, application_publish_object, custom_headers:custom_headers).value!
1166
+ end
1167
+
1168
+ #
1169
+ # Publishes a specific version of the application.
1170
+ #
1171
+ # @param app_id The application ID.
1172
+ # @param application_publish_object [ApplicationPublishObject] The application
1173
+ # publish object. The region is the target region that the application is
1174
+ # published to.
1175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1176
+ # to the HTTP request.
1177
+ #
1178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1179
+ #
1180
+ def publish_async(app_id, application_publish_object, custom_headers:nil)
1181
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1182
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1183
+ fail ArgumentError, 'application_publish_object is nil' if application_publish_object.nil?
1184
+
1185
+
1186
+ request_headers = {}
1187
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1188
+
1189
+ # Set Headers
1190
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1191
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1192
+
1193
+ # Serialize Request
1194
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ApplicationPublishObject.mapper()
1195
+ request_content = @client.serialize(request_mapper, application_publish_object)
1196
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1197
+
1198
+ path_template = 'apps/{appId}/publish'
1199
+
1200
+ request_url = @base_url || @client.base_url
1201
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1202
+
1203
+ options = {
1204
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1205
+ path_params: {'appId' => app_id},
1206
+ body: request_content,
1207
+ headers: request_headers.merge(custom_headers || {}),
1208
+ base_url: request_url
1209
+ }
1210
+ promise = @client.make_request_async(:post, path_template, options)
1211
+
1212
+ promise = promise.then do |result|
1213
+ http_response = result.response
1214
+ status_code = http_response.status
1215
+ response_content = http_response.body
1216
+ unless status_code == 201 || status_code == 207
1217
+ error_model = JSON.load(response_content)
1218
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1219
+ end
1220
+
1221
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1222
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1223
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1224
+ # Deserialize Response
1225
+ if status_code == 201
1226
+ begin
1227
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1228
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ProductionOrStagingEndpointInfo.mapper()
1229
+ result.body = @client.deserialize(result_mapper, parsed_response)
1230
+ rescue Exception => e
1231
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1232
+ end
1233
+ end
1234
+ # Deserialize Response
1235
+ if status_code == 207
1236
+ begin
1237
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1238
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ProductionOrStagingEndpointInfo.mapper()
1239
+ result.body = @client.deserialize(result_mapper, parsed_response)
1240
+ rescue Exception => e
1241
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1242
+ end
1243
+ end
1244
+
1245
+ result
1246
+ end
1247
+
1248
+ promise.execute
1249
+ end
1250
+
1251
+ #
1252
+ # Get the application settings including 'UseAllTrainingData'.
1253
+ #
1254
+ # @param app_id The application ID.
1255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1256
+ # will be added to the HTTP request.
1257
+ #
1258
+ # @return [ApplicationSettings] operation results.
1259
+ #
1260
+ def get_settings(app_id, custom_headers:nil)
1261
+ response = get_settings_async(app_id, custom_headers:custom_headers).value!
1262
+ response.body unless response.nil?
1263
+ end
1264
+
1265
+ #
1266
+ # Get the application settings including 'UseAllTrainingData'.
1267
+ #
1268
+ # @param app_id The application ID.
1269
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1270
+ # will be added to the HTTP request.
1271
+ #
1272
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1273
+ #
1274
+ def get_settings_with_http_info(app_id, custom_headers:nil)
1275
+ get_settings_async(app_id, custom_headers:custom_headers).value!
1276
+ end
1277
+
1278
+ #
1279
+ # Get the application settings including 'UseAllTrainingData'.
1280
+ #
1281
+ # @param app_id The application ID.
1282
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1283
+ # to the HTTP request.
1284
+ #
1285
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1286
+ #
1287
+ def get_settings_async(app_id, custom_headers:nil)
1288
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1289
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1290
+
1291
+
1292
+ request_headers = {}
1293
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1294
+
1295
+ # Set Headers
1296
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1297
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1298
+ path_template = 'apps/{appId}/settings'
1299
+
1300
+ request_url = @base_url || @client.base_url
1301
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1302
+
1303
+ options = {
1304
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1305
+ path_params: {'appId' => app_id},
1306
+ headers: request_headers.merge(custom_headers || {}),
1307
+ base_url: request_url
1308
+ }
1309
+ promise = @client.make_request_async(:get, path_template, options)
1310
+
1311
+ promise = promise.then do |result|
1312
+ http_response = result.response
1313
+ status_code = http_response.status
1314
+ response_content = http_response.body
1315
+ unless status_code == 200
1316
+ error_model = JSON.load(response_content)
1317
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1318
+ end
1319
+
1320
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1321
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1322
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1323
+ # Deserialize Response
1324
+ if status_code == 200
1325
+ begin
1326
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1327
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ApplicationSettings.mapper()
1328
+ result.body = @client.deserialize(result_mapper, parsed_response)
1329
+ rescue Exception => e
1330
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1331
+ end
1332
+ end
1333
+
1334
+ result
1335
+ end
1336
+
1337
+ promise.execute
1338
+ end
1339
+
1340
+ #
1341
+ # Updates the application settings including 'UseAllTrainingData'.
1342
+ #
1343
+ # @param app_id The application ID.
1344
+ # @param application_setting_update_object [ApplicationSettingUpdateObject] An
1345
+ # object containing the new application settings.
1346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1347
+ # will be added to the HTTP request.
1348
+ #
1349
+ # @return [OperationStatus] operation results.
1350
+ #
1351
+ def update_settings(app_id, application_setting_update_object, custom_headers:nil)
1352
+ response = update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value!
1353
+ response.body unless response.nil?
1354
+ end
1355
+
1356
+ #
1357
+ # Updates the application settings including 'UseAllTrainingData'.
1358
+ #
1359
+ # @param app_id The application ID.
1360
+ # @param application_setting_update_object [ApplicationSettingUpdateObject] An
1361
+ # object containing the new application settings.
1362
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1363
+ # will be added to the HTTP request.
1364
+ #
1365
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1366
+ #
1367
+ def update_settings_with_http_info(app_id, application_setting_update_object, custom_headers:nil)
1368
+ update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value!
1369
+ end
1370
+
1371
+ #
1372
+ # Updates the application settings including 'UseAllTrainingData'.
1373
+ #
1374
+ # @param app_id The application ID.
1375
+ # @param application_setting_update_object [ApplicationSettingUpdateObject] An
1376
+ # object containing the new application settings.
1377
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1378
+ # to the HTTP request.
1379
+ #
1380
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1381
+ #
1382
+ def update_settings_async(app_id, application_setting_update_object, custom_headers:nil)
1383
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1384
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1385
+ fail ArgumentError, 'application_setting_update_object is nil' if application_setting_update_object.nil?
1386
+
1387
+
1388
+ request_headers = {}
1389
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1390
+
1391
+ # Set Headers
1392
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1393
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1394
+
1395
+ # Serialize Request
1396
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ApplicationSettingUpdateObject.mapper()
1397
+ request_content = @client.serialize(request_mapper, application_setting_update_object)
1398
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1399
+
1400
+ path_template = 'apps/{appId}/settings'
1401
+
1402
+ request_url = @base_url || @client.base_url
1403
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1404
+
1405
+ options = {
1406
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1407
+ path_params: {'appId' => app_id},
1408
+ body: request_content,
1409
+ headers: request_headers.merge(custom_headers || {}),
1410
+ base_url: request_url
1411
+ }
1412
+ promise = @client.make_request_async(:put, path_template, options)
1413
+
1414
+ promise = promise.then do |result|
1415
+ http_response = result.response
1416
+ status_code = http_response.status
1417
+ response_content = http_response.body
1418
+ unless status_code == 200
1419
+ error_model = JSON.load(response_content)
1420
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1421
+ end
1422
+
1423
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1424
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1425
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1426
+ # Deserialize Response
1427
+ if status_code == 200
1428
+ begin
1429
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1430
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper()
1431
+ result.body = @client.deserialize(result_mapper, parsed_response)
1432
+ rescue Exception => e
1433
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1434
+ end
1435
+ end
1436
+
1437
+ result
1438
+ end
1439
+
1440
+ promise.execute
1441
+ end
1442
+
1443
+ #
1444
+ # Get the application publish settings including 'UseAllTrainingData'.
1445
+ #
1446
+ # @param app_id The application ID.
1447
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1448
+ # will be added to the HTTP request.
1449
+ #
1450
+ # @return [PublishSettings] operation results.
1451
+ #
1452
+ def get_publish_settings(app_id, custom_headers:nil)
1453
+ response = get_publish_settings_async(app_id, custom_headers:custom_headers).value!
1454
+ response.body unless response.nil?
1455
+ end
1456
+
1457
+ #
1458
+ # Get the application publish settings including 'UseAllTrainingData'.
1459
+ #
1460
+ # @param app_id The application ID.
1461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1462
+ # will be added to the HTTP request.
1463
+ #
1464
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1465
+ #
1466
+ def get_publish_settings_with_http_info(app_id, custom_headers:nil)
1467
+ get_publish_settings_async(app_id, custom_headers:custom_headers).value!
1468
+ end
1469
+
1470
+ #
1471
+ # Get the application publish settings including 'UseAllTrainingData'.
1472
+ #
1473
+ # @param app_id The application ID.
1474
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1475
+ # to the HTTP request.
1476
+ #
1477
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1478
+ #
1479
+ def get_publish_settings_async(app_id, custom_headers:nil)
1480
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1481
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1482
+
1483
+
1484
+ request_headers = {}
1485
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1486
+
1487
+ # Set Headers
1488
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1489
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1490
+ path_template = 'apps/{appId}/publishsettings'
1491
+
1492
+ request_url = @base_url || @client.base_url
1493
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1494
+
1495
+ options = {
1496
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1497
+ path_params: {'appId' => app_id},
1498
+ headers: request_headers.merge(custom_headers || {}),
1499
+ base_url: request_url
1500
+ }
1501
+ promise = @client.make_request_async(:get, path_template, options)
1502
+
1503
+ promise = promise.then do |result|
1504
+ http_response = result.response
1505
+ status_code = http_response.status
1506
+ response_content = http_response.body
1507
+ unless status_code == 200
1508
+ error_model = JSON.load(response_content)
1509
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1510
+ end
1511
+
1512
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1513
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1514
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1515
+ # Deserialize Response
1516
+ if status_code == 200
1517
+ begin
1518
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1519
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::PublishSettings.mapper()
1520
+ result.body = @client.deserialize(result_mapper, parsed_response)
1521
+ rescue Exception => e
1522
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1523
+ end
1524
+ end
1525
+
1526
+ result
1527
+ end
1528
+
1529
+ promise.execute
1530
+ end
1531
+
1532
+ #
1533
+ # Updates the application publish settings including 'UseAllTrainingData'.
1534
+ #
1535
+ # @param app_id The application ID.
1536
+ # @param publish_setting_update_object [PublishSettingUpdateObject] An object
1537
+ # containing the new publish application settings.
1538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1539
+ # will be added to the HTTP request.
1540
+ #
1541
+ # @return [OperationStatus] operation results.
1542
+ #
1543
+ def update_publish_settings(app_id, publish_setting_update_object, custom_headers:nil)
1544
+ response = update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value!
1545
+ response.body unless response.nil?
1546
+ end
1547
+
1548
+ #
1549
+ # Updates the application publish settings including 'UseAllTrainingData'.
1550
+ #
1551
+ # @param app_id The application ID.
1552
+ # @param publish_setting_update_object [PublishSettingUpdateObject] An object
1553
+ # containing the new publish application settings.
1554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1555
+ # will be added to the HTTP request.
1556
+ #
1557
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1558
+ #
1559
+ def update_publish_settings_with_http_info(app_id, publish_setting_update_object, custom_headers:nil)
1560
+ update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value!
1561
+ end
1562
+
1563
+ #
1564
+ # Updates the application publish settings including 'UseAllTrainingData'.
1565
+ #
1566
+ # @param app_id The application ID.
1567
+ # @param publish_setting_update_object [PublishSettingUpdateObject] An object
1568
+ # containing the new publish application settings.
1569
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1570
+ # to the HTTP request.
1571
+ #
1572
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1573
+ #
1574
+ def update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:nil)
1575
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1576
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1577
+ fail ArgumentError, 'publish_setting_update_object is nil' if publish_setting_update_object.nil?
1578
+
1579
+
1580
+ request_headers = {}
1581
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1582
+
1583
+ # Set Headers
1584
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1585
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1586
+
1587
+ # Serialize Request
1588
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::PublishSettingUpdateObject.mapper()
1589
+ request_content = @client.serialize(request_mapper, publish_setting_update_object)
1590
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1591
+
1592
+ path_template = 'apps/{appId}/publishsettings'
1593
+
1594
+ request_url = @base_url || @client.base_url
1595
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1596
+
1597
+ options = {
1598
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1599
+ path_params: {'appId' => app_id},
1600
+ body: request_content,
1601
+ headers: request_headers.merge(custom_headers || {}),
1602
+ base_url: request_url
1603
+ }
1604
+ promise = @client.make_request_async(:put, path_template, options)
1605
+
1606
+ promise = promise.then do |result|
1607
+ http_response = result.response
1608
+ status_code = http_response.status
1609
+ response_content = http_response.body
1610
+ unless status_code == 200
1611
+ error_model = JSON.load(response_content)
1612
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1613
+ end
1614
+
1615
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1616
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1617
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1618
+ # Deserialize Response
1619
+ if status_code == 200
1620
+ begin
1621
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1622
+ result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper()
1623
+ result.body = @client.deserialize(result_mapper, parsed_response)
1624
+ rescue Exception => e
1625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1626
+ end
1627
+ end
1628
+
1629
+ result
1630
+ end
1631
+
1632
+ promise.execute
1633
+ end
1634
+
1635
+ #
1636
+ # Returns the available endpoint deployment regions and URLs.
1637
+ #
1638
+ # @param app_id The application ID.
1639
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1640
+ # will be added to the HTTP request.
1641
+ #
1642
+ # @return [Hash] operation results.
1643
+ #
1644
+ def list_endpoints(app_id, custom_headers:nil)
1645
+ response = list_endpoints_async(app_id, custom_headers:custom_headers).value!
1646
+ response.body unless response.nil?
1647
+ end
1648
+
1649
+ #
1650
+ # Returns the available endpoint deployment regions and URLs.
1651
+ #
1652
+ # @param app_id The application ID.
1653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1654
+ # will be added to the HTTP request.
1655
+ #
1656
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1657
+ #
1658
+ def list_endpoints_with_http_info(app_id, custom_headers:nil)
1659
+ list_endpoints_async(app_id, custom_headers:custom_headers).value!
1660
+ end
1661
+
1662
+ #
1663
+ # Returns the available endpoint deployment regions and URLs.
1664
+ #
1665
+ # @param app_id The application ID.
1666
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1667
+ # to the HTTP request.
1668
+ #
1669
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1670
+ #
1671
+ def list_endpoints_async(app_id, custom_headers:nil)
1672
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1673
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
1674
+
1675
+
1676
+ request_headers = {}
1677
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1678
+
1679
+ # Set Headers
1680
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1681
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1682
+ path_template = 'apps/{appId}/endpoints'
1683
+
1684
+ request_url = @base_url || @client.base_url
1685
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1686
+
1687
+ options = {
1688
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1689
+ path_params: {'appId' => app_id},
1690
+ headers: request_headers.merge(custom_headers || {}),
1691
+ base_url: request_url
1692
+ }
1693
+ promise = @client.make_request_async(:get, path_template, options)
1694
+
1695
+ promise = promise.then do |result|
1696
+ http_response = result.response
1697
+ status_code = http_response.status
1698
+ response_content = http_response.body
1699
+ unless status_code == 200
1700
+ error_model = JSON.load(response_content)
1701
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1702
+ end
1703
+
1704
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1705
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1706
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1707
+ # Deserialize Response
1708
+ if status_code == 200
1709
+ begin
1710
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1711
+ result_mapper = {
1712
+ client_side_validation: true,
1713
+ required: false,
1714
+ serialized_name: 'parsed_response',
1715
+ type: {
1716
+ name: 'Dictionary',
1717
+ value: {
1718
+ client_side_validation: true,
1719
+ required: false,
1720
+ serialized_name: 'StringElementType',
1721
+ type: {
1722
+ name: 'String'
1723
+ }
1724
+ }
1725
+ }
1726
+ }
1727
+ result.body = @client.deserialize(result_mapper, parsed_response)
1728
+ rescue Exception => e
1729
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1730
+ end
1731
+ end
1732
+
1733
+ result
1734
+ end
1735
+
1736
+ promise.execute
1737
+ end
1738
+
1739
+ #
1740
+ # Gets all the available custom prebuilt domains for all cultures.
1741
+ #
1742
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1743
+ # will be added to the HTTP request.
1744
+ #
1745
+ # @return [Array] operation results.
1746
+ #
1747
+ def list_available_custom_prebuilt_domains(custom_headers:nil)
1748
+ response = list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value!
1749
+ response.body unless response.nil?
1750
+ end
1751
+
1752
+ #
1753
+ # Gets all the available custom prebuilt domains for all cultures.
1754
+ #
1755
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1756
+ # will be added to the HTTP request.
1757
+ #
1758
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1759
+ #
1760
+ def list_available_custom_prebuilt_domains_with_http_info(custom_headers:nil)
1761
+ list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value!
1762
+ end
1763
+
1764
+ #
1765
+ # Gets all the available custom prebuilt domains for all cultures.
1766
+ #
1767
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1768
+ # to the HTTP request.
1769
+ #
1770
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1771
+ #
1772
+ def list_available_custom_prebuilt_domains_async(custom_headers:nil)
1773
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1774
+
1775
+
1776
+ request_headers = {}
1777
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1778
+
1779
+ # Set Headers
1780
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1781
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1782
+ path_template = 'apps/customprebuiltdomains'
1783
+
1784
+ request_url = @base_url || @client.base_url
1785
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1786
+
1787
+ options = {
1788
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1789
+ headers: request_headers.merge(custom_headers || {}),
1790
+ base_url: request_url
1791
+ }
1792
+ promise = @client.make_request_async(:get, path_template, options)
1793
+
1794
+ promise = promise.then do |result|
1795
+ http_response = result.response
1796
+ status_code = http_response.status
1797
+ response_content = http_response.body
1798
+ unless status_code == 200
1799
+ error_model = JSON.load(response_content)
1800
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1801
+ end
1802
+
1803
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1804
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1805
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1806
+ # Deserialize Response
1807
+ if status_code == 200
1808
+ begin
1809
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1810
+ result_mapper = {
1811
+ client_side_validation: true,
1812
+ required: false,
1813
+ serialized_name: 'parsed_response',
1814
+ type: {
1815
+ name: 'Sequence',
1816
+ element: {
1817
+ client_side_validation: true,
1818
+ required: false,
1819
+ serialized_name: 'PrebuiltDomainElementType',
1820
+ type: {
1821
+ name: 'Composite',
1822
+ class_name: 'PrebuiltDomain'
1823
+ }
1824
+ }
1825
+ }
1826
+ }
1827
+ result.body = @client.deserialize(result_mapper, parsed_response)
1828
+ rescue Exception => e
1829
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1830
+ end
1831
+ end
1832
+
1833
+ result
1834
+ end
1835
+
1836
+ promise.execute
1837
+ end
1838
+
1839
+ #
1840
+ # Adds a prebuilt domain along with its intent and entity models as a new
1841
+ # application.
1842
+ #
1843
+ # @param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt
1844
+ # domain create object containing the name and culture of the domain.
1845
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1846
+ # will be added to the HTTP request.
1847
+ #
1848
+ # @return [Uuid] operation results.
1849
+ #
1850
+ def add_custom_prebuilt_domain(prebuilt_domain_create_object, custom_headers:nil)
1851
+ response = add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value!
1852
+ response.body unless response.nil?
1853
+ end
1854
+
1855
+ #
1856
+ # Adds a prebuilt domain along with its intent and entity models as a new
1857
+ # application.
1858
+ #
1859
+ # @param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt
1860
+ # domain create object containing the name and culture of the domain.
1861
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1862
+ # will be added to the HTTP request.
1863
+ #
1864
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1865
+ #
1866
+ def add_custom_prebuilt_domain_with_http_info(prebuilt_domain_create_object, custom_headers:nil)
1867
+ add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value!
1868
+ end
1869
+
1870
+ #
1871
+ # Adds a prebuilt domain along with its intent and entity models as a new
1872
+ # application.
1873
+ #
1874
+ # @param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt
1875
+ # domain create object containing the name and culture of the domain.
1876
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1877
+ # to the HTTP request.
1878
+ #
1879
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1880
+ #
1881
+ def add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:nil)
1882
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1883
+ fail ArgumentError, 'prebuilt_domain_create_object is nil' if prebuilt_domain_create_object.nil?
1884
+
1885
+
1886
+ request_headers = {}
1887
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1888
+
1889
+ # Set Headers
1890
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1891
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1892
+
1893
+ # Serialize Request
1894
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::PrebuiltDomainCreateObject.mapper()
1895
+ request_content = @client.serialize(request_mapper, prebuilt_domain_create_object)
1896
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1897
+
1898
+ path_template = 'apps/customprebuiltdomains'
1899
+
1900
+ request_url = @base_url || @client.base_url
1901
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1902
+
1903
+ options = {
1904
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1905
+ body: request_content,
1906
+ headers: request_headers.merge(custom_headers || {}),
1907
+ base_url: request_url
1908
+ }
1909
+ promise = @client.make_request_async(:post, path_template, options)
1910
+
1911
+ promise = promise.then do |result|
1912
+ http_response = result.response
1913
+ status_code = http_response.status
1914
+ response_content = http_response.body
1915
+ unless status_code == 201
1916
+ error_model = JSON.load(response_content)
1917
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1918
+ end
1919
+
1920
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1921
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1922
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1923
+ # Deserialize Response
1924
+ if status_code == 201
1925
+ begin
1926
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1927
+ result_mapper = {
1928
+ client_side_validation: true,
1929
+ required: false,
1930
+ serialized_name: 'parsed_response',
1931
+ type: {
1932
+ name: 'String'
1933
+ }
1934
+ }
1935
+ result.body = @client.deserialize(result_mapper, parsed_response)
1936
+ rescue Exception => e
1937
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1938
+ end
1939
+ end
1940
+
1941
+ result
1942
+ end
1943
+
1944
+ promise.execute
1945
+ end
1946
+
1947
+ #
1948
+ # Gets all the available prebuilt domains for a specific culture.
1949
+ #
1950
+ # @param culture [String] Culture.
1951
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1952
+ # will be added to the HTTP request.
1953
+ #
1954
+ # @return [Array] operation results.
1955
+ #
1956
+ def list_available_custom_prebuilt_domains_for_culture(culture, custom_headers:nil)
1957
+ response = list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value!
1958
+ response.body unless response.nil?
1959
+ end
1960
+
1961
+ #
1962
+ # Gets all the available prebuilt domains for a specific culture.
1963
+ #
1964
+ # @param culture [String] Culture.
1965
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1966
+ # will be added to the HTTP request.
1967
+ #
1968
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1969
+ #
1970
+ def list_available_custom_prebuilt_domains_for_culture_with_http_info(culture, custom_headers:nil)
1971
+ list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value!
1972
+ end
1973
+
1974
+ #
1975
+ # Gets all the available prebuilt domains for a specific culture.
1976
+ #
1977
+ # @param culture [String] Culture.
1978
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1979
+ # to the HTTP request.
1980
+ #
1981
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1982
+ #
1983
+ def list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:nil)
1984
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1985
+ fail ArgumentError, 'culture is nil' if culture.nil?
1986
+
1987
+
1988
+ request_headers = {}
1989
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1990
+
1991
+ # Set Headers
1992
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1993
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1994
+ path_template = 'apps/customprebuiltdomains/{culture}'
1995
+
1996
+ request_url = @base_url || @client.base_url
1997
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1998
+
1999
+ options = {
2000
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2001
+ path_params: {'culture' => culture},
2002
+ headers: request_headers.merge(custom_headers || {}),
2003
+ base_url: request_url
2004
+ }
2005
+ promise = @client.make_request_async(:get, path_template, options)
2006
+
2007
+ promise = promise.then do |result|
2008
+ http_response = result.response
2009
+ status_code = http_response.status
2010
+ response_content = http_response.body
2011
+ unless status_code == 200
2012
+ error_model = JSON.load(response_content)
2013
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2014
+ end
2015
+
2016
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2017
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2018
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2019
+ # Deserialize Response
2020
+ if status_code == 200
2021
+ begin
2022
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2023
+ result_mapper = {
2024
+ client_side_validation: true,
2025
+ required: false,
2026
+ serialized_name: 'parsed_response',
2027
+ type: {
2028
+ name: 'Sequence',
2029
+ element: {
2030
+ client_side_validation: true,
2031
+ required: false,
2032
+ serialized_name: 'PrebuiltDomainElementType',
2033
+ type: {
2034
+ name: 'Composite',
2035
+ class_name: 'PrebuiltDomain'
2036
+ }
2037
+ }
2038
+ }
2039
+ }
2040
+ result.body = @client.deserialize(result_mapper, parsed_response)
2041
+ rescue Exception => e
2042
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2043
+ end
2044
+ end
2045
+
2046
+ result
2047
+ end
2048
+
2049
+ promise.execute
2050
+ end
2051
+
2052
+ #
2053
+ # package - Gets published LUIS application package in binary stream GZip
2054
+ # format
2055
+ #
2056
+ # Packages a published LUIS application as a GZip file to be used in the LUIS
2057
+ # container.
2058
+ #
2059
+ # @param app_id The application ID.
2060
+ # @param slot_name [String] The publishing slot name.
2061
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2062
+ # will be added to the HTTP request.
2063
+ #
2064
+ # @return [NOT_IMPLEMENTED] operation results.
2065
+ #
2066
+ def package_published_application_as_gzip(app_id, slot_name, custom_headers:nil)
2067
+ response = package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value!
2068
+ response.body unless response.nil?
2069
+ end
2070
+
2071
+ #
2072
+ # package - Gets published LUIS application package in binary stream GZip
2073
+ # format
2074
+ #
2075
+ # Packages a published LUIS application as a GZip file to be used in the LUIS
2076
+ # container.
2077
+ #
2078
+ # @param app_id The application ID.
2079
+ # @param slot_name [String] The publishing slot name.
2080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2081
+ # will be added to the HTTP request.
2082
+ #
2083
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2084
+ #
2085
+ def package_published_application_as_gzip_with_http_info(app_id, slot_name, custom_headers:nil)
2086
+ package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value!
2087
+ end
2088
+
2089
+ #
2090
+ # package - Gets published LUIS application package in binary stream GZip
2091
+ # format
2092
+ #
2093
+ # Packages a published LUIS application as a GZip file to be used in the LUIS
2094
+ # container.
2095
+ #
2096
+ # @param app_id The application ID.
2097
+ # @param slot_name [String] The publishing slot name.
2098
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2099
+ # to the HTTP request.
2100
+ #
2101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2102
+ #
2103
+ def package_published_application_as_gzip_async(app_id, slot_name, custom_headers:nil)
2104
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2105
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
2106
+ fail ArgumentError, 'slot_name is nil' if slot_name.nil?
2107
+
2108
+
2109
+ request_headers = {}
2110
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2111
+
2112
+ # Set Headers
2113
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2114
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2115
+ path_template = 'package/{appId}/slot/{slotName}/gzip'
2116
+
2117
+ request_url = @base_url || @client.base_url
2118
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2119
+
2120
+ options = {
2121
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2122
+ path_params: {'appId' => app_id,'slotName' => slot_name},
2123
+ headers: request_headers.merge(custom_headers || {}),
2124
+ base_url: request_url
2125
+ }
2126
+ promise = @client.make_request_async(:get, path_template, options)
2127
+
2128
+ promise = promise.then do |result|
2129
+ http_response = result.response
2130
+ status_code = http_response.status
2131
+ response_content = http_response.body
2132
+ unless status_code == 200
2133
+ error_model = JSON.load(response_content)
2134
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2135
+ end
2136
+
2137
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2138
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2139
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2140
+ # Deserialize Response
2141
+ if status_code == 200
2142
+ begin
2143
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2144
+ result_mapper = {
2145
+ client_side_validation: true,
2146
+ required: false,
2147
+ serialized_name: 'parsed_response',
2148
+ type: {
2149
+ name: 'Stream'
2150
+ }
2151
+ }
2152
+ result.body = @client.deserialize(result_mapper, parsed_response)
2153
+ rescue Exception => e
2154
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2155
+ end
2156
+ end
2157
+
2158
+ result
2159
+ end
2160
+
2161
+ promise.execute
2162
+ end
2163
+
2164
+ #
2165
+ # package - Gets trained LUIS application package in binary stream GZip format
2166
+ #
2167
+ # Packages trained LUIS application as GZip file to be used in the LUIS
2168
+ # container.
2169
+ #
2170
+ # @param app_id The application ID.
2171
+ # @param version_id [String] The version ID.
2172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2173
+ # will be added to the HTTP request.
2174
+ #
2175
+ # @return [NOT_IMPLEMENTED] operation results.
2176
+ #
2177
+ def package_trained_application_as_gzip(app_id, version_id, custom_headers:nil)
2178
+ response = package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value!
2179
+ response.body unless response.nil?
2180
+ end
2181
+
2182
+ #
2183
+ # package - Gets trained LUIS application package in binary stream GZip format
2184
+ #
2185
+ # Packages trained LUIS application as GZip file to be used in the LUIS
2186
+ # container.
2187
+ #
2188
+ # @param app_id The application ID.
2189
+ # @param version_id [String] The version ID.
2190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2191
+ # will be added to the HTTP request.
2192
+ #
2193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2194
+ #
2195
+ def package_trained_application_as_gzip_with_http_info(app_id, version_id, custom_headers:nil)
2196
+ package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value!
2197
+ end
2198
+
2199
+ #
2200
+ # package - Gets trained LUIS application package in binary stream GZip format
2201
+ #
2202
+ # Packages trained LUIS application as GZip file to be used in the LUIS
2203
+ # container.
2204
+ #
2205
+ # @param app_id The application ID.
2206
+ # @param version_id [String] The version ID.
2207
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2208
+ # to the HTTP request.
2209
+ #
2210
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2211
+ #
2212
+ def package_trained_application_as_gzip_async(app_id, version_id, custom_headers:nil)
2213
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2214
+ fail ArgumentError, 'app_id is nil' if app_id.nil?
2215
+ fail ArgumentError, 'version_id is nil' if version_id.nil?
2216
+
2217
+
2218
+ request_headers = {}
2219
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2220
+
2221
+ # Set Headers
2222
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2223
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2224
+ path_template = 'package/{appId}/versions/{versionId}/gzip'
2225
+
2226
+ request_url = @base_url || @client.base_url
2227
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2228
+
2229
+ options = {
2230
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2231
+ path_params: {'appId' => app_id,'versionId' => version_id},
2232
+ headers: request_headers.merge(custom_headers || {}),
2233
+ base_url: request_url
2234
+ }
2235
+ promise = @client.make_request_async(:get, path_template, options)
2236
+
2237
+ promise = promise.then do |result|
2238
+ http_response = result.response
2239
+ status_code = http_response.status
2240
+ response_content = http_response.body
2241
+ unless status_code == 200
2242
+ error_model = JSON.load(response_content)
2243
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2244
+ end
2245
+
2246
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2247
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2248
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2249
+ # Deserialize Response
2250
+ if status_code == 200
2251
+ begin
2252
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2253
+ result_mapper = {
2254
+ client_side_validation: true,
2255
+ required: false,
2256
+ serialized_name: 'parsed_response',
2257
+ type: {
2258
+ name: 'Stream'
2259
+ }
2260
+ }
2261
+ result.body = @client.deserialize(result_mapper, parsed_response)
2262
+ rescue Exception => e
2263
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2264
+ end
2265
+ end
2266
+
2267
+ result
2268
+ end
2269
+
2270
+ promise.execute
2271
+ end
2272
+
2273
+ #
2274
+ # Imports an application to LUIS, the application's structure is included in
2275
+ # the request body.
2276
+ #
2277
+ # @param luis_app_v2 [LuisAppV2] A LUIS application structure.
2278
+ # @param app_name [String] The application name to create. If not specified,
2279
+ # the application name will be read from the imported object. If the
2280
+ # application name already exists, an error is returned.
2281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2282
+ # will be added to the HTTP request.
2283
+ #
2284
+ # @return [Uuid] operation results.
2285
+ #
2286
+ def import_v2app(luis_app_v2, app_name:nil, custom_headers:nil)
2287
+ response = import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
2288
+ response.body unless response.nil?
2289
+ end
2290
+
2291
+ #
2292
+ # Imports an application to LUIS, the application's structure is included in
2293
+ # the request body.
2294
+ #
2295
+ # @param luis_app_v2 [LuisAppV2] A LUIS application structure.
2296
+ # @param app_name [String] The application name to create. If not specified,
2297
+ # the application name will be read from the imported object. If the
2298
+ # application name already exists, an error is returned.
2299
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2300
+ # will be added to the HTTP request.
2301
+ #
2302
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2303
+ #
2304
+ def import_v2app_with_http_info(luis_app_v2, app_name:nil, custom_headers:nil)
2305
+ import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
2306
+ end
2307
+
2308
+ #
2309
+ # Imports an application to LUIS, the application's structure is included in
2310
+ # the request body.
2311
+ #
2312
+ # @param luis_app_v2 [LuisAppV2] A LUIS application structure.
2313
+ # @param app_name [String] The application name to create. If not specified,
2314
+ # the application name will be read from the imported object. If the
2315
+ # application name already exists, an error is returned.
2316
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2317
+ # to the HTTP request.
2318
+ #
2319
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2320
+ #
2321
+ def import_v2app_async(luis_app_v2, app_name:nil, custom_headers:nil)
2322
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2323
+ fail ArgumentError, 'luis_app_v2 is nil' if luis_app_v2.nil?
2324
+
2325
+
2326
+ request_headers = {}
2327
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2328
+
2329
+ # Set Headers
2330
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2331
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2332
+
2333
+ # Serialize Request
2334
+ request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::LuisAppV2.mapper()
2335
+ request_content = @client.serialize(request_mapper, luis_app_v2)
2336
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2337
+
2338
+ path_template = 'apps/import'
2339
+
2340
+ request_url = @base_url || @client.base_url
2341
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2342
+
2343
+ options = {
2344
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2345
+ query_params: {'appName' => app_name},
2346
+ body: request_content,
2347
+ headers: request_headers.merge(custom_headers || {}),
2348
+ base_url: request_url
2349
+ }
2350
+ promise = @client.make_request_async(:post, path_template, options)
2351
+
2352
+ promise = promise.then do |result|
2353
+ http_response = result.response
2354
+ status_code = http_response.status
2355
+ response_content = http_response.body
2356
+ unless status_code == 201
2357
+ error_model = JSON.load(response_content)
2358
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2359
+ end
2360
+
2361
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2362
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2363
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2364
+ # Deserialize Response
2365
+ if status_code == 201
2366
+ begin
2367
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2368
+ result_mapper = {
2369
+ client_side_validation: true,
2370
+ required: false,
2371
+ serialized_name: 'parsed_response',
2372
+ type: {
2373
+ name: 'String'
2374
+ }
2375
+ }
2376
+ result.body = @client.deserialize(result_mapper, parsed_response)
2377
+ rescue Exception => e
2378
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2379
+ end
2380
+ end
2381
+
2382
+ result
2383
+ end
2384
+
2385
+ promise.execute
2386
+ end
2387
+
2388
+ #
2389
+ # Imports an application to LUIS, the application's structure is included in
2390
+ # the request body.
2391
+ #
2392
+ # @param luis_app_lu [String] A LUIS application structure.
2393
+ # @param app_name [String] The application name to create. If not specified,
2394
+ # the application name will be read from the imported object. If the
2395
+ # application name already exists, an error is returned.
2396
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2397
+ # will be added to the HTTP request.
2398
+ #
2399
+ # @return [Uuid] operation results.
2400
+ #
2401
+ def import_lu_format(luis_app_lu, app_name:nil, custom_headers:nil)
2402
+ response = import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
2403
+ response.body unless response.nil?
2404
+ end
2405
+
2406
+ #
2407
+ # Imports an application to LUIS, the application's structure is included in
2408
+ # the request body.
2409
+ #
2410
+ # @param luis_app_lu [String] A LUIS application structure.
2411
+ # @param app_name [String] The application name to create. If not specified,
2412
+ # the application name will be read from the imported object. If the
2413
+ # application name already exists, an error is returned.
2414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2415
+ # will be added to the HTTP request.
2416
+ #
2417
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2418
+ #
2419
+ def import_lu_format_with_http_info(luis_app_lu, app_name:nil, custom_headers:nil)
2420
+ import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
2421
+ end
2422
+
2423
+ #
2424
+ # Imports an application to LUIS, the application's structure is included in
2425
+ # the request body.
2426
+ #
2427
+ # @param luis_app_lu [String] A LUIS application structure.
2428
+ # @param app_name [String] The application name to create. If not specified,
2429
+ # the application name will be read from the imported object. If the
2430
+ # application name already exists, an error is returned.
2431
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2432
+ # to the HTTP request.
2433
+ #
2434
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2435
+ #
2436
+ def import_lu_format_async(luis_app_lu, app_name:nil, custom_headers:nil)
2437
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2438
+ fail ArgumentError, 'luis_app_lu is nil' if luis_app_lu.nil?
2439
+
2440
+
2441
+ request_headers = {}
2442
+ request_headers['Content-Type'] = 'text/plain'
2443
+
2444
+ # Set Headers
2445
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2446
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2447
+
2448
+ # Serialize Request
2449
+ request_mapper = {
2450
+ client_side_validation: true,
2451
+ required: true,
2452
+ serialized_name: 'luisAppLu',
2453
+ type: {
2454
+ name: 'String'
2455
+ }
2456
+ }
2457
+ request_content = @client.serialize(request_mapper, luis_app_lu)
2458
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2459
+
2460
+ path_template = 'apps/import'
2461
+
2462
+ request_url = @base_url || @client.base_url
2463
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2464
+
2465
+ options = {
2466
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2467
+ query_params: {'appName' => app_name},
2468
+ body: request_content,
2469
+ headers: request_headers.merge(custom_headers || {}),
2470
+ base_url: request_url
2471
+ }
2472
+ promise = @client.make_request_async(:post, path_template, options)
2473
+
2474
+ promise = promise.then do |result|
2475
+ http_response = result.response
2476
+ status_code = http_response.status
2477
+ response_content = http_response.body
2478
+ unless status_code == 201
2479
+ error_model = JSON.load(response_content)
2480
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2481
+ end
2482
+
2483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2484
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2485
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2486
+ # Deserialize Response
2487
+ if status_code == 201
2488
+ begin
2489
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2490
+ result_mapper = {
2491
+ client_side_validation: true,
2492
+ required: false,
2493
+ serialized_name: 'parsed_response',
2494
+ type: {
2495
+ name: 'String'
2496
+ }
2497
+ }
2498
+ result.body = @client.deserialize(result_mapper, parsed_response)
2499
+ rescue Exception => e
2500
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2501
+ end
2502
+ end
2503
+
2504
+ result
2505
+ end
2506
+
2507
+ promise.execute
2508
+ end
2509
+
2510
+ end
2511
+ end