From bcc345cfb7afb9b3173aa10f14bcaa64f6de1fc4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 11 Jan 2023 07:56:11 -0800 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1808) --- api-list.json | 2 +- contentwarehouse/v1/contentwarehouse-api.json | 300 +- contentwarehouse/v1/contentwarehouse-gen.go | 463 ++- documentai/v1/documentai-api.json | 93 +- documentai/v1/documentai-gen.go | 245 +- documentai/v1beta2/documentai-api.json | 68 +- documentai/v1beta2/documentai-gen.go | 94 +- documentai/v1beta3/documentai-api.json | 93 +- documentai/v1beta3/documentai-gen.go | 246 +- healthcare/v1/healthcare-gen.go | 2 +- healthcare/v1beta1/healthcare-gen.go | 2 +- homegraph/v1/homegraph-api.json | 28 +- homegraph/v1/homegraph-gen.go | 51 +- ondemandscanning/v1/ondemandscanning-api.json | 10 +- ondemandscanning/v1/ondemandscanning-gen.go | 2 + recommender/v1/recommender-api.json | 125 +- recommender/v1/recommender-gen.go | 637 +++- recommender/v1beta1/recommender-api.json | 125 +- recommender/v1beta1/recommender-gen.go | 637 +++- retail/v2/retail-api.json | 4 +- retail/v2/retail-gen.go | 2 +- servicecontrol/v1/servicecontrol-api.json | 8 +- servicecontrol/v1/servicecontrol-gen.go | 2 - translate/v3/translate-api.json | 676 +++- translate/v3/translate-gen.go | 3339 ++++++++++++++--- translate/v3beta1/translate-api.json | 12 +- translate/v3beta1/translate-gen.go | 28 +- 27 files changed, 6072 insertions(+), 1222 deletions(-) diff --git a/api-list.json b/api-list.json index f6866b69a34..93370c2e8a8 100644 --- a/api-list.json +++ b/api-list.json @@ -3288,7 +3288,7 @@ "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" }, - "documentationLink": "https://developers.google.com/actions/smarthome/create-app#request-sync", + "documentationLink": "https://developers.home.google.com/cloud-to-cloud/get-started", "preferred": true }, { diff --git a/contentwarehouse/v1/contentwarehouse-api.json b/contentwarehouse/v1/contentwarehouse-api.json index 394cb17f33c..590dcb674a8 100644 --- a/contentwarehouse/v1/contentwarehouse-api.json +++ b/contentwarehouse/v1/contentwarehouse-api.json @@ -136,7 +136,7 @@ ] }, "setAcl": { - "description": "Sets the access control policy for a resource. Replaces any existing policy.", + "description": "Sets the access control policy for a resource. Replaces any existing policy. You can set ACL with condition for projects only. Supported operators are: `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=` where the left of the operator is `DocumentSchemaId` or property name and the right of the operator is a number or a quoted string. You must escape backslash (\\\\) and quote (\\\") characters. Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for example, \"((A AND B AND C) OR D) AND E\"), a maximum of 10 comparisons are allowed in the expression. The expression must be \u003c 6000 bytes in length. Sample condition: `\"DocumentSchemaId = \\\"some schema id\\\" \" OR SchemaId.floatPropertyName \u003e= 10`", "flatPath": "v1/projects/{projectsId}:setAcl", "httpMethod": "POST", "id": "contentwarehouse.projects.setAcl", @@ -570,7 +570,7 @@ ] }, "setAcl": { - "description": "Sets the access control policy for a resource. Replaces any existing policy.", + "description": "Sets the access control policy for a resource. Replaces any existing policy. You can set ACL with condition for projects only. Supported operators are: `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=` where the left of the operator is `DocumentSchemaId` or property name and the right of the operator is a number or a quoted string. You must escape backslash (\\\\) and quote (\\\") characters. Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for example, \"((A AND B AND C) OR D) AND E\"), a maximum of 10 comparisons are allowed in the expression. The expression must be \u003c 6000 bytes in length. Sample condition: `\"DocumentSchemaId = \\\"some schema id\\\" \" OR SchemaId.floatPropertyName \u003e= 10`", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/documents/{documentsId}:setAcl", "httpMethod": "POST", "id": "contentwarehouse.projects.locations.documents.setAcl", @@ -1075,7 +1075,7 @@ } } }, - "revision": "20221219", + "revision": "20230106", "rootUrl": "https://contentwarehouse.googleapis.com/", "schemas": { "AbuseiamAbuseType": { @@ -13094,9 +13094,14 @@ "type": "object" }, "AssistantApiScreenCapabilities": { - "description": "These capabilities represent the tactile features associated with the device. This includes, for example, whether the device has a screen, how big the screen is, and privacy of the screen. Next ID: 10", + "description": "These capabilities represent the tactile features associated with the device. This includes, for example, whether the device has a screen, how big the screen is, and privacy of the screen. Next ID: 11", "id": "AssistantApiScreenCapabilities", "properties": { + "fontScaleFactor": { + "description": "The scale factor used to convert Scalable Pixel (SP) units to Density-independent Pixel (DP) units (DP = SP * scale factor). Fonts are measured in units of SP, and on some platforms such as Android the SP to DP scale factor can be affected by the font size a user selects in accessibility settings.", + "format": "float", + "type": "number" + }, "inputType": { "description": "The types of input that this screen supports. Note that this can be empty in which case the screen's input type is unknown.", "items": { @@ -18648,7 +18653,7 @@ "type": "object" }, "AssistantPrefulfillmentRankerPrefulfillmentSignals": { - "description": "Signals to be used by the Prefulfillment Ranker. Derived from the ParsingSignals and GroundingSignals carried by the FunctionCall. LINT.IfChange Next ID: 34", + "description": "Signals to be used by the Prefulfillment Ranker. Derived from the ParsingSignals and GroundingSignals carried by the FunctionCall. LINT.IfChange Next ID: 36", "id": "AssistantPrefulfillmentRankerPrefulfillmentSignals", "properties": { "bindingSetAuis": { @@ -18656,6 +18661,11 @@ "format": "float", "type": "number" }, + "bindingSetPauis": { + "description": "Pauis score for the binding set", + "format": "float", + "type": "number" + }, "calibratedParsingScore": { "description": "A parsing score that is independently calibrated by each parser/IG.", "format": "double", @@ -18711,6 +18721,11 @@ "description": "This feature is always false / no-op in serving time. In training time, this feature may be set true on specific examples for weighted training where when this signal is true, only cross-intent level features are used for training and other candidate level features are masked (set as missing).", "type": "boolean" }, + "maxHgrScoreAcrossBindingSets": { + "description": "The maximum score assigned by the Horizontal Grounding Ranker (HGR) across all of the intent's binding sets.", + "format": "double", + "type": "number" + }, "numAlternativeHypothesis": { "description": "Number of alternative hypotheses from speech recognition(S3).", "format": "float", @@ -19315,7 +19330,7 @@ "type": "object" }, "AssistantVerticalsHomeautomationProtoHomeAutomation_MetaData": { - "description": "Next ID: 42", + "description": "Next ID: 43", "id": "AssistantVerticalsHomeautomationProtoHomeAutomation_MetaData", "properties": { "actionProjectConfigs": { @@ -19361,6 +19376,13 @@ "description": "GCM address for cloud execution across google cloud messaging rather than 3p cloud; for future use.", "type": "string" }, + "groupIds": { + "description": "List of parent group IDs, if the device is added to one or multiple device groups (see go/home-groups). Will be consumed by Smart Home APIs and (in the future) Assistant CTF to populate the group member list of device groups.", + "items": { + "type": "string" + }, + "type": "array" + }, "hashValue": { "description": "The hash value from go/de-consistency-check", "type": "string" @@ -20377,7 +20399,7 @@ "type": "object" }, "ClassifierPornSiteData": { - "description": "Next ID: 51", + "description": "Next ID: 52", "id": "ClassifierPornSiteData", "properties": { "avgPedoPageScore": { @@ -20399,6 +20421,10 @@ "format": "uint64", "type": "string" }, + "site": { + "description": "Sitechunk used to compute the signals. The field is present only for data created after December 2022.", + "type": "string" + }, "sitePornRatio": { "description": "The ratio of porn/softporn of the site this page belongs to.", "format": "float", @@ -36917,7 +36943,7 @@ "type": "object" }, "GeostorePriceListNameInfoProto": { - "description": "A PriceListNameInfoProto is used by PriceListProto and fields and messages contained in it for storing names, descriptions, languages, and IDs. The name field and the description field must be in the same language, as specified by the language field. None of the fields in this proto is required, although it is not expected to have the language field set unless there is a name or description. When the language field is not set, it is understood to be the preferred language of the locale where the establishment is located. An empty string for any of the fields is treated the same as having the fields not set.", + "description": "A PriceListNameInfoProto is used by PriceListProto and fields and messages contained in it for storing names, descriptions, languages, and IDs. The name field and the description field must be in the same language, as specified by the language field. None of the fields in this proto is required, although it is not expected to have the language field set unless there is a name or description. When the language field is not set, it is understood to be the preferred language of the locale where the establishment is located. An empty string for any of the fields is not allowed (as enforced by lints).", "id": "GeostorePriceListNameInfoProto", "properties": { "description": { @@ -37091,6 +37117,10 @@ }, "type": "array" }, + "language": { + "description": "The external form of a Google International Identifiers Initiative (III) LanguageCode object. See google3/i18n/identifiers/languagecode.h for details. We place extra restrictions on languages in addition to what the III library requires. See go/geo-schema-reference/feature-properties/languages. When set, represents the language of the section and its items. Any section and item level name infos must match this language. Optional.", + "type": "string" + }, "media": { "description": "One or more media items (photos, videos, etc.) describing this section / category.", "items": { @@ -43030,6 +43060,11 @@ "dimensions": { "$ref": "GoogleAssistantAccessoryV1ScreenOutConfigDimensions", "description": "Device dimensions." + }, + "fontScaleFactor": { + "description": "The scale factor used to convert Scalable Pixel (SP) units to Density-independent Pixel (DP) units (DP = SP * scale factor). Fonts are measured in units of SP, and on some platforms such as Android the SP to DP scale factor can be affected by the font size a user selects in accessibility settings.", + "format": "float", + "type": "number" } }, "type": "object" @@ -43617,6 +43652,20 @@ }, "type": "object" }, + "GoogleCloudContentwarehouseV1CustomWeightsMetadata": { + "description": "To support the custom weighting across document schemas.", + "id": "GoogleCloudContentwarehouseV1CustomWeightsMetadata", + "properties": { + "weightedSchemaProperties": { + "description": "List of schema and property name. Allows a maximum of 10 schemas to be specified for relevance boosting.", + "items": { + "$ref": "GoogleCloudContentwarehouseV1WeightedSchemaProperty" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudContentwarehouseV1DataUpdateAction": { "description": "Represents the action responsible for properties update operations.", "id": "GoogleCloudContentwarehouseV1DataUpdateAction", @@ -43873,6 +43922,10 @@ "description": "This filter specifies a structured syntax to match against the [PropertyDefinition].is_filterable marked as `true`. The syntax for this expression is a subset of SQL syntax. Supported operators are: `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=` where the left of the operator is a property name and the right of the operator is a number or a quoted string. You must escape backslash (\\\\) and quote (\\\") characters. Supported functions are `LOWER([property_name])` to perform a case insensitive match and `EMPTY([property_name])` to filter on the existence of a key. Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting (for example, \"((A AND B AND C) OR NOT D) AND E\"), a maximum of 100 comparisons or functions are allowed in the expression. The expression must be \u003c 6000 bytes in length. Sample Query: `(LOWER(driving_license)=\"class \\\"a\\\"\" OR EMPTY(driving_license)) AND driving_years \u003e 10`", "type": "string" }, + "customWeightsMetadata": { + "$ref": "GoogleCloudContentwarehouseV1CustomWeightsMetadata", + "description": "To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored." + }, "documentCreatorFilter": { "description": "The exact creator(s) of the documents to search against. If a value isn't specified, documents within the search results are associated with any creator. If multiple values are specified, documents within the search results may be associated with any of the specified creators.", "items": { @@ -44242,6 +44295,22 @@ ], "type": "string" }, + "documentCreatorDefaultRole": { + "description": "Optional. The default role for the person who create a document.", + "enum": [ + "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED", + "DOCUMENT_ADMIN", + "DOCUMENT_EDITOR", + "DOCUMENT_VIEWER" + ], + "enumDescriptions": [ + "Unspecified, will be default to document admin role.", + "Document Admin, same as contentwarehouse.googleapis.com/documentAdmin.", + "Document Editor, same as contentwarehouse.googleapis.com/documentEditor.", + "Document Viewer, same as contentwarehouse.googleapis.com/documentViewer." + ], + "type": "string" + }, "kmsKey": { "description": "Optional. The KMS key used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key is left empty, no encryption will be enforced.", "type": "string" @@ -44583,6 +44652,28 @@ "$ref": "GoogleCloudContentwarehouseV1PropertyTypeOptions", "description": "Nested structured data property." }, + "retrievalImportance": { + "description": "The retrieval importance of the property during search.", + "enum": [ + "RETRIEVAL_IMPORTANCE_UNSPECIFIED", + "HIGHEST", + "HIGHER", + "HIGH", + "MEDIUM", + "LOW", + "LOWEST" + ], + "enumDescriptions": [ + "No importance specified. Default medium importance.", + "Highest importance.", + "Higher importance.", + "High importance.", + "Medium importance.", + "Low importance (negative).", + "Lowest importance (negative)." + ], + "type": "string" + }, "textTypeOptions": { "$ref": "GoogleCloudContentwarehouseV1TextTypeOptions", "description": "Text/string property." @@ -45271,6 +45362,24 @@ }, "type": "object" }, + "GoogleCloudContentwarehouseV1WeightedSchemaProperty": { + "description": "Specifies the schema property name.", + "id": "GoogleCloudContentwarehouseV1WeightedSchemaProperty", + "properties": { + "documentSchemaName": { + "description": "The document schema name.", + "type": "string" + }, + "propertyNames": { + "description": "The property definition names in the schema.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudContentwarehouseV1beta1CreateDocumentMetadata": { "description": "Metadata object for CreateDocument request (currently empty).", "id": "GoogleCloudContentwarehouseV1beta1CreateDocumentMetadata", @@ -47525,7 +47634,7 @@ "type": "boolean" }, "trait": { - "description": "Trait name, e.g., \"action.devices.traits.MediaInitiation\". See [device traits](https://developers.google.com/assistant/smarthome/traits). See java/com/google/home/graph/common/devices/config/protoconf.pi for the exhaustive list of trait-strings.", + "description": "Trait name, e.g., \"action.devices.traits.MediaInitiation\". See [device traits](https://developers.home.google.com/cloud-to-cloud/traits). See java/com/google/home/graph/common/devices/config/protoconf.pi for the exhaustive list of trait-strings.", "type": "string" } }, @@ -52646,6 +52755,18 @@ "description": "The generation number returned by Venom.", "format": "int64", "type": "string" + }, + "videoVenomSetting": { + "description": "This field is not persisted anywhere. It is only used in deletion service for converying the VideoVenomSetting when deleting Venom data.", + "enum": [ + "VIDEO_VENOM_SETTING_COMMON", + "VIDEO_VENOM_SETTING_VINEYARD" + ], + "enumDescriptions": [ + "This corresponds to [trustme.crawl] is {CLIENT_OTHER}.", + "This corresponds to [trustme.crawl] is {CLIENT_OTHER, CLIENT_VINEYARD}. LINT.ThenChange( //depot/google3/image/repository/shared/util/video_util.cc, )" + ], + "type": "string" } }, "type": "object" @@ -61190,13 +61311,15 @@ "UNSPECIFIED_COMPOSITION", "ALL_COMPOSITION", "PRIMITIVES_ONLY_COMPOSITION", - "PRIMITIVES_AND_OPERATORS_OF_PRIMITIVES_COMPOSITION" + "PRIMITIVES_AND_OPERATORS_OF_PRIMITIVES_COMPOSITION", + "PRIMITIVES_AND_SEMANTIC_TYPES_COMPOSITION" ], "enumDescriptions": [ "An unspecified value is required by enum best practices. It will not be used anywhere as the default is ALL_COMPOSITION.", "", "", - "To handle cases where we have a Group of entities" + "To handle cases where we have a Group of entities", + "Allows primitives only, or specific FunctionCalls with explicitly listed semantic_types." ], "type": "string" }, @@ -62518,7 +62641,7 @@ "Unknown type.", "Actions lead users to Food Ordering site (orderfood.google.com), powered by end to end partners that signed the full integration contact with Google. This is the default action type for most cases. go/fopa-order-button-placesheet", "TOA actions lead users to TOA site (eg. https://ordering.app/cuba512/downtown/contact/). go/payfood-entrypoint-experiments", - "Autobot actions lead users to 3p site that support Autobot. go/fo-autobot-triggering", + "DEPRECATED(b/261496948): Autobot has been sunset. Autobot actions lead users to 3p site that support Autobot. go/fo-autobot-triggering", "PAS actions lead users to Food Ordering site (orderfood.google.com), but powered by PAS partners. Note that if one restaurant is supported by both E2E and PAS partners, the action type should still be E2E. go/fo-pas-integration" ], "type": "string" @@ -63663,7 +63786,7 @@ "type": "object" }, "MediaIndexRegion": { - "description": "Metadata associated with a region in an image. NEXT_ID: 13", + "description": "Metadata associated with a region in an image. NEXT_ID: 14", "id": "MediaIndexRegion", "properties": { "boundingBox": { @@ -63731,6 +63854,9 @@ }, "starburstV4": { "$ref": "ImageContentStarburstVersionGroup" + }, + "starburstV5": { + "$ref": "ImageContentStarburstVersionGroup" } }, "type": "object" @@ -69092,6 +69218,11 @@ "The perception models believe it is likely, but not certain that the user has finished expressing their thought. This signal as a lower latency and lower precision than the COMPLETE status." ], "type": "string" + }, + "textCompletenessProbability": { + "description": "Completeness probability as calculated by the parser's completeness layer.", + "format": "float", + "type": "number" } }, "type": "object" @@ -69491,11 +69622,13 @@ "chargingSpeed": { "enum": [ "UNKNOWN_CHARGING_SPEED", - "FAST_CHARGING_SPEED" + "FAST_CHARGING_SPEED", + "VERY_FAST_CHARGING_SPEED" ], "enumDescriptions": [ "", - "" + "", + "Very fast definition : go/very-fast-speed-qbf-evcs" ], "type": "string" } @@ -76509,7 +76642,7 @@ "OnTheGo app. http://go/onthego Team contact: otg-eng@google.com", "Google AdSense app. Team contact: publisher-android-app@google.com", "Project Fi app. http://go/nova-eng Team contact: tycho-atlas@google.com", - "Karma team's Jam app. http://go/jam Team contact: karma-eng@google.com", + "Jamboard app. http://go/jamnpard-eng Team contact: jamboard-eng@google.com", "Huddle app. http://go/huddle Team contact: huddle-eng@google.com", "Chauffeur Car app. http://go/chauffeur Team contact: chauffeur-ux-eng@google.com", "Tailormade app. http://go/tailormade Team contact: tailormade-eng@google.com", @@ -80705,18 +80838,9 @@ "type": "object" }, "PtokenPToken": { - "description": "PToken expresses policy-relevant properties of the data objects being processed and stored in Google's production systems. See go/ptoken to learn more. Next ID: 8", + "description": "PToken expresses policy-relevant properties of the data objects being processed and stored in Google's production systems. See go/ptoken to learn more. PTokens are intentionally opaque: go/ptokens-are-opaque. The following should be considered implementation details. Next ID: 8 INTERNAL: If both the Scalar and the Compound extensions are populated, we use the Compound and discard the Scalar. In principle, this should never happen.", "id": "PtokenPToken", - "properties": { - "compoundPtokenData": { - "format": "byte", - "type": "string" - }, - "ptokenData": { - "format": "byte", - "type": "string" - } - }, + "properties": {}, "type": "object" }, "QualityActionsAppInfo": { @@ -81271,8 +81395,6 @@ "PERSONAL_INTELLIGENCE_NOTIFICATION", "PERSONAL_INTELLIGENCE_LIVE_CARD", "LENS_REMINDER", - "AUTOBOT_TRANSACTION", - "AUTOBOT_CSAT", "IQS_NOTIFICATION", "ASSISTANT_SURVEY", "ASSISTANT_SURVEY_IMPORTANCE_MIN", @@ -81674,8 +81796,6 @@ "", "", "", - "", - "", "Notification for HomeIntelligenceService(IQS) go/iqs-notification-sink", "", "Deprecated! use ASSISTANT_SURVEY_PRIORITY_LOW Similar to ASSISTANT_SURVEY but used by Android TV to set android_tv_importance to IMPORTANCE_MIN.", @@ -84493,6 +84613,11 @@ "description": "Contains meta information about this data. This field is only available in docjoins (and potentially MDU shards), it is not populated offline. NOTE: This is a new field (Nov 2022) and we do not want clients to depend on this; please contact qscore-team@ if you want to use this information.", "id": "QualityNsrNsrDataMetadata", "properties": { + "encodedLookupInformation": { + "description": "Encoded lookup information. The fields set above are expensive to store. Storing them in docjoins is fine, but we cannot store them in MDU shards. In order for the MDU shards to display field provenance information, we store them as a bitfield. For details about the encoding and decoding scheme, see quality_nsr::util::EncodeMetadataLookupInformation. We expect this to occupy 8 bytes as long as there are less than 64 fields in NsrData proto, 12 bytes between 64 and 92 fields, etc.", + "format": "byte", + "type": "string" + }, "goldmineLookupKeyPerField": { "additionalProperties": { "format": "int32", @@ -86289,6 +86414,7 @@ "id": "QualityQrewriteCandidateIdField", "properties": { "index": { + "description": "If needed, a servlet can use this field to assign an ID to distinguish between different candidates of the same CandidateType.", "format": "int32", "type": "integer" }, @@ -87234,9 +87360,9 @@ "V4_2", "V5", "V5_1", + "V5_2", "V1_BODYONLY", "V2_BODYONLY", - "RENAME_ME_TO_ADD_NEW_ENUM_15", "RENAME_ME_TO_ADD_NEW_ENUM_16", "RENAME_ME_TO_ADD_NEW_ENUM_17", "RENAME_ME_TO_ADD_NEW_ENUM_18", @@ -87245,7 +87371,8 @@ "RENAME_ME_TO_ADD_NEW_ENUM_21", "RENAME_ME_TO_ADD_NEW_ENUM_22", "RENAME_ME_TO_ADD_NEW_ENUM_23", - "RENAME_ME_TO_ADD_NEW_ENUM_24" + "RENAME_ME_TO_ADD_NEW_ENUM_24", + "RENAME_ME_TO_ADD_NEW_ENUM_25" ], "enumDescriptions": [ "In case an old binary doesn't know a recently added version.", @@ -87261,6 +87388,7 @@ "ariane/4031318). Lyrebird V4.2: Salient Terms V4.2 (ariane/4057245)", "Lyrebird V5: Salient Terms V5 (ariane/4076831)", "Lyrebird V5.1: Salient Terms V5.1 (ariane/4144754)", + "Lyrebird V5.2: Salient Terms V5.2 (ariane/4218250)", "Lyrebird BodyOnly V1.", "Experimental version of Lyrebird BodyOnly V2.", "Dummy enum values to be renamed when a new enum value is needed. Note that this is a requirement from go/cds-schema-council. If you rename one of these enum values, be sure to add (at least one) more below.", @@ -88364,6 +88492,7 @@ "id": "QualityTimebasedLastSignificantUpdateAdjustments", "properties": { "adjustmentSource": { + "description": "If the selected LSU has been adjusted, i.e. the maximum passage timestamp, firstseen or contentage were assigned to LSU, the adjustment source is stored here.", "enum": [ "UNSET", "PASSAGE_TIMESTAMP", @@ -88382,11 +88511,45 @@ "description": "The timestamp is precise when it's derived from existing (\u003eMarch 2022) passage timestamp.", "type": "boolean" }, - "unadjustedTimestampInSeconds": { - "description": "The timestamp that was picked up by the component indicated in the LastSignificantUpdateSource but was dropped due to exceeding the upper bound. The two following fields are present only when the adjustment took place.", + "unboundedTimestampInSeconds": { + "description": "The timestamp that was picked up by the component indicated in the LastSignificantUpdateSource but was dropped due to exceeding the upper bound. Set only if it's not equal to final LSU.", "format": "int64", "type": "string" }, + "unboundedTimestampSource": { + "description": "The source that produced the unbounded timestamp.", + "enum": [ + "UNSET", + "LSU_V1", + "LSU_V2_UPDATE_MARKUP_SUPPORTED_BY_CONTENTAGE", + "LSU_V2_UPDATE_MARKUP_SUPPORTED_BY_ANNOTATION", + "LSU_V2_ANNOTATION_WITH_UPDATE_TAG", + "LSU_V2_PUBLICATION_MARKUP_SUPPORTED_BY_CONTENTAGE", + "LSU_V2_PUBLICATION_MARKUP_SUPPORTED_BY_ANNOTATION", + "LSU_V2_ANNOTATION_WITH_PATTERN_BYLINE_TAG", + "LSU_V2_RELIABLE_CONTENT_AGE_SUPPORTED_BY_ANNOTATION", + "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_LOW_SUPPORT", + "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_MEDIUM_SUPPORT", + "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_HIGH_SUPPORT", + "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_FULL_SUPPORT" + ], + "enumDescriptions": [ + "", + "The signal from legacy selector (quality/timebased/lastsignificantupdate/lsu-selector.h). It's a fallback for clients relying on ~100% recall of the signal.", + "The signal comes from update markup date supported by ContentAge.", + "The signal comes from update markup date supported by annotation.", + "The signal comes from date annotation representing update date of a page.", + "The signal comes from publication markup date supported by ContentAge.", + "The signal comes from publication markup date supported by annotation.", + "The signal comes from date annotation often selected as a byline.", + "The signal comes from ContentAge that's supported by date annotation.", + "", + "", + "", + "" + ], + "type": "string" + }, "upperboundTimestampInSeconds": { "description": "The upperbound value derived from passage timestamps. If present, the LSU date should never exceed this value. Design doc: go/lsu-max-passage-timestamp", "format": "int64", @@ -92221,7 +92384,7 @@ "enumDescriptions": [ "", "A range that is an adjectival expression referring to a base entity.", - "An adjectival range is expressed in the superlaive degree.", + "An adjectival range is expressed in the superlative degree.", "A range which is lexically plural.", "A range expressing unequivocally a (semantic) female gender. This could be for expressions that are intrinsically female (\"aunt\") or the female expression of an entity that is lexically gendered (\"chairwoman\" as opposed to \"chairman\" or \"chairperson\").", "The range designates an aspect, that is, a modifier of some other range.", @@ -92767,20 +92930,14 @@ "PRODUCTS", "SYMPTOMS", "CHAINS", - "SYMPTOMS_PATTERN", "MOVIES", "SPORTS_TEAM", "EXAMS", "MOTORCYCLES", - "TOURNAMENTS", "PRIMEREF", "SONGS", - "AWARDS", "EDUCATION", - "EVENTS", - "OLYMPICS", - "BIG_MOMENTS", - "DISASTERS" + "EVENTS" ], "enumDescriptions": [ "", @@ -92796,12 +92953,6 @@ "", "", "", - "", - "", - "", - "", - "", - "", "" ], "type": "string" @@ -94320,11 +94471,6 @@ "format": "float", "type": "number" }, - "explainedNormalizedTopicality": { - "description": "Fraction of importance_ratio (IR) that is explained by this entity and implied entities. E.g. a page about a song with IR 0.2 for the song and 0.5 for the artist actually has explained_normalized_topicality 0.7 for the song.", - "format": "float", - "type": "number" - }, "firstScore": { "description": "The raw topicality score of the primary entity.", "format": "float", @@ -94349,11 +94495,6 @@ "format": "float", "type": "number" }, - "referencePageSelectionScore": { - "description": "The score used to sort reference pages for a given entity. This score tries to assign higher scores to reference pages that are more useful to the model building.", - "format": "float", - "type": "number" - }, "selected": { "description": "True if the entity is selected as the reference page owner.", "type": "boolean" @@ -97140,6 +97281,19 @@ "description": "The original name for the area covered by the dataset.", "type": "string" }, + "locationResource": { + "enum": [ + "UNKNOWN", + "METADATA", + "WEBREF" + ], + "enumDescriptions": [ + "", + "When the locationthe is specified in the raw metadata", + "When the locationthe is not specified in the raw metadata" + ], + "type": "string" + }, "pointCoordinates": { "description": "Latitude and longitude for a single point in the form of \"lat,long\".", "type": "string" @@ -97757,6 +97911,13 @@ ], "type": "string" }, + "kgCollection": { + "description": "HRID of the KG collections", + "items": { + "type": "string" + }, + "type": "array" + }, "mid": { "description": "The KG identifier of the WebrefEntity.", "type": "string" @@ -100685,7 +100846,7 @@ "type": "object" }, "SnippetExtraInfoSnippetCandidateInfo": { - "description": "Next ID: 13", + "description": "Next ID: 14", "id": "SnippetExtraInfoSnippetCandidateInfo", "properties": { "boldedRanges": { @@ -100715,6 +100876,13 @@ "scoringInfo": { "$ref": "SnippetExtraInfoSnippetScoringInfo" }, + "sentenceStarts": { + "description": "Sentence starting positions in the printed snippet lines.", + "items": { + "$ref": "QualitySnippetsTruncationSnippetBoldedRangePosition" + }, + "type": "array" + }, "snippet": { "description": "Muppet fills snippet lines in `snippet` field.", "items": { @@ -103370,6 +103538,7 @@ "ISOLATION_PKG_YOUTUBE_PRIVATE_PLAYLISTS", "ISOLATION_PKG_YOUTUBE_PUBLIC_AND_PRIVATE_PLAYLISTS", "ISOLATION_S3_CREATOR_PRESENCE", + "ISOLATION_S12Y_RECIPE_INGREDIENT_INSIGHTS", "UMP_TESTING_ONLY", "INTENTJOINS_NB_SIGNALS", "ADS_INTEGRITY_ANNOTATION", @@ -103549,6 +103718,7 @@ "For personal playlists from YouTube's PlaylistService that have private visibility. PWG-YouTube approval required for all usecases involving this data.", "For data from YouTube's PlaylistService that has either public or private visibility (i.e. the combination of ISOLATION_PKG_YOUTUBE_PLAYLISTS and ISOLATION_PKG_YOUTUBE_PRIVATE_PLAYLISTS). PWG-YouTube approval required for all usecases involving this data.", "Access controls for Creator Channel's S-Cubed corpus data. See more in go/uro-access-required. YOU MUST CONTACT milk-tea@ before reading or writing this data", + "For Search sustainability's food choice feature, Recipe Ingredient Insights. Assign existing KG entities feature types to classify triggering behavior and insights. Owned by salehh@ and s12y-eng@ See go/rii-kg-triggering-migration for more information.", "This access control is used to guard data used by the Unified Media Platform team (ke-media-actions-serving@) for testing new features. It should never be used for purposes other than testing. More context at go/fake-media-provider.", "Access controls for the IntentJoins Navboost data. YOU MUST CONTACT intentjoins-eng@ before reading or writing this data.", "Access controls for Ads Integrity annotation data. Ads Integrity annotations are only available for Ads Integrity policy enforcement. See go/ai-political-km for more details. YOU MUST CONTACT ai-pacg@ before reading or writing this data.", @@ -108283,6 +108453,10 @@ "PBUY_FINE_TUNING_WITH_TEXT_TREAT_USER_LEVEL", "PLAY_GAMES_ACHIEVEMENT_LOYALTY_QUEST_USER_LEVEL", "PLAY_BOOKS_READING_PROGRESS_TOOLTIP_USER_LEVEL", + "IAP_SKU_DEALS_LIVE_OP_GAMES_HOME_USER_LEVEL1", + "POST_PURCHASE_OFFER_POST_PURCHASE_CONFIRMATION_DIALOG_SERVER_USER_LEVEL", + "POST_PURCHASE_OFFER_POST_PURCHASE_OFFER_SAVED_DIALOG_SERVER_USER_LEVEL", + "POST_PURCHASE_OFFER_VALUE_PROMOTION_DIALOG_SHOWN_SERVER_USER_LEVEL", "USER_LEVEL_TEST_CODE_LIMIT" ], "enumDescriptions": [ @@ -109947,6 +110121,10 @@ "User level test code for new uplift modeling architecture with campaign features in treatment tower.", "User level test code for Non-Play Growth Events experiment (go/npge-prd). Logged on the server side and applied to users that visit Loyalty Home and are eligible to receive a quest with Play Games Achievement tasks, regardless of whether the quest was shown or held back.", "User level test code for reading progress tooltip.", + "User level test code for tracking users who should see the IAP Sku Games Home liveops card.", + "Post purchase offer test codes User level test code to track the user who sees the post purcahse offer redemption dialog for post purchase offer experiment.", + "User level test code to track the user who sees the post purcahse offer saved dialog for post purchase offer experiment.", + "User level test code to track the user who sees the value promotion dialog, including loyalty upsell, post purcahse offer and so on for post purchase offer experiment.", "" ], "type": "string" @@ -110319,7 +110497,7 @@ "type": "string" }, "ns": { - "description": "LINT.ThenChange( //depot/google3/googledata/production/playbooks/video-assets/clients.md ) REQUIRED.", + "description": "LINT.ThenChange( //depot/google3/googledata/production/playbooks/video-assets/clients.md, //depot/google3/video/assets/venom/proto/namespace.proto ) REQUIRED.", "enum": [ "NS_UNKNOWN", "NS_YOUTUBE", diff --git a/contentwarehouse/v1/contentwarehouse-gen.go b/contentwarehouse/v1/contentwarehouse-gen.go index c84e98a927e..424cd5383af 100644 --- a/contentwarehouse/v1/contentwarehouse-gen.go +++ b/contentwarehouse/v1/contentwarehouse-gen.go @@ -16210,8 +16210,15 @@ func (s *AssistantApiRecurrenceDatetimeRange) MarshalJSON() ([]byte, error) { // AssistantApiScreenCapabilities: These capabilities represent the // tactile features associated with the device. This includes, for // example, whether the device has a screen, how big the screen is, and -// privacy of the screen. Next ID: 10 +// privacy of the screen. Next ID: 11 type AssistantApiScreenCapabilities struct { + // FontScaleFactor: The scale factor used to convert Scalable Pixel (SP) + // units to Density-independent Pixel (DP) units (DP = SP * scale + // factor). Fonts are measured in units of SP, and on some platforms + // such as Android the SP to DP scale factor can be affected by the font + // size a user selects in accessibility settings. + FontScaleFactor float64 `json:"fontScaleFactor,omitempty"` + // InputType: The types of input that this screen supports. Note that // this can be empty in which case the screen's input type is unknown. // @@ -16271,7 +16278,7 @@ type AssistantApiScreenCapabilities struct { // color and TTS will be adjusted. VisionHelpEnabled bool `json:"visionHelpEnabled,omitempty"` - // ForceSendFields is a list of field names (e.g. "InputType") to + // ForceSendFields is a list of field names (e.g. "FontScaleFactor") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -16279,12 +16286,13 @@ type AssistantApiScreenCapabilities struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "InputType") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "FontScaleFactor") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } @@ -16294,6 +16302,20 @@ func (s *AssistantApiScreenCapabilities) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +func (s *AssistantApiScreenCapabilities) UnmarshalJSON(data []byte) error { + type NoMethod AssistantApiScreenCapabilities + var s1 struct { + FontScaleFactor gensupport.JSONFloat64 `json:"fontScaleFactor"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.FontScaleFactor = float64(s1.FontScaleFactor) + return nil +} + // AssistantApiScreenCapabilitiesMask: A mask applied to the screen's // pixel space to determine regions not visible on the physical device. type AssistantApiScreenCapabilitiesMask struct { @@ -24054,11 +24076,14 @@ func (s *AssistantLogsTargetDeviceLog) MarshalJSON() ([]byte, error) { // AssistantPrefulfillmentRankerPrefulfillmentSignals: Signals to be // used by the Prefulfillment Ranker. Derived from the ParsingSignals // and GroundingSignals carried by the FunctionCall. LINT.IfChange Next -// ID: 34 +// ID: 36 type AssistantPrefulfillmentRankerPrefulfillmentSignals struct { // BindingSetAuis: Assistant User Interaction Score for binding set. BindingSetAuis float64 `json:"bindingSetAuis,omitempty"` + // BindingSetPauis: Pauis score for the binding set + BindingSetPauis float64 `json:"bindingSetPauis,omitempty"` + // CalibratedParsingScore: A parsing score that is independently // calibrated by each parser/IG. CalibratedParsingScore float64 `json:"calibratedParsingScore,omitempty"` @@ -24120,6 +24145,11 @@ type AssistantPrefulfillmentRankerPrefulfillmentSignals struct { // other candidate level features are masked (set as missing). MaskCandidateLevelFeatures bool `json:"maskCandidateLevelFeatures,omitempty"` + // MaxHgrScoreAcrossBindingSets: The maximum score assigned by the + // Horizontal Grounding Ranker (HGR) across all of the intent's binding + // sets. + MaxHgrScoreAcrossBindingSets float64 `json:"maxHgrScoreAcrossBindingSets,omitempty"` + // NumAlternativeHypothesis: Number of alternative hypotheses from // speech recognition(S3). NumAlternativeHypothesis float64 `json:"numAlternativeHypothesis,omitempty"` @@ -24223,12 +24253,14 @@ func (s *AssistantPrefulfillmentRankerPrefulfillmentSignals) UnmarshalJSON(data type NoMethod AssistantPrefulfillmentRankerPrefulfillmentSignals var s1 struct { BindingSetAuis gensupport.JSONFloat64 `json:"bindingSetAuis"` + BindingSetPauis gensupport.JSONFloat64 `json:"bindingSetPauis"` CalibratedParsingScore gensupport.JSONFloat64 `json:"calibratedParsingScore"` EffectiveArgSpanLength gensupport.JSONFloat64 `json:"effectiveArgSpanLength"` GroundabilityScore gensupport.JSONFloat64 `json:"groundabilityScore"` InQueryMaxEffectiveArgSpanLength gensupport.JSONFloat64 `json:"inQueryMaxEffectiveArgSpanLength"` IntentNameAuisScore gensupport.JSONFloat64 `json:"intentNameAuisScore"` IntentNameAuisScoreExp gensupport.JSONFloat64 `json:"intentNameAuisScoreExp"` + MaxHgrScoreAcrossBindingSets gensupport.JSONFloat64 `json:"maxHgrScoreAcrossBindingSets"` NumAlternativeHypothesis gensupport.JSONFloat64 `json:"numAlternativeHypothesis"` NumConstraints gensupport.JSONFloat64 `json:"numConstraints"` NumConstraintsSatisfied gensupport.JSONFloat64 `json:"numConstraintsSatisfied"` @@ -24248,12 +24280,14 @@ func (s *AssistantPrefulfillmentRankerPrefulfillmentSignals) UnmarshalJSON(data return err } s.BindingSetAuis = float64(s1.BindingSetAuis) + s.BindingSetPauis = float64(s1.BindingSetPauis) s.CalibratedParsingScore = float64(s1.CalibratedParsingScore) s.EffectiveArgSpanLength = float64(s1.EffectiveArgSpanLength) s.GroundabilityScore = float64(s1.GroundabilityScore) s.InQueryMaxEffectiveArgSpanLength = float64(s1.InQueryMaxEffectiveArgSpanLength) s.IntentNameAuisScore = float64(s1.IntentNameAuisScore) s.IntentNameAuisScoreExp = float64(s1.IntentNameAuisScoreExp) + s.MaxHgrScoreAcrossBindingSets = float64(s1.MaxHgrScoreAcrossBindingSets) s.NumAlternativeHypothesis = float64(s1.NumAlternativeHypothesis) s.NumConstraints = float64(s1.NumConstraints) s.NumConstraintsSatisfied = float64(s1.NumConstraintsSatisfied) @@ -25129,7 +25163,7 @@ func (s *AssistantVerticalsHomeautomationProtoHomeAutomationDeviceItem) MarshalJ } // AssistantVerticalsHomeautomationProtoHomeAutomationMetaData: Next ID: -// 42 +// 43 type AssistantVerticalsHomeautomationProtoHomeAutomationMetaData struct { // ActionProjectConfigs: Custom actions that this item supports. ActionProjectConfigs []*AssistantVerticalsHomeautomationProtoActionProjectConfig `json:"actionProjectConfigs,omitempty"` @@ -25169,6 +25203,12 @@ type AssistantVerticalsHomeautomationProtoHomeAutomationMetaData struct { // cloud messaging rather than 3p cloud; for future use. GcmExecutionAddress string `json:"gcmExecutionAddress,omitempty"` + // GroupIds: List of parent group IDs, if the device is added to one or + // multiple device groups (see go/home-groups). Will be consumed by + // Smart Home APIs and (in the future) Assistant CTF to populate the + // group member list of device groups. + GroupIds []string `json:"groupIds,omitempty"` + // HashValue: The hash value from go/de-consistency-check HashValue string `json:"hashValue,omitempty"` @@ -26932,7 +26972,7 @@ func (s *ClassifierPornReferrerCounts) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ClassifierPornSiteData: Next ID: 51 +// ClassifierPornSiteData: Next ID: 52 type ClassifierPornSiteData struct { // AvgPedoPageScore: The average pedo page score for the site. AvgPedoPageScore float64 `json:"avgPedoPageScore,omitempty"` @@ -26946,6 +26986,10 @@ type ClassifierPornSiteData struct { // NumberOfPedoPages: The number of pages with pedo restrict. NumberOfPedoPages uint64 `json:"numberOfPedoPages,omitempty,string"` + // Site: Sitechunk used to compute the signals. The field is present + // only for data created after December 2022. + Site string `json:"site,omitempty"` + // SitePornRatio: The ratio of porn/softporn of the site this page // belongs to. SitePornRatio float64 `json:"sitePornRatio,omitempty"` @@ -45202,7 +45246,7 @@ func (s *GeostorePriceInfoStatus) MarshalJSON() ([]byte, error) { // there is a name or description. When the language field is not set, // it is understood to be the preferred language of the locale where the // establishment is located. An empty string for any of the fields is -// treated the same as having the fields not set. +// not allowed (as enforced by lints). type GeostorePriceListNameInfoProto struct { Description string `json:"description,omitempty"` @@ -45386,6 +45430,15 @@ type GeostorePriceListSectionProto struct { // feeds, which need to remain separate from the TYPE_JOB list. ItemType []string `json:"itemType,omitempty"` + // Language: The external form of a Google International Identifiers + // Initiative (III) LanguageCode object. See + // google3/i18n/identifiers/languagecode.h for details. We place extra + // restrictions on languages in addition to what the III library + // requires. See go/geo-schema-reference/feature-properties/languages. + // When set, represents the language of the section and its items. Any + // section and item level name infos must match this language. Optional. + Language string `json:"language,omitempty"` + // Media: One or more media items (photos, videos, etc.) describing this // section / category. Media []*GeostoreMediaItemProto `json:"media,omitempty"` @@ -52776,6 +52829,13 @@ type GoogleAssistantAccessoryV1ScreenOutConfig struct { // Dimensions: Device dimensions. Dimensions *GoogleAssistantAccessoryV1ScreenOutConfigDimensions `json:"dimensions,omitempty"` + // FontScaleFactor: The scale factor used to convert Scalable Pixel (SP) + // units to Density-independent Pixel (DP) units (DP = SP * scale + // factor). Fonts are measured in units of SP, and on some platforms + // such as Android the SP to DP scale factor can be affected by the font + // size a user selects in accessibility settings. + FontScaleFactor float64 `json:"fontScaleFactor,omitempty"` + // ForceSendFields is a list of field names (e.g. "Dimensions") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -52799,6 +52859,20 @@ func (s *GoogleAssistantAccessoryV1ScreenOutConfig) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +func (s *GoogleAssistantAccessoryV1ScreenOutConfig) UnmarshalJSON(data []byte) error { + type NoMethod GoogleAssistantAccessoryV1ScreenOutConfig + var s1 struct { + FontScaleFactor gensupport.JSONFloat64 `json:"fontScaleFactor"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.FontScaleFactor = float64(s1.FontScaleFactor) + return nil +} + // GoogleAssistantAccessoryV1ScreenOutConfigDimensions: This contains // physical and logical characteristics about the device (e.g. screen // size and DPI, etc). @@ -53682,6 +53756,38 @@ func (s *GoogleCloudContentwarehouseV1CreateDocumentResponse) MarshalJSON() ([]b return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudContentwarehouseV1CustomWeightsMetadata: To support the +// custom weighting across document schemas. +type GoogleCloudContentwarehouseV1CustomWeightsMetadata struct { + // WeightedSchemaProperties: List of schema and property name. Allows a + // maximum of 10 schemas to be specified for relevance boosting. + WeightedSchemaProperties []*GoogleCloudContentwarehouseV1WeightedSchemaProperty `json:"weightedSchemaProperties,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "WeightedSchemaProperties") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "WeightedSchemaProperties") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudContentwarehouseV1CustomWeightsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudContentwarehouseV1CustomWeightsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudContentwarehouseV1DataUpdateAction: Represents the action // responsible for properties update operations. type GoogleCloudContentwarehouseV1DataUpdateAction struct { @@ -54077,6 +54183,13 @@ type GoogleCloudContentwarehouseV1DocumentQuery struct { // driving_years > 10` CustomPropertyFilter string `json:"customPropertyFilter,omitempty"` + // CustomWeightsMetadata: To support the custom weighting across + // document schemas, customers need to provide the properties to be used + // to boost the ranking in the search request. For a search query with + // CustomWeightsMetadata specified, only the RetrievalImportance for the + // properties in the CustomWeightsMetadata will be honored. + CustomWeightsMetadata *GoogleCloudContentwarehouseV1CustomWeightsMetadata `json:"customWeightsMetadata,omitempty"` + // DocumentCreatorFilter: The exact creator(s) of the documents to // search against. If a value isn't specified, documents within the // search results are associated with any creator. If multiple values @@ -54714,6 +54827,20 @@ type GoogleCloudContentwarehouseV1InitializeProjectRequest struct { // "DB_CLOUD_SQL_POSTGRES" - Cloud Sql with a Postgres Sql instance DatabaseType string `json:"databaseType,omitempty"` + // DocumentCreatorDefaultRole: Optional. The default role for the person + // who create a document. + // + // Possible values: + // "DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED" - Unspecified, will be + // default to document admin role. + // "DOCUMENT_ADMIN" - Document Admin, same as + // contentwarehouse.googleapis.com/documentAdmin. + // "DOCUMENT_EDITOR" - Document Editor, same as + // contentwarehouse.googleapis.com/documentEditor. + // "DOCUMENT_VIEWER" - Document Viewer, same as + // contentwarehouse.googleapis.com/documentViewer. + DocumentCreatorDefaultRole string `json:"documentCreatorDefaultRole,omitempty"` + // KmsKey: Optional. The KMS key used for CMEK encryption. It is // required that the kms key is in the same region as the endpoint. The // same key will be used for all provisioned resources, if encryption is @@ -55330,6 +55457,20 @@ type GoogleCloudContentwarehouseV1PropertyDefinition struct { // PropertyTypeOptions: Nested structured data property. PropertyTypeOptions *GoogleCloudContentwarehouseV1PropertyTypeOptions `json:"propertyTypeOptions,omitempty"` + // RetrievalImportance: The retrieval importance of the property during + // search. + // + // Possible values: + // "RETRIEVAL_IMPORTANCE_UNSPECIFIED" - No importance specified. + // Default medium importance. + // "HIGHEST" - Highest importance. + // "HIGHER" - Higher importance. + // "HIGH" - High importance. + // "MEDIUM" - Medium importance. + // "LOW" - Low importance (negative). + // "LOWEST" - Lowest importance (negative). + RetrievalImportance string `json:"retrievalImportance,omitempty"` + // TextTypeOptions: Text/string property. TextTypeOptions *GoogleCloudContentwarehouseV1TextTypeOptions `json:"textTypeOptions,omitempty"` @@ -56673,6 +56814,39 @@ func (s *GoogleCloudContentwarehouseV1Value) UnmarshalJSON(data []byte) error { return nil } +// GoogleCloudContentwarehouseV1WeightedSchemaProperty: Specifies the +// schema property name. +type GoogleCloudContentwarehouseV1WeightedSchemaProperty struct { + // DocumentSchemaName: The document schema name. + DocumentSchemaName string `json:"documentSchemaName,omitempty"` + + // PropertyNames: The property definition names in the schema. + PropertyNames []string `json:"propertyNames,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DocumentSchemaName") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DocumentSchemaName") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudContentwarehouseV1WeightedSchemaProperty) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudContentwarehouseV1WeightedSchemaProperty + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudContentwarehouseV1beta1CreateDocumentMetadata: Metadata // object for CreateDocument request (currently empty). type GoogleCloudContentwarehouseV1beta1CreateDocumentMetadata struct { @@ -60671,7 +60845,7 @@ type HomeGraphCommonTraitRoutingHints struct { // Trait: Trait name, e.g., "action.devices.traits.MediaInitiation". See // device traits - // (https://developers.google.com/assistant/smarthome/traits). See + // (https://developers.home.google.com/cloud-to-cloud/traits). See // java/com/google/home/graph/common/devices/config/protoconf.pi for the // exhaustive list of trait-strings. Trait string `json:"trait,omitempty"` @@ -66859,6 +67033,18 @@ type ImageRepositoryVenomStatus struct { // VenomMutationGeneration: The generation number returned by Venom. VenomMutationGeneration int64 `json:"venomMutationGeneration,omitempty,string"` + // VideoVenomSetting: This field is not persisted anywhere. It is only + // used in deletion service for converying the VideoVenomSetting when + // deleting Venom data. + // + // Possible values: + // "VIDEO_VENOM_SETTING_COMMON" - This corresponds to [trustme.crawl] + // is {CLIENT_OTHER}. + // "VIDEO_VENOM_SETTING_VINEYARD" - This corresponds to + // [trustme.crawl] is {CLIENT_OTHER, CLIENT_VINEYARD}. LINT.ThenChange( + // //depot/google3/image/repository/shared/util/video_util.cc, ) + VideoVenomSetting string `json:"videoVenomSetting,omitempty"` + // ForceSendFields is a list of field names (e.g. "Acl") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -78455,6 +78641,9 @@ type KnowledgeAnswersValueType struct { // "PRIMITIVES_ONLY_COMPOSITION" // "PRIMITIVES_AND_OPERATORS_OF_PRIMITIVES_COMPOSITION" - To handle // cases where we have a Group of entities + // "PRIMITIVES_AND_SEMANTIC_TYPES_COMPOSITION" - Allows primitives + // only, or specific FunctionCalls with explicitly listed + // semantic_types. InputCompositionConfig string `json:"inputCompositionConfig,omitempty"` MeasurementType *KnowledgeAnswersMeasurementType `json:"measurementType,omitempty"` @@ -80359,8 +80548,9 @@ type LocalsearchProtoInternalFoodOrderingActionMetadata struct { // "TOA" - TOA actions lead users to TOA site (eg. // https://ordering.app/cuba512/downtown/contact/). // go/payfood-entrypoint-experiments - // "AUTOBOT" - Autobot actions lead users to 3p site that support - // Autobot. go/fo-autobot-triggering + // "AUTOBOT" - DEPRECATED(b/261496948): Autobot has been sunset. + // Autobot actions lead users to 3p site that support Autobot. + // go/fo-autobot-triggering // "PAS" - PAS actions lead users to Food Ordering site // (orderfood.google.com), but powered by PAS partners. Note that if one // restaurant is supported by both E2E and PAS partners, the action type @@ -81632,7 +81822,7 @@ func (s *MediaIndexFrameIdentifierPreviewFrameZeroVariant) MarshalJSON() ([]byte } // MediaIndexRegion: Metadata associated with a region in an image. -// NEXT_ID: 13 +// NEXT_ID: 14 type MediaIndexRegion struct { // BoundingBox: The bounding box corresponding to the region. BoundingBox *MediaIndexBoundingbox `json:"boundingBox,omitempty"` @@ -81671,6 +81861,8 @@ type MediaIndexRegion struct { StarburstV4 *ImageContentStarburstVersionGroup `json:"starburstV4,omitempty"` + StarburstV5 *ImageContentStarburstVersionGroup `json:"starburstV5,omitempty"` + // ForceSendFields is a list of field names (e.g. "BoundingBox") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -87697,6 +87889,10 @@ type NlpSemanticParsingExpressionStatus struct { // status. Status string `json:"status,omitempty"` + // TextCompletenessProbability: Completeness probability as calculated + // by the parser's completeness layer. + TextCompletenessProbability float64 `json:"textCompletenessProbability,omitempty"` + // ForceSendFields is a list of field names (e.g. "Status") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -87720,6 +87916,20 @@ func (s *NlpSemanticParsingExpressionStatus) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +func (s *NlpSemanticParsingExpressionStatus) UnmarshalJSON(data []byte) error { + type NoMethod NlpSemanticParsingExpressionStatus + var s1 struct { + TextCompletenessProbability gensupport.JSONFloat64 `json:"textCompletenessProbability"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.TextCompletenessProbability = float64(s1.TextCompletenessProbability) + return nil +} + // NlpSemanticParsingLocalAmenities: A list of amenity constraints. // There is an implicit AND relationship between the different // constraints. @@ -88173,6 +88383,8 @@ type NlpSemanticParsingLocalEvChargingStationSpeedConstraint struct { // Possible values: // "UNKNOWN_CHARGING_SPEED" // "FAST_CHARGING_SPEED" + // "VERY_FAST_CHARGING_SPEED" - Very fast definition : + // go/very-fast-speed-qbf-evcs ChargingSpeed string `json:"chargingSpeed,omitempty"` // ForceSendFields is a list of field names (e.g. "ChargingSpeed") to @@ -97307,8 +97519,8 @@ type PeoplestackFlexorgsProtoInternalExternal struct { // publisher-android-app@google.com // "PROJECT_FI" - Project Fi app. http://go/nova-eng Team contact: // tycho-atlas@google.com - // "JAM" - Karma team's Jam app. http://go/jam Team contact: - // karma-eng@google.com + // "JAM" - Jamboard app. http://go/jamnpard-eng Team contact: + // jamboard-eng@google.com // "HUDDLE" - Huddle app. http://go/huddle Team contact: // huddle-eng@google.com // "CAR_APP" - Chauffeur Car app. http://go/chauffeur Team contact: @@ -102013,34 +102225,12 @@ func (s *PseudoVideoDataTranscriptTimestamp) MarshalJSON() ([]byte, error) { // PtokenPToken: PToken expresses policy-relevant properties of the data // objects being processed and stored in Google's production systems. -// See go/ptoken to learn more. Next ID: 8 +// See go/ptoken to learn more. PTokens are intentionally opaque: +// go/ptokens-are-opaque. The following should be considered +// implementation details. Next ID: 8 INTERNAL: If both the Scalar and +// the Compound extensions are populated, we use the Compound and +// discard the Scalar. In principle, this should never happen. type PtokenPToken struct { - CompoundPtokenData string `json:"compoundPtokenData,omitempty"` - - PtokenData string `json:"ptokenData,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CompoundPtokenData") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CompoundPtokenData") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *PtokenPToken) MarshalJSON() ([]byte, error) { - type NoMethod PtokenPToken - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // QualityActionsAppInfo: Information of the app to be annotated for the @@ -102860,8 +103050,6 @@ type QualityActionsReminder struct { // "PERSONAL_INTELLIGENCE_NOTIFICATION" // "PERSONAL_INTELLIGENCE_LIVE_CARD" // "LENS_REMINDER" - // "AUTOBOT_TRANSACTION" - // "AUTOBOT_CSAT" // "IQS_NOTIFICATION" - Notification for HomeIntelligenceService(IQS) // go/iqs-notification-sink // "ASSISTANT_SURVEY" @@ -106213,6 +106401,16 @@ func (s *QualityNsrNsrDataClusterUplift) UnmarshalJSON(data []byte) error { // 2022) and we do not want clients to depend on this; please contact // qscore-team@ if you want to use this information. type QualityNsrNsrDataMetadata struct { + // EncodedLookupInformation: Encoded lookup information. The fields set + // above are expensive to store. Storing them in docjoins is fine, but + // we cannot store them in MDU shards. In order for the MDU shards to + // display field provenance information, we store them as a bitfield. + // For details about the encoding and decoding scheme, see + // quality_nsr::util::EncodeMetadataLookupInformation. We expect this to + // occupy 8 bytes as long as there are less than 64 fields in NsrData + // proto, 12 bytes between 64 and 92 fields, etc. + EncodedLookupInformation string `json:"encodedLookupInformation,omitempty"` + // GoldmineLookupKeyPerField: Same as raffia_lookup_key_per_field. Note // that the goldmine_lookups have priority; if a field appears in both // goldmine and raffia entries, it means it was taken from goldmine. If @@ -106243,7 +106441,7 @@ type QualityNsrNsrDataMetadata struct { RaffiaLookupKeys []string `json:"raffiaLookupKeys,omitempty"` // ForceSendFields is a list of field names (e.g. - // "GoldmineLookupKeyPerField") to unconditionally include in API + // "EncodedLookupInformation") to unconditionally include in API // requests. By default, fields with empty or default values are omitted // from API requests. However, any non-pointer, non-interface field // appearing in ForceSendFields will be sent to the server regardless of @@ -106251,13 +106449,13 @@ type QualityNsrNsrDataMetadata struct { // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. - // "GoldmineLookupKeyPerField") to include in API requests with the JSON - // null value. By default, fields with empty values are omitted from API - // requests. However, any field with an empty value appearing in - // NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. + // NullFields is a list of field names (e.g. "EncodedLookupInformation") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } @@ -108227,6 +108425,8 @@ func (s *QualityQrewriteCandidateId) MarshalJSON() ([]byte, error) { // QualityQrewriteCandidateIdField: The message represents a field in // the query candidate Id. type QualityQrewriteCandidateIdField struct { + // Index: If needed, a servlet can use this field to assign an ID to + // distinguish between different candidates of the same CandidateType. Index int64 `json:"index,omitempty"` // Possible values: @@ -109304,13 +109504,13 @@ type QualitySalientTermsSalientTermSet struct { // (ariane/4057245) // "V5" - Lyrebird V5: Salient Terms V5 (ariane/4076831) // "V5_1" - Lyrebird V5.1: Salient Terms V5.1 (ariane/4144754) + // "V5_2" - Lyrebird V5.2: Salient Terms V5.2 (ariane/4218250) // "V1_BODYONLY" - Lyrebird BodyOnly V1. // "V2_BODYONLY" - Experimental version of Lyrebird BodyOnly V2. - // "RENAME_ME_TO_ADD_NEW_ENUM_15" - Dummy enum values to be renamed + // "RENAME_ME_TO_ADD_NEW_ENUM_16" - Dummy enum values to be renamed // when a new enum value is needed. Note that this is a requirement from // go/cds-schema-council. If you rename one of these enum values, be // sure to add (at least one) more below. - // "RENAME_ME_TO_ADD_NEW_ENUM_16" // "RENAME_ME_TO_ADD_NEW_ENUM_17" // "RENAME_ME_TO_ADD_NEW_ENUM_18" // "RENAME_ME_TO_ADD_NEW_ENUM_19" @@ -109319,6 +109519,7 @@ type QualitySalientTermsSalientTermSet struct { // "RENAME_ME_TO_ADD_NEW_ENUM_22" // "RENAME_ME_TO_ADD_NEW_ENUM_23" // "RENAME_ME_TO_ADD_NEW_ENUM_24" + // "RENAME_ME_TO_ADD_NEW_ENUM_25" Version string `json:"version,omitempty"` // ForceSendFields is a list of field names (e.g. "DocData") to @@ -110820,6 +111021,10 @@ func (s *QualityTimebasedLastSignificantUpdate) MarshalJSON() ([]byte, error) { } type QualityTimebasedLastSignificantUpdateAdjustments struct { + // AdjustmentSource: If the selected LSU has been adjusted, i.e. the + // maximum passage timestamp, firstseen or contentage were assigned to + // LSU, the adjustment source is stored here. + // // Possible values: // "UNSET" // "PASSAGE_TIMESTAMP" @@ -110831,11 +111036,39 @@ type QualityTimebasedLastSignificantUpdateAdjustments struct { // derived from existing (>March 2022) passage timestamp. IsUpperboundTimestampPrecise bool `json:"isUpperboundTimestampPrecise,omitempty"` - // UnadjustedTimestampInSeconds: The timestamp that was picked up by the + // UnboundedTimestampInSeconds: The timestamp that was picked up by the // component indicated in the LastSignificantUpdateSource but was - // dropped due to exceeding the upper bound. The two following fields - // are present only when the adjustment took place. - UnadjustedTimestampInSeconds int64 `json:"unadjustedTimestampInSeconds,omitempty,string"` + // dropped due to exceeding the upper bound. Set only if it's not equal + // to final LSU. + UnboundedTimestampInSeconds int64 `json:"unboundedTimestampInSeconds,omitempty,string"` + + // UnboundedTimestampSource: The source that produced the unbounded + // timestamp. + // + // Possible values: + // "UNSET" + // "LSU_V1" - The signal from legacy selector + // (quality/timebased/lastsignificantupdate/lsu-selector.h). It's a + // fallback for clients relying on ~100% recall of the signal. + // "LSU_V2_UPDATE_MARKUP_SUPPORTED_BY_CONTENTAGE" - The signal comes + // from update markup date supported by ContentAge. + // "LSU_V2_UPDATE_MARKUP_SUPPORTED_BY_ANNOTATION" - The signal comes + // from update markup date supported by annotation. + // "LSU_V2_ANNOTATION_WITH_UPDATE_TAG" - The signal comes from date + // annotation representing update date of a page. + // "LSU_V2_PUBLICATION_MARKUP_SUPPORTED_BY_CONTENTAGE" - The signal + // comes from publication markup date supported by ContentAge. + // "LSU_V2_PUBLICATION_MARKUP_SUPPORTED_BY_ANNOTATION" - The signal + // comes from publication markup date supported by annotation. + // "LSU_V2_ANNOTATION_WITH_PATTERN_BYLINE_TAG" - The signal comes from + // date annotation often selected as a byline. + // "LSU_V2_RELIABLE_CONTENT_AGE_SUPPORTED_BY_ANNOTATION" - The signal + // comes from ContentAge that's supported by date annotation. + // "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_LOW_SUPPORT" + // "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_MEDIUM_SUPPORT" + // "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_HIGH_SUPPORT" + // "LSU_MEDIUM_PRECISION_FRESH_SALIENT_ANNOTATION_FULL_SUPPORT" + UnboundedTimestampSource string `json:"unboundedTimestampSource,omitempty"` // UpperboundTimestampInSeconds: The upperbound value derived from // passage timestamps. If present, the LSU date should never exceed this @@ -116218,7 +116451,7 @@ type RepositoryWebrefLexicalRange struct { // "UNKNOWN" // "RELATIONAL_ADJECTIVE" - A range that is an adjectival expression // referring to a base entity. - // "SUPERLATIVE" - An adjectival range is expressed in the superlaive + // "SUPERLATIVE" - An adjectival range is expressed in the superlative // degree. // "PLURAL" - A range which is lexically plural. // "FEMALE" - A range expressing unequivocally a (semantic) female @@ -116881,20 +117114,14 @@ type RepositoryWebrefMdvcMetadataPerVertical struct { // "PRODUCTS" // "SYMPTOMS" // "CHAINS" - // "SYMPTOMS_PATTERN" // "MOVIES" // "SPORTS_TEAM" // "EXAMS" // "MOTORCYCLES" - // "TOURNAMENTS" // "PRIMEREF" // "SONGS" - // "AWARDS" // "EDUCATION" // "EVENTS" - // "OLYMPICS" - // "BIG_MOMENTS" - // "DISASTERS" VerticalName string `json:"verticalName,omitempty"` // ForceSendFields is a list of field names (e.g. "CompatibleIds") to @@ -119132,12 +119359,6 @@ type RepositoryWebrefReferencePageScores struct { // pages. If zero, it's not a good book reference page. BookScore float64 `json:"bookScore,omitempty"` - // ExplainedNormalizedTopicality: Fraction of importance_ratio (IR) that - // is explained by this entity and implied entities. E.g. a page about a - // song with IR 0.2 for the song and 0.5 for the artist actually has - // explained_normalized_topicality 0.7 for the song. - ExplainedNormalizedTopicality float64 `json:"explainedNormalizedTopicality,omitempty"` - // FirstScore: The raw topicality score of the primary entity. FirstScore float64 `json:"firstScore,omitempty"` @@ -119157,11 +119378,6 @@ type RepositoryWebrefReferencePageScores struct { // page owner. ReferencePageScore float64 `json:"referencePageScore,omitempty"` - // ReferencePageSelectionScore: The score used to sort reference pages - // for a given entity. This score tries to assign higher scores to - // reference pages that are more useful to the model building. - ReferencePageSelectionScore float64 `json:"referencePageSelectionScore,omitempty"` - // Selected: True if the entity is selected as the reference page owner. Selected bool `json:"selected,omitempty"` @@ -119208,17 +119424,15 @@ func (s *RepositoryWebrefReferencePageScores) MarshalJSON() ([]byte, error) { func (s *RepositoryWebrefReferencePageScores) UnmarshalJSON(data []byte) error { type NoMethod RepositoryWebrefReferencePageScores var s1 struct { - BookScore gensupport.JSONFloat64 `json:"bookScore"` - ExplainedNormalizedTopicality gensupport.JSONFloat64 `json:"explainedNormalizedTopicality"` - FirstScore gensupport.JSONFloat64 `json:"firstScore"` - MedianMentionScore gensupport.JSONFloat64 `json:"medianMentionScore"` - NavboostCoverage gensupport.JSONFloat64 `json:"navboostCoverage"` - ReferencePageScore gensupport.JSONFloat64 `json:"referencePageScore"` - ReferencePageSelectionScore gensupport.JSONFloat64 `json:"referencePageSelectionScore"` - SingleTopicness gensupport.JSONFloat64 `json:"singleTopicness"` - SingleTopicnessV2 gensupport.JSONFloat64 `json:"singleTopicnessV2"` - TitleCoverage gensupport.JSONFloat64 `json:"titleCoverage"` - TotalSum gensupport.JSONFloat64 `json:"totalSum"` + BookScore gensupport.JSONFloat64 `json:"bookScore"` + FirstScore gensupport.JSONFloat64 `json:"firstScore"` + MedianMentionScore gensupport.JSONFloat64 `json:"medianMentionScore"` + NavboostCoverage gensupport.JSONFloat64 `json:"navboostCoverage"` + ReferencePageScore gensupport.JSONFloat64 `json:"referencePageScore"` + SingleTopicness gensupport.JSONFloat64 `json:"singleTopicness"` + SingleTopicnessV2 gensupport.JSONFloat64 `json:"singleTopicnessV2"` + TitleCoverage gensupport.JSONFloat64 `json:"titleCoverage"` + TotalSum gensupport.JSONFloat64 `json:"totalSum"` *NoMethod } s1.NoMethod = (*NoMethod)(s) @@ -119226,12 +119440,10 @@ func (s *RepositoryWebrefReferencePageScores) UnmarshalJSON(data []byte) error { return err } s.BookScore = float64(s1.BookScore) - s.ExplainedNormalizedTopicality = float64(s1.ExplainedNormalizedTopicality) s.FirstScore = float64(s1.FirstScore) s.MedianMentionScore = float64(s1.MedianMentionScore) s.NavboostCoverage = float64(s1.NavboostCoverage) s.ReferencePageScore = float64(s1.ReferencePageScore) - s.ReferencePageSelectionScore = float64(s1.ReferencePageSelectionScore) s.SingleTopicness = float64(s1.SingleTopicness) s.SingleTopicnessV2 = float64(s1.SingleTopicnessV2) s.TitleCoverage = float64(s1.TitleCoverage) @@ -123133,6 +123345,13 @@ type ResearchScienceSearchLocation struct { // LocationName: The original name for the area covered by the dataset. LocationName string `json:"locationName,omitempty"` + // Possible values: + // "UNKNOWN" + // "METADATA" - When the locationthe is specified in the raw metadata + // "WEBREF" - When the locationthe is not specified in the raw + // metadata + LocationResource string `json:"locationResource,omitempty"` + // PointCoordinates: Latitude and longitude for a single point in the // form of "lat,long". PointCoordinates string `json:"pointCoordinates,omitempty"` @@ -123767,6 +123986,9 @@ type ResearchScienceSearchSourceUrlDocjoinInfoWebrefEntityInfo struct { // "ORGANIZATION" - /collection/organization/* in KG EntityType string `json:"entityType,omitempty"` + // KgCollection: HRID of the KG collections + KgCollection []string `json:"kgCollection,omitempty"` + // Mid: The KG identifier of the WebrefEntity. Mid string `json:"mid,omitempty"` @@ -127920,7 +128142,7 @@ func (s *SnippetExtraInfo) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SnippetExtraInfoSnippetCandidateInfo: Next ID: 13 +// SnippetExtraInfoSnippetCandidateInfo: Next ID: 14 type SnippetExtraInfoSnippetCandidateInfo struct { // BoldedRanges: Bolded ranges in the printed snippet lines. BoldedRanges []*QualitySnippetsTruncationSnippetBoldedRange `json:"boldedRanges,omitempty"` @@ -127948,6 +128170,10 @@ type SnippetExtraInfoSnippetCandidateInfo struct { ScoringInfo *SnippetExtraInfoSnippetScoringInfo `json:"scoringInfo,omitempty"` + // SentenceStarts: Sentence starting positions in the printed snippet + // lines. + SentenceStarts []*QualitySnippetsTruncationSnippetBoldedRangePosition `json:"sentenceStarts,omitempty"` + // Snippet: Muppet fills snippet lines in `snippet` field. Snippet []string `json:"snippet,omitempty"` @@ -132606,6 +132832,11 @@ type StorageGraphBfgTripleProvenance struct { // "ISOLATION_S3_CREATOR_PRESENCE" - Access controls for Creator // Channel's S-Cubed corpus data. See more in go/uro-access-required. // YOU MUST CONTACT milk-tea@ before reading or writing this data + // "ISOLATION_S12Y_RECIPE_INGREDIENT_INSIGHTS" - For Search + // sustainability's food choice feature, Recipe Ingredient Insights. + // Assign existing KG entities feature types to classify triggering + // behavior and insights. Owned by salehh@ and s12y-eng@ See + // go/rii-kg-triggering-migration for more information. // "UMP_TESTING_ONLY" - This access control is used to guard data used // by the Unified Media Platform team (ke-media-actions-serving@) for // testing new features. It should never be used for purposes other than @@ -138786,6 +139017,23 @@ type VendingConsumerProtoTrustedGenomeAnnotation struct { // regardless of whether the quest was shown or held back. // "PLAY_BOOKS_READING_PROGRESS_TOOLTIP_USER_LEVEL" - User level test // code for reading progress tooltip. + // "IAP_SKU_DEALS_LIVE_OP_GAMES_HOME_USER_LEVEL1" - User level test + // code for tracking users who should see the IAP Sku Games Home liveops + // card. + // + // "POST_PURCHASE_OFFER_POST_PURCHASE_CONFIRMATION_DIALOG_SERVER_USER_LEV + // EL" - Post purchase offer test codes User level test code to track + // the user who sees the post purcahse offer redemption dialog for post + // purchase offer experiment. + // + // "POST_PURCHASE_OFFER_POST_PURCHASE_OFFER_SAVED_DIALOG_SERVER_USER_LEVE + // L" - User level test code to track the user who sees the post + // purcahse offer saved dialog for post purchase offer experiment. + // + // "POST_PURCHASE_OFFER_VALUE_PROMOTION_DIALOG_SHOWN_SERVER_USER_LEVEL" + // - User level test code to track the user who sees the value promotion + // dialog, including loyalty upsell, post purcahse offer and so on for + // post purchase offer experiment. // "USER_LEVEL_TEST_CODE_LIMIT" TestCode []string `json:"testCode,omitempty"` @@ -139312,7 +139560,8 @@ type VideoAssetsVenomVideoId struct { // Ns: LINT.ThenChange( // //depot/google3/googledata/production/playbooks/video-assets/clients.m - // d ) REQUIRED. + // d, //depot/google3/video/assets/venom/proto/namespace.proto ) + // REQUIRED. // // Possible values: // "NS_UNKNOWN" - Default (invalid) namespace if the field is not set. @@ -155536,7 +155785,16 @@ type ProjectsSetAclCall struct { } // SetAcl: Sets the access control policy for a resource. Replaces any -// existing policy. +// existing policy. You can set ACL with condition for projects only. +// Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where +// the left of the operator is `DocumentSchemaId` or property name and +// the right of the operator is a number or a quoted string. You must +// escape backslash (\\) and quote (\") characters. Boolean expressions +// (AND/OR) are supported up to 3 levels of nesting (for example, "((A +// AND B AND C) OR D) AND E"), a maximum of 10 comparisons are allowed +// in the expression. The expression must be < 6000 bytes in length. +// Sample condition: "DocumentSchemaId = \"some schema id\" " OR +// SchemaId.floatPropertyName >= 10` // // - resource: REQUIRED: The resource for which the policy is being // requested. Format for document: @@ -155642,7 +155900,7 @@ func (c *ProjectsSetAclCall) Do(opts ...googleapi.CallOption) (*GoogleCloudConte } return ret, nil // { - // "description": "Sets the access control policy for a resource. Replaces any existing policy.", + // "description": "Sets the access control policy for a resource. Replaces any existing policy. You can set ACL with condition for projects only. Supported operators are: `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=` where the left of the operator is `DocumentSchemaId` or property name and the right of the operator is a number or a quoted string. You must escape backslash (\\\\) and quote (\\\") characters. Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for example, \"((A AND B AND C) OR D) AND E\"), a maximum of 10 comparisons are allowed in the expression. The expression must be \u003c 6000 bytes in length. Sample condition: `\"DocumentSchemaId = \\\"some schema id\\\" \" OR SchemaId.floatPropertyName \u003e= 10`", // "flatPath": "v1/projects/{projectsId}:setAcl", // "httpMethod": "POST", // "id": "contentwarehouse.projects.setAcl", @@ -157831,7 +158089,16 @@ type ProjectsLocationsDocumentsSetAclCall struct { } // SetAcl: Sets the access control policy for a resource. Replaces any -// existing policy. +// existing policy. You can set ACL with condition for projects only. +// Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where +// the left of the operator is `DocumentSchemaId` or property name and +// the right of the operator is a number or a quoted string. You must +// escape backslash (\\) and quote (\") characters. Boolean expressions +// (AND/OR) are supported up to 3 levels of nesting (for example, "((A +// AND B AND C) OR D) AND E"), a maximum of 10 comparisons are allowed +// in the expression. The expression must be < 6000 bytes in length. +// Sample condition: "DocumentSchemaId = \"some schema id\" " OR +// SchemaId.floatPropertyName >= 10` // // - resource: REQUIRED: The resource for which the policy is being // requested. Format for document: @@ -157937,7 +158204,7 @@ func (c *ProjectsLocationsDocumentsSetAclCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Sets the access control policy for a resource. Replaces any existing policy.", + // "description": "Sets the access control policy for a resource. Replaces any existing policy. You can set ACL with condition for projects only. Supported operators are: `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, and `\u003e=` where the left of the operator is `DocumentSchemaId` or property name and the right of the operator is a number or a quoted string. You must escape backslash (\\\\) and quote (\\\") characters. Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for example, \"((A AND B AND C) OR D) AND E\"), a maximum of 10 comparisons are allowed in the expression. The expression must be \u003c 6000 bytes in length. Sample condition: `\"DocumentSchemaId = \\\"some schema id\\\" \" OR SchemaId.floatPropertyName \u003e= 10`", // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/documents/{documentsId}:setAcl", // "httpMethod": "POST", // "id": "contentwarehouse.projects.locations.documents.setAcl", diff --git a/documentai/v1/documentai-api.json b/documentai/v1/documentai-api.json index d5cbb697b62..d5564abb5a1 100644 --- a/documentai/v1/documentai-api.json +++ b/documentai/v1/documentai-api.json @@ -328,6 +328,31 @@ }, "processorTypes": { "methods": { + "get": { + "description": "Gets a processor type detail.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", + "httpMethod": "GET", + "id": "documentai.projects.locations.processorTypes.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The processor type resource name.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudDocumentaiV1ProcessorType" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Lists the processor types that exist.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes", @@ -894,7 +919,7 @@ } } }, - "revision": "20221201", + "revision": "20230106", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -1164,11 +1189,11 @@ "type": "object" }, "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId": { - "description": "Identifies a document uniquely within the scope of a dataset in the GCS-based option.", + "description": "Identifies a document uniquely within the scope of a dataset in the Cloud Storage option.", "id": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId", "properties": { "cwDocId": { - "description": "Optional. Id of the document (indexed) managed by Content Warehouse.", + "description": "Id of the document (indexed) managed by Content Warehouse.", "type": "string" }, "gcsUri": { @@ -1477,11 +1502,11 @@ "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "properties": { "latestProcessorVersion": { - "description": "Read the revision generated by the processor version, returns error if it does not exist.", + "description": "Reads the revision generated by the processor version.", "type": "string" }, "revisionCase": { - "description": "Read the revision by the predefined case.", + "description": "Reads the revision by the predefined case.", "enum": [ "REVISION_CASE_UNSPECIFIED", "LATEST_HUMAN_REVIEW", @@ -1495,7 +1520,7 @@ "type": "string" }, "revisionId": { - "description": "Read the revision given by the id, returns error if it does not exist.", + "description": "Reads the revision given by the id.", "type": "string" } }, @@ -3742,62 +3767,6 @@ }, "type": "object" }, - "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata": { - "description": "The long running operation metadata for AnalyzeHitlData.", - "id": "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata", - "properties": { - "commonMetadata": { - "$ref": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "description": "The basic metadata of the long running operation." - } - }, - "type": "object" - }, - "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata": { - "description": "The common metadata for long running operations.", - "id": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "properties": { - "createTime": { - "description": "The creation time of the operation.", - "format": "google-datetime", - "type": "string" - }, - "resource": { - "description": "A related resource to this operation.", - "type": "string" - }, - "state": { - "description": "The state of the operation.", - "enum": [ - "STATE_UNSPECIFIED", - "RUNNING", - "CANCELLING", - "SUCCEEDED", - "FAILED", - "CANCELLED" - ], - "enumDescriptions": [ - "Unspecified state.", - "Operation is still running.", - "Operation is being cancelled.", - "Operation succeeded.", - "Operation failed.", - "Operation is cancelled." - ], - "type": "string" - }, - "stateMessage": { - "description": "A message providing more details about the current state of processing.", - "type": "string" - }, - "updateTime": { - "description": "The last update time of the operation.", - "format": "google-datetime", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudDocumentaiV1beta1Barcode": { "description": "Encodes the detailed information of a barcode.", "id": "GoogleCloudDocumentaiV1beta1Barcode", diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 86b6fc6da11..08427a51ef3 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -714,10 +714,9 @@ func (s *GoogleCloudDocumentaiUiv1beta3DocumentId) MarshalJSON() ([]byte, error) // GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId: // Identifies a document uniquely within the scope of a dataset in the -// GCS-based option. +// Cloud Storage option. type GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId struct { - // CwDocId: Optional. Id of the document (indexed) managed by Content - // Warehouse. + // CwDocId: Id of the document (indexed) managed by Content Warehouse. CwDocId string `json:"cwDocId,omitempty"` // GcsUri: Required. The Cloud Storage uri where the actual document is @@ -1278,11 +1277,11 @@ type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { - // LatestProcessorVersion: Read the revision generated by the processor - // version, returns error if it does not exist. + // LatestProcessorVersion: Reads the revision generated by the processor + // version. LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` - // RevisionCase: Read the revision by the predefined case. + // RevisionCase: Reads the revision by the predefined case. // // Possible values: // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read @@ -1291,8 +1290,7 @@ type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { // "LATEST_TIMESTAMP" - The latest revision based on timestamp. RevisionCase string `json:"revisionCase,omitempty"` - // RevisionId: Read the revision given by the id, returns error if it - // does not exist. + // RevisionId: Reads the revision given by the id. RevisionId string `json:"revisionId,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -4657,6 +4655,10 @@ type GoogleCloudDocumentaiV1ProcessorType struct { // etc. Type string `json:"type,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AllowCreation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -5121,86 +5123,6 @@ func (s *GoogleCloudDocumentaiV1Vertex) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata: The long -// running operation metadata for AnalyzeHitlData. -type GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata `json:"commonMetadata,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDocumentaiV1alpha1CommonOperationMetadata: The common -// metadata for long running operations. -type GoogleCloudDocumentaiV1alpha1CommonOperationMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // Resource: A related resource to this operation. - Resource string `json:"resource,omitempty"` - - // State: The state of the operation. - // - // Possible values: - // "STATE_UNSPECIFIED" - Unspecified state. - // "RUNNING" - Operation is still running. - // "CANCELLING" - Operation is being cancelled. - // "SUCCEEDED" - Operation succeeded. - // "FAILED" - Operation failed. - // "CANCELLED" - Operation is cancelled. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. - StateMessage string `json:"stateMessage,omitempty"` - - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CreateTime") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1CommonOperationMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // GoogleCloudDocumentaiV1beta1Barcode: Encodes the detailed information // of a barcode. type GoogleCloudDocumentaiV1beta1Barcode struct { @@ -12032,6 +11954,153 @@ func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func( } } +// method id "documentai.projects.locations.processorTypes.get": + +type ProjectsLocationsProcessorTypesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a processor type detail. +// +// - name: The processor type resource name. +func (r *ProjectsLocationsProcessorTypesService) Get(name string) *ProjectsLocationsProcessorTypesGetCall { + c := &ProjectsLocationsProcessorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsProcessorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsProcessorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsProcessorTypesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.processorTypes.get" call. +// Exactly one of *GoogleCloudDocumentaiV1ProcessorType or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudDocumentaiV1ProcessorType.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1ProcessorType, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDocumentaiV1ProcessorType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a processor type detail.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processorTypes.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The processor type resource name.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "GoogleCloudDocumentaiV1ProcessorType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "documentai.projects.locations.processorTypes.list": type ProjectsLocationsProcessorTypesListCall struct { diff --git a/documentai/v1beta2/documentai-api.json b/documentai/v1beta2/documentai-api.json index 839cdcd18f7..2d431e5250d 100644 --- a/documentai/v1beta2/documentai-api.json +++ b/documentai/v1beta2/documentai-api.json @@ -292,7 +292,7 @@ } } }, - "revision": "20221201", + "revision": "20230106", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -562,11 +562,11 @@ "type": "object" }, "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId": { - "description": "Identifies a document uniquely within the scope of a dataset in the GCS-based option.", + "description": "Identifies a document uniquely within the scope of a dataset in the Cloud Storage option.", "id": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId", "properties": { "cwDocId": { - "description": "Optional. Id of the document (indexed) managed by Content Warehouse.", + "description": "Id of the document (indexed) managed by Content Warehouse.", "type": "string" }, "gcsUri": { @@ -875,11 +875,11 @@ "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "properties": { "latestProcessorVersion": { - "description": "Read the revision generated by the processor version, returns error if it does not exist.", + "description": "Reads the revision generated by the processor version.", "type": "string" }, "revisionCase": { - "description": "Read the revision by the predefined case.", + "description": "Reads the revision by the predefined case.", "enum": [ "REVISION_CASE_UNSPECIFIED", "LATEST_HUMAN_REVIEW", @@ -893,7 +893,7 @@ "type": "string" }, "revisionId": { - "description": "Read the revision given by the id, returns error if it does not exist.", + "description": "Reads the revision given by the id.", "type": "string" } }, @@ -1334,62 +1334,6 @@ "properties": {}, "type": "object" }, - "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata": { - "description": "The long running operation metadata for AnalyzeHitlData.", - "id": "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata", - "properties": { - "commonMetadata": { - "$ref": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "description": "The basic metadata of the long running operation." - } - }, - "type": "object" - }, - "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata": { - "description": "The common metadata for long running operations.", - "id": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "properties": { - "createTime": { - "description": "The creation time of the operation.", - "format": "google-datetime", - "type": "string" - }, - "resource": { - "description": "A related resource to this operation.", - "type": "string" - }, - "state": { - "description": "The state of the operation.", - "enum": [ - "STATE_UNSPECIFIED", - "RUNNING", - "CANCELLING", - "SUCCEEDED", - "FAILED", - "CANCELLED" - ], - "enumDescriptions": [ - "Unspecified state.", - "Operation is still running.", - "Operation is being cancelled.", - "Operation succeeded.", - "Operation failed.", - "Operation is cancelled." - ], - "type": "string" - }, - "stateMessage": { - "description": "A message providing more details about the current state of processing.", - "type": "string" - }, - "updateTime": { - "description": "The last update time of the operation.", - "format": "google-datetime", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudDocumentaiV1beta1Barcode": { "description": "Encodes the detailed information of a barcode.", "id": "GoogleCloudDocumentaiV1beta1Barcode", diff --git a/documentai/v1beta2/documentai-gen.go b/documentai/v1beta2/documentai-gen.go index d0cf8b84080..b2ca3267656 100644 --- a/documentai/v1beta2/documentai-gen.go +++ b/documentai/v1beta2/documentai-gen.go @@ -678,10 +678,9 @@ func (s *GoogleCloudDocumentaiUiv1beta3DocumentId) MarshalJSON() ([]byte, error) // GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId: // Identifies a document uniquely within the scope of a dataset in the -// GCS-based option. +// Cloud Storage option. type GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId struct { - // CwDocId: Optional. Id of the document (indexed) managed by Content - // Warehouse. + // CwDocId: Id of the document (indexed) managed by Content Warehouse. CwDocId string `json:"cwDocId,omitempty"` // GcsUri: Required. The Cloud Storage uri where the actual document is @@ -1242,11 +1241,11 @@ type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { - // LatestProcessorVersion: Read the revision generated by the processor - // version, returns error if it does not exist. + // LatestProcessorVersion: Reads the revision generated by the processor + // version. LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` - // RevisionCase: Read the revision by the predefined case. + // RevisionCase: Reads the revision by the predefined case. // // Possible values: // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read @@ -1255,8 +1254,7 @@ type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { // "LATEST_TIMESTAMP" - The latest revision based on timestamp. RevisionCase string `json:"revisionCase,omitempty"` - // RevisionId: Read the revision given by the id, returns error if it - // does not exist. + // RevisionId: Reads the revision given by the id. RevisionId string `json:"revisionId,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -2080,86 +2078,6 @@ func (s *GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata) MarshalJSON() type GoogleCloudDocumentaiV1UndeployProcessorVersionResponse struct { } -// GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata: The long -// running operation metadata for AnalyzeHitlData. -type GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata `json:"commonMetadata,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDocumentaiV1alpha1CommonOperationMetadata: The common -// metadata for long running operations. -type GoogleCloudDocumentaiV1alpha1CommonOperationMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // Resource: A related resource to this operation. - Resource string `json:"resource,omitempty"` - - // State: The state of the operation. - // - // Possible values: - // "STATE_UNSPECIFIED" - Unspecified state. - // "RUNNING" - Operation is still running. - // "CANCELLING" - Operation is being cancelled. - // "SUCCEEDED" - Operation succeeded. - // "FAILED" - Operation failed. - // "CANCELLED" - Operation is cancelled. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. - StateMessage string `json:"stateMessage,omitempty"` - - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CreateTime") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1CommonOperationMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // GoogleCloudDocumentaiV1beta1Barcode: Encodes the detailed information // of a barcode. type GoogleCloudDocumentaiV1beta1Barcode struct { diff --git a/documentai/v1beta3/documentai-api.json b/documentai/v1beta3/documentai-api.json index 622947bf586..f36250fa732 100644 --- a/documentai/v1beta3/documentai-api.json +++ b/documentai/v1beta3/documentai-api.json @@ -299,6 +299,31 @@ }, "processorTypes": { "methods": { + "get": { + "description": "Gets a processor type detail.", + "flatPath": "v1beta3/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", + "httpMethod": "GET", + "id": "documentai.projects.locations.processorTypes.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The processor type resource name.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta3/{+name}", + "response": { + "$ref": "GoogleCloudDocumentaiV1beta3ProcessorType" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Lists the processor types that exist.", "flatPath": "v1beta3/projects/{projectsId}/locations/{locationsId}/processorTypes", @@ -959,7 +984,7 @@ } } }, - "revision": "20221201", + "revision": "20230106", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3BatchDeleteDocumentsMetadata": { @@ -1229,11 +1254,11 @@ "type": "object" }, "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId": { - "description": "Identifies a document uniquely within the scope of a dataset in the GCS-based option.", + "description": "Identifies a document uniquely within the scope of a dataset in the Cloud Storage option.", "id": "GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId", "properties": { "cwDocId": { - "description": "Optional. Id of the document (indexed) managed by Content Warehouse.", + "description": "Id of the document (indexed) managed by Content Warehouse.", "type": "string" }, "gcsUri": { @@ -1542,11 +1567,11 @@ "id": "GoogleCloudDocumentaiUiv1beta3RevisionReference", "properties": { "latestProcessorVersion": { - "description": "Read the revision generated by the processor version, returns error if it does not exist.", + "description": "Reads the revision generated by the processor version.", "type": "string" }, "revisionCase": { - "description": "Read the revision by the predefined case.", + "description": "Reads the revision by the predefined case.", "enum": [ "REVISION_CASE_UNSPECIFIED", "LATEST_HUMAN_REVIEW", @@ -1560,7 +1585,7 @@ "type": "string" }, "revisionId": { - "description": "Read the revision given by the id, returns error if it does not exist.", + "description": "Reads the revision given by the id.", "type": "string" } }, @@ -2001,62 +2026,6 @@ "properties": {}, "type": "object" }, - "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata": { - "description": "The long running operation metadata for AnalyzeHitlData.", - "id": "GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata", - "properties": { - "commonMetadata": { - "$ref": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "description": "The basic metadata of the long running operation." - } - }, - "type": "object" - }, - "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata": { - "description": "The common metadata for long running operations.", - "id": "GoogleCloudDocumentaiV1alpha1CommonOperationMetadata", - "properties": { - "createTime": { - "description": "The creation time of the operation.", - "format": "google-datetime", - "type": "string" - }, - "resource": { - "description": "A related resource to this operation.", - "type": "string" - }, - "state": { - "description": "The state of the operation.", - "enum": [ - "STATE_UNSPECIFIED", - "RUNNING", - "CANCELLING", - "SUCCEEDED", - "FAILED", - "CANCELLED" - ], - "enumDescriptions": [ - "Unspecified state.", - "Operation is still running.", - "Operation is being cancelled.", - "Operation succeeded.", - "Operation failed.", - "Operation is cancelled." - ], - "type": "string" - }, - "stateMessage": { - "description": "A message providing more details about the current state of processing.", - "type": "string" - }, - "updateTime": { - "description": "The last update time of the operation.", - "format": "google-datetime", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudDocumentaiV1beta1Barcode": { "description": "Encodes the detailed information of a barcode.", "id": "GoogleCloudDocumentaiV1beta1Barcode", diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index 247c6efbe99..23baa80f2a2 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -702,10 +702,9 @@ func (s *GoogleCloudDocumentaiUiv1beta3DocumentId) MarshalJSON() ([]byte, error) // GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId: // Identifies a document uniquely within the scope of a dataset in the -// GCS-based option. +// Cloud Storage option. type GoogleCloudDocumentaiUiv1beta3DocumentIdGCSManagedDocumentId struct { - // CwDocId: Optional. Id of the document (indexed) managed by Content - // Warehouse. + // CwDocId: Id of the document (indexed) managed by Content Warehouse. CwDocId string `json:"cwDocId,omitempty"` // GcsUri: Required. The Cloud Storage uri where the actual document is @@ -1266,11 +1265,11 @@ type GoogleCloudDocumentaiUiv1beta3ResyncDatasetResponse struct { // GoogleCloudDocumentaiUiv1beta3RevisionReference: The revision // reference specifies which revision on the document to read. type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { - // LatestProcessorVersion: Read the revision generated by the processor - // version, returns error if it does not exist. + // LatestProcessorVersion: Reads the revision generated by the processor + // version. LatestProcessorVersion string `json:"latestProcessorVersion,omitempty"` - // RevisionCase: Read the revision by the predefined case. + // RevisionCase: Reads the revision by the predefined case. // // Possible values: // "REVISION_CASE_UNSPECIFIED" - Unspecified case, fallback to read @@ -1279,8 +1278,7 @@ type GoogleCloudDocumentaiUiv1beta3RevisionReference struct { // "LATEST_TIMESTAMP" - The latest revision based on timestamp. RevisionCase string `json:"revisionCase,omitempty"` - // RevisionId: Read the revision given by the id, returns error if it - // does not exist. + // RevisionId: Reads the revision given by the id. RevisionId string `json:"revisionId,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -2104,86 +2102,6 @@ func (s *GoogleCloudDocumentaiV1UndeployProcessorVersionMetadata) MarshalJSON() type GoogleCloudDocumentaiV1UndeployProcessorVersionResponse struct { } -// GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata: The long -// running operation metadata for AnalyzeHitlData. -type GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata struct { - // CommonMetadata: The basic metadata of the long running operation. - CommonMetadata *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata `json:"commonMetadata,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CommonMetadata") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CommonMetadata") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1AnalyzeHitlDataMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDocumentaiV1alpha1CommonOperationMetadata: The common -// metadata for long running operations. -type GoogleCloudDocumentaiV1alpha1CommonOperationMetadata struct { - // CreateTime: The creation time of the operation. - CreateTime string `json:"createTime,omitempty"` - - // Resource: A related resource to this operation. - Resource string `json:"resource,omitempty"` - - // State: The state of the operation. - // - // Possible values: - // "STATE_UNSPECIFIED" - Unspecified state. - // "RUNNING" - Operation is still running. - // "CANCELLING" - Operation is being cancelled. - // "SUCCEEDED" - Operation succeeded. - // "FAILED" - Operation failed. - // "CANCELLED" - Operation is cancelled. - State string `json:"state,omitempty"` - - // StateMessage: A message providing more details about the current - // state of processing. - StateMessage string `json:"stateMessage,omitempty"` - - // UpdateTime: The last update time of the operation. - UpdateTime string `json:"updateTime,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CreateTime") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDocumentaiV1alpha1CommonOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDocumentaiV1alpha1CommonOperationMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // GoogleCloudDocumentaiV1beta1Barcode: Encodes the detailed information // of a barcode. type GoogleCloudDocumentaiV1beta1Barcode struct { @@ -10124,6 +10042,10 @@ type GoogleCloudDocumentaiV1beta3ProcessorType struct { // etc. Type string `json:"type,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AllowCreation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -12500,6 +12422,154 @@ func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func( } } +// method id "documentai.projects.locations.processorTypes.get": + +type ProjectsLocationsProcessorTypesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a processor type detail. +// +// - name: The processor type resource name. +func (r *ProjectsLocationsProcessorTypesService) Get(name string) *ProjectsLocationsProcessorTypesGetCall { + c := &ProjectsLocationsProcessorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsProcessorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProcessorTypesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsProcessorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProcessorTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsProcessorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsProcessorTypesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsProcessorTypesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsProcessorTypesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "documentai.projects.locations.processorTypes.get" call. +// Exactly one of *GoogleCloudDocumentaiV1beta3ProcessorType or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDocumentaiV1beta3ProcessorType.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsProcessorTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDocumentaiV1beta3ProcessorType, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDocumentaiV1beta3ProcessorType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a processor type detail.", + // "flatPath": "v1beta3/projects/{projectsId}/locations/{locationsId}/processorTypes/{processorTypesId}", + // "httpMethod": "GET", + // "id": "documentai.projects.locations.processorTypes.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The processor type resource name.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/processorTypes/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/{+name}", + // "response": { + // "$ref": "GoogleCloudDocumentaiV1beta3ProcessorType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "documentai.projects.locations.processorTypes.list": type ProjectsLocationsProcessorTypesListCall struct { diff --git a/healthcare/v1/healthcare-gen.go b/healthcare/v1/healthcare-gen.go index 3508304b422..c66741dc37f 100644 --- a/healthcare/v1/healthcare-gen.go +++ b/healthcare/v1/healthcare-gen.go @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC. +// Copyright 2023 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/healthcare/v1beta1/healthcare-gen.go b/healthcare/v1beta1/healthcare-gen.go index a89dd8167f8..2e9ab6b5eda 100644 --- a/healthcare/v1beta1/healthcare-gen.go +++ b/healthcare/v1beta1/healthcare-gen.go @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC. +// Copyright 2023 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/homegraph/v1/homegraph-api.json b/homegraph/v1/homegraph-api.json index 37708310eee..28c8f17c1b6 100644 --- a/homegraph/v1/homegraph-api.json +++ b/homegraph/v1/homegraph-api.json @@ -14,7 +14,7 @@ "canonicalName": "Home Graph Service", "description": "", "discoveryVersion": "v1", - "documentationLink": "https://developers.google.com/actions/smarthome/create-app#request-sync", + "documentationLink": "https://developers.home.google.com/cloud-to-cloud/get-started", "fullyEncodeReservedExpansion": true, "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", @@ -108,7 +108,7 @@ "agentUsers": { "methods": { "delete": { - "description": "Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.google.com/assistant/smarthome/concepts/fulfillment-authentication). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.", + "description": "Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.home.google.com/cloud-to-cloud/primer/fulfillment). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.", "flatPath": "v1/agentUsers/{agentUsersId}", "httpMethod": "DELETE", "id": "homegraph.agentUsers.delete", @@ -160,7 +160,7 @@ ] }, "reportStateAndNotification": { - "description": "Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.", + "description": "Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.home.google.com/cloud-to-cloud/integration/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.home.google.com/cloud-to-cloud/primer/device-types-and-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.", "flatPath": "v1/devices:reportStateAndNotification", "httpMethod": "POST", "id": "homegraph.devices.reportStateAndNotification", @@ -178,7 +178,7 @@ ] }, "requestSync": { - "description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.", + "description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.home.google.com/cloud-to-cloud/intents/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.", "flatPath": "v1/devices:requestSync", "httpMethod": "POST", "id": "homegraph.devices.requestSync", @@ -216,7 +216,7 @@ } } }, - "revision": "20220325", + "revision": "20230106", "rootUrl": "https://homegraph.googleapis.com/", "schemas": { "AgentDeviceId": { @@ -262,7 +262,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.google.com/assistant/smarthome/reference/intent/query) and [EXECUTE](https://developers.google.com/assistant/smarthome/reference/intent/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.", + "description": "Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.home.google.com/cloud-to-cloud/intents/query) and [EXECUTE](https://developers.home.google.com/cloud-to-cloud/intents/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.", "type": "object" }, "deviceInfo": { @@ -282,7 +282,7 @@ "type": "boolean" }, "otherDeviceIds": { - "description": "Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.google.com/assistant/smarthome/concepts/local).", + "description": "Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.home.google.com/local-home/overview).", "items": { "$ref": "AgentOtherDeviceId" }, @@ -297,14 +297,14 @@ "type": "string" }, "traits": { - "description": "Traits supported by the device. See [device traits](https://developers.google.com/assistant/smarthome/traits).", + "description": "Traits supported by the device. See [device traits](https://developers.home.google.com/cloud-to-cloud/traits).", "items": { "type": "string" }, "type": "array" }, "type": { - "description": "Hardware type of the device. See [device types](https://developers.google.com/assistant/smarthome/guides).", + "description": "Hardware type of the device. See [device types](https://developers.home.google.com/cloud-to-cloud/guides).", "type": "string" }, "willReportState": { @@ -416,7 +416,7 @@ "type": "object" }, "QueryResponse": { - "description": "Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call. This should follow the same format as the Google smart home `action.devices.QUERY` [response](https://developers.google.com/assistant/smarthome/reference/intent/query). # Example ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"devices\": { \"123\": { \"on\": true, \"online\": true }, \"456\": { \"on\": true, \"online\": true, \"brightness\": 80, \"color\": { \"name\": \"cerulean\", \"spectrumRGB\": 31655 } } } } } ```", + "description": "Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call. This should follow the same format as the Google smart home `action.devices.QUERY` [response](https://developers.home.google.com/cloud-to-cloud/intents/query). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"devices\": { \"123\": { \"on\": true, \"online\": true }, \"456\": { \"on\": true, \"online\": true, \"brightness\": 80, \"color\": { \"name\": \"cerulean\", \"spectrumRGB\": 31655 } } } } } ```", "id": "QueryResponse", "properties": { "payload": { @@ -457,7 +457,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).", + "description": "Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).", "type": "object" }, "states": { @@ -465,14 +465,14 @@ "description": "Properties of the object.", "type": "any" }, - "description": "States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).", + "description": "States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).", "type": "object" } }, "type": "object" }, "ReportStateAndNotificationRequest": { - "description": "Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call. It may include states, notifications, or both. States and notifications are defined per `device_id` (for example, \"123\" and \"456\" in the following example). # Example ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"agentUserId\": \"1234\", \"payload\": { \"devices\": { \"states\": { \"123\": { \"on\": true }, \"456\": { \"on\": true, \"brightness\": 10 } }, } } } ```", + "description": "Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call. It may include states, notifications, or both. States and notifications are defined per `device_id` (for example, \"123\" and \"456\" in the following example). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"agentUserId\": \"1234\", \"payload\": { \"devices\": { \"states\": { \"123\": { \"on\": true }, \"456\": { \"on\": true, \"brightness\": 10 } }, } } } ```", "id": "ReportStateAndNotificationRequest", "properties": { "agentUserId": { @@ -557,7 +557,7 @@ "type": "object" }, "SyncResponse": { - "description": "Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.google.com/assistant/smarthome/reference/intent/sync). # Example ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"agentUserId\": \"1836.15267389\", \"devices\": [{ \"id\": \"123\", \"type\": \"action.devices.types.OUTLET\", \"traits\": [ \"action.devices.traits.OnOff\" ], \"name\": { \"defaultNames\": [\"My Outlet 1234\"], \"name\": \"Night light\", \"nicknames\": [\"wall plug\"] }, \"willReportState\": false, \"deviceInfo\": { \"manufacturer\": \"lights-out-inc\", \"model\": \"hs1234\", \"hwVersion\": \"3.2\", \"swVersion\": \"11.4\" }, \"customData\": { \"fooValue\": 74, \"barValue\": true, \"bazValue\": \"foo\" } }] } } ```", + "description": "Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.home.google.com/cloud-to-cloud/intents/sync). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"agentUserId\": \"1836.15267389\", \"devices\": [{ \"id\": \"123\", \"type\": \"action.devices.types.OUTLET\", \"traits\": [ \"action.devices.traits.OnOff\" ], \"name\": { \"defaultNames\": [\"My Outlet 1234\"], \"name\": \"Night light\", \"nicknames\": [\"wall plug\"] }, \"willReportState\": false, \"deviceInfo\": { \"manufacturer\": \"lights-out-inc\", \"model\": \"hs1234\", \"hwVersion\": \"3.2\", \"swVersion\": \"11.4\" }, \"customData\": { \"fooValue\": 74, \"barValue\": true, \"bazValue\": \"foo\" } }] } } ```", "id": "SyncResponse", "properties": { "payload": { diff --git a/homegraph/v1/homegraph-gen.go b/homegraph/v1/homegraph-gen.go index 3316eda1291..420c6b187f3 100644 --- a/homegraph/v1/homegraph-gen.go +++ b/homegraph/v1/homegraph-gen.go @@ -6,7 +6,7 @@ // Package homegraph provides access to the HomeGraph API. // -// For product documentation, see: https://developers.google.com/actions/smarthome/create-app#request-sync +// For product documentation, see: https://developers.home.google.com/cloud-to-cloud/get-started // // # Creating a client // @@ -223,9 +223,9 @@ type Device struct { // CustomData: Custom device attributes stored in Home Graph and // provided to your smart home Action in each QUERY - // (https://developers.google.com/assistant/smarthome/reference/intent/query) - // and EXECUTE - // (https://developers.google.com/assistant/smarthome/reference/intent/execute) + // (https://developers.home.google.com/cloud-to-cloud/intents/query) and + // EXECUTE + // (https://developers.home.google.com/cloud-to-cloud/intents/execute) // intent. Data in this object has a few constraints: No sensitive // information, including but not limited to Personally Identifiable // Information. @@ -250,7 +250,7 @@ type Device struct { // OtherDeviceIds: Alternate IDs associated with this device. This is // used to identify cloud synced devices enabled for local fulfillment - // (https://developers.google.com/assistant/smarthome/concepts/local). + // (https://developers.home.google.com/local-home/overview). OtherDeviceIds []*AgentOtherDeviceId `json:"otherDeviceIds,omitempty"` // RoomHint: Suggested name for the room where this device is installed. @@ -262,11 +262,11 @@ type Device struct { StructureHint string `json:"structureHint,omitempty"` // Traits: Traits supported by the device. See device traits - // (https://developers.google.com/assistant/smarthome/traits). + // (https://developers.home.google.com/cloud-to-cloud/traits). Traits []string `json:"traits,omitempty"` // Type: Hardware type of the device. See device types - // (https://developers.google.com/assistant/smarthome/guides). + // (https://developers.home.google.com/cloud-to-cloud/guides). Type string `json:"type,omitempty"` // WillReportState: Indicates whether your smart home Action will report @@ -475,8 +475,8 @@ func (s *QueryRequestPayload) MarshalJSON() ([]byte, error) { // (#google.home.graph.v1.HomeGraphApiService.Query) call. This should // follow the same format as the Google smart home // `action.devices.QUERY` response -// (https://developers.google.com/assistant/smarthome/reference/intent/query). -// # Example ```json { "requestId": +// (https://developers.home.google.com/cloud-to-cloud/intents/query). +// Example: ```json { "requestId": // "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "devices": { // "123": { "on": true, "online": true }, "456": { "on": true, "online": // true, "brightness": 80, "color": { "name": "cerulean", "spectrumRGB": @@ -549,12 +549,12 @@ func (s *QueryResponsePayload) MarshalJSON() ([]byte, error) { type ReportStateAndNotificationDevice struct { // Notifications: Notifications metadata for devices. See the **Device // NOTIFICATIONS** section of the individual trait reference guides - // (https://developers.google.com/assistant/smarthome/traits). + // (https://developers.home.google.com/cloud-to-cloud/traits). Notifications googleapi.RawMessage `json:"notifications,omitempty"` // States: States of devices to update. See the **Device STATES** // section of the individual trait reference guides - // (https://developers.google.com/assistant/smarthome/traits). + // (https://developers.home.google.com/cloud-to-cloud/traits). States googleapi.RawMessage `json:"states,omitempty"` // ForceSendFields is a list of field names (e.g. "Notifications") to @@ -587,7 +587,7 @@ func (s *ReportStateAndNotificationDevice) MarshalJSON() ([]byte, error) { // call. It may include states, notifications, or both. States and // // notifications are defined per `device_id` (for example, "123" and -// "456" in the following example). # Example ```json { "requestId": +// "456" in the following example). Example: ```json { "requestId": // "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "agentUserId": "1234", // "payload": { "devices": { "states": { "123": { "on": true }, "456": { // "on": true, "brightness": 10 } }, } } } ``` @@ -778,8 +778,8 @@ func (s *SyncRequest) MarshalJSON() ([]byte, error) { // (#google.home.graph.v1.HomeGraphApiService.Sync) call. This should // follow the same format as the Google smart home `action.devices.SYNC` // response -// (https://developers.google.com/assistant/smarthome/reference/intent/sync). -// # Example ```json { "requestId": +// (https://developers.home.google.com/cloud-to-cloud/intents/sync). +// Example: ```json { "requestId": // "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "agentUserId": // "1836.15267389", "devices": [{ "id": "123", "type": // "action.devices.types.OUTLET", "traits": [ @@ -868,7 +868,7 @@ type AgentUsersDeleteCall struct { // Action. All data related to this user will be deleted. For more // details on how users link their accounts, see fulfillment and // authentication -// (https://developers.google.com/assistant/smarthome/concepts/fulfillment-authentication). +// (https://developers.home.google.com/cloud-to-cloud/primer/fulfillment). // The third-party user's identity is passed in via the `agent_user_id` // (see DeleteAgentUserRequest). This request must be authorized using // service account credentials from your Actions console project. @@ -973,7 +973,7 @@ func (c *AgentUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } return ret, nil // { - // "description": "Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.google.com/assistant/smarthome/concepts/fulfillment-authentication). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.", + // "description": "Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.home.google.com/cloud-to-cloud/primer/fulfillment). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.", // "flatPath": "v1/agentUsers/{agentUsersId}", // "httpMethod": "DELETE", // "id": "homegraph.agentUsers.delete", @@ -1148,10 +1148,10 @@ type DevicesReportStateAndNotificationCall struct { // device notifications. Called by your smart home Action when the state // of a third-party device changes or you need to send a notification // about the device. See Implement Report State -// (https://developers.google.com/assistant/smarthome/develop/report-state) +// (https://developers.home.google.com/cloud-to-cloud/integration/report-state) // for more information. This method updates the device state according // to its declared traits -// (https://developers.google.com/assistant/smarthome/concepts/devices-traits). +// (https://developers.home.google.com/cloud-to-cloud/primer/device-types-and-traits). // Publishing a new state value outside of these traits will result in // an `INVALID_ARGUMENT` error response. The third-party user's identity // is passed in via the `agent_user_id` (see @@ -1252,7 +1252,7 @@ func (c *DevicesReportStateAndNotificationCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.", + // "description": "Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.home.google.com/cloud-to-cloud/integration/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.home.google.com/cloud-to-cloud/primer/device-types-and-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.", // "flatPath": "v1/devices:reportStateAndNotification", // "httpMethod": "POST", // "id": "homegraph.devices.reportStateAndNotification", @@ -1283,12 +1283,11 @@ type DevicesRequestSyncCall struct { } // RequestSync: Requests Google to send an `action.devices.SYNC` intent -// (https://developers.google.com/assistant/smarthome/reference/intent/sync) -// to your smart home Action to update device metadata for the given -// user. The third-party user's identity is passed via the -// `agent_user_id` (see RequestSyncDevicesRequest). This request must be -// authorized using service account credentials from your Actions -// console project. +// (https://developers.home.google.com/cloud-to-cloud/intents/sync) to +// your smart home Action to update device metadata for the given user. +// The third-party user's identity is passed via the `agent_user_id` +// (see RequestSyncDevicesRequest). This request must be authorized +// using service account credentials from your Actions console project. func (r *DevicesService) RequestSync(requestsyncdevicesrequest *RequestSyncDevicesRequest) *DevicesRequestSyncCall { c := &DevicesRequestSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.requestsyncdevicesrequest = requestsyncdevicesrequest @@ -1383,7 +1382,7 @@ func (c *DevicesRequestSyncCall) Do(opts ...googleapi.CallOption) (*RequestSyncD } return ret, nil // { - // "description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.", + // "description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.home.google.com/cloud-to-cloud/intents/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.", // "flatPath": "v1/devices:requestSync", // "httpMethod": "POST", // "id": "homegraph.devices.requestSync", diff --git a/ondemandscanning/v1/ondemandscanning-api.json b/ondemandscanning/v1/ondemandscanning-api.json index 862f2ae3847..bca9367741a 100644 --- a/ondemandscanning/v1/ondemandscanning-api.json +++ b/ondemandscanning/v1/ondemandscanning-api.json @@ -339,7 +339,7 @@ } } }, - "revision": "20221024", + "revision": "20230109", "rootUrl": "https://ondemandscanning.googleapis.com/", "schemas": { "AliasContext": { @@ -1722,14 +1722,18 @@ "OS", "MAVEN", "GO", - "GO_STDLIB" + "GO_STDLIB", + "PYPI", + "NPM" ], "enumDescriptions": [ "", "Operating System", "Java packages from Maven.", "Go third-party packages.", - "Go toolchain + standard library packages." + "Go toolchain + standard library packages.", + "Python packages.", + "NPM packages." ], "type": "string" }, diff --git a/ondemandscanning/v1/ondemandscanning-gen.go b/ondemandscanning/v1/ondemandscanning-gen.go index d5a697e44e6..951167a4087 100644 --- a/ondemandscanning/v1/ondemandscanning-gen.go +++ b/ondemandscanning/v1/ondemandscanning-gen.go @@ -2346,6 +2346,8 @@ type PackageData struct { // "MAVEN" - Java packages from Maven. // "GO" - Go third-party packages. // "GO_STDLIB" - Go toolchain + standard library packages. + // "PYPI" - Python packages. + // "NPM" - NPM packages. PackageType string `json:"packageType,omitempty"` // PatchedCve: CVEs that this package is no longer vulnerable to diff --git a/recommender/v1/recommender-api.json b/recommender/v1/recommender-api.json index 3586065bd27..1f92797552c 100644 --- a/recommender/v1/recommender-api.json +++ b/recommender/v1/recommender-api.json @@ -441,6 +441,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -709,6 +737,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.folders.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1109,6 +1165,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.organizations.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1509,6 +1593,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.projects.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1574,7 +1686,7 @@ } } }, - "revision": "20220924", + "revision": "20230108", "rootUrl": "https://recommender.googleapis.com/", "schemas": { "GoogleCloudRecommenderV1CostProjection": { @@ -1905,6 +2017,17 @@ }, "type": "object" }, + "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest": { + "description": "Request for the `MarkRecommendationDismissed` Method.", + "id": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest", + "properties": { + "etag": { + "description": "Fingerprint of the Recommendation. Provides optimistic locking.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRecommenderV1MarkRecommendationFailedRequest": { "description": "Request for the `MarkRecommendationFailed` Method.", "id": "GoogleCloudRecommenderV1MarkRecommendationFailedRequest", diff --git a/recommender/v1/recommender-gen.go b/recommender/v1/recommender-gen.go index c741b76e827..d2436fed159 100644 --- a/recommender/v1/recommender-gen.go +++ b/recommender/v1/recommender-gen.go @@ -926,6 +926,35 @@ func (s *GoogleCloudRecommenderV1MarkRecommendationClaimedRequest) MarshalJSON() return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRecommenderV1MarkRecommendationDismissedRequest: Request +// for the `MarkRecommendationDismissed` Method. +type GoogleCloudRecommenderV1MarkRecommendationDismissedRequest struct { + // Etag: Fingerprint of the Recommendation. Provides optimistic locking. + Etag string `json:"etag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRecommenderV1MarkRecommendationDismissedRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRecommenderV1MarkRecommendationFailedRequest: Request for // the `MarkRecommendationFailed` Method. type GoogleCloudRecommenderV1MarkRecommendationFailedRequest struct { @@ -3337,6 +3366,154 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Do( } +// method id "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed": + +type BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1markrecommendationdismissedrequest = googlecloudrecommenderv1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1Recommendation or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRecommenderV1Recommendation.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.billingAccounts.locations.recommenders.recommendations.markFailed": type BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall struct { @@ -4625,7 +4802,155 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "recommender.folders.locations.recommenders.recommendations.markClaimed" call. +// Do executes the "recommender.folders.locations.recommenders.recommendations.markClaimed" call. +// Exactly one of *GoogleCloudRecommenderV1Recommendation or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRecommenderV1Recommendation.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markClaimed", + // "httpMethod": "POST", + // "id": "recommender.folders.locations.recommenders.recommendations.markClaimed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Name of the recommendation.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:markClaimed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1MarkRecommendationClaimedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "recommender.folders.locations.recommenders.recommendations.markDismissed": + +type FoldersLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *FoldersLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c := &FoldersLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1markrecommendationdismissedrequest = googlecloudrecommenderv1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.folders.locations.recommenders.recommendations.markDismissed" call. // Exactly one of *GoogleCloudRecommenderV1Recommendation or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -4633,7 +4958,7 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) doRequest(a // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4664,25 +4989,25 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ... } return ret, nil // { - // "description": "Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", - // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markClaimed", + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", // "httpMethod": "POST", - // "id": "recommender.folders.locations.recommenders.recommendations.markClaimed", + // "id": "recommender.folders.locations.recommenders.recommendations.markDismissed", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the recommendation.", + // "description": "Name of the recommendation.", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:markClaimed", + // "path": "v1/{+name}:markDismissed", // "request": { - // "$ref": "GoogleCloudRecommenderV1MarkRecommendationClaimedRequest" + // "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" // }, // "response": { // "$ref": "GoogleCloudRecommenderV1Recommendation" @@ -6712,6 +7037,154 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Do(op } +// method id "recommender.organizations.locations.recommenders.recommendations.markDismissed": + +type OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1markrecommendationdismissedrequest = googlecloudrecommenderv1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.organizations.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1Recommendation or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRecommenderV1Recommendation.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.organizations.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.organizations.locations.recommenders.recommendations.markFailed": type OrganizationsLocationsRecommendersRecommendationsMarkFailedCall struct { @@ -8730,6 +9203,154 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts .. } +// method id "recommender.projects.locations.recommenders.recommendations.markDismissed": + +type ProjectsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *ProjectsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1markrecommendationdismissedrequest *GoogleCloudRecommenderV1MarkRecommendationDismissedRequest) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &ProjectsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1markrecommendationdismissedrequest = googlecloudrecommenderv1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.projects.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1Recommendation or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRecommenderV1Recommendation.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.projects.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.projects.locations.recommenders.recommendations.markFailed": type ProjectsLocationsRecommendersRecommendationsMarkFailedCall struct { diff --git a/recommender/v1beta1/recommender-api.json b/recommender/v1beta1/recommender-api.json index bef906e11f5..3764387344c 100644 --- a/recommender/v1beta1/recommender-api.json +++ b/recommender/v1beta1/recommender-api.json @@ -441,6 +441,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1beta1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1beta1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -709,6 +737,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.folders.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1109,6 +1165,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.organizations.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1509,6 +1593,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "markDismissed": { + "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + "httpMethod": "POST", + "id": "recommender.projects.locations.recommenders.recommendations.markDismissed", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name of the recommendation.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:markDismissed", + "request": { + "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + }, + "response": { + "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "markFailed": { "description": "Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.", "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed", @@ -1574,7 +1686,7 @@ } } }, - "revision": "20220924", + "revision": "20230108", "rootUrl": "https://recommender.googleapis.com/", "schemas": { "GoogleCloudRecommenderV1beta1CostProjection": { @@ -1905,6 +2017,17 @@ }, "type": "object" }, + "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest": { + "description": "Request for the `MarkRecommendationDismissed` Method.", + "id": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest", + "properties": { + "etag": { + "description": "Fingerprint of the Recommendation. Provides optimistic locking.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest": { "description": "Request for the `MarkRecommendationFailed` Method.", "id": "GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest", diff --git a/recommender/v1beta1/recommender-gen.go b/recommender/v1beta1/recommender-gen.go index 8b74ead1050..65d20b8d92f 100644 --- a/recommender/v1beta1/recommender-gen.go +++ b/recommender/v1beta1/recommender-gen.go @@ -926,6 +926,35 @@ func (s *GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest) MarshalJ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest: +// Request for the `MarkRecommendationDismissed` Method. +type GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest struct { + // Etag: Fingerprint of the Recommendation. Provides optimistic locking. + Etag string `json:"etag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest: Request // for the `MarkRecommendationFailed` Method. type GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest struct { @@ -3343,6 +3372,155 @@ func (c *BillingAccountsLocationsRecommendersRecommendationsMarkClaimedCall) Do( } +// method id "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed": + +type BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *BillingAccountsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1beta1Recommendation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BillingAccountsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1beta1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1beta1/billingAccounts/{billingAccountsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.billingAccounts.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.billingAccounts.locations.recommenders.recommendations.markFailed": type BillingAccountsLocationsRecommendersRecommendationsMarkFailedCall struct { @@ -4676,25 +4854,174 @@ func (c *FoldersLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts ... } return ret, nil // { - // "description": "Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", - // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markClaimed", + // "description": "Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markClaimed", + // "httpMethod": "POST", + // "id": "recommender.folders.locations.recommenders.recommendations.markClaimed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Name of the recommendation.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+name}:markClaimed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "recommender.folders.locations.recommenders.recommendations.markDismissed": + +type FoldersLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *FoldersLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c := &FoldersLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *FoldersLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.folders.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1beta1Recommendation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1beta1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", // "httpMethod": "POST", - // "id": "recommender.folders.locations.recommenders.recommendations.markClaimed", + // "id": "recommender.folders.locations.recommenders.recommendations.markDismissed", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the recommendation.", + // "description": "Name of the recommendation.", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta1/{+name}:markClaimed", + // "path": "v1beta1/{+name}:markDismissed", // "request": { - // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest" + // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" // }, // "response": { // "$ref": "GoogleCloudRecommenderV1beta1Recommendation" @@ -6730,6 +7057,155 @@ func (c *OrganizationsLocationsRecommendersRecommendationsMarkClaimedCall) Do(op } +// method id "recommender.organizations.locations.recommenders.recommendations.markDismissed": + +type OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *OrganizationsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.organizations.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1beta1Recommendation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1beta1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.organizations.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.organizations.locations.recommenders.recommendations.markFailed": type OrganizationsLocationsRecommendersRecommendationsMarkFailedCall struct { @@ -8754,6 +9230,155 @@ func (c *ProjectsLocationsRecommendersRecommendationsMarkClaimedCall) Do(opts .. } +// method id "recommender.projects.locations.recommenders.recommendations.markDismissed": + +type ProjectsLocationsRecommendersRecommendationsMarkDismissedCall struct { + s *Service + name string + googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MarkDismissed: Mark the Recommendation State as Dismissed. Users can +// use this method to indicate to the Recommender API that an ACTIVE +// recommendation has to be marked back as DISMISSED. +// MarkRecommendationDismissed can be applied to recommendations in +// ACTIVE state. Requires the recommender.*.update IAM permission for +// the specified recommender. +// +// - name: Name of the recommendation. +func (r *ProjectsLocationsRecommendersRecommendationsService) MarkDismissed(name string, googlecloudrecommenderv1beta1markrecommendationdismissedrequest *GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c := &ProjectsLocationsRecommendersRecommendationsMarkDismissedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest = googlecloudrecommenderv1beta1markrecommendationdismissedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Context(ctx context.Context) *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudrecommenderv1beta1markrecommendationdismissedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:markDismissed") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "recommender.projects.locations.recommenders.recommendations.markDismissed" call. +// Exactly one of *GoogleCloudRecommenderV1beta1Recommendation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRecommenderV1beta1Recommendation.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsRecommendersRecommendationsMarkDismissedCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRecommenderV1beta1Recommendation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudRecommenderV1beta1Recommendation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Mark the Recommendation State as Dismissed. Users can use this method to indicate to the Recommender API that an ACTIVE recommendation has to be marked back as DISMISSED. MarkRecommendationDismissed can be applied to recommendations in ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markDismissed", + // "httpMethod": "POST", + // "id": "recommender.projects.locations.recommenders.recommendations.markDismissed", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Name of the recommendation.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+name}:markDismissed", + // "request": { + // "$ref": "GoogleCloudRecommenderV1beta1MarkRecommendationDismissedRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRecommenderV1beta1Recommendation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "recommender.projects.locations.recommenders.recommendations.markFailed": type ProjectsLocationsRecommendersRecommendationsMarkFailedCall struct { diff --git a/retail/v2/retail-api.json b/retail/v2/retail-api.json index 457c7e7d31b..32547a31c7c 100644 --- a/retail/v2/retail-api.json +++ b/retail/v2/retail-api.json @@ -1785,7 +1785,7 @@ } } }, - "revision": "20230102", + "revision": "20230105", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2256,7 +2256,7 @@ "type": "array" }, "colors": { - "description": "The color display names, which may be different from standard color family names, such as the color aliases used in the website frontend. Normally it is expected to have only 1 color. May consider using single \"Mixed\" instead of multiple values. A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).", + "description": "The color display names, which may be different from standard color family names, such as the color aliases used in the website frontend. Normally it is expected to have only 1 color. May consider using single \"Mixed\" instead of multiple values. A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).", "items": { "type": "string" }, diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index 82a988ef65a..2d68150f6bb 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -1166,7 +1166,7 @@ type GoogleCloudRetailV2ColorInfo struct { // Colors: The color display names, which may be different from standard // color family names, such as the color aliases used in the website // frontend. Normally it is expected to have only 1 color. May consider - // using single "Mixed" instead of multiple values. A maximum of 25 + // using single "Mixed" instead of multiple values. A maximum of 75 // colors are allowed. Each value must be a UTF-8 encoded string with a // length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error // is returned. Google Merchant Center property color diff --git a/servicecontrol/v1/servicecontrol-api.json b/servicecontrol/v1/servicecontrol-api.json index c39174b9cee..3b4fbd23881 100644 --- a/servicecontrol/v1/servicecontrol-api.json +++ b/servicecontrol/v1/servicecontrol-api.json @@ -197,7 +197,7 @@ } } }, - "revision": "20221014", + "revision": "20230104", "rootUrl": "https://servicecontrol.googleapis.com/", "schemas": { "AllocateInfo": { @@ -1466,14 +1466,12 @@ "enum": [ "ACQUIRE", "ACQUIRE_BEST_EFFORT", - "CHECK", - "RELEASE" + "CHECK" ], "enumDescriptions": [ "Decreases available quota by the cost specified for the operation. If cost is higher than available quota, operation fails and returns error.", "Decreases available quota by the cost specified for the operation. If cost is higher than available quota, operation does not fail and available quota goes down to zero but it returns error.", - "Does not change any available quota. Only checks if there is enough quota. No lock is placed on the checked tokens neither.", - "DEPRECATED: Increases available quota by the operation cost specified for the operation." + "Does not change any available quota. Only checks if there is enough quota. No lock is placed on the checked tokens neither." ], "type": "string" } diff --git a/servicecontrol/v1/servicecontrol-gen.go b/servicecontrol/v1/servicecontrol-gen.go index 6eda2f4cba4..e334d0d6558 100644 --- a/servicecontrol/v1/servicecontrol-gen.go +++ b/servicecontrol/v1/servicecontrol-gen.go @@ -2177,8 +2177,6 @@ type QuotaProperties struct { // returns error. // "CHECK" - Does not change any available quota. Only checks if there // is enough quota. No lock is placed on the checked tokens neither. - // "RELEASE" - DEPRECATED: Increases available quota by the operation - // cost specified for the operation. QuotaMode string `json:"quotaMode,omitempty"` // ForceSendFields is a list of field names (e.g. "QuotaMode") to diff --git a/translate/v3/translate-api.json b/translate/v3/translate-api.json index 070bccd700f..29bf0bdf325 100644 --- a/translate/v3/translate-api.json +++ b/translate/v3/translate-api.json @@ -457,6 +457,234 @@ } }, "resources": { + "datasets": { + "methods": { + "create": { + "description": "Creates a Dataset.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets", + "httpMethod": "POST", + "id": "translate.projects.locations.datasets.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The project name.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+parent}/datasets", + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "delete": { + "description": "Deletes a dataset and all of its contents.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}", + "httpMethod": "DELETE", + "id": "translate.projects.locations.datasets.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the dataset to delete.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "exportData": { + "description": "Exports dataset's data to the provided output location.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:exportData", + "httpMethod": "POST", + "id": "translate.projects.locations.datasets.exportData", + "parameterOrder": [ + "dataset" + ], + "parameters": { + "dataset": { + "description": "Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+dataset}:exportData", + "request": { + "$ref": "ExportDataRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "get": { + "description": "Gets a Dataset.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}", + "httpMethod": "GET", + "id": "translate.projects.locations.datasets.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the dataset to retrieve.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+name}", + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "importData": { + "description": "Import sentence pairs into translation Dataset.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:importData", + "httpMethod": "POST", + "id": "translate.projects.locations.datasets.importData", + "parameterOrder": [ + "dataset" + ], + "parameters": { + "dataset": { + "description": "Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+dataset}:importData", + "request": { + "$ref": "ImportDataRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "list": { + "description": "Lists datasets.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets", + "httpMethod": "GET", + "id": "translate.projects.locations.datasets.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. Requested page size. The server can return fewer results than requested.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListDatasets call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+parent}/datasets", + "response": { + "$ref": "ListDatasetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + } + }, + "resources": { + "examples": { + "methods": { + "list": { + "description": "Lists sentence pairs in the dataset.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/examples", + "httpMethod": "GET", + "id": "translate.projects.locations.datasets.examples.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN`", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Requested page size. The server can return fewer results than requested.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListExamples call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+parent}/examples", + "response": { + "$ref": "ListExamplesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + } + } + } + } + }, "glossaries": { "methods": { "create": { @@ -770,6 +998,133 @@ } } }, + "models": { + "methods": { + "create": { + "description": "Creates a Model.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models", + "httpMethod": "POST", + "id": "translate.projects.locations.models.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The project name, in form of `projects/{project}/locations/{location}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+parent}/models", + "request": { + "$ref": "Model" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "delete": { + "description": "Deletes a model.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models/{modelsId}", + "httpMethod": "DELETE", + "id": "translate.projects.locations.models.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the model to delete.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "get": { + "description": "Gets a model.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models/{modelsId}", + "httpMethod": "GET", + "id": "translate.projects.locations.models.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the model to retrieve.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+name}", + "response": { + "$ref": "Model" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + }, + "list": { + "description": "Lists models.", + "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models", + "httpMethod": "GET", + "id": "translate.projects.locations.models.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. An expression for filtering the models that will be returned. Supported filter: `dataset_id=${dataset_id}`", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Requested page size. The server can return fewer results than requested.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListModels call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v3/{+parent}/models", + "response": { + "$ref": "ListModelsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + } + } + }, "operations": { "methods": { "cancel": { @@ -931,7 +1286,7 @@ } } }, - "revision": "20221021", + "revision": "20230106", "rootUrl": "https://translation.googleapis.com/", "schemas": { "BatchDocumentInputConfig": { @@ -960,6 +1315,10 @@ "description": "The BatchTranslateDocument request.", "id": "BatchTranslateDocumentRequest", "properties": { + "customizedAttribution": { + "description": "Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos", + "type": "string" + }, "formatConversions": { "additionalProperties": { "type": "string" @@ -1062,6 +1421,90 @@ "properties": {}, "type": "object" }, + "Dataset": { + "description": "A dataset that hosts the examples (sentence pairs) used for translation models.", + "id": "Dataset", + "properties": { + "createTime": { + "description": "Output only. Timestamp when this dataset was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "The name of the dataset to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.", + "type": "string" + }, + "exampleCount": { + "description": "Output only. The number of examples in the dataset.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "name": { + "description": "The resource name of the dataset, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`", + "type": "string" + }, + "sourceLanguageCode": { + "description": "The BCP-47 language code of the source language.", + "type": "string" + }, + "targetLanguageCode": { + "description": "The BCP-47 language code of the target language.", + "type": "string" + }, + "testExampleCount": { + "description": "Output only. Number of test examples (sentence pairs).", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "trainExampleCount": { + "description": "Output only. Number of training examples (sentence pairs).", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "updateTime": { + "description": "Output only. Timestamp when this dataset was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "validateExampleCount": { + "description": "Output only. Number of validation examples (sentence pairs).", + "format": "int32", + "readOnly": true, + "type": "integer" + } + }, + "type": "object" + }, + "DatasetInputConfig": { + "description": "Input configuration for datasets.", + "id": "DatasetInputConfig", + "properties": { + "inputFiles": { + "description": "Files containing the sentence pairs to be imported to the dataset.", + "items": { + "$ref": "InputFile" + }, + "type": "array" + } + }, + "type": "object" + }, + "DatasetOutputConfig": { + "description": "Output configuration for datasets.", + "id": "DatasetOutputConfig", + "properties": { + "gcsDestination": { + "$ref": "GcsOutputDestination", + "description": "Google Cloud Storage destination to write the output." + } + }, + "type": "object" + }, "DetectLanguageRequest": { "description": "The request message for language detection.", "id": "DetectLanguageRequest", @@ -1112,7 +1555,7 @@ "type": "number" }, "languageCode": { - "description": "The BCP-47 language code of source content in the request, detected automatically.", + "description": "The BCP-47 language code of the source content in the request, detected automatically.", "type": "string" } }, @@ -1182,6 +1625,42 @@ "properties": {}, "type": "object" }, + "Example": { + "description": "A sentence pair.", + "id": "Example", + "properties": { + "name": { + "description": "Output only. The resource name of the example, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}'", + "readOnly": true, + "type": "string" + }, + "sourceText": { + "description": "Sentence in source language.", + "type": "string" + }, + "targetText": { + "description": "Sentence in target language.", + "type": "string" + }, + "usage": { + "description": "Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ExportDataRequest": { + "description": "Request message for ExportData.", + "id": "ExportDataRequest", + "properties": { + "outputConfig": { + "$ref": "DatasetOutputConfig", + "description": "Required. The config for the output content." + } + }, + "type": "object" + }, "GcsDestination": { "description": "The Google Cloud Storage location for the output content.", "id": "GcsDestination", @@ -1193,6 +1672,28 @@ }, "type": "object" }, + "GcsInputSource": { + "description": "The Google Cloud Storage location for the input content.", + "id": "GcsInputSource", + "properties": { + "inputUri": { + "description": "Required. Source data URI. For example, `gs://my_bucket/my_object`.", + "type": "string" + } + }, + "type": "object" + }, + "GcsOutputDestination": { + "description": "The Google Cloud Storage location for the output content.", + "id": "GcsOutputDestination", + "properties": { + "outputUriPrefix": { + "description": "Required. Google Cloud Storage URI to output directory. For example, `gs://bucket/directory`. The requesting user must have write permission to the bucket. The directory will be created if it doesn't exist.", + "type": "string" + } + }, + "type": "object" + }, "GcsSource": { "description": "The Google Cloud Storage location for the input content.", "id": "GcsSource", @@ -1205,7 +1706,7 @@ "type": "object" }, "Glossary": { - "description": "Represents a glossary built from user provided data.", + "description": "Represents a glossary built from user-provided data.", "id": "Glossary", "properties": { "displayName": { @@ -1278,7 +1779,7 @@ "properties": { "gcsSource": { "$ref": "GcsSource", - "description": "Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. The first column is source text. The second column is target text. The file must not contain headers. That is, the first row is data, not column names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary)." + "description": "Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. The first column is source text. The second column is target text. No headers in this file. The first row contains data and not column names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary)." } }, "type": "object" @@ -1327,6 +1828,17 @@ }, "type": "object" }, + "ImportDataRequest": { + "description": "Request message for ImportData.", + "id": "ImportDataRequest", + "properties": { + "inputConfig": { + "$ref": "DatasetInputConfig", + "description": "Required. The config for the input content." + } + }, + "type": "object" + }, "InputConfig": { "description": "Input configuration for BatchTranslateText request.", "id": "InputConfig", @@ -1342,6 +1854,21 @@ }, "type": "object" }, + "InputFile": { + "description": "An input file.", + "id": "InputFile", + "properties": { + "gcsSource": { + "$ref": "GcsInputSource", + "description": "Google Cloud Storage file source." + }, + "usage": { + "description": "Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, or UNASSIGNED (by default) for auto split.", + "type": "string" + } + }, + "type": "object" + }, "LanguageCodePair": { "description": "Used with unidirectional glossaries.", "id": "LanguageCodePair", @@ -1371,6 +1898,42 @@ }, "type": "object" }, + "ListDatasetsResponse": { + "description": "Response message for ListDatasets.", + "id": "ListDatasetsResponse", + "properties": { + "datasets": { + "description": "The datasets read.", + "items": { + "$ref": "Dataset" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this token to the page_token field in the ListDatasetsRequest to obtain the corresponding page.", + "type": "string" + } + }, + "type": "object" + }, + "ListExamplesResponse": { + "description": "Response message for ListExamples.", + "id": "ListExamplesResponse", + "properties": { + "examples": { + "description": "The sentence pairs.", + "items": { + "$ref": "Example" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this token to the page_token field in the ListExamplesRequest to obtain the corresponding page.", + "type": "string" + } + }, + "type": "object" + }, "ListGlossariesResponse": { "description": "Response message for ListGlossaries.", "id": "ListGlossariesResponse", @@ -1425,6 +1988,24 @@ }, "type": "object" }, + "ListModelsResponse": { + "description": "Response message for ListModels.", + "id": "ListModelsResponse", + "properties": { + "models": { + "description": "The models read.", + "items": { + "$ref": "Model" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token to retrieve next page of results. Pass this token to the page_token field in the ListModelsRequest to obtain the corresponding page.", + "type": "string" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -1477,6 +2058,71 @@ }, "type": "object" }, + "Model": { + "description": "A trained translation model.", + "id": "Model", + "properties": { + "createTime": { + "description": "Output only. Timestamp when the model resource was created, which is also when the training started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "dataset": { + "description": "The dataset from which the model is trained, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`", + "type": "string" + }, + "deployTime": { + "description": "Output only. Timestamp when the model training finished and ready to be used for translation.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.", + "type": "string" + }, + "name": { + "description": "The resource name of the model, in form of `projects/{project-number-or-id}/locations/{location_id}/models/{model_id}`", + "type": "string" + }, + "sourceLanguageCode": { + "description": "Output only. The BCP-47 language code of the source language.", + "readOnly": true, + "type": "string" + }, + "targetLanguageCode": { + "description": "Output only. The BCP-47 language code of the target language.", + "readOnly": true, + "type": "string" + }, + "testExampleCount": { + "description": "Output only. Number of examples (sentence pairs) used to test the model.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "trainExampleCount": { + "description": "Output only. Number of examples (sentence pairs) used to train the model.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "updateTime": { + "description": "Output only. Timestamp when this model was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "validateExampleCount": { + "description": "Output only. Number of examples (sentence pairs) used to validate the model.", + "format": "int32", + "readOnly": true, + "type": "integer" + } + }, + "type": "object" + }, "Operation": { "description": "This resource represents a long-running operation that is the result of a network API call.", "id": "Operation", @@ -1518,7 +2164,7 @@ "properties": { "gcsDestination": { "$ref": "GcsDestination", - "description": "Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\\n' instead of '\\r\\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_translations.[extension] If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]" + "description": "Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\\n' instead of '\\r\\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]" } }, "type": "object" @@ -1555,19 +2201,19 @@ "id": "SupportedLanguage", "properties": { "displayName": { - "description": "Human readable name of the language localized in the display language specified in the request.", + "description": "Human-readable name of the language localized in the display language specified in the request.", "type": "string" }, "languageCode": { - "description": "Supported language code, generally consisting of its ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, 'zh-TW' and 'zh-CN')", + "description": "Supported language code, generally consisting of its ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, 'zh-TW' and 'zh-CN').", "type": "string" }, "supportSource": { - "description": "Can be used as source language.", + "description": "Can be used as a source language.", "type": "boolean" }, "supportTarget": { - "description": "Can be used as target language.", + "description": "Can be used as a target language.", "type": "boolean" } }, @@ -1603,6 +2249,10 @@ "$ref": "DocumentOutputConfig", "description": "Optional. Output configurations. Defines if the output file should be stored within Cloud Storage as well as the desired output format. If not provided the translated file will only be returned through a byte-stream and its output mime type will be the same as the input file's mime type." }, + "enableShadowRemovalNativePdf": { + "description": "Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation.", + "type": "boolean" + }, "glossaryConfig": { "$ref": "TranslateTextGlossaryConfig", "description": "Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned." @@ -1657,15 +2307,15 @@ "type": "object" }, "TranslateTextGlossaryConfig": { - "description": "Configures which glossary should be used for a specific target language, and defines options for applying that glossary.", + "description": "Configures which glossary is used for a specific target language and defines options for applying that glossary.", "id": "TranslateTextGlossaryConfig", "properties": { "glossary": { - "description": "Required. The `glossary` to be applied for this translation. The format depends on glossary: - User provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`", + "description": "Required. The `glossary` to be applied for this translation. The format depends on the glossary: - User-provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`", "type": "string" }, "ignoreCase": { - "description": "Optional. Indicates match is case-insensitive. Default value is false if missing.", + "description": "Optional. Indicates match is case insensitive. The default value is `false` if missing.", "type": "boolean" } }, @@ -1676,7 +2326,7 @@ "id": "TranslateTextRequest", "properties": { "contents": { - "description": "Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.", + "description": "Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.", "items": { "type": "string" }, diff --git a/translate/v3/translate-gen.go b/translate/v3/translate-gen.go index 717790c4b1d..5ab05f83e18 100644 --- a/translate/v3/translate-gen.go +++ b/translate/v3/translate-gen.go @@ -161,7 +161,9 @@ type ProjectsService struct { func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs := &ProjectsLocationsService{s: s} + rs.Datasets = NewProjectsLocationsDatasetsService(s) rs.Glossaries = NewProjectsLocationsGlossariesService(s) + rs.Models = NewProjectsLocationsModelsService(s) rs.Operations = NewProjectsLocationsOperationsService(s) return rs } @@ -169,11 +171,36 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { type ProjectsLocationsService struct { s *Service + Datasets *ProjectsLocationsDatasetsService + Glossaries *ProjectsLocationsGlossariesService + Models *ProjectsLocationsModelsService + Operations *ProjectsLocationsOperationsService } +func NewProjectsLocationsDatasetsService(s *Service) *ProjectsLocationsDatasetsService { + rs := &ProjectsLocationsDatasetsService{s: s} + rs.Examples = NewProjectsLocationsDatasetsExamplesService(s) + return rs +} + +type ProjectsLocationsDatasetsService struct { + s *Service + + Examples *ProjectsLocationsDatasetsExamplesService +} + +func NewProjectsLocationsDatasetsExamplesService(s *Service) *ProjectsLocationsDatasetsExamplesService { + rs := &ProjectsLocationsDatasetsExamplesService{s: s} + return rs +} + +type ProjectsLocationsDatasetsExamplesService struct { + s *Service +} + func NewProjectsLocationsGlossariesService(s *Service) *ProjectsLocationsGlossariesService { rs := &ProjectsLocationsGlossariesService{s: s} rs.GlossaryEntries = NewProjectsLocationsGlossariesGlossaryEntriesService(s) @@ -195,6 +222,15 @@ type ProjectsLocationsGlossariesGlossaryEntriesService struct { s *Service } +func NewProjectsLocationsModelsService(s *Service) *ProjectsLocationsModelsService { + rs := &ProjectsLocationsModelsService{s: s} + return rs +} + +type ProjectsLocationsModelsService struct { + s *Service +} + func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { rs := &ProjectsLocationsOperationsService{s: s} return rs @@ -316,6 +352,12 @@ func (s *BatchDocumentOutputConfig) MarshalJSON() ([]byte, error) { // BatchTranslateDocumentRequest: The BatchTranslateDocument request. type BatchTranslateDocumentRequest struct { + // CustomizedAttribution: Optional. This flag is to support user + // customized attribution. If not provided, the default is `Machine + // Translated by Google`. Customized attribution should follow rules in + // https://cloud.google.com/translate/attribution#attribution_and_logos + CustomizedAttribution string `json:"customizedAttribution,omitempty"` + // FormatConversions: Optional. FormatConversions map[string]string `json:"formatConversions,omitempty"` @@ -356,15 +398,16 @@ type BatchTranslateDocumentRequest struct { // here. TargetLanguageCodes []string `json:"targetLanguageCodes,omitempty"` - // ForceSendFields is a list of field names (e.g. "FormatConversions") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "CustomizedAttribution") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FormatConversions") to + // NullFields is a list of field names (e.g. "CustomizedAttribution") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -450,6 +493,132 @@ func (s *BatchTranslateTextRequest) MarshalJSON() ([]byte, error) { type CancelOperationRequest struct { } +// Dataset: A dataset that hosts the examples (sentence pairs) used for +// translation models. +type Dataset struct { + // CreateTime: Output only. Timestamp when this dataset was created. + CreateTime string `json:"createTime,omitempty"` + + // DisplayName: The name of the dataset to show in the interface. The + // name can be up to 32 characters long and can consist only of ASCII + // Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. + DisplayName string `json:"displayName,omitempty"` + + // ExampleCount: Output only. The number of examples in the dataset. + ExampleCount int64 `json:"exampleCount,omitempty"` + + // Name: The resource name of the dataset, in form of + // `projects/{project-number-or-id}/locations/{location_id}/datasets/{dat + // aset_id}` + Name string `json:"name,omitempty"` + + // SourceLanguageCode: The BCP-47 language code of the source language. + SourceLanguageCode string `json:"sourceLanguageCode,omitempty"` + + // TargetLanguageCode: The BCP-47 language code of the target language. + TargetLanguageCode string `json:"targetLanguageCode,omitempty"` + + // TestExampleCount: Output only. Number of test examples (sentence + // pairs). + TestExampleCount int64 `json:"testExampleCount,omitempty"` + + // TrainExampleCount: Output only. Number of training examples (sentence + // pairs). + TrainExampleCount int64 `json:"trainExampleCount,omitempty"` + + // UpdateTime: Output only. Timestamp when this dataset was last + // updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ValidateExampleCount: Output only. Number of validation examples + // (sentence pairs). + ValidateExampleCount int64 `json:"validateExampleCount,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Dataset) MarshalJSON() ([]byte, error) { + type NoMethod Dataset + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DatasetInputConfig: Input configuration for datasets. +type DatasetInputConfig struct { + // InputFiles: Files containing the sentence pairs to be imported to the + // dataset. + InputFiles []*InputFile `json:"inputFiles,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InputFiles") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "InputFiles") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *DatasetInputConfig) MarshalJSON() ([]byte, error) { + type NoMethod DatasetInputConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DatasetOutputConfig: Output configuration for datasets. +type DatasetOutputConfig struct { + // GcsDestination: Google Cloud Storage destination to write the output. + GcsDestination *GcsOutputDestination `json:"gcsDestination,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GcsDestination") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "GcsDestination") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *DatasetOutputConfig) MarshalJSON() ([]byte, error) { + type NoMethod DatasetOutputConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // DetectLanguageRequest: The request message for language detection. type DetectLanguageRequest struct { // Content: The content of the input stored as a string. @@ -539,7 +708,7 @@ type DetectedLanguage struct { // Confidence: The confidence of the detection result for this language. Confidence float64 `json:"confidence,omitempty"` - // LanguageCode: The BCP-47 language code of source content in the + // LanguageCode: The BCP-47 language code of the source content in the // request, detected automatically. LanguageCode string `json:"languageCode,omitempty"` @@ -745,6 +914,74 @@ type Empty struct { googleapi.ServerResponse `json:"-"` } +// Example: A sentence pair. +type Example struct { + // Name: Output only. The resource name of the example, in form of + // `projects/{project-number-or-id}/locations/{location_id}/datasets/{dat + // aset_id}/examples/{example_id}' + Name string `json:"name,omitempty"` + + // SourceText: Sentence in source language. + SourceText string `json:"sourceText,omitempty"` + + // TargetText: Sentence in target language. + TargetText string `json:"targetText,omitempty"` + + // Usage: Output only. Usage of the sentence pair. Options are + // TRAIN|VALIDATION|TEST. + Usage string `json:"usage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Example) MarshalJSON() ([]byte, error) { + type NoMethod Example + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ExportDataRequest: Request message for ExportData. +type ExportDataRequest struct { + // OutputConfig: Required. The config for the output content. + OutputConfig *DatasetOutputConfig `json:"outputConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OutputConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "OutputConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ExportDataRequest) MarshalJSON() ([]byte, error) { + type NoMethod ExportDataRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GcsDestination: The Google Cloud Storage location for the output // content. type GcsDestination struct { @@ -779,6 +1016,69 @@ func (s *GcsDestination) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GcsInputSource: The Google Cloud Storage location for the input +// content. +type GcsInputSource struct { + // InputUri: Required. Source data URI. For example, + // `gs://my_bucket/my_object`. + InputUri string `json:"inputUri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InputUri") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "InputUri") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GcsInputSource) MarshalJSON() ([]byte, error) { + type NoMethod GcsInputSource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GcsOutputDestination: The Google Cloud Storage location for the +// output content. +type GcsOutputDestination struct { + // OutputUriPrefix: Required. Google Cloud Storage URI to output + // directory. For example, `gs://bucket/directory`. The requesting user + // must have write permission to the bucket. The directory will be + // created if it doesn't exist. + OutputUriPrefix string `json:"outputUriPrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "OutputUriPrefix") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GcsOutputDestination) MarshalJSON() ([]byte, error) { + type NoMethod GcsOutputDestination + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GcsSource: The Google Cloud Storage location for the input content. type GcsSource struct { // InputUri: Required. Source data URI. For example, @@ -808,7 +1108,7 @@ func (s *GcsSource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Glossary: Represents a glossary built from user provided data. +// Glossary: Represents a glossary built from user-provided data. type Glossary struct { // DisplayName: Optional. The display name of the glossary. DisplayName string `json:"displayName,omitempty"` @@ -915,10 +1215,10 @@ type GlossaryInputConfig struct { // returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and // file formats. Wildcards are not allowed. This must be a single file // in one of the following formats: For unidirectional glossaries: - - // TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. The - // first column is source text. The second column is target text. The - // file must not contain headers. That is, the first row is data, not - // column names. - TMX (`.tmx`): TMX file with parallel data defining + // TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. + // The first column is source text. The second column is target text. No + // headers in this file. The first row contains data and not column + // names. - TMX (`.tmx`): TMX file with parallel data defining // source/target term pairs. For equivalent term sets glossaries: - CSV // (`.csv`): Multi-column CSV file defining equivalent glossary terms in // multiple languages. See documentation for more information - @@ -1044,6 +1344,34 @@ func (s *GlossaryTermsSet) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ImportDataRequest: Request message for ImportData. +type ImportDataRequest struct { + // InputConfig: Required. The config for the input content. + InputConfig *DatasetInputConfig `json:"inputConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InputConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "InputConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ImportDataRequest) MarshalJSON() ([]byte, error) { + type NoMethod ImportDataRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // InputConfig: Input configuration for BatchTranslateText request. type InputConfig struct { // GcsSource: Required. Google Cloud Storage location for the source @@ -1092,34 +1420,66 @@ func (s *InputConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// LanguageCodePair: Used with unidirectional glossaries. -type LanguageCodePair struct { - // SourceLanguageCode: Required. The BCP-47 language code of the input - // text, for example, "en-US". Expected to be an exact match for - // GlossaryTerm.language_code. - SourceLanguageCode string `json:"sourceLanguageCode,omitempty"` +// InputFile: An input file. +type InputFile struct { + // GcsSource: Google Cloud Storage file source. + GcsSource *GcsInputSource `json:"gcsSource,omitempty"` - // TargetLanguageCode: Required. The BCP-47 language code for - // translation output, for example, "zh-CN". Expected to be an exact - // match for GlossaryTerm.language_code. - TargetLanguageCode string `json:"targetLanguageCode,omitempty"` + // Usage: Optional. Usage of the file contents. Options are + // TRAIN|VALIDATION|TEST, or UNASSIGNED (by default) for auto split. + Usage string `json:"usage,omitempty"` - // ForceSendFields is a list of field names (e.g. "SourceLanguageCode") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "GcsSource") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "SourceLanguageCode") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GcsSource") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *InputFile) MarshalJSON() ([]byte, error) { + type NoMethod InputFile + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LanguageCodePair: Used with unidirectional glossaries. +type LanguageCodePair struct { + // SourceLanguageCode: Required. The BCP-47 language code of the input + // text, for example, "en-US". Expected to be an exact match for + // GlossaryTerm.language_code. + SourceLanguageCode string `json:"sourceLanguageCode,omitempty"` + + // TargetLanguageCode: Required. The BCP-47 language code for + // translation output, for example, "zh-CN". Expected to be an exact + // match for GlossaryTerm.language_code. + TargetLanguageCode string `json:"targetLanguageCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SourceLanguageCode") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "SourceLanguageCode") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` } func (s *LanguageCodePair) MarshalJSON() ([]byte, error) { @@ -1159,6 +1519,80 @@ func (s *LanguageCodesSet) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListDatasetsResponse: Response message for ListDatasets. +type ListDatasetsResponse struct { + // Datasets: The datasets read. + Datasets []*Dataset `json:"datasets,omitempty"` + + // NextPageToken: A token to retrieve next page of results. Pass this + // token to the page_token field in the ListDatasetsRequest to obtain + // the corresponding page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Datasets") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Datasets") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListDatasetsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListDatasetsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListExamplesResponse: Response message for ListExamples. +type ListExamplesResponse struct { + // Examples: The sentence pairs. + Examples []*Example `json:"examples,omitempty"` + + // NextPageToken: A token to retrieve next page of results. Pass this + // token to the page_token field in the ListExamplesRequest to obtain + // the corresponding page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Examples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Examples") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListExamplesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListExamplesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListGlossariesResponse: Response message for ListGlossaries. type ListGlossariesResponse struct { // Glossaries: The list of glossaries for a project. @@ -1271,6 +1705,43 @@ func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListModelsResponse: Response message for ListModels. +type ListModelsResponse struct { + // Models: The models read. + Models []*Model `json:"models,omitempty"` + + // NextPageToken: A token to retrieve next page of results. Pass this + // token to the page_token field in the ListModelsRequest to obtain the + // corresponding page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Models") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Models") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListModelsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListModelsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListOperationsResponse: The response message for // Operations.ListOperations. type ListOperationsResponse struct { @@ -1358,6 +1829,81 @@ func (s *Location) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Model: A trained translation model. +type Model struct { + // CreateTime: Output only. Timestamp when the model resource was + // created, which is also when the training started. + CreateTime string `json:"createTime,omitempty"` + + // Dataset: The dataset from which the model is trained, in form of + // `projects/{project-number-or-id}/locations/{location_id}/datasets/{dat + // aset_id}` + Dataset string `json:"dataset,omitempty"` + + // DeployTime: Output only. Timestamp when the model training finished + // and ready to be used for translation. + DeployTime string `json:"deployTime,omitempty"` + + // DisplayName: The name of the model to show in the interface. The name + // can be up to 32 characters long and can consist only of ASCII Latin + // letters A-Z and a-z, underscores (_), and ASCII digits 0-9. + DisplayName string `json:"displayName,omitempty"` + + // Name: The resource name of the model, in form of + // `projects/{project-number-or-id}/locations/{location_id}/models/{model + // _id}` + Name string `json:"name,omitempty"` + + // SourceLanguageCode: Output only. The BCP-47 language code of the + // source language. + SourceLanguageCode string `json:"sourceLanguageCode,omitempty"` + + // TargetLanguageCode: Output only. The BCP-47 language code of the + // target language. + TargetLanguageCode string `json:"targetLanguageCode,omitempty"` + + // TestExampleCount: Output only. Number of examples (sentence pairs) + // used to test the model. + TestExampleCount int64 `json:"testExampleCount,omitempty"` + + // TrainExampleCount: Output only. Number of examples (sentence pairs) + // used to train the model. + TrainExampleCount int64 `json:"trainExampleCount,omitempty"` + + // UpdateTime: Output only. Timestamp when this model was last updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ValidateExampleCount: Output only. Number of examples (sentence + // pairs) used to validate the model. + ValidateExampleCount int64 `json:"validateExampleCount,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Model) MarshalJSON() ([]byte, error) { + type NoMethod Model + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Operation: This resource represents a long-running operation that is // the result of a network API call. type Operation struct { @@ -1450,7 +1996,7 @@ type OutputConfig struct { // file updating. // (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] If the + // `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the // input file extension is tsv, the output has the following columns: // Column 1: ID of the request provided in the input, if it's not // provided in the input, then the input row number is used (0-based). @@ -1547,20 +2093,20 @@ func (s *Status) MarshalJSON() ([]byte, error) { // SupportedLanguage: A single supported language response corresponds // to information related to one supported language. type SupportedLanguage struct { - // DisplayName: Human readable name of the language localized in the + // DisplayName: Human-readable name of the language localized in the // display language specified in the request. DisplayName string `json:"displayName,omitempty"` // LanguageCode: Supported language code, generally consisting of its // ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, // BCP-47 codes including language and region identifiers are returned - // (for example, 'zh-TW' and 'zh-CN') + // (for example, 'zh-TW' and 'zh-CN'). LanguageCode string `json:"languageCode,omitempty"` - // SupportSource: Can be used as source language. + // SupportSource: Can be used as a source language. SupportSource bool `json:"supportSource,omitempty"` - // SupportTarget: Can be used as target language. + // SupportTarget: Can be used as a target language. SupportTarget bool `json:"supportTarget,omitempty"` // ForceSendFields is a list of field names (e.g. "DisplayName") to @@ -1638,6 +2184,11 @@ type TranslateDocumentRequest struct { // the same as the input file's mime type. DocumentOutputConfig *DocumentOutputConfig `json:"documentOutputConfig,omitempty"` + // EnableShadowRemovalNativePdf: Optional. If true, use the text removal + // server to remove the shadow text on background image for native pdf + // translation. + EnableShadowRemovalNativePdf bool `json:"enableShadowRemovalNativePdf,omitempty"` + // GlossaryConfig: Optional. Glossary to be applied. The glossary must // be within the same region (have the same location-id) as the model, // otherwise an INVALID_ARGUMENT (400) error is returned. @@ -1757,19 +2308,19 @@ func (s *TranslateDocumentResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TranslateTextGlossaryConfig: Configures which glossary should be used -// for a specific target language, and defines options for applying that +// TranslateTextGlossaryConfig: Configures which glossary is used for a +// specific target language and defines options for applying that // glossary. type TranslateTextGlossaryConfig struct { // Glossary: Required. The `glossary` to be applied for this - // translation. The format depends on glossary: - User provided custom - // glossary: + // translation. The format depends on the glossary: - User-provided + // custom glossary: // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{g // lossary-id}` Glossary string `json:"glossary,omitempty"` - // IgnoreCase: Optional. Indicates match is case-insensitive. Default - // value is false if missing. + // IgnoreCase: Optional. Indicates match is case insensitive. The + // default value is `false` if missing. IgnoreCase bool `json:"ignoreCase,omitempty"` // ForceSendFields is a list of field names (e.g. "Glossary") to @@ -1799,7 +2350,7 @@ func (s *TranslateTextGlossaryConfig) MarshalJSON() ([]byte, error) { // translation. type TranslateTextRequest struct { // Contents: Required. The content of the input in string format. We - // recommend the total content be less than 30k codepoints. The max + // recommend the total content be less than 30,000 codepoints. The max // length of this field is 1024. Use BatchTranslateText for larger text. Contents []string `json:"contents,omitempty"` @@ -3782,32 +4333,31 @@ func (c *ProjectsLocationsTranslateTextCall) Do(opts ...googleapi.CallOption) (* } -// method id "translate.projects.locations.glossaries.create": +// method id "translate.projects.locations.datasets.create": -type ProjectsLocationsGlossariesCreateCall struct { +type ProjectsLocationsDatasetsCreateCall struct { s *Service parent string - glossary *Glossary + dataset *Dataset urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a glossary and returns the long-running operation. -// Returns NOT_FOUND, if the project doesn't exist. +// Create: Creates a Dataset. // // - parent: The project name. -func (r *ProjectsLocationsGlossariesService) Create(parent string, glossary *Glossary) *ProjectsLocationsGlossariesCreateCall { - c := &ProjectsLocationsGlossariesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDatasetsService) Create(parent string, dataset *Dataset) *ProjectsLocationsDatasetsCreateCall { + c := &ProjectsLocationsDatasetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.glossary = glossary + c.dataset = dataset return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesCreateCall { +func (c *ProjectsLocationsDatasetsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3815,21 +4365,21 @@ func (c *ProjectsLocationsGlossariesCreateCall) Fields(s ...googleapi.Field) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesCreateCall) Context(ctx context.Context) *ProjectsLocationsGlossariesCreateCall { +func (c *ProjectsLocationsDatasetsCreateCall) Context(ctx context.Context) *ProjectsLocationsDatasetsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesCreateCall) Header() http.Header { +func (c *ProjectsLocationsDatasetsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDatasetsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3837,14 +4387,14 @@ func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaries") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/datasets") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3857,14 +4407,14 @@ func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.create" call. +// Do executes the "translate.projects.locations.datasets.create" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsDatasetsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3895,10 +4445,10 @@ func (c *ProjectsLocationsGlossariesCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries", + // "description": "Creates a Dataset.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets", // "httpMethod": "POST", - // "id": "translate.projects.locations.glossaries.create", + // "id": "translate.projects.locations.datasets.create", // "parameterOrder": [ // "parent" // ], @@ -3911,23 +4461,24 @@ func (c *ProjectsLocationsGlossariesCreateCall) Do(opts ...googleapi.CallOption) // "type": "string" // } // }, - // "path": "v3/{+parent}/glossaries", + // "path": "v3/{+parent}/datasets", // "request": { - // "$ref": "Glossary" + // "$ref": "Dataset" // }, // "response": { // "$ref": "Operation" // }, // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" // ] // } } -// method id "translate.projects.locations.glossaries.delete": +// method id "translate.projects.locations.datasets.delete": -type ProjectsLocationsGlossariesDeleteCall struct { +type ProjectsLocationsDatasetsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -3935,13 +4486,11 @@ type ProjectsLocationsGlossariesDeleteCall struct { header_ http.Header } -// Delete: Deletes a glossary, or cancels glossary construction if the -// glossary isn't created yet. Returns NOT_FOUND, if the glossary -// doesn't exist. +// Delete: Deletes a dataset and all of its contents. // -// - name: The name of the glossary to delete. -func (r *ProjectsLocationsGlossariesService) Delete(name string) *ProjectsLocationsGlossariesDeleteCall { - c := &ProjectsLocationsGlossariesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the dataset to delete. +func (r *ProjectsLocationsDatasetsService) Delete(name string) *ProjectsLocationsDatasetsDeleteCall { + c := &ProjectsLocationsDatasetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -3949,7 +4498,7 @@ func (r *ProjectsLocationsGlossariesService) Delete(name string) *ProjectsLocati // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesDeleteCall { +func (c *ProjectsLocationsDatasetsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3957,21 +4506,21 @@ func (c *ProjectsLocationsGlossariesDeleteCall) Fields(s ...googleapi.Field) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlossariesDeleteCall { +func (c *ProjectsLocationsDatasetsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDatasetsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDatasetsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3994,14 +4543,14 @@ func (c *ProjectsLocationsGlossariesDeleteCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.delete" call. +// Do executes the "translate.projects.locations.datasets.delete" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsDatasetsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4032,18 +4581,18 @@ func (c *ProjectsLocationsGlossariesDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", + // "description": "Deletes a dataset and all of its contents.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}", // "httpMethod": "DELETE", - // "id": "translate.projects.locations.glossaries.delete", + // "id": "translate.projects.locations.datasets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the glossary to delete.", + // "description": "Required. The name of the dataset to delete.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", // "required": true, // "type": "string" // } @@ -4060,96 +4609,90 @@ func (c *ProjectsLocationsGlossariesDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "translate.projects.locations.glossaries.get": +// method id "translate.projects.locations.datasets.exportData": -type ProjectsLocationsGlossariesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDatasetsExportDataCall struct { + s *Service + dataset string + exportdatarequest *ExportDataRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a glossary. Returns NOT_FOUND, if the glossary doesn't -// exist. +// ExportData: Exports dataset's data to the provided output location. // -// - name: The name of the glossary to retrieve. -func (r *ProjectsLocationsGlossariesService) Get(name string) *ProjectsLocationsGlossariesGetCall { - c := &ProjectsLocationsGlossariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - dataset: Name of the dataset. In form of +// `projects/{project-number-or-id}/locations/{location-id}/datasets/{d +// ataset-id}`. +func (r *ProjectsLocationsDatasetsService) ExportData(dataset string, exportdatarequest *ExportDataRequest) *ProjectsLocationsDatasetsExportDataCall { + c := &ProjectsLocationsDatasetsExportDataCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataset = dataset + c.exportdatarequest = exportdatarequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGetCall { +func (c *ProjectsLocationsDatasetsExportDataCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsExportDataCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGlossariesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesGetCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGetCall { +func (c *ProjectsLocationsDatasetsExportDataCall) Context(ctx context.Context) *ProjectsLocationsDatasetsExportDataCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGetCall) Header() http.Header { +func (c *ProjectsLocationsDatasetsExportDataCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDatasetsExportDataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportdatarequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+dataset}:exportData") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "dataset": c.dataset, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.get" call. -// Exactly one of *Glossary or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Glossary.ServerResponse.Header or (if a response was returned at +// Do executes the "translate.projects.locations.datasets.exportData" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesGetCall) Do(opts ...googleapi.CallOption) (*Glossary, error) { +func (c *ProjectsLocationsDatasetsExportDataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4168,7 +4711,7 @@ func (c *ProjectsLocationsGlossariesGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Glossary{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4180,25 +4723,1961 @@ func (c *ProjectsLocationsGlossariesGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", - // "httpMethod": "GET", - // "id": "translate.projects.locations.glossaries.get", + // "description": "Exports dataset's data to the provided output location.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:exportData", + // "httpMethod": "POST", + // "id": "translate.projects.locations.datasets.exportData", // "parameterOrder": [ - // "name" + // "dataset" + // ], + // "parameters": { + // "dataset": { + // "description": "Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+dataset}:exportData", + // "request": { + // "$ref": "ExportDataRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.datasets.get": + +type ProjectsLocationsDatasetsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Dataset. +// +// - name: The resource name of the dataset to retrieve. +func (r *ProjectsLocationsDatasetsService) Get(name string) *ProjectsLocationsDatasetsGetCall { + c := &ProjectsLocationsDatasetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDatasetsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDatasetsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDatasetsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsGetCall) Context(ctx context.Context) *ProjectsLocationsDatasetsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.datasets.get" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsDatasetsGetCall) Do(opts ...googleapi.CallOption) (*Dataset, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Dataset.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}", + // "httpMethod": "GET", + // "id": "translate.projects.locations.datasets.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the dataset to retrieve.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+name}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.datasets.importData": + +type ProjectsLocationsDatasetsImportDataCall struct { + s *Service + dataset string + importdatarequest *ImportDataRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ImportData: Import sentence pairs into translation Dataset. +// +// - dataset: Name of the dataset. In form of +// `projects/{project-number-or-id}/locations/{location-id}/datasets/{d +// ataset-id}`. +func (r *ProjectsLocationsDatasetsService) ImportData(dataset string, importdatarequest *ImportDataRequest) *ProjectsLocationsDatasetsImportDataCall { + c := &ProjectsLocationsDatasetsImportDataCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataset = dataset + c.importdatarequest = importdatarequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDatasetsImportDataCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsImportDataCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsImportDataCall) Context(ctx context.Context) *ProjectsLocationsDatasetsImportDataCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsImportDataCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsImportDataCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.importdatarequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+dataset}:importData") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "dataset": c.dataset, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.datasets.importData" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDatasetsImportDataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Import sentence pairs into translation Dataset.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:importData", + // "httpMethod": "POST", + // "id": "translate.projects.locations.datasets.importData", + // "parameterOrder": [ + // "dataset" + // ], + // "parameters": { + // "dataset": { + // "description": "Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+dataset}:importData", + // "request": { + // "$ref": "ImportDataRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.datasets.list": + +type ProjectsLocationsDatasetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists datasets. +// +// - parent: Name of the parent project. In form of +// `projects/{project-number-or-id}/locations/{location-id}`. +func (r *ProjectsLocationsDatasetsService) List(parent string) *ProjectsLocationsDatasetsListCall { + c := &ProjectsLocationsDatasetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// The server can return fewer results than requested. +func (c *ProjectsLocationsDatasetsListCall) PageSize(pageSize int64) *ProjectsLocationsDatasetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results for the server to return. Typically +// obtained from next_page_token field in the response of a ListDatasets +// call. +func (c *ProjectsLocationsDatasetsListCall) PageToken(pageToken string) *ProjectsLocationsDatasetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDatasetsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDatasetsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDatasetsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsListCall) Context(ctx context.Context) *ProjectsLocationsDatasetsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/datasets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.datasets.list" call. +// Exactly one of *ListDatasetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDatasetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDatasetsListCall) Do(opts ...googleapi.CallOption) (*ListDatasetsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListDatasetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists datasets.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets", + // "httpMethod": "GET", + // "id": "translate.projects.locations.datasets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. Requested page size. The server can return fewer results than requested.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListDatasets call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+parent}/datasets", + // "response": { + // "$ref": "ListDatasetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDatasetsListCall) Pages(ctx context.Context, f func(*ListDatasetsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "translate.projects.locations.datasets.examples.list": + +type ProjectsLocationsDatasetsExamplesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists sentence pairs in the dataset. +// +// - parent: Name of the parent dataset. In form of +// `projects/{project-number-or-id}/locations/{location-id}/datasets/{d +// ataset-id}`. +func (r *ProjectsLocationsDatasetsExamplesService) List(parent string) *ProjectsLocationsDatasetsExamplesListCall { + c := &ProjectsLocationsDatasetsExamplesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": An expression for +// filtering the examples that will be returned. Example filter: * +// `usage=TRAIN` +func (c *ProjectsLocationsDatasetsExamplesListCall) Filter(filter string) *ProjectsLocationsDatasetsExamplesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// The server can return fewer results than requested. +func (c *ProjectsLocationsDatasetsExamplesListCall) PageSize(pageSize int64) *ProjectsLocationsDatasetsExamplesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results for the server to return. Typically +// obtained from next_page_token field in the response of a ListExamples +// call. +func (c *ProjectsLocationsDatasetsExamplesListCall) PageToken(pageToken string) *ProjectsLocationsDatasetsExamplesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDatasetsExamplesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsExamplesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDatasetsExamplesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDatasetsExamplesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsExamplesListCall) Context(ctx context.Context) *ProjectsLocationsDatasetsExamplesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsExamplesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsExamplesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/examples") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.datasets.examples.list" call. +// Exactly one of *ListExamplesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExamplesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDatasetsExamplesListCall) Do(opts ...googleapi.CallOption) (*ListExamplesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListExamplesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists sentence pairs in the dataset.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/examples", + // "httpMethod": "GET", + // "id": "translate.projects.locations.datasets.examples.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN`", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. Requested page size. The server can return fewer results than requested.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListExamples call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the parent dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+parent}/examples", + // "response": { + // "$ref": "ListExamplesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDatasetsExamplesListCall) Pages(ctx context.Context, f func(*ListExamplesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "translate.projects.locations.glossaries.create": + +type ProjectsLocationsGlossariesCreateCall struct { + s *Service + parent string + glossary *Glossary + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a glossary and returns the long-running operation. +// Returns NOT_FOUND, if the project doesn't exist. +// +// - parent: The project name. +func (r *ProjectsLocationsGlossariesService) Create(parent string, glossary *Glossary) *ProjectsLocationsGlossariesCreateCall { + c := &ProjectsLocationsGlossariesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.glossary = glossary + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesCreateCall) Context(ctx context.Context) *ProjectsLocationsGlossariesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaries") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries", + // "httpMethod": "POST", + // "id": "translate.projects.locations.glossaries.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The project name.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+parent}/glossaries", + // "request": { + // "$ref": "Glossary" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.delete": + +type ProjectsLocationsGlossariesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a glossary, or cancels glossary construction if the +// glossary isn't created yet. Returns NOT_FOUND, if the glossary +// doesn't exist. +// +// - name: The name of the glossary to delete. +func (r *ProjectsLocationsGlossariesService) Delete(name string) *ProjectsLocationsGlossariesDeleteCall { + c := &ProjectsLocationsGlossariesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlossariesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", + // "httpMethod": "DELETE", + // "id": "translate.projects.locations.glossaries.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the glossary to delete.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.get": + +type ProjectsLocationsGlossariesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a glossary. Returns NOT_FOUND, if the glossary doesn't +// exist. +// +// - name: The name of the glossary to retrieve. +func (r *ProjectsLocationsGlossariesService) Get(name string) *ProjectsLocationsGlossariesGetCall { + c := &ProjectsLocationsGlossariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGlossariesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesGetCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.get" call. +// Exactly one of *Glossary or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Glossary.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesGetCall) Do(opts ...googleapi.CallOption) (*Glossary, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Glossary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", + // "httpMethod": "GET", + // "id": "translate.projects.locations.glossaries.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the glossary to retrieve.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+name}", + // "response": { + // "$ref": "Glossary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.list": + +type ProjectsLocationsGlossariesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists glossaries in a project. Returns NOT_FOUND, if the +// project doesn't exist. +// +// - parent: The name of the project from which to list all of the +// glossaries. +func (r *ProjectsLocationsGlossariesService) List(parent string) *ProjectsLocationsGlossariesListCall { + c := &ProjectsLocationsGlossariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": Filter specifying +// constraints of a list operation. Specify the constraint by the format +// of "key=value", where key must be "src" or "tgt", and the value must +// be a valid language code. For multiple restrictions, concatenate them +// by "AND" (uppercase only), such as: "src=en-US AND tgt=zh-CN". Notice +// that the exact match is used here, which means using 'en-US' and 'en' +// can lead to different results, which depends on the language code you +// used when you create the glossary. For the unidirectional glossaries, +// the "src" and "tgt" add restrictions on the source and target +// language code separately. For the equivalent term set glossaries, the +// "src" and/or "tgt" add restrictions on the term set. For example: +// "src=en-US AND tgt=zh-CN" will only pick the unidirectional +// glossaries which exactly match the source language code as "en-US" +// and the target language code "zh-CN", but all equivalent term set +// glossaries which contain "en-US" and "zh-CN" in their language set +// will be picked. If missing, no filtering is performed. +func (c *ProjectsLocationsGlossariesListCall) Filter(filter string) *ProjectsLocationsGlossariesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// The server may return fewer glossaries than requested. If +// unspecified, the server picks an appropriate default. +func (c *ProjectsLocationsGlossariesListCall) PageSize(pageSize int64) *ProjectsLocationsGlossariesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results the server should return. Typically, +// this is the value of [ListGlossariesResponse.next_page_token] +// returned from the previous call to `ListGlossaries` method. The first +// page is returned if `page_token`is empty or missing. +func (c *ProjectsLocationsGlossariesListCall) PageToken(pageToken string) *ProjectsLocationsGlossariesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGlossariesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesListCall) Context(ctx context.Context) *ProjectsLocationsGlossariesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaries") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.list" call. +// Exactly one of *ListGlossariesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListGlossariesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesListCall) Do(opts ...googleapi.CallOption) (*ListGlossariesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListGlossariesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries", + // "httpMethod": "GET", + // "id": "translate.projects.locations.glossaries.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. Filter specifying constraints of a list operation. Specify the constraint by the format of \"key=value\", where key must be \"src\" or \"tgt\", and the value must be a valid language code. For multiple restrictions, concatenate them by \"AND\" (uppercase only), such as: \"src=en-US AND tgt=zh-CN\". Notice that the exact match is used here, which means using 'en-US' and 'en' can lead to different results, which depends on the language code you used when you create the glossary. For the unidirectional glossaries, the \"src\" and \"tgt\" add restrictions on the source and target language code separately. For the equivalent term set glossaries, the \"src\" and/or \"tgt\" add restrictions on the term set. For example: \"src=en-US AND tgt=zh-CN\" will only pick the unidirectional glossaries which exactly match the source language code as \"en-US\" and the target language code \"zh-CN\", but all equivalent term set glossaries which contain \"en-US\" and \"zh-CN\" in their language set will be picked. If missing, no filtering is performed.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossariesResponse.next_page_token] returned from the previous call to `ListGlossaries` method. The first page is returned if `page_token`is empty or missing.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The name of the project from which to list all of the glossaries.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+parent}/glossaries", + // "response": { + // "$ref": "ListGlossariesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsGlossariesListCall) Pages(ctx context.Context, f func(*ListGlossariesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "translate.projects.locations.glossaries.patch": + +type ProjectsLocationsGlossariesPatchCall struct { + s *Service + name string + glossary *Glossary + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a glossary. A LRO is used since the update can be +// async if the glossary's entry file is updated. +// +// - name: The resource name of the glossary. Glossary names have the +// form +// `projects/{project-number-or-id}/locations/{location-id}/glossaries/ +// {glossary-id}`. +func (r *ProjectsLocationsGlossariesService) Patch(name string, glossary *Glossary) *ProjectsLocationsGlossariesPatchCall { + c := &ProjectsLocationsGlossariesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.glossary = glossary + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. Currently only `display_name` and +// 'input_config' +func (c *ProjectsLocationsGlossariesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGlossariesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesPatchCall) Context(ctx context.Context) *ProjectsLocationsGlossariesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", + // "httpMethod": "PATCH", + // "id": "translate.projects.locations.glossaries.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. Currently only `display_name` and 'input_config'", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v3/{+name}", + // "request": { + // "$ref": "Glossary" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.glossaryEntries.create": + +type ProjectsLocationsGlossariesGlossaryEntriesCreateCall struct { + s *Service + parent string + glossaryentry *GlossaryEntry + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a glossary entry. +// +// - parent: The resource name of the glossary to create the entry +// under. +func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Create(parent string, glossaryentry *GlossaryEntry) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { + c := &ProjectsLocationsGlossariesGlossaryEntriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.glossaryentry = glossaryentry + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaryEntries") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.glossaryEntries.create" call. +// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GlossaryEntry.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GlossaryEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a glossary entry.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries", + // "httpMethod": "POST", + // "id": "translate.projects.locations.glossaries.glossaryEntries.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The resource name of the glossary to create the entry under.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+parent}/glossaryEntries", + // "request": { + // "$ref": "GlossaryEntry" + // }, + // "response": { + // "$ref": "GlossaryEntry" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.glossaryEntries.delete": + +type ProjectsLocationsGlossariesGlossaryEntriesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a single entry from the glossary +// +// - name: The resource name of the glossary entry to delete. +func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Delete(name string) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { + c := &ProjectsLocationsGlossariesGlossaryEntriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.glossaryEntries.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a single entry from the glossary", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", + // "httpMethod": "DELETE", + // "id": "translate.projects.locations.glossaries.glossaryEntries.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the glossary entry to delete", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v3/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" + // ] + // } + +} + +// method id "translate.projects.locations.glossaries.glossaryEntries.get": + +type ProjectsLocationsGlossariesGlossaryEntriesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a single glossary entry by the given id. +// +// - name: The resource name of the glossary entry to get. +func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Get(name string) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { + c := &ProjectsLocationsGlossariesGlossaryEntriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "translate.projects.locations.glossaries.glossaryEntries.get" call. +// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GlossaryEntry.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GlossaryEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a single glossary entry by the given id.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", + // "httpMethod": "GET", + // "id": "translate.projects.locations.glossaries.glossaryEntries.get", + // "parameterOrder": [ + // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the glossary to retrieve.", + // "description": "Required. The resource name of the glossary entry to get", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v3/{+name}", // "response": { - // "$ref": "Glossary" + // "$ref": "GlossaryEntry" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -4208,9 +6687,9 @@ func (c *ProjectsLocationsGlossariesGetCall) Do(opts ...googleapi.CallOption) (* } -// method id "translate.projects.locations.glossaries.list": +// method id "translate.projects.locations.glossaries.glossaryEntries.list": -type ProjectsLocationsGlossariesListCall struct { +type ProjectsLocationsGlossariesGlossaryEntriesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -4219,52 +6698,30 @@ type ProjectsLocationsGlossariesListCall struct { header_ http.Header } -// List: Lists glossaries in a project. Returns NOT_FOUND, if the -// project doesn't exist. +// List: List the entries for the glossary. // -// - parent: The name of the project from which to list all of the -// glossaries. -func (r *ProjectsLocationsGlossariesService) List(parent string) *ProjectsLocationsGlossariesListCall { - c := &ProjectsLocationsGlossariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent glossary resource name for listing the +// glossary's entries. +func (r *ProjectsLocationsGlossariesGlossaryEntriesService) List(parent string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { + c := &ProjectsLocationsGlossariesGlossaryEntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// Filter sets the optional parameter "filter": Filter specifying -// constraints of a list operation. Specify the constraint by the format -// of "key=value", where key must be "src" or "tgt", and the value must -// be a valid language code. For multiple restrictions, concatenate them -// by "AND" (uppercase only), such as: "src=en-US AND tgt=zh-CN". Notice -// that the exact match is used here, which means using 'en-US' and 'en' -// can lead to different results, which depends on the language code you -// used when you create the glossary. For the unidirectional glossaries, -// the "src" and "tgt" add restrictions on the source and target -// language code separately. For the equivalent term set glossaries, the -// "src" and/or "tgt" add restrictions on the term set. For example: -// "src=en-US AND tgt=zh-CN" will only pick the unidirectional -// glossaries which exactly match the source language code as "en-US" -// and the target language code "zh-CN", but all equivalent term set -// glossaries which contain "en-US" and "zh-CN" in their language set -// will be picked. If missing, no filtering is performed. -func (c *ProjectsLocationsGlossariesListCall) Filter(filter string) *ProjectsLocationsGlossariesListCall { - c.urlParams_.Set("filter", filter) - return c -} - // PageSize sets the optional parameter "pageSize": Requested page size. -// The server may return fewer glossaries than requested. If +// The server may return fewer glossary entries than requested. If // unspecified, the server picks an appropriate default. -func (c *ProjectsLocationsGlossariesListCall) PageSize(pageSize int64) *ProjectsLocationsGlossariesListCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) PageSize(pageSize int64) *ProjectsLocationsGlossariesGlossaryEntriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A token // identifying a page of results the server should return. Typically, -// this is the value of [ListGlossariesResponse.next_page_token] -// returned from the previous call to `ListGlossaries` method. The first -// page is returned if `page_token`is empty or missing. -func (c *ProjectsLocationsGlossariesListCall) PageToken(pageToken string) *ProjectsLocationsGlossariesListCall { +// this is the value of [ListGlossaryEntriesResponse.next_page_token] +// returned from the previous call. The first page is returned if +// `page_token`is empty or missing. +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) PageToken(pageToken string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -4272,7 +6729,7 @@ func (c *ProjectsLocationsGlossariesListCall) PageToken(pageToken string) *Proje // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesListCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4282,7 +6739,7 @@ func (c *ProjectsLocationsGlossariesListCall) Fields(s ...googleapi.Field) *Proj // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGlossariesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesListCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -4290,21 +6747,21 @@ func (c *ProjectsLocationsGlossariesListCall) IfNoneMatch(entityTag string) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesListCall) Context(ctx context.Context) *ProjectsLocationsGlossariesListCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesListCall) Header() http.Header { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4317,7 +6774,7 @@ func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Respo var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaries") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaryEntries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4330,14 +6787,14 @@ func (c *ProjectsLocationsGlossariesListCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.list" call. -// Exactly one of *ListGlossariesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListGlossariesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "translate.projects.locations.glossaries.glossaryEntries.list" call. +// Exactly one of *ListGlossaryEntriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListGlossaryEntriesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesListCall) Do(opts ...googleapi.CallOption) (*ListGlossariesResponse, error) { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Do(opts ...googleapi.CallOption) (*ListGlossaryEntriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4356,7 +6813,7 @@ func (c *ProjectsLocationsGlossariesListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListGlossariesResponse{ + ret := &ListGlossaryEntriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4368,41 +6825,36 @@ func (c *ProjectsLocationsGlossariesListCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries", + // "description": "List the entries for the glossary.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries", // "httpMethod": "GET", - // "id": "translate.projects.locations.glossaries.list", + // "id": "translate.projects.locations.glossaries.glossaryEntries.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "filter": { - // "description": "Optional. Filter specifying constraints of a list operation. Specify the constraint by the format of \"key=value\", where key must be \"src\" or \"tgt\", and the value must be a valid language code. For multiple restrictions, concatenate them by \"AND\" (uppercase only), such as: \"src=en-US AND tgt=zh-CN\". Notice that the exact match is used here, which means using 'en-US' and 'en' can lead to different results, which depends on the language code you used when you create the glossary. For the unidirectional glossaries, the \"src\" and \"tgt\" add restrictions on the source and target language code separately. For the equivalent term set glossaries, the \"src\" and/or \"tgt\" add restrictions on the term set. For example: \"src=en-US AND tgt=zh-CN\" will only pick the unidirectional glossaries which exactly match the source language code as \"en-US\" and the target language code \"zh-CN\", but all equivalent term set glossaries which contain \"en-US\" and \"zh-CN\" in their language set will be picked. If missing, no filtering is performed.", - // "location": "query", - // "type": "string" - // }, // "pageSize": { - // "description": "Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.", + // "description": "Optional. Requested page size. The server may return fewer glossary entries than requested. If unspecified, the server picks an appropriate default.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossariesResponse.next_page_token] returned from the previous call to `ListGlossaries` method. The first page is returned if `page_token`is empty or missing.", + // "description": "Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossaryEntriesResponse.next_page_token] returned from the previous call. The first page is returned if `page_token`is empty or missing.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the project from which to list all of the glossaries.", + // "description": "Required. The parent glossary resource name for listing the glossary's entries.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v3/{+parent}/glossaries", + // "path": "v3/{+parent}/glossaryEntries", // "response": { - // "$ref": "ListGlossariesResponse" + // "$ref": "ListGlossaryEntriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -4415,7 +6867,7 @@ func (c *ProjectsLocationsGlossariesListCall) Do(opts ...googleapi.CallOption) ( // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsGlossariesListCall) Pages(ctx context.Context, f func(*ListGlossariesResponse) error) error { +func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Pages(ctx context.Context, f func(*ListGlossaryEntriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -4433,43 +6885,32 @@ func (c *ProjectsLocationsGlossariesListCall) Pages(ctx context.Context, f func( } } -// method id "translate.projects.locations.glossaries.patch": +// method id "translate.projects.locations.glossaries.glossaryEntries.patch": -type ProjectsLocationsGlossariesPatchCall struct { - s *Service - name string - glossary *Glossary - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsGlossariesGlossaryEntriesPatchCall struct { + s *Service + name string + glossaryentry *GlossaryEntry + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a glossary. A LRO is used since the update can be -// async if the glossary's entry file is updated. +// Patch: Updates a glossary entry. // -// - name: The resource name of the glossary. Glossary names have the -// form -// `projects/{project-number-or-id}/locations/{location-id}/glossaries/ -// {glossary-id}`. -func (r *ProjectsLocationsGlossariesService) Patch(name string, glossary *Glossary) *ProjectsLocationsGlossariesPatchCall { - c := &ProjectsLocationsGlossariesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the entry. Format: +// "projects/*/locations/*/glossaries/*/glossaryEntries/*". +func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Patch(name string, glossaryentry *GlossaryEntry) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { + c := &ProjectsLocationsGlossariesGlossaryEntriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.glossary = glossary - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. Currently only `display_name` and -// 'input_config' -func (c *ProjectsLocationsGlossariesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGlossariesPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.glossaryentry = glossaryentry return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesPatchCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4477,21 +6918,21 @@ func (c *ProjectsLocationsGlossariesPatchCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesPatchCall) Context(ctx context.Context) *ProjectsLocationsGlossariesPatchCall { +func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesPatchCall) Header() http.Header { +func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4499,7 +6940,7 @@ func (c *ProjectsLocationsGlossariesPatchCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossary) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) if err != nil { return nil, err } @@ -4519,14 +6960,14 @@ func (c *ProjectsLocationsGlossariesPatchCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.patch" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "translate.projects.locations.glossaries.glossaryEntries.patch" call. +// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *GlossaryEntry.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4545,7 +6986,7 @@ func (c *ProjectsLocationsGlossariesPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &GlossaryEntry{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4557,68 +6998,63 @@ func (c *ProjectsLocationsGlossariesPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", + // "description": "Updates a glossary entry.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", // "httpMethod": "PATCH", - // "id": "translate.projects.locations.glossaries.patch", + // "id": "translate.projects.locations.glossaries.glossaryEntries.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.", + // "description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. Currently only `display_name` and 'input_config'", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v3/{+name}", // "request": { - // "$ref": "Glossary" + // "$ref": "GlossaryEntry" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GlossaryEntry" // }, // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-translation" // ] // } } -// method id "translate.projects.locations.glossaries.glossaryEntries.create": +// method id "translate.projects.locations.models.create": -type ProjectsLocationsGlossariesGlossaryEntriesCreateCall struct { - s *Service - parent string - glossaryentry *GlossaryEntry - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsModelsCreateCall struct { + s *Service + parent string + model *Model + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a glossary entry. +// Create: Creates a Model. // -// - parent: The resource name of the glossary to create the entry -// under. -func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Create(parent string, glossaryentry *GlossaryEntry) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { - c := &ProjectsLocationsGlossariesGlossaryEntriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The project name, in form of +// `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsModelsService) Create(parent string, model *Model) *ProjectsLocationsModelsCreateCall { + c := &ProjectsLocationsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.glossaryentry = glossaryentry + c.model = model return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { +func (c *ProjectsLocationsModelsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsModelsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4626,21 +7062,21 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Fields(s ...googl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesCreateCall { +func (c *ProjectsLocationsModelsCreateCall) Context(ctx context.Context) *ProjectsLocationsModelsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Header() http.Header { +func (c *ProjectsLocationsModelsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsModelsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4648,14 +7084,14 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) doRequest(alt str } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaryEntries") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/models") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4668,14 +7104,14 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.glossaryEntries.create" call. -// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx +// Do executes the "translate.projects.locations.models.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *GlossaryEntry.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsModelsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4694,7 +7130,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GlossaryEntry{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4706,28 +7142,28 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Do(opts ...google } return ret, nil // { - // "description": "Creates a glossary entry.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries", + // "description": "Creates a Model.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models", // "httpMethod": "POST", - // "id": "translate.projects.locations.glossaries.glossaryEntries.create", + // "id": "translate.projects.locations.models.create", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The resource name of the glossary to create the entry under.", + // "description": "Required. The project name, in form of `projects/{project}/locations/{location}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v3/{+parent}/glossaryEntries", + // "path": "v3/{+parent}/models", // "request": { - // "$ref": "GlossaryEntry" + // "$ref": "Model" // }, // "response": { - // "$ref": "GlossaryEntry" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -4737,9 +7173,9 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesCreateCall) Do(opts ...google } -// method id "translate.projects.locations.glossaries.glossaryEntries.delete": +// method id "translate.projects.locations.models.delete": -type ProjectsLocationsGlossariesGlossaryEntriesDeleteCall struct { +type ProjectsLocationsModelsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -4747,11 +7183,11 @@ type ProjectsLocationsGlossariesGlossaryEntriesDeleteCall struct { header_ http.Header } -// Delete: Deletes a single entry from the glossary +// Delete: Deletes a model. // -// - name: The resource name of the glossary entry to delete. -func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Delete(name string) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { - c := &ProjectsLocationsGlossariesGlossaryEntriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the model to delete. +func (r *ProjectsLocationsModelsService) Delete(name string) *ProjectsLocationsModelsDeleteCall { + c := &ProjectsLocationsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -4759,7 +7195,7 @@ func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Delete(name string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { +func (c *ProjectsLocationsModelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsModelsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4767,21 +7203,21 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Fields(s ...googl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall { +func (c *ProjectsLocationsModelsDeleteCall) Context(ctx context.Context) *ProjectsLocationsModelsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsModelsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4804,14 +7240,14 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.glossaryEntries.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "translate.projects.locations.models.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsModelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4830,7 +7266,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4842,25 +7278,25 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Do(opts ...google } return ret, nil // { - // "description": "Deletes a single entry from the glossary", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", + // "description": "Deletes a model.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models/{modelsId}", // "httpMethod": "DELETE", - // "id": "translate.projects.locations.glossaries.glossaryEntries.delete", + // "id": "translate.projects.locations.models.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the glossary entry to delete", + // "description": "Required. The name of the model to delete.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/models/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v3/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -4870,9 +7306,9 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesDeleteCall) Do(opts ...google } -// method id "translate.projects.locations.glossaries.glossaryEntries.get": +// method id "translate.projects.locations.models.get": -type ProjectsLocationsGlossariesGlossaryEntriesGetCall struct { +type ProjectsLocationsModelsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -4881,11 +7317,11 @@ type ProjectsLocationsGlossariesGlossaryEntriesGetCall struct { header_ http.Header } -// Get: Gets a single glossary entry by the given id. +// Get: Gets a model. // -// - name: The resource name of the glossary entry to get. -func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Get(name string) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { - c := &ProjectsLocationsGlossariesGlossaryEntriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the model to retrieve. +func (r *ProjectsLocationsModelsService) Get(name string) *ProjectsLocationsModelsGetCall { + c := &ProjectsLocationsModelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -4893,7 +7329,7 @@ func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Get(name string) *Pr // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { +func (c *ProjectsLocationsModelsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsModelsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4903,7 +7339,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Fields(s ...googleap // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { +func (c *ProjectsLocationsModelsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsModelsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -4911,21 +7347,21 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) IfNoneMatch(entityTa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesGetCall { +func (c *ProjectsLocationsModelsGetCall) Context(ctx context.Context) *ProjectsLocationsModelsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Header() http.Header { +func (c *ProjectsLocationsModelsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsModelsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4951,14 +7387,14 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) doRequest(alt string return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.glossaryEntries.get" call. -// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *GlossaryEntry.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { +// Do executes the "translate.projects.locations.models.get" call. +// Exactly one of *Model or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Model.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4977,7 +7413,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GlossaryEntry{ + ret := &Model{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4989,25 +7425,25 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Gets a single glossary entry by the given id.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", + // "description": "Gets a model.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models/{modelsId}", // "httpMethod": "GET", - // "id": "translate.projects.locations.glossaries.glossaryEntries.get", + // "id": "translate.projects.locations.models.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the glossary entry to get", + // "description": "Required. The resource name of the model to retrieve.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/models/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v3/{+name}", // "response": { - // "$ref": "GlossaryEntry" + // "$ref": "Model" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -5017,9 +7453,9 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesGetCall) Do(opts ...googleapi } -// method id "translate.projects.locations.glossaries.glossaryEntries.list": +// method id "translate.projects.locations.models.list": -type ProjectsLocationsGlossariesGlossaryEntriesListCall struct { +type ProjectsLocationsModelsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -5028,30 +7464,36 @@ type ProjectsLocationsGlossariesGlossaryEntriesListCall struct { header_ http.Header } -// List: List the entries for the glossary. +// List: Lists models. // -// - parent: The parent glossary resource name for listing the -// glossary's entries. -func (r *ProjectsLocationsGlossariesGlossaryEntriesService) List(parent string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { - c := &ProjectsLocationsGlossariesGlossaryEntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the parent project. In form of +// `projects/{project-number-or-id}/locations/{location-id}`. +func (r *ProjectsLocationsModelsService) List(parent string) *ProjectsLocationsModelsListCall { + c := &ProjectsLocationsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } +// Filter sets the optional parameter "filter": An expression for +// filtering the models that will be returned. Supported filter: +// `dataset_id=${dataset_id}` +func (c *ProjectsLocationsModelsListCall) Filter(filter string) *ProjectsLocationsModelsListCall { + c.urlParams_.Set("filter", filter) + return c +} + // PageSize sets the optional parameter "pageSize": Requested page size. -// The server may return fewer glossary entries than requested. If -// unspecified, the server picks an appropriate default. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) PageSize(pageSize int64) *ProjectsLocationsGlossariesGlossaryEntriesListCall { +// The server can return fewer results than requested. +func (c *ProjectsLocationsModelsListCall) PageSize(pageSize int64) *ProjectsLocationsModelsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A token -// identifying a page of results the server should return. Typically, -// this is the value of [ListGlossaryEntriesResponse.next_page_token] -// returned from the previous call. The first page is returned if -// `page_token`is empty or missing. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) PageToken(pageToken string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { +// identifying a page of results for the server to return. Typically +// obtained from next_page_token field in the response of a ListModels +// call. +func (c *ProjectsLocationsModelsListCall) PageToken(pageToken string) *ProjectsLocationsModelsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -5059,7 +7501,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) PageToken(pageToken // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesListCall { +func (c *ProjectsLocationsModelsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsModelsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5069,7 +7511,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Fields(s ...googlea // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlossariesGlossaryEntriesListCall { +func (c *ProjectsLocationsModelsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsModelsListCall { c.ifNoneMatch_ = entityTag return c } @@ -5077,21 +7519,21 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) IfNoneMatch(entityT // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesListCall { +func (c *ProjectsLocationsModelsListCall) Context(ctx context.Context) *ProjectsLocationsModelsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Header() http.Header { +func (c *ProjectsLocationsModelsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsModelsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5104,7 +7546,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) doRequest(alt strin var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/glossaryEntries") + urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/models") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -5117,14 +7559,14 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) doRequest(alt strin return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "translate.projects.locations.glossaries.glossaryEntries.list" call. -// Exactly one of *ListGlossaryEntriesResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListGlossaryEntriesResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "translate.projects.locations.models.list" call. +// Exactly one of *ListModelsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListModelsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Do(opts ...googleapi.CallOption) (*ListGlossaryEntriesResponse, error) { +func (c *ProjectsLocationsModelsListCall) Do(opts ...googleapi.CallOption) (*ListModelsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5143,7 +7585,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Do(opts ...googleap if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListGlossaryEntriesResponse{ + ret := &ListModelsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5155,36 +7597,41 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Do(opts ...googleap } return ret, nil // { - // "description": "List the entries for the glossary.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries", + // "description": "Lists models.", + // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/models", // "httpMethod": "GET", - // "id": "translate.projects.locations.glossaries.glossaryEntries.list", + // "id": "translate.projects.locations.models.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "filter": { + // "description": "Optional. An expression for filtering the models that will be returned. Supported filter: `dataset_id=${dataset_id}`", + // "location": "query", + // "type": "string" + // }, // "pageSize": { - // "description": "Optional. Requested page size. The server may return fewer glossary entries than requested. If unspecified, the server picks an appropriate default.", + // "description": "Optional. Requested page size. The server can return fewer results than requested.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossaryEntriesResponse.next_page_token] returned from the previous call. The first page is returned if `page_token`is empty or missing.", + // "description": "Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListModels call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent glossary resource name for listing the glossary's entries.", + // "description": "Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v3/{+parent}/glossaryEntries", + // "path": "v3/{+parent}/models", // "response": { - // "$ref": "ListGlossaryEntriesResponse" + // "$ref": "ListModelsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -5197,7 +7644,7 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Do(opts ...googleap // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Pages(ctx context.Context, f func(*ListGlossaryEntriesResponse) error) error { +func (c *ProjectsLocationsModelsListCall) Pages(ctx context.Context, f func(*ListModelsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -5215,150 +7662,6 @@ func (c *ProjectsLocationsGlossariesGlossaryEntriesListCall) Pages(ctx context.C } } -// method id "translate.projects.locations.glossaries.glossaryEntries.patch": - -type ProjectsLocationsGlossariesGlossaryEntriesPatchCall struct { - s *Service - name string - glossaryentry *GlossaryEntry - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates a glossary entry. -// -// - name: The resource name of the entry. Format: -// "projects/*/locations/*/glossaries/*/glossaryEntries/*". -func (r *ProjectsLocationsGlossariesGlossaryEntriesService) Patch(name string, glossaryentry *GlossaryEntry) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { - c := &ProjectsLocationsGlossariesGlossaryEntriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.glossaryentry = glossaryentry - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Context(ctx context.Context) *ProjectsLocationsGlossariesGlossaryEntriesPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.glossaryentry) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "translate.projects.locations.glossaries.glossaryEntries.patch" call. -// Exactly one of *GlossaryEntry or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *GlossaryEntry.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsGlossariesGlossaryEntriesPatchCall) Do(opts ...googleapi.CallOption) (*GlossaryEntry, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GlossaryEntry{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a glossary entry.", - // "flatPath": "v3/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}/glossaryEntries/{glossaryEntriesId}", - // "httpMethod": "PATCH", - // "id": "translate.projects.locations.glossaries.glossaryEntries.patch", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v3/{+name}", - // "request": { - // "$ref": "GlossaryEntry" - // }, - // "response": { - // "$ref": "GlossaryEntry" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-translation" - // ] - // } - -} - // method id "translate.projects.locations.operations.cancel": type ProjectsLocationsOperationsCancelCall struct { diff --git a/translate/v3beta1/translate-api.json b/translate/v3beta1/translate-api.json index eb5a293a690..2cd10717aad 100644 --- a/translate/v3beta1/translate-api.json +++ b/translate/v3beta1/translate-api.json @@ -744,7 +744,7 @@ } } }, - "revision": "20221021", + "revision": "20230106", "rootUrl": "https://translation.googleapis.com/", "schemas": { "BatchDocumentInputConfig": { @@ -773,6 +773,10 @@ "description": "The BatchTranslateDocument request.", "id": "BatchTranslateDocumentRequest", "properties": { + "customizedAttribution": { + "description": "Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos", + "type": "string" + }, "formatConversions": { "additionalProperties": { "type": "string" @@ -1242,7 +1246,7 @@ "properties": { "gcsDestination": { "$ref": "GcsDestination", - "description": "Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\\n' instead of '\\r\\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_translations.[extension] If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]" + "description": "Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\\n' instead of '\\r\\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]" } }, "type": "object" @@ -1327,6 +1331,10 @@ "$ref": "DocumentOutputConfig", "description": "Optional. Output configurations. Defines if the output file should be stored within Cloud Storage as well as the desired output format. If not provided the translated file will only be returned through a byte-stream and its output mime type will be the same as the input file's mime type." }, + "enableShadowRemovalNativePdf": { + "description": "Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation.", + "type": "boolean" + }, "glossaryConfig": { "$ref": "TranslateTextGlossaryConfig", "description": "Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned." diff --git a/translate/v3beta1/translate-gen.go b/translate/v3beta1/translate-gen.go index a176d4f333d..5dc5e202630 100644 --- a/translate/v3beta1/translate-gen.go +++ b/translate/v3beta1/translate-gen.go @@ -304,6 +304,12 @@ func (s *BatchDocumentOutputConfig) MarshalJSON() ([]byte, error) { // BatchTranslateDocumentRequest: The BatchTranslateDocument request. type BatchTranslateDocumentRequest struct { + // CustomizedAttribution: Optional. This flag is to support user + // customized attribution. If not provided, the default is `Machine + // Translated by Google`. Customized attribution should follow rules in + // https://cloud.google.com/translate/attribution#attribution_and_logos + CustomizedAttribution string `json:"customizedAttribution,omitempty"` + // FormatConversions: Optional. FormatConversions map[string]string `json:"formatConversions,omitempty"` @@ -344,15 +350,16 @@ type BatchTranslateDocumentRequest struct { // here. TargetLanguageCodes []string `json:"targetLanguageCodes,omitempty"` - // ForceSendFields is a list of field names (e.g. "FormatConversions") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "CustomizedAttribution") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FormatConversions") to + // NullFields is a list of field names (e.g. "CustomizedAttribution") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -1257,7 +1264,7 @@ type OutputConfig struct { // file updating. // (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] If the + // `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the // input file extension is tsv, the output has the following columns: // Column 1: ID of the request provided in the input, if it's not // provided in the input, then the input row number is used (0-based). @@ -1445,6 +1452,11 @@ type TranslateDocumentRequest struct { // the same as the input file's mime type. DocumentOutputConfig *DocumentOutputConfig `json:"documentOutputConfig,omitempty"` + // EnableShadowRemovalNativePdf: Optional. If true, use the text removal + // server to remove the shadow text on background image for native pdf + // translation. + EnableShadowRemovalNativePdf bool `json:"enableShadowRemovalNativePdf,omitempty"` + // GlossaryConfig: Optional. Glossary to be applied. The glossary must // be within the same region (have the same location-id) as the model, // otherwise an INVALID_ARGUMENT (400) error is returned.