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