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