gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

(SAMPLES) Missing argument `type` when initializing an input Document

Open kuhanaklobasa opened this issue 9 months ago • 0 comments

All google-cloud-language samples that initialize an input Document class are missing the required field type. Example: https://cloud.google.com/python/docs/reference/language/latest/google.cloud.language_v2.services.language_service.LanguageServiceAsyncClient#google_cloud_language_v2_services_language_service_LanguageServiceAsyncClient_moderate_text Current:

# Initialize request argument(s)
document = language_v2.Document()
document.content = "content_value"

Fix (1):

# Initialize request argument(s)
document = language_v2.Document()
document.type = language_v2.Document.Type.PLAIN_TEXT
document.content = "content_value"

Fix (2):

# Initialize request argument(s)
document = language_v2.Document(type=language_v2.Document.Type.PLAIN_TEXT)
document.content = "content_value"

kuhanaklobasa avatar May 01 '24 17:05 kuhanaklobasa