Class: Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Apps

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb

Overview

Apps

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Apps

Creates and initializes a new instance of the Apps class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientLuisAuthoringClient (readonly)

Returns reference to the LuisAuthoringClient.

Returns:



22
23
24
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 22

def client
  @client
end

Instance Method Details

#add(application_create_object, custom_headers: nil) ⇒ Uuid

Creates a new LUIS app.

containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. will be added to the HTTP request.

Parameters:

  • application_create_object (ApplicationCreateObject)

    An application

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Uuid)

    operation results.



37
38
39
40
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 37

def add(application_create_object, custom_headers:nil)
  response = add_async(application_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#add_async(application_create_object, custom_headers: nil) ⇒ Concurrent::Promise

Creates a new LUIS app.

containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. to the HTTP request.

Parameters:

  • application_create_object (ApplicationCreateObject)

    An application

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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/apps.rb', line 72

def add_async(application_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'application_create_object is nil' if application_create_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::ApplicationCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  application_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#add_custom_prebuilt_domain(prebuilt_domain_create_object, custom_headers: nil) ⇒ Uuid

Adds a prebuilt domain along with its intent and entity models as a new application.

domain create object containing the name and culture of the domain. will be added to the HTTP request.

Parameters:

  • prebuilt_domain_create_object (PrebuiltDomainCreateObject)

    A prebuilt

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Uuid)

    operation results.



1850
1851
1852
1853
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1850

def add_custom_prebuilt_domain(prebuilt_domain_create_object, custom_headers:nil)
  response = add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers: nil) ⇒ Concurrent::Promise

Adds a prebuilt domain along with its intent and entity models as a new application.

domain create object containing the name and culture of the domain. to the HTTP request.

Parameters:

  • prebuilt_domain_create_object (PrebuiltDomainCreateObject)

    A prebuilt

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1881

def add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'prebuilt_domain_create_object is nil' if prebuilt_domain_create_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::PrebuiltDomainCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  prebuilt_domain_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/customprebuiltdomains'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#add_custom_prebuilt_domain_with_http_info(prebuilt_domain_create_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Adds a prebuilt domain along with its intent and entity models as a new application.

domain create object containing the name and culture of the domain. will be added to the HTTP request.

Parameters:

  • prebuilt_domain_create_object (PrebuiltDomainCreateObject)

    A prebuilt

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1866
1867
1868
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1866

def add_custom_prebuilt_domain_with_http_info(prebuilt_domain_create_object, custom_headers:nil)
  add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value!
end

#add_with_http_info(application_create_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new LUIS app.

containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. will be added to the HTTP request.

Parameters:

  • application_create_object (ApplicationCreateObject)

    An application

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



55
56
57
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 55

def add_with_http_info(application_create_object, custom_headers:nil)
  add_async(application_create_object, custom_headers:custom_headers).value!
end

#delete(app_id, force: false, custom_headers: nil) ⇒ OperationStatus

Deletes an application.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • force (Boolean) (defaults to: false)

    A flag to indicate whether to force an operation.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (OperationStatus)

    operation results.



1052
1053
1054
1055
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1052

