azure_cognitiveservices_luisauthoring 0.17.0

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