diff --git a/services/cognitiveservices/v4.0/qnamaker/endpointsettings.go b/services/cognitiveservices/v4.0/qnamaker/endpointsettings.go index 8d43cafa21ec..61a0dc5f49ff 100644 --- a/services/cognitiveservices/v4.0/qnamaker/endpointsettings.go +++ b/services/cognitiveservices/v4.0/qnamaker/endpointsettings.go @@ -102,13 +102,13 @@ func (client EndpointSettingsClient) GetSettingsResponder(resp *http.Response) ( // UpdateSettings sends the update settings request. // Parameters: // endpointSettingsPayload - post body of the request. -func (client EndpointSettingsClient) UpdateSettings(ctx context.Context, endpointSettingsPayload EndpointSettingsDTO) (result String, err error) { +func (client EndpointSettingsClient) UpdateSettings(ctx context.Context, endpointSettingsPayload EndpointSettingsDTO) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EndpointSettingsClient.UpdateSettings") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response != nil { + sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -121,7 +121,7 @@ func (client EndpointSettingsClient) UpdateSettings(ctx context.Context, endpoin resp, err := client.UpdateSettingsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.Response = resp err = autorest.NewErrorWithError(err, "qnamaker.EndpointSettingsClient", "UpdateSettings", resp, "Failure sending request") return } @@ -157,12 +157,11 @@ func (client EndpointSettingsClient) UpdateSettingsSender(req *http.Request) (*h // UpdateSettingsResponder handles the response to the UpdateSettings request. The method always // closes the http.Response Body. -func (client EndpointSettingsClient) UpdateSettingsResponder(resp *http.Response) (result String, err error) { +func (client EndpointSettingsClient) UpdateSettingsResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } diff --git a/services/cognitiveservices/v4.0/qnamaker/models.go b/services/cognitiveservices/v4.0/qnamaker/models.go index 50b6c121208d..610f00209cb7 100644 --- a/services/cognitiveservices/v4.0/qnamaker/models.go +++ b/services/cognitiveservices/v4.0/qnamaker/models.go @@ -60,7 +60,7 @@ type CreateKbDTO struct { EnableHierarchicalExtraction *bool `json:"enableHierarchicalExtraction,omitempty"` // DefaultAnswerUsedForExtraction - Text string to be used as the answer in any Q-A which has no extracted answer from the document but has a hierarchy. Required when EnableHierarchicalExtraction field is set to True. DefaultAnswerUsedForExtraction *string `json:"defaultAnswerUsedForExtraction,omitempty"` - // Language - Language of the knowledgebase. + // Language - Language of the knowledgebase. Please find the list of supported languages here. Language *string `json:"language,omitempty"` } @@ -288,12 +288,6 @@ type ReplaceKbDTO struct { QnAList *[]QnADTO `json:"qnAList,omitempty"` } -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - // UpdateContextDTO update Body schema to represent context to be updated type UpdateContextDTO struct { // PromptsToDelete - List of prompts associated with qna to be deleted diff --git a/services/cognitiveservices/v4.0/qnamaker/qnamakerapi/interfaces.go b/services/cognitiveservices/v4.0/qnamaker/qnamakerapi/interfaces.go index 04ab3aa23b3d..9b21cb9ac73f 100644 --- a/services/cognitiveservices/v4.0/qnamaker/qnamakerapi/interfaces.go +++ b/services/cognitiveservices/v4.0/qnamaker/qnamakerapi/interfaces.go @@ -26,7 +26,7 @@ import ( // EndpointSettingsClientAPI contains the set of methods on the EndpointSettingsClient type. type EndpointSettingsClientAPI interface { GetSettings(ctx context.Context) (result qnamaker.EndpointSettingsDTO, err error) - UpdateSettings(ctx context.Context, endpointSettingsPayload qnamaker.EndpointSettingsDTO) (result qnamaker.String, err error) + UpdateSettings(ctx context.Context, endpointSettingsPayload qnamaker.EndpointSettingsDTO) (result autorest.Response, err error) } var _ EndpointSettingsClientAPI = (*qnamaker.EndpointSettingsClient)(nil)