def delete(app_id, force:false, custom_headers:nil)
  response = delete_async(app_id, force:force, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_async(app_id, force: false, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an application.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • force (Boolean) (defaults to: false)

    A flag to indicate whether to force an operation.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1081

def delete_async(app_id, force:false, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      query_params: {'force' => force},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#delete_with_http_info(app_id, force: false, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an application.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • force (Boolean) (defaults to: false)

    A flag to indicate whether to force an operation.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1067
1068
1069
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1067

def delete_with_http_info(app_id, force:false, custom_headers:nil)
  delete_async(app_id, force:force, custom_headers:custom_headers).value!
end

#download_query_logs(app_id, custom_headers: nil) ⇒ NOT_IMPLEMENTED

Gets the logs of the past month’s endpoint queries for the application.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (NOT_IMPLEMENTED)

    operation results.



763
764
765
766
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 763

def download_query_logs(app_id, custom_headers:nil)
  response = download_query_logs_async(app_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#download_query_logs_async(app_id, custom_headers: nil) ⇒ Concurrent::Promise

Gets the logs of the past month’s endpoint queries for the application.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



790
791
792
793
794
795
796
797
798
799
800
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
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 790

def download_query_logs_async(app_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}/querylogs'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#download_query_logs_with_http_info(app_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the logs of the past month’s endpoint queries for the application.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



777
778
779
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 777

def download_query_logs_with_http_info(app_id, custom_headers:nil)
  download_query_logs_async(app_id, custom_headers:custom_headers).value!
end

#get(app_id, custom_headers: nil) ⇒ ApplicationInfoResponse

Gets the application info.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ApplicationInfoResponse)

    operation results.



859
860
861
862
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 859

def get(app_id, custom_headers:nil)
  response = get_async(app_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(app_id, custom_headers: nil) ⇒ Concurrent::Promise

Gets the application info.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 886

def get_async(app_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::ApplicationInfoResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_publish_settings(app_id, custom_headers: nil) ⇒ PublishSettings

Get the application publish settings including ‘UseAllTrainingData’.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (PublishSettings)

    operation results.



1452
1453
1454
1455
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1452

def get_publish_settings(app_id, custom_headers:nil)
  response = get_publish_settings_async(app_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_publish_settings_async(app_id, custom_headers: nil) ⇒ Concurrent::Promise

Get the application publish settings including ‘UseAllTrainingData’.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1479

def get_publish_settings_async(app_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}/publishsettings'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::PublishSettings.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_publish_settings_with_http_info(app_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the application publish settings including ‘UseAllTrainingData’.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1466
1467
1468
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1466

def get_publish_settings_with_http_info(app_id, custom_headers:nil)
  get_publish_settings_async(app_id, custom_headers:custom_headers).value!
end

#get_settings(app_id, custom_headers: nil) ⇒ ApplicationSettings

Get the application settings including ‘UseAllTrainingData’.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ApplicationSettings)

    operation results.



1260
1261
1262
1263
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1260

def get_settings(app_id, custom_headers:nil)
  response = get_settings_async(app_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_settings_async(app_id, custom_headers: nil) ⇒ Concurrent::Promise

Get the application settings including ‘UseAllTrainingData’.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1287

def get_settings_async(app_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}/settings'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::ApplicationSettings.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_settings_with_http_info(app_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the application settings including ‘UseAllTrainingData’.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1274
1275
1276
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1274

def get_settings_with_http_info(app_id, custom_headers:nil)
  get_settings_async(app_id, custom_headers:custom_headers).value!
end

#get_with_http_info(app_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the application info.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



873
874
875
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 873

def get_with_http_info(app_id, custom_headers:nil)
  get_async(app_id, custom_headers:custom_headers).value!
end

#import(luis_app, app_name: nil, custom_headers: nil) ⇒ Uuid

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app (LuisApp)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Uuid)

    operation results.



264
265
266
267
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 264

def import(luis_app, app_name:nil, custom_headers:nil)
  response = import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_async(luis_app, app_name: nil, custom_headers: nil) ⇒ Concurrent::Promise

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. to the HTTP request.

Parameters:

  • luis_app (LuisApp)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 299

def import_async(luis_app, app_name:nil, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/import'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'appName' => app_name},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#import_lu_format(luis_app_lu, app_name: nil, custom_headers: nil) ⇒ Uuid

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app_lu (String)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Uuid)

    operation results.



2401
2402
2403
2404
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2401

def import_lu_format(luis_app_lu, app_name:nil, custom_headers:nil)
  response = import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_lu_format_async(luis_app_lu, app_name: nil, custom_headers: nil) ⇒ Concurrent::Promise

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. to the HTTP request.

Parameters:

  • luis_app_lu (String)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2436

def import_lu_format_async(luis_app_lu, app_name:nil, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/import'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'appName' => app_name},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#import_lu_format_with_http_info(luis_app_lu, app_name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app_lu (String)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2419
2420
2421
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2419

def import_lu_format_with_http_info(luis_app_lu, app_name:nil, custom_headers:nil)
  import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
end

#import_v2app(luis_app_v2, app_name: nil, custom_headers: nil) ⇒ Uuid

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app_v2 (LuisAppV2)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Uuid)

    operation results.



2286
2287
2288
2289
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2286

def import_v2app(luis_app_v2, app_name:nil, custom_headers:nil)
  response = import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_v2app_async(luis_app_v2, app_name: nil, custom_headers: nil) ⇒ Concurrent::Promise

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. to the HTTP request.

Parameters:

  • luis_app_v2 (LuisAppV2)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2321

def import_v2app_async(luis_app_v2, app_name:nil, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/import'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'appName' => app_name},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#import_v2app_with_http_info(luis_app_v2, app_name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app_v2 (LuisAppV2)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2304
2305
2306
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2304

def import_v2app_with_http_info(luis_app_v2, app_name:nil, custom_headers:nil)
  import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
end

#import_with_http_info(luis_app, app_name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Imports an application to LUIS, the application’s structure is included in the request body.

the application name will be read from the imported object. If the application name already exists, an error is returned. will be added to the HTTP request.

Parameters:

  • luis_app (LuisApp)

    A LUIS application structure.

  • app_name (String) (defaults to: nil)

    The application name to create. If not specified,

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



282
283
284
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 282

def import_with_http_info(luis_app, app_name:nil, custom_headers:nil)
  import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value!
end

#list(skip: 0, take: 100, custom_headers: nil) ⇒ Array

Lists all of the user’s applications.

  1. Default is 100.

will be added to the HTTP request.

Parameters:

  • skip (Integer) (defaults to: 0)

    The number of entries to skip. Default value is 0.

  • take (Integer) (defaults to: 100)

    The number of entries to return. Maximum page size is

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



149
150
151
152
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 149

def list(skip:0, take:100, custom_headers:nil)
  response = list_async(skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_async(skip: 0, take: 100, custom_headers: nil) ⇒ Concurrent::Promise

Lists all of the user’s applications.

  1. Default is 100.

to the HTTP request.

Parameters:

  • skip (Integer) (defaults to: 0)

    The number of entries to skip. Default value is 0.

  • take (Integer) (defaults to: 100)

    The number of entries to return. Maximum page size is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



180
181
182
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
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 180

def list_async(skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'ApplicationInfoResponseElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ApplicationInfoResponse'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_available_custom_prebuilt_domains(custom_headers: nil) ⇒ Array

Gets all the available custom prebuilt domains for all cultures.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



1747
1748
1749
1750
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1747

def list_available_custom_prebuilt_domains(custom_headers:nil)
  response = list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_available_custom_prebuilt_domains_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets all the available custom prebuilt domains for all cultures.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1772

def list_available_custom_prebuilt_domains_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/customprebuiltdomains'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'PrebuiltDomainElementType',
                type: {
                  name: 'Composite',
                  class_name: 'PrebuiltDomain'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_available_custom_prebuilt_domains_for_culture(culture, custom_headers: nil) ⇒ Array

Gets all the available prebuilt domains for a specific culture.

will be added to the HTTP request.

Parameters:

  • culture (String)

    Culture.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



1956
1957
1958
1959
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1956

def list_available_custom_prebuilt_domains_for_culture(culture, custom_headers:nil)
  response = list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers: nil) ⇒ Concurrent::Promise

Gets all the available prebuilt domains for a specific culture.

to the HTTP request.

Parameters:

  • culture (String)

    Culture.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1983

def list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'culture is nil' if culture.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/customprebuiltdomains/{culture}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'culture' => culture},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'PrebuiltDomainElementType',
                type: {
                  name: 'Composite',
                  class_name: 'PrebuiltDomain'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_available_custom_prebuilt_domains_for_culture_with_http_info(culture, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the available prebuilt domains for a specific culture.

will be added to the HTTP request.

Parameters:

  • culture (String)

    Culture.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1970
1971
1972
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1970

def list_available_custom_prebuilt_domains_for_culture_with_http_info(culture, custom_headers:nil)
  list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value!
end

#list_available_custom_prebuilt_domains_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the available custom prebuilt domains for all cultures.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1760
1761
1762
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1760

def list_available_custom_prebuilt_domains_with_http_info(custom_headers:nil)
  list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value!
end

#list_cortana_endpoints(custom_headers: nil) ⇒ PersonalAssistantsResponse

Gets the endpoint URLs for the prebuilt Cortana applications.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (PersonalAssistantsResponse)

    operation results.



374
375
376
377
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 374

def list_cortana_endpoints(custom_headers:nil)
  response = list_cortana_endpoints_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_cortana_endpoints_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets the endpoint URLs for the prebuilt Cortana applications.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 399

def list_cortana_endpoints_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/assistants'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::PersonalAssistantsResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_cortana_endpoints_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the endpoint URLs for the prebuilt Cortana applications.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



387
388
389
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 387

def list_cortana_endpoints_with_http_info(custom_headers:nil)
  list_cortana_endpoints_async(custom_headers:custom_headers).value!
end

#list_domains(custom_headers: nil) ⇒ Array

Gets the available application domains.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



458
459
460
461
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 458

def list_domains(custom_headers:nil)
  response = list_domains_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_domains_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets the available application domains.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
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
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 483

def list_domains_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/domains'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'StringElementType',
                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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_domains_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the available application domains.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



471
472
473
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 471

def list_domains_with_http_info(custom_headers:nil)
  list_domains_async(custom_headers:custom_headers).value!
end

#list_endpoints(app_id, custom_headers: nil) ⇒ Hash

Returns the available endpoint deployment regions and URLs.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Hash)

    operation results.



1644
1645
1646
1647
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1644

def list_endpoints(app_id, custom_headers:nil)
  response = list_endpoints_async(app_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_endpoints_async(app_id, custom_headers: nil) ⇒ Concurrent::Promise

Returns the available endpoint deployment regions and URLs.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1671

def list_endpoints_async(app_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_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}/endpoints'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'Dictionary',
            value: {
                client_side_validation: true,
                required: false,
                serialized_name: 'StringElementType',
                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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_endpoints_with_http_info(app_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns the available endpoint deployment regions and URLs.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1658
1659
1660
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1658

def list_endpoints_with_http_info(app_id, custom_headers:nil)
  list_endpoints_async(app_id, custom_headers:custom_headers).value!
end

#list_supported_cultures(custom_headers: nil) ⇒ Array

Gets a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



658
659
660
661
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 658

def list_supported_cultures(custom_headers:nil)
  response = list_supported_cultures_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_supported_cultures_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



687
688
689
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
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 687

def list_supported_cultures_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/cultures'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'AvailableCultureElementType',
                type: {
                  name: 'Composite',
                  class_name: 'AvailableCulture'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_supported_cultures_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



673
674
675
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 673

def list_supported_cultures_with_http_info(custom_headers:nil)
  list_supported_cultures_async(custom_headers:custom_headers).value!
end

#list_usage_scenarios(custom_headers: nil) ⇒ Array

Gets the application available usage scenarios.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



557
558
559
560
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 557

def list_usage_scenarios(custom_headers:nil)
  response = list_usage_scenarios_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_usage_scenarios_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets the application available usage scenarios.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



582
583
584
585
586
587
588
589
590
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
644
645
646
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 582

def list_usage_scenarios_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/usagescenarios'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'StringElementType',
                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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_usage_scenarios_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the application available usage scenarios.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



570
571
572
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 570

def list_usage_scenarios_with_http_info(custom_headers:nil)
  list_usage_scenarios_async(custom_headers:custom_headers).value!
end

#list_with_http_info(skip: 0, take: 100, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all of the user’s applications.

  1. Default is 100.

will be added to the HTTP request.

Parameters:

  • skip (Integer) (defaults to: 0)

    The number of entries to skip. Default value is 0.

  • take (Integer) (defaults to: 100)

    The number of entries to return. Maximum page size is

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



165
166
167
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 165

def list_with_http_info(skip:0, take:100, custom_headers:nil)
  list_async(skip:skip, take:take, custom_headers:custom_headers).value!
end

#package_published_application_as_gzip(app_id, slot_name, custom_headers: nil) ⇒ NOT_IMPLEMENTED

package - Gets published LUIS application package in binary stream GZip format

Packages a published LUIS application as a GZip file to be used in the LUIS container.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • slot_name (String)

    The publishing slot name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (NOT_IMPLEMENTED)

    operation results.



2066
2067
2068
2069
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2066

def package_published_application_as_gzip(app_id, slot_name, custom_headers:nil)
  response = package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#package_published_application_as_gzip_async(app_id, slot_name, custom_headers: nil) ⇒ Concurrent::Promise

package - Gets published LUIS application package in binary stream GZip format

Packages a published LUIS application as a GZip file to be used in the LUIS container.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • slot_name (String)

    The publishing slot name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2103

def package_published_application_as_gzip_async(app_id, slot_name, 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, 'slot_name is nil' if slot_name.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 = 'package/{appId}/slot/{slotName}/gzip'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'slotName' => slot_name},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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: 'Stream'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#package_published_application_as_gzip_with_http_info(app_id, slot_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

package - Gets published LUIS application package in binary stream GZip format

Packages a published LUIS application as a GZip file to be used in the LUIS container.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • slot_name (String)

    The publishing slot name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2085
2086
2087
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2085

def package_published_application_as_gzip_with_http_info(app_id, slot_name, custom_headers:nil)
  package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value!
end

#package_trained_application_as_gzip(app_id, version_id, custom_headers: nil) ⇒ NOT_IMPLEMENTED

package - Gets trained LUIS application package in binary stream GZip format

Packages trained LUIS application as GZip file to be used in the LUIS container.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • version_id (String)

    The version ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (NOT_IMPLEMENTED)

    operation results.



2177
2178
2179
2180
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2177

def package_trained_application_as_gzip(app_id, version_id, custom_headers:nil)
  response = package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#package_trained_application_as_gzip_async(app_id, version_id, custom_headers: nil) ⇒ Concurrent::Promise

package - Gets trained LUIS application package in binary stream GZip format

Packages trained LUIS application as GZip file to be used in the LUIS container.

to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • version_id (String)

    The version ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2212

def package_trained_application_as_gzip_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 = 'package/{appId}/versions/{versionId}/gzip'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      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, options)

  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: 'Stream'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#package_trained_application_as_gzip_with_http_info(app_id, version_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

package - Gets trained LUIS application package in binary stream GZip format

Packages trained LUIS application as GZip file to be used in the LUIS container.

will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • version_id (String)

    The version ID.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2195
2196
2197
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 2195

def package_trained_application_as_gzip_with_http_info(app_id, version_id, custom_headers:nil)
  package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value!
end

#publish(app_id, application_publish_object, custom_headers: nil) ⇒ ProductionOrStagingEndpointInfo

Publishes a specific version of the application.

publish object. The region is the target region that the application is published to. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_publish_object (ApplicationPublishObject)

    The application

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ProductionOrStagingEndpointInfo)

    operation results.



1147
1148
1149
1150
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1147

def publish(app_id, application_publish_object, custom_headers:nil)
  response = publish_async(app_id, application_publish_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#publish_async(app_id, application_publish_object, custom_headers: nil) ⇒ Concurrent::Promise

Publishes a specific version of the application.

publish object. The region is the target region that the application is published to. to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_publish_object (ApplicationPublishObject)

    The application

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1180

def publish_async(app_id, application_publish_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, 'application_publish_object is nil' if application_publish_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::ApplicationPublishObject.mapper()
  request_content = @client.serialize(request_mapper,  application_publish_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/publish'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 207
      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 = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ProductionOrStagingEndpointInfo.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 207
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Models::ProductionOrStagingEndpointInfo.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#publish_with_http_info(app_id, application_publish_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Publishes a specific version of the application.

publish object. The region is the target region that the application is published to. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_publish_object (ApplicationPublishObject)

    The application

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1164
1165
1166
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1164

def publish_with_http_info(app_id, application_publish_object, custom_headers:nil)
  publish_async(app_id, application_publish_object, custom_headers:custom_headers).value!
end

#update(app_id, application_update_object, custom_headers: nil) ⇒ OperationStatus

Updates the name or description of the application.

Name and Description of the application. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_update_object (ApplicationUpdateObject)

    A model containing

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (OperationStatus)

    operation results.



950
951
952
953
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 950

def update(app_id, application_update_object, custom_headers:nil)
  response = update_async(app_id, application_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(app_id, application_update_object, custom_headers: nil) ⇒ Concurrent::Promise

Updates the name or description of the application.

Name and Description of the application. to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_update_object (ApplicationUpdateObject)

    A model containing

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 981

def update_async(app_id, application_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, 'application_update_object is nil' if application_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::ApplicationUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  application_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_publish_settings(app_id, publish_setting_update_object, custom_headers: nil) ⇒ OperationStatus

Updates the application publish settings including ‘UseAllTrainingData’.

containing the new publish application settings. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • publish_setting_update_object (PublishSettingUpdateObject)

    An object

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (OperationStatus)

    operation results.



1543
1544
1545
1546
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1543

def update_publish_settings(app_id, publish_setting_update_object, custom_headers:nil)
  response = update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_publish_settings_async(app_id, publish_setting_update_object, custom_headers: nil) ⇒ Concurrent::Promise

Updates the application publish settings including ‘UseAllTrainingData’.

containing the new publish application settings. to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • publish_setting_update_object (PublishSettingUpdateObject)

    An object

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1574

def update_publish_settings_async(app_id, publish_setting_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, 'publish_setting_update_object is nil' if publish_setting_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::PublishSettingUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  publish_setting_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/publishsettings'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_publish_settings_with_http_info(app_id, publish_setting_update_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the application publish settings including ‘UseAllTrainingData’.

containing the new publish application settings. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • publish_setting_update_object (PublishSettingUpdateObject)

    An object

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1559
1560
1561
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1559

def update_publish_settings_with_http_info(app_id, publish_setting_update_object, custom_headers:nil)
  update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value!
end

#update_settings(app_id, application_setting_update_object, custom_headers: nil) ⇒ OperationStatus

Updates the application settings including ‘UseAllTrainingData’.

object containing the new application settings. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_setting_update_object (ApplicationSettingUpdateObject)

    An

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (OperationStatus)

    operation results.



1351
1352
1353
1354
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1351

def update_settings(app_id, application_setting_update_object, custom_headers:nil)
  response = update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_settings_async(app_id, application_setting_update_object, custom_headers: nil) ⇒ Concurrent::Promise

Updates the application settings including ‘UseAllTrainingData’.

object containing the new application settings. to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_setting_update_object (ApplicationSettingUpdateObject)

    An

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1382

def update_settings_async(app_id, application_setting_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, 'application_setting_update_object is nil' if application_setting_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::ApplicationSettingUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  application_setting_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/settings'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  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.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_settings_with_http_info(app_id, application_setting_update_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the application settings including ‘UseAllTrainingData’.

object containing the new application settings. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_setting_update_object (ApplicationSettingUpdateObject)

    An

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1367
1368
1369
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 1367

def update_settings_with_http_info(app_id, application_setting_update_object, custom_headers:nil)
  update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value!
end

#update_with_http_info(app_id, application_update_object, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the name or description of the application.

Name and Description of the application. will be added to the HTTP request.

Parameters:

  • app_id

    The application ID.

  • application_update_object (ApplicationUpdateObject)

    A model containing

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



966
967
968
# File 'lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb', line 966

def update_with_http_info(app_id, application_update_object, custom_headers:nil)
  update_async(app_id, application_update_object, custom_headers:custom_headers).value!
end