From d24ddf4586ca9dabedbfbf2a5e71794a2b4d792d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Wed, 23 Oct 2019 14:25:59 +0800 Subject: [PATCH] Generated from 3df959debc8a270d8f8c7af0de16d63938009fe3 (#6119) Fix error in luis runtime readme --- .../cognitiveservices/luis/runtime/models.go | 20 +- .../luis/runtime/runtimeapi/models.go | 2 +- .../cognitiveservices/luis/runtime/models.go | 20 +- .../luis/runtime/runtimeapi/models.go | 2 +- .../v3.0/luis/runtime/client.go | 44 ++++ .../v3.0/luis/runtime/models.go | 152 ++++++++++++ .../v3.0/luis/runtime/prediction.go | 234 ++++++++++++++++++ .../luis/runtime/runtimeapi/interfaces.go | 32 +++ .../v3.0/luis/runtime/version.go | 30 +++ 9 files changed, 516 insertions(+), 20 deletions(-) create mode 100644 services/cognitiveservices/v3.0/luis/runtime/client.go create mode 100644 services/cognitiveservices/v3.0/luis/runtime/models.go create mode 100644 services/cognitiveservices/v3.0/luis/runtime/prediction.go create mode 100644 services/cognitiveservices/v3.0/luis/runtime/runtimeapi/interfaces.go create mode 100644 services/cognitiveservices/v3.0/luis/runtime/version.go diff --git a/profiles/latest/cognitiveservices/luis/runtime/models.go b/profiles/latest/cognitiveservices/luis/runtime/models.go index 874c6edc8fb4..d667bc94c344 100644 --- a/profiles/latest/cognitiveservices/luis/runtime/models.go +++ b/profiles/latest/cognitiveservices/luis/runtime/models.go @@ -19,18 +19,20 @@ package runtime -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime" -type APIError = original.APIError type BaseClient = original.BaseClient -type CompositeChildModel = original.CompositeChildModel -type CompositeEntityModel = original.CompositeEntityModel -type EntityModel = original.EntityModel -type EntityWithResolution = original.EntityWithResolution -type EntityWithScore = original.EntityWithScore -type IntentModel = original.IntentModel -type LuisResult = original.LuisResult +type DynamicList = original.DynamicList +type Error = original.Error +type ErrorBody = original.ErrorBody +type ExternalEntity = original.ExternalEntity +type Intent = original.Intent +type Prediction = original.Prediction type PredictionClient = original.PredictionClient +type PredictionRequest = original.PredictionRequest +type PredictionRequestOptions = original.PredictionRequestOptions +type PredictionResponse = original.PredictionResponse +type RequestList = original.RequestList type Sentiment = original.Sentiment func New(endpoint string) BaseClient { diff --git a/profiles/latest/cognitiveservices/luis/runtime/runtimeapi/models.go b/profiles/latest/cognitiveservices/luis/runtime/runtimeapi/models.go index bd78fd1355eb..2ab87e1823d9 100644 --- a/profiles/latest/cognitiveservices/luis/runtime/runtimeapi/models.go +++ b/profiles/latest/cognitiveservices/luis/runtime/runtimeapi/models.go @@ -19,6 +19,6 @@ package runtimeapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/runtimeapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime/runtimeapi" type PredictionClientAPI = original.PredictionClientAPI diff --git a/profiles/preview/cognitiveservices/luis/runtime/models.go b/profiles/preview/cognitiveservices/luis/runtime/models.go index 12591d37c0d6..f33485fca269 100644 --- a/profiles/preview/cognitiveservices/luis/runtime/models.go +++ b/profiles/preview/cognitiveservices/luis/runtime/models.go @@ -19,18 +19,20 @@ package runtime -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime" -type APIError = original.APIError type BaseClient = original.BaseClient -type CompositeChildModel = original.CompositeChildModel -type CompositeEntityModel = original.CompositeEntityModel -type EntityModel = original.EntityModel -type EntityWithResolution = original.EntityWithResolution -type EntityWithScore = original.EntityWithScore -type IntentModel = original.IntentModel -type LuisResult = original.LuisResult +type DynamicList = original.DynamicList +type Error = original.Error +type ErrorBody = original.ErrorBody +type ExternalEntity = original.ExternalEntity +type Intent = original.Intent +type Prediction = original.Prediction type PredictionClient = original.PredictionClient +type PredictionRequest = original.PredictionRequest +type PredictionRequestOptions = original.PredictionRequestOptions +type PredictionResponse = original.PredictionResponse +type RequestList = original.RequestList type Sentiment = original.Sentiment func New(endpoint string) BaseClient { diff --git a/profiles/preview/cognitiveservices/luis/runtime/runtimeapi/models.go b/profiles/preview/cognitiveservices/luis/runtime/runtimeapi/models.go index bd78fd1355eb..2ab87e1823d9 100644 --- a/profiles/preview/cognitiveservices/luis/runtime/runtimeapi/models.go +++ b/profiles/preview/cognitiveservices/luis/runtime/runtimeapi/models.go @@ -19,6 +19,6 @@ package runtimeapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/runtimeapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime/runtimeapi" type PredictionClientAPI = original.PredictionClientAPI diff --git a/services/cognitiveservices/v3.0/luis/runtime/client.go b/services/cognitiveservices/v3.0/luis/runtime/client.go new file mode 100644 index 000000000000..b9e8440b450c --- /dev/null +++ b/services/cognitiveservices/v3.0/luis/runtime/client.go @@ -0,0 +1,44 @@ +// Package runtime implements the Azure ARM Runtime service API version 3.0. +// +// +package runtime + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +// BaseClient is the base client for Runtime. +type BaseClient struct { + autorest.Client + Endpoint string +} + +// New creates an instance of the BaseClient client. +func New(endpoint string) BaseClient { + return NewWithoutDefaults(endpoint) +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults(endpoint string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + Endpoint: endpoint, + } +} diff --git a/services/cognitiveservices/v3.0/luis/runtime/models.go b/services/cognitiveservices/v3.0/luis/runtime/models.go new file mode 100644 index 000000000000..f87f972b82eb --- /dev/null +++ b/services/cognitiveservices/v3.0/luis/runtime/models.go @@ -0,0 +1,152 @@ +package runtime + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime" + +// DynamicList defines an extension for a list entity. +type DynamicList struct { + // ListEntityName - The name of the list entity to extend. + ListEntityName *string `json:"listEntityName,omitempty"` + // RequestLists - The lists to append on the extended list entity. + RequestLists *[]RequestList `json:"requestLists,omitempty"` +} + +// Error represents the error that occurred. +type Error struct { + Error *ErrorBody `json:"error,omitempty"` +} + +// ErrorBody represents the definition of the error that occurred. +type ErrorBody struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` +} + +// ExternalEntity defines a user predicted entity that extends an already existing one. +type ExternalEntity struct { + // EntityName - The name of the entity to extend. + EntityName *string `json:"entityName,omitempty"` + // StartIndex - The start character index of the predicted entity. + StartIndex *int32 `json:"startIndex,omitempty"` + // EntityLength - The length of the predicted entity. + EntityLength *int32 `json:"entityLength,omitempty"` + // Resolution - A user supplied custom resolution to return as the entity's prediction. + Resolution interface{} `json:"resolution,omitempty"` + // Score - A user supplied score to return as the entity's prediction score. + Score *float64 `json:"score,omitempty"` +} + +// Intent represents an intent prediction. +type Intent struct { + // Score - The score of the fired intent. + Score *float64 `json:"score,omitempty"` + // ChildApp - The prediction of the dispatched application. + ChildApp *Prediction `json:"childApp,omitempty"` +} + +// Prediction represents the prediction of a query. +type Prediction struct { + // AlteredQuery - The query after spell checking. Only set if spell check was enabled and a spelling mistake was found. + AlteredQuery *string `json:"alteredQuery,omitempty"` + // TopIntent - The name of the top scoring intent. + TopIntent *string `json:"topIntent,omitempty"` + // Intents - A dictionary representing the intents that fired. + Intents map[string]*Intent `json:"intents"` + // Entities - A dictionary representing the entities that fired. + Entities map[string]interface{} `json:"entities"` + // Sentiment - The result of the sentiment analysis. + Sentiment *Sentiment `json:"sentiment,omitempty"` +} + +// MarshalJSON is the custom marshaler for Prediction. +func (p Prediction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.AlteredQuery != nil { + objectMap["alteredQuery"] = p.AlteredQuery + } + if p.TopIntent != nil { + objectMap["topIntent"] = p.TopIntent + } + if p.Intents != nil { + objectMap["intents"] = p.Intents + } + if p.Entities != nil { + objectMap["entities"] = p.Entities + } + if p.Sentiment != nil { + objectMap["sentiment"] = p.Sentiment + } + return json.Marshal(objectMap) +} + +// PredictionRequest represents the prediction request parameters. +type PredictionRequest struct { + // Query - The query to predict. + Query *string `json:"query,omitempty"` + // Options - The custom options defined for this request. + Options *PredictionRequestOptions `json:"options,omitempty"` + // ExternalEntities - The externally predicted entities for this request. + ExternalEntities *[]ExternalEntity `json:"externalEntities,omitempty"` + // DynamicLists - The dynamically created list entities for this request. + DynamicLists *[]DynamicList `json:"dynamicLists,omitempty"` +} + +// PredictionRequestOptions the custom options for the prediction request. +type PredictionRequestOptions struct { + // DatetimeReference - The reference DateTime used for predicting datetime entities. + DatetimeReference *date.Time `json:"datetimeReference,omitempty"` + // PreferExternalEntities - Whether to make the external entities resolution override the predictions if an overlap occurs. + PreferExternalEntities *bool `json:"preferExternalEntities,omitempty"` +} + +// PredictionResponse represents the prediction response. +type PredictionResponse struct { + autorest.Response `json:"-"` + // Query - The query used in the prediction. + Query *string `json:"query,omitempty"` + // Prediction - The prediction of the requested query. + Prediction *Prediction `json:"prediction,omitempty"` +} + +// RequestList defines a sub-list to append to an existing list entity. +type RequestList struct { + // Name - The name of the sub-list. + Name *string `json:"name,omitempty"` + // CanonicalForm - The canonical form of the sub-list. + CanonicalForm *string `json:"canonicalForm,omitempty"` + // Synonyms - The synonyms of the canonical form. + Synonyms *[]string `json:"synonyms,omitempty"` +} + +// Sentiment the result of the sentiment analysis. +type Sentiment struct { + // Label - The label of the sentiment analysis result. + Label *string `json:"label,omitempty"` + // Score - The sentiment score of the query. + Score *float64 `json:"score,omitempty"` +} diff --git a/services/cognitiveservices/v3.0/luis/runtime/prediction.go b/services/cognitiveservices/v3.0/luis/runtime/prediction.go new file mode 100644 index 000000000000..1493c9f637a6 --- /dev/null +++ b/services/cognitiveservices/v3.0/luis/runtime/prediction.go @@ -0,0 +1,234 @@ +package runtime + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// PredictionClient is the client for the Prediction methods of the Runtime service. +type PredictionClient struct { + BaseClient +} + +// NewPredictionClient creates an instance of the PredictionClient client. +func NewPredictionClient(endpoint string) PredictionClient { + return PredictionClient{New(endpoint)} +} + +// GetSlotPrediction gets the predictions for an application slot. +// Parameters: +// appID - the application ID. +// slotName - the application slot name. +// predictionRequest - the prediction request parameters. +// verbose - indicates whether to get extra metadata for the entities predictions or not. +// showAllIntents - indicates whether to return all the intents in the response or just the top intent. +// logParameter - indicates whether to log the endpoint query or not. +func (client PredictionClient) GetSlotPrediction(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PredictionClient.GetSlotPrediction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: predictionRequest, + Constraints: []validation.Constraint{{Target: "predictionRequest.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("runtime.PredictionClient", "GetSlotPrediction", err.Error()) + } + + req, err := client.GetSlotPredictionPreparer(ctx, appID, slotName, predictionRequest, verbose, showAllIntents, logParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetSlotPrediction", nil, "Failure preparing request") + return + } + + resp, err := client.GetSlotPredictionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetSlotPrediction", resp, "Failure sending request") + return + } + + result, err = client.GetSlotPredictionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetSlotPrediction", resp, "Failure responding to request") + } + + return +} + +// GetSlotPredictionPreparer prepares the GetSlotPrediction request. +func (client PredictionClient) GetSlotPredictionPreparer(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "slotName": autorest.Encode("path", slotName), + } + + queryParameters := map[string]interface{}{} + if verbose != nil { + queryParameters["verbose"] = autorest.Encode("query", *verbose) + } + if showAllIntents != nil { + queryParameters["show-all-intents"] = autorest.Encode("query", *showAllIntents) + } + if logParameter != nil { + queryParameters["log"] = autorest.Encode("query", *logParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/prediction/v3.0", urlParameters), + autorest.WithPathParameters("/apps/{appId}/slots/{slotName}/predict", pathParameters), + autorest.WithJSON(predictionRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSlotPredictionSender sends the GetSlotPrediction request. The method will close the +// http.Response Body if it receives an error. +func (client PredictionClient) GetSlotPredictionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetSlotPredictionResponder handles the response to the GetSlotPrediction request. The method always +// closes the http.Response Body. +func (client PredictionClient) GetSlotPredictionResponder(resp *http.Response) (result PredictionResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVersionPrediction gets the predictions for an application version. +// Parameters: +// appID - the application ID. +// versionID - the application version ID. +// predictionRequest - the prediction request parameters. +// verbose - indicates whether to get extra metadata for the entities predictions or not. +// showAllIntents - indicates whether to return all the intents in the response or just the top intent. +// logParameter - indicates whether to log the endpoint query or not. +func (client PredictionClient) GetVersionPrediction(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result PredictionResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PredictionClient.GetVersionPrediction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: predictionRequest, + Constraints: []validation.Constraint{{Target: "predictionRequest.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("runtime.PredictionClient", "GetVersionPrediction", err.Error()) + } + + req, err := client.GetVersionPredictionPreparer(ctx, appID, versionID, predictionRequest, verbose, showAllIntents, logParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetVersionPrediction", nil, "Failure preparing request") + return + } + + resp, err := client.GetVersionPredictionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetVersionPrediction", resp, "Failure sending request") + return + } + + result, err = client.GetVersionPredictionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "runtime.PredictionClient", "GetVersionPrediction", resp, "Failure responding to request") + } + + return +} + +// GetVersionPredictionPreparer prepares the GetVersionPrediction request. +func (client PredictionClient) GetVersionPredictionPreparer(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "versionId": autorest.Encode("path", versionID), + } + + queryParameters := map[string]interface{}{} + if verbose != nil { + queryParameters["verbose"] = autorest.Encode("query", *verbose) + } + if showAllIntents != nil { + queryParameters["show-all-intents"] = autorest.Encode("query", *showAllIntents) + } + if logParameter != nil { + queryParameters["log"] = autorest.Encode("query", *logParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/luis/prediction/v3.0", urlParameters), + autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/predict", pathParameters), + autorest.WithJSON(predictionRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVersionPredictionSender sends the GetVersionPrediction request. The method will close the +// http.Response Body if it receives an error. +func (client PredictionClient) GetVersionPredictionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetVersionPredictionResponder handles the response to the GetVersionPrediction request. The method always +// closes the http.Response Body. +func (client PredictionClient) GetVersionPredictionResponder(resp *http.Response) (result PredictionResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/v3.0/luis/runtime/runtimeapi/interfaces.go b/services/cognitiveservices/v3.0/luis/runtime/runtimeapi/interfaces.go new file mode 100644 index 000000000000..187195a67c71 --- /dev/null +++ b/services/cognitiveservices/v3.0/luis/runtime/runtimeapi/interfaces.go @@ -0,0 +1,32 @@ +package runtimeapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/luis/runtime" + "github.com/satori/go.uuid" +) + +// PredictionClientAPI contains the set of methods on the PredictionClient type. +type PredictionClientAPI interface { + GetSlotPrediction(ctx context.Context, appID uuid.UUID, slotName string, predictionRequest runtime.PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result runtime.PredictionResponse, err error) + GetVersionPrediction(ctx context.Context, appID uuid.UUID, versionID string, predictionRequest runtime.PredictionRequest, verbose *bool, showAllIntents *bool, logParameter *bool) (result runtime.PredictionResponse, err error) +} + +var _ PredictionClientAPI = (*runtime.PredictionClient)(nil) diff --git a/services/cognitiveservices/v3.0/luis/runtime/version.go b/services/cognitiveservices/v3.0/luis/runtime/version.go new file mode 100644 index 000000000000..5c5aa27eab02 --- /dev/null +++ b/services/cognitiveservices/v3.0/luis/runtime/version.go @@ -0,0 +1,30 @@ +package runtime + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " runtime/3.0" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}