Class: Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Versions
- Inherits:
-
Object
- Object
- Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Versions
- Includes:
- MsRestAzure
- Defined in:
- lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb
Overview
Versions
Instance Attribute Summary collapse
-
#client ⇒ LuisAuthoringClient
readonly
Reference to the LuisAuthoringClient.
Instance Method Summary collapse
-
#clone(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ String
Creates a new version from the selected version.
-
#clone_async(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ Concurrent::Promise
Creates a new version from the selected version.
-
#clone_with_http_info(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a new version from the selected version.
-
#delete(app_id, version_id, custom_headers: nil) ⇒ OperationStatus
Deletes an application version.
-
#delete_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Deletes an application version.
-
#delete_unlabelled_utterance(app_id, version_id, utterance, custom_headers: nil) ⇒ OperationStatus
Deleted an unlabelled utterance in a version of the application.
-
#delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers: nil) ⇒ Concurrent::Promise
Deleted an unlabelled utterance in a version of the application.
-
#delete_unlabelled_utterance_with_http_info(app_id, version_id, utterance, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deleted an unlabelled utterance in a version of the application.
-
#delete_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes an application version.
-
#export(app_id, version_id, custom_headers: nil) ⇒ LuisApp
Exports a LUIS application to JSON format.
-
#export_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Exports a LUIS application to JSON format.
-
#export_lu_format(app_id, version_id, custom_headers: nil) ⇒ NOT_IMPLEMENTED
Exports a LUIS application to text format.
-
#export_lu_format_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Exports a LUIS application to text format.
-
#export_lu_format_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Exports a LUIS application to text format.
-
#export_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Exports a LUIS application to JSON format.
-
#get(app_id, version_id, custom_headers: nil) ⇒ VersionInfo
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
-
#get_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
-
#get_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
-
#import(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
-
#import_async(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
-
#import_lu_format(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
-
#import_lu_format_async(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
-
#import_lu_format_with_http_info(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
-
#import_v2app(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
-
#import_v2app_async(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
-
#import_v2app_with_http_info(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
-
#import_with_http_info(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
-
#initialize(client) ⇒ Versions
constructor
Creates and initializes a new instance of the Versions class.
-
#list(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ Array
Gets a list of versions for this application ID.
-
#list_async(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of versions for this application ID.
-
#list_with_http_info(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of versions for this application ID.
-
#update(app_id, version_id, version_update_object, custom_headers: nil) ⇒ OperationStatus
Updates the name or description of the application version.
-
#update_async(app_id, version_id, version_update_object, custom_headers: nil) ⇒ Concurrent::Promise
Updates the name or description of the application version.
-
#update_with_http_info(app_id, version_id, version_update_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates the name or description of the application version.
Constructor Details
#initialize(client) ⇒ Versions
Creates and initializes a new instance of the Versions class.
17 18 19 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ LuisAuthoringClient (readonly)
Returns reference to the LuisAuthoringClient.
22 23 24 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 22 def client @client end |
Instance Method Details
#clone(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ String
Creates a new version from the selected version.
version ID. will be added to the HTTP request.
36 37 38 39 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 36 def clone(app_id, version_id, version_clone_object, custom_headers:nil) response = clone_async(app_id, version_id, version_clone_object, custom_headers:custom_headers).value! response.body unless response.nil? end |
#clone_async(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ Concurrent::Promise
Creates a new version from the selected version.
version ID. to the HTTP request.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 69 def clone_async(app_id, version_id, version_clone_object, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'version_clone_object is nil' if version_clone_object.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::TaskUpdateObject.mapper() request_content = @client.serialize(request_mapper, version_clone_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/clone' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'String' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#clone_with_http_info(app_id, version_id, version_clone_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a new version from the selected version.
version ID. will be added to the HTTP request.
53 54 55 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 53 def clone_with_http_info(app_id, version_id, version_clone_object, custom_headers:nil) clone_async(app_id, version_id, version_clone_object, custom_headers:custom_headers).value! end |
#delete(app_id, version_id, custom_headers: nil) ⇒ OperationStatus
Deletes an application version.
will be added to the HTTP request.
469 470 471 472 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 469 def delete(app_id, version_id, custom_headers:nil) response = delete_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#delete_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Deletes an application version.
to the HTTP request.
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 498 def delete_async(app_id, version_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/{appId}/versions/{versionId}/' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#delete_unlabelled_utterance(app_id, version_id, utterance, custom_headers: nil) ⇒ OperationStatus
Deleted an unlabelled utterance in a version of the application.
will be added to the HTTP request.
770 771 772 773 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 770 def delete_unlabelled_utterance(app_id, version_id, utterance, custom_headers:nil) response = delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers:custom_headers).value! response.body unless response.nil? end |
#delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers: nil) ⇒ Concurrent::Promise
Deleted an unlabelled utterance in a version of the application.
to the HTTP request.
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 801 def delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'utterance is nil' if utterance.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = { client_side_validation: true, required: true, serialized_name: 'utterance', type: { name: 'String' } } request_content = @client.serialize(request_mapper, utterance) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/suggest' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#delete_unlabelled_utterance_with_http_info(app_id, version_id, utterance, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deleted an unlabelled utterance in a version of the application.
will be added to the HTTP request.
786 787 788 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 786 def delete_unlabelled_utterance_with_http_info(app_id, version_id, utterance, custom_headers:nil) delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers:custom_headers).value! end |
#delete_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes an application version.
will be added to the HTTP request.
484 485 486 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 484 def delete_with_http_info(app_id, version_id, custom_headers:nil) delete_async(app_id, version_id, custom_headers:custom_headers).value! end |
#export(app_id, version_id, custom_headers: nil) ⇒ LuisApp
Exports a LUIS application to JSON format.
will be added to the HTTP request.
562 563 564 565 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 562 def export(app_id, version_id, custom_headers:nil) response = export_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#export_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Exports a LUIS application to JSON format.
to the HTTP request.
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 591 def export_async(app_id, version_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/{appId}/versions/{versionId}/export' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::LuisApp.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#export_lu_format(app_id, version_id, custom_headers: nil) ⇒ NOT_IMPLEMENTED
Exports a LUIS application to text format.
will be added to the HTTP request.
1118 1119 1120 1121 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 1118 def export_lu_format(app_id, version_id, custom_headers:nil) response = export_lu_format_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#export_lu_format_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Exports a LUIS application to text format.
to the HTTP request.
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 1147 def export_lu_format_async(app_id, version_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? format = 'lu' fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/{appId}/versions/{versionId}/export' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, query_params: {'format' => format}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Stream' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#export_lu_format_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Exports a LUIS application to text format.
will be added to the HTTP request.
1133 1134 1135 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 1133 def export_lu_format_with_http_info(app_id, version_id, custom_headers:nil) export_lu_format_async(app_id, version_id, custom_headers:custom_headers).value! end |
#export_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Exports a LUIS application to JSON format.
will be added to the HTTP request.
577 578 579 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 577 def export_with_http_info(app_id, version_id, custom_headers:nil) export_async(app_id, version_id, custom_headers:custom_headers).value! end |
#get(app_id, version_id, custom_headers: nil) ⇒ VersionInfo
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
will be added to the HTTP request.
267 268 269 270 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 267 def get(app_id, version_id, custom_headers:nil) response = get_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
to the HTTP request.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 298 def get_async(app_id, version_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/{appId}/versions/{versionId}/' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::VersionInfo.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
will be added to the HTTP request.
283 284 285 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 283 def get_with_http_info(app_id, version_id, custom_headers:nil) get_async(app_id, version_id, custom_headers:custom_headers).value! end |
#import(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
versionId will be read from the imported object. will be added to the HTTP request.
657 658 659 660 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 657 def import(app_id, luis_app, version_id:nil, custom_headers:nil) response = import_async(app_id, luis_app, version_id:version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#import_async(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
versionId will be read from the imported object. to the HTTP request.
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 690 def import_async(app_id, luis_app, version_id:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'luis_app is nil' if luis_app.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::LuisApp.mapper() request_content = @client.serialize(request_mapper, luis_app) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/import' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id}, query_params: {'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'String' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#import_lu_format(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
structure. versionId will be read from the imported object. will be added to the HTTP request.
997 998 999 1000 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 997 def import_lu_format(app_id, luis_app_lu, version_id:nil, custom_headers:nil) response = import_lu_format_async(app_id, luis_app_lu, version_id:version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#import_lu_format_async(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
structure. versionId will be read from the imported object. to the HTTP request.
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 1032 def import_lu_format_async(app_id, luis_app_lu, version_id:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'luis_app_lu is nil' if luis_app_lu.nil? request_headers = {} request_headers['Content-Type'] = 'text/plain' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = { client_side_validation: true, required: true, serialized_name: 'luisAppLu', type: { name: 'String' } } request_content = @client.serialize(request_mapper, luis_app_lu) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/import' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id}, query_params: {'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'String' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#import_lu_format_with_http_info(app_id, luis_app_lu, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
structure. versionId will be read from the imported object. will be added to the HTTP request.
1015 1016 1017 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 1015 def import_lu_format_with_http_info(app_id, luis_app_lu, version_id:nil, custom_headers:nil) import_lu_format_async(app_id, luis_app_lu, version_id:version_id, custom_headers:custom_headers).value! end |
#import_v2app(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ String
Imports a new version into a LUIS application.
versionId will be read from the imported object. will be added to the HTTP request.
882 883 884 885 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 882 def import_v2app(app_id, luis_app_v2, version_id:nil, custom_headers:nil) response = import_v2app_async(app_id, luis_app_v2, version_id:version_id, custom_headers:custom_headers).value! response.body unless response.nil? end |
#import_v2app_async(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ Concurrent::Promise
Imports a new version into a LUIS application.
versionId will be read from the imported object. to the HTTP request.
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 915 def import_v2app_async(app_id, luis_app_v2, version_id:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'luis_app_v2 is nil' if luis_app_v2.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::LuisAppV2.mapper() request_content = @client.serialize(request_mapper, luis_app_v2) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/import' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id}, query_params: {'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'String' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#import_v2app_with_http_info(app_id, luis_app_v2, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
versionId will be read from the imported object. will be added to the HTTP request.
899 900 901 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 899 def import_v2app_with_http_info(app_id, luis_app_v2, version_id:nil, custom_headers:nil) import_v2app_async(app_id, luis_app_v2, version_id:version_id, custom_headers:custom_headers).value! end |
#import_with_http_info(app_id, luis_app, version_id: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Imports a new version into a LUIS application.
versionId will be read from the imported object. will be added to the HTTP request.
674 675 676 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 674 def import_with_http_info(app_id, luis_app, version_id:nil, custom_headers:nil) import_async(app_id, luis_app, version_id:version_id, custom_headers:custom_headers).value! end |
#list(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ Array
Gets a list of versions for this application ID.
-
Default is 100.
will be added to the HTTP request.
150 151 152 153 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 150 def list(app_id, skip:0, take:100, custom_headers:nil) response = list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_async(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of versions for this application ID.
-
Default is 100.
to the HTTP request.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 183 def list_async(app_id, skip:0, take:100, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/{appId}/versions' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id}, query_params: {'skip' => skip,'take' => take}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VersionInfoElementType', type: { name: 'Composite', class_name: 'VersionInfo' } } } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_with_http_info(app_id, skip: 0, take: 100, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of versions for this application ID.
-
Default is 100.
will be added to the HTTP request.
167 168 169 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 167 def list_with_http_info(app_id, skip:0, take:100, custom_headers:nil) list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value! end |
#update(app_id, version_id, version_update_object, custom_headers: nil) ⇒ OperationStatus
Updates the name or description of the application version.
Description of the application. will be added to the HTTP request.
364 365 366 367 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 364 def update(app_id, version_id, version_update_object, custom_headers:nil) response = update_async(app_id, version_id, version_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(app_id, version_id, version_update_object, custom_headers: nil) ⇒ Concurrent::Promise
Updates the name or description of the application version.
Description of the application. to the HTTP request.
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 397 def update_async(app_id, version_id, version_update_object, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'version_update_object is nil' if version_update_object.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::TaskUpdateObject.mapper() request_content = @client.serialize(request_mapper, version_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'appId' => app_id,'versionId' => version_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::OperationStatus.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#update_with_http_info(app_id, version_id, version_update_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates the name or description of the application version.
Description of the application. will be added to the HTTP request.
381 382 383 |
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/versions.rb', line 381 def update_with_http_info(app_id, version_id, version_update_object, custom_headers:nil) update_async(app_id, version_id, version_update_object, custom_headers:custom_headers).value! end |