From 615cc46fde96112211513b1aaa7bac97c74e3688 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 17 Apr 2018 00:55:03 +0000 Subject: [PATCH] Generated from f03560745b3d5ce46009cb8e9897bf4d6f397bf9 Set language non-required parameter --- .../v1.0/contentmoderator/textmoderation.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/services/cognitiveservices/v1.0/contentmoderator/textmoderation.go b/services/cognitiveservices/v1.0/contentmoderator/textmoderation.go index 0dec98b6bb34..f77e16557c2b 100644 --- a/services/cognitiveservices/v1.0/contentmoderator/textmoderation.go +++ b/services/cognitiveservices/v1.0/contentmoderator/textmoderation.go @@ -116,12 +116,12 @@ func (client TextModerationClient) DetectLanguageResponder(resp *http.Response) // ScreenText detects profanity in more than 100 languages and match against custom and shared blacklists. // -// language is language of the terms. textContentType is the content type. textContent is content to screen. -// textContent will be closed upon successful return. Callers should ensure closure when receiving an -// error.autocorrect is autocorrect text. pii is detect personal identifiable information. listID is the list Id. +// textContentType is the content type. textContent is content to screen. textContent will be closed upon +// successful return. Callers should ensure closure when receiving an error.language is language of the text. +// autocorrect is autocorrect text. pii is detect personal identifiable information. listID is the list Id. // classify is classify input. -func (client TextModerationClient) ScreenText(ctx context.Context, language string, textContentType string, textContent io.ReadCloser, autocorrect *bool, pii *bool, listID string, classify *bool) (result Screen, err error) { - req, err := client.ScreenTextPreparer(ctx, language, textContentType, textContent, autocorrect, pii, listID, classify) +func (client TextModerationClient) ScreenText(ctx context.Context, textContentType string, textContent io.ReadCloser, language string, autocorrect *bool, pii *bool, listID string, classify *bool) (result Screen, err error) { + req, err := client.ScreenTextPreparer(ctx, textContentType, textContent, language, autocorrect, pii, listID, classify) if err != nil { err = autorest.NewErrorWithError(err, "contentmoderator.TextModerationClient", "ScreenText", nil, "Failure preparing request") return @@ -143,13 +143,14 @@ func (client TextModerationClient) ScreenText(ctx context.Context, language stri } // ScreenTextPreparer prepares the ScreenText request. -func (client TextModerationClient) ScreenTextPreparer(ctx context.Context, language string, textContentType string, textContent io.ReadCloser, autocorrect *bool, pii *bool, listID string, classify *bool) (*http.Request, error) { +func (client TextModerationClient) ScreenTextPreparer(ctx context.Context, textContentType string, textContent io.ReadCloser, language string, autocorrect *bool, pii *bool, listID string, classify *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "baseUrl": client.BaseURL, } - queryParameters := map[string]interface{}{ - "language": autorest.Encode("query", language), + queryParameters := map[string]interface{}{} + if len(language) > 0 { + queryParameters["language"] = autorest.Encode("query", language) } if autocorrect != nil { queryParameters["autocorrect"] = autorest.Encode("query", *autocorrect